Skip to content

Commit

Permalink
FEAT-modin-project#4574: Warn when pre-initialized Ray cluster is not…
Browse files Browse the repository at this point in the history
… using all available memory

Signed-off-by: Rehan Durrani <[email protected]>
  • Loading branch information
RehanSD committed Jun 14, 2022
1 parent 4ec7f63 commit 199ece6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modin/core/execution/ray/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,17 @@ def initialize_ray(
if not GPU_MANAGERS:
for i in range(GpuCount.get()):
GPU_MANAGERS.append(GPUManager.remote(i))
else:
ray_obj_store_mem = ray.available_resources()["object_store_memory"]
virtual_memory = psutil.virtual_memory().total
if (ray_obj_store_mem // 1e9) < (0.6 * virtual_memory) // 1e9:
warnings.warn(
"Modin has detected that it is running on a pre-initialized Ray cluster. "
+ f"This cluster has currently allocated {ray_obj_store_mem // 1e9} GB for its "
+ f"object store, but the device has {virtual_memory // 1e9} GB of RAM available. "
+ "Modin recommends initializing Ray with at least 60% of available RAM to prevent "
+ "Out Of Memory errors."
)
_move_stdlib_ahead_of_site_packages()
ray.worker.global_worker.run_function_on_all_workers(
_move_stdlib_ahead_of_site_packages
Expand Down

0 comments on commit 199ece6

Please sign in to comment.