-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX-#4450: Ensure Modin successfully initializes when Ray cluster has no resources #4451
base: master
Are you sure you want to change the base?
Changes from all commits
2683d06
f62f847
a5437e8
ad4b868
17c7c9c
5035ad3
f52b3bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -217,7 +217,17 @@ def initialize_ray( | |||||
_move_stdlib_ahead_of_site_packages | ||||||
) | ||||||
ray.worker.global_worker.run_function_on_all_workers(_import_pandas) | ||||||
num_cpus = int(ray.cluster_resources()["CPU"]) | ||||||
num_cpus = ray.cluster_resources().get("CPU", None) | ||||||
if num_cpus is None: | ||||||
warnings.warn( | ||||||
"The current Ray cluster does not have any CPU Resources.\nModin uses the number of " | ||||||
+ "CPUs to determine how many partitions to create.\nNumber of partitions defaulting to" | ||||||
+ " number of CPUs on head node. To update, run the following python code:\n\tfrom " | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could you instead instantiate |
||||||
+ "modin.config import NPartitions\n\tNPartitions.put(desired_num_cpus)" | ||||||
) | ||||||
num_cpus = CpuCount.get() | ||||||
else: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
num_cpus = int(num_cpus) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
num_gpus = int(ray.cluster_resources().get("GPU", 0)) | ||||||
if StorageFormat.get() == "Cudf": | ||||||
NPartitions._put(num_gpus) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I did it like this is because I wanted to warn users that we were unable to determine how many
CPU
s there were and were relying on an internal heuristic - should we keep it this way, or change it to the more streamlined version you propose?