Skip to content
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

Rearrange ray initialization to avoid RuntimeWarning #515

Merged
merged 7 commits into from
Apr 29, 2024
Merged

Conversation

bwohlberg
Copy link
Collaborator

Rearrange ray initialization to avoid RuntimeWarning resulting from initialization of ray after jax has been imported, as described in #513.

@bwohlberg bwohlberg added examples Pertaining to SCICO examples tests Pertaining to SCICO tests labels Apr 25, 2024
@bwohlberg bwohlberg linked an issue Apr 25, 2024 that may be closed by this pull request
conftest.py Outdated
have_ray = False
else:
have_ray = True
ray.init(num_cpus=1) # required to be here: see ray-project/ray#44087
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why num_cpus=1? I don't see anything about that at ray-project/ray#44087

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the location of the ray.init call that is "required to be here". The constraint on the number of cpus is so that it will play nicely with tests run in parallel.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comment in an attempt to clarify this.

@bwohlberg bwohlberg merged commit 738b4a0 into main Apr 29, 2024
18 checks passed
@bwohlberg bwohlberg deleted the brendt/ray branch April 29, 2024 23:05
@bwohlberg bwohlberg restored the brendt/ray branch April 30, 2024 00:41
@bwohlberg bwohlberg deleted the brendt/ray branch April 30, 2024 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Pertaining to SCICO examples tests Pertaining to SCICO tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RuntimeWarning when using ray
2 participants