Repository: modin-project/modin

Issue:
Make Modin on MPI through unidist component more obvious
We should make Modin on MPI through unidist component more obvious to emphasize MPI backend for Modin.


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -26,7 +26,16 @@ def noop_decorator(*args, **kwargs):
 ray.remote = noop_decorator
 
 # fake modules if they're missing
-for mod_name in ("cudf", "cupy", "pyarrow.gandiva", "pyhdk", "pyhdk.hdk", "xgboost"):
+for mod_name in (
+    "cudf",
+    "cupy",
+    "pyarrow.gandiva",
+    "pyhdk",
+    "pyhdk.hdk",
+    "xgboost",
+    "unidist",
+    "unidist.config",
+):
     try:
         __import__(mod_name)
     except ImportError:
@@ -52,6 +61,16 @@ def noop_decorator(*args, **kwargs):
     sys.modules["pyhdk"].__version__ = "999"
 if not hasattr(sys.modules["xgboost"], "Booster"):
     sys.modules["xgboost"].Booster = type("Booster", (object,), {})
+if not hasattr(sys.modules["unidist"], "remote"):
+    sys.modules["unidist"].remote = noop_decorator
+if not hasattr(sys.modules["unidist"], "core"):
+    sys.modules["unidist"].core = type("core", (object,), {})
+if not hasattr(sys.modules["unidist"].core, "base"):
+    sys.modules["unidist"].core.base = type("base", (object,), {})
+if not hasattr(sys.modules["unidist"].core.base, "object_ref"):
+    sys.modules["unidist"].core.base.object_ref = type("object_ref", (object,), {})
+if not hasattr(sys.modules["unidist"].core.base.object_ref, "ObjectRef"):
+    sys.modules["unidist"].core.base.object_ref.ObjectRef = type("ObjectRef", (object,), {})
 
 sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
 import modin
diff --git a/modin/core/execution/unidist/common/utils.py b/modin/core/execution/unidist/common/utils.py
--- a/modin/core/execution/unidist/common/utils.py
+++ b/modin/core/execution/unidist/common/utils.py
@@ -29,7 +29,7 @@ def initialize_unidist():
 
     if unidist_cfg.Backend.get() != "mpi":
         raise RuntimeError(
-            f"Modin only supports unidist on MPI for now, got unidist backend '{unidist_cfg.Backend.get()}'"
+            f"Modin only supports MPI through unidist for now, got unidist backend '{unidist_cfg.Backend.get()}'"
         )
 
     if not unidist.is_initialized():
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,9 +9,13 @@
 # ray==2.5.0 broken: https://github.com/conda-forge/ray-packages-feedstock/issues/100
 # pydantic<2: https://github.com/modin-project/modin/issues/6336
 ray_deps = ["ray[default]>=1.13.0,!=2.5.0", "pyarrow>=7.0.0", "pydantic<2"]
-unidist_deps = ["unidist[mpi]>=0.2.1,<=0.4.1"]
+mpi_deps = ["unidist[mpi]>=0.2.1"]
 spreadsheet_deps = ["modin-spreadsheet>=0.1.0"]
-all_deps = dask_deps + ray_deps + unidist_deps + spreadsheet_deps
+# Currently, Modin does not include `mpi` option in `all`.
+# Otherwise, installation of modin[all] would fail because
+# users need to have a working MPI implementation and
+# certain software installed beforehand.
+all_deps = dask_deps + ray_deps + spreadsheet_deps
 
 # Distribute 'modin-autoimport-pandas.pth' along with binary and source distributions.
 # This file provides the "import pandas before Ray init" feature if specific
@@ -58,7 +62,7 @@ def make_distribution(self):
         # can be installed by pip install modin[dask]
         "dask": dask_deps,
         "ray": ray_deps,
-        "unidist": unidist_deps,
+        "mpi": mpi_deps,
         "spreadsheet": spreadsheet_deps,
         "all": all_deps,
     },


Test patch: