Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modin/config/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def print_config_help():
for objname in sorted(globals()):
obj = globals()[objname]
if isinstance(obj, type) and issubclass(obj, Parameter) and not obj.is_abstract:
pring("print_config_help()")
print(f"{obj.get_help()}\n\tCurrent value: {obj.get()}") # noqa: T001


Expand Down
27 changes: 25 additions & 2 deletions modin/config/envvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Backend(EnvironmentVariable, type=str):

varname = "MODIN_BACKEND"
default = "Pandas"
choices = ("Pandas", "OmniSci", "Pyarrow")
choices = ("Pandas", "OmniSci", "Pyarrow", "cuDF")


class IsExperimental(EnvironmentVariable, type=bool):
Expand Down Expand Up @@ -135,6 +135,26 @@ def _get_default(cls):
return multiprocessing.cpu_count()


class GpuCount(EnvironmentVariable, type=int):
"""
How may GPU devices to utilize across the whole distribution
"""

varname = "MODIN_GPUS"

# @classmethod
# def _get_default(cls):
# import ray
# if ray.is_initialized():
# return len(ray.get_gpu_ids())
# else:
# print(
# f"Ray has not been initialized yet. "
# f"MODIN-GPU doesn't know the number of available GPUs. "
# )
# return 1


class Memory(EnvironmentVariable, type=int):
"""
How much memory give to each Ray worker (in bytes)
Expand All @@ -152,7 +172,10 @@ class NPartitions(EnvironmentVariable, type=int):

@classmethod
def _get_default(cls):
return CpuCount.get()
if Backend.get() == "cuDF":
return GpuCount.get()
else:
return CpuCount.get()


class RayPlasmaDir(EnvironmentVariable, type=ExactStr):
Expand Down
2 changes: 1 addition & 1 deletion modin/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

def _update_engine(publisher: Parameter):
global dask_client
from modin.config import Backend, CpuCount
from modin.config import Backend, CpuCount, GpuCount

if publisher.get() == "Ray":
from modin.engines.ray.utils import initialize_ray
Expand Down