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

[Core][deprecate run_function_on_all_workers 3/n] delete run_function_on_all_workers #30895

Merged
merged 13 commits into from
Jun 8, 2023

Conversation

scv119
Copy link
Contributor

@scv119 scv119 commented Dec 5, 2022

Why are these changes needed?

This function is deprecated. The only use of run_funcion_on_all_workers in ray core has been replaced by #31383
Delete it to make our worker prestart change simpler.
This PR depends on #31383 #31528

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@scv119 scv119 changed the title [Core] deprecate run_function_on_all_workers [Core] delete run_function_on_all_workers Dec 5, 2022
@scv119 scv119 marked this pull request as ready for review December 5, 2022 19:38
@@ -156,9 +156,6 @@ def _process_key(self, key):
# for profiling).
# with profiling.profile("register_remote_function"):
(self.worker.function_actor_manager.fetch_and_register_remote_function(key))
elif key.startswith(b"FunctionsToRun:"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's also delete import_thread.py. It's only used in run_function_on_all_workers

@scv119 scv119 added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Dec 5, 2022
python/ray/_private/worker.py Show resolved Hide resolved
@@ -156,9 +156,6 @@ def _process_key(self, key):
# for profiling).
# with profiling.profile("register_remote_function"):
(self.worker.function_actor_manager.fetch_and_register_remote_function(key))
elif key.startswith(b"FunctionsToRun:"):
with profiling.profile("fetch_and_run_function"):
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it mean we are losing this data? This is kind of important for the timeline feature.

@pcmoritz
Copy link
Contributor

pcmoritz commented Dec 6, 2022

Very excited for this change, thank you so much for making it! This is code that is still around from a long time ago :)

@scv119
Copy link
Contributor Author

scv119 commented Jan 9, 2023

Will continue this after Ray 2.3.

@scv119 scv119 changed the title [Core] delete run_function_on_all_workers [Core][deprecate run_function_on_all_workers 3/n] delete run_function_on_all_workers Jan 9, 2023
@scv119 scv119 requested a review from a team February 2, 2023 12:45
@@ -3054,7 +2959,7 @@ def remote(
application-level errors should be retried up to max_retries times.
This can be a boolean or a list of exceptions that should be retried.
scheduling_strategy: Strategy about how to
schedule a remote function or actor. Possible values are
schedule a remote function or actou. Possible values are
Copy link
Contributor

Choose a reason for hiding this comment

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

revert?

python/ray/_private/worker.py Show resolved Hide resolved
@edoakes
Copy link
Contributor

edoakes commented Feb 2, 2023

🤩

@scv119 scv119 added do-not-merge Do not merge this PR! and removed @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. labels Feb 3, 2023
@scv119 scv119 force-pushed the deprecate-worker-init branch 2 times, most recently from b8b0554 to e3a7561 Compare February 6, 2023 18:09
@scv119 scv119 removed the do-not-merge Do not merge this PR! label Mar 8, 2023
@scv119
Copy link
Contributor Author

scv119 commented Mar 8, 2023

rebase

Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

Hmm is it really a good idea to deprecate this without the proper alternative? I feel like we need sth like a callback API that's called when the worker starts?

@scv119
Copy link
Contributor Author

scv119 commented Mar 9, 2023

I feel like we need sth like a callback API that's called when the worker starts?

I thought that API called runtime env :)

@rkooo567
Copy link
Contributor

rkooo567 commented Mar 9, 2023

Hmm I actually have 2 suggestions in this case?

https://docs.ray.io/en/master/ray-core/handling-dependencies.html -> I saw this doc, and it is not clear to me where to look in order to perform the same action. Can you link to the sub-category that has the exact API to replace this?

Instead of completely removing the function, why don't we keep the function but just raise an exception (for the backward compatibility)?

@rkooo567
Copy link
Contributor

rkooo567 commented Jun 8, 2023

cc @RehanSD for the awareness.

Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

Actually @pcmoritz instead of completely removing the API, why don't we raise an exception? Or do you think it is better just removing it? If so, we should make sure this is documented in 2.6 (do we have any place to track deprecation somewhere?)

@rkooo567
Copy link
Contributor

rkooo567 commented Jun 8, 2023

Also, I will make sure the replacement API will be available and documented by ray 2.6

@pcmoritz
Copy link
Contributor

pcmoritz commented Jun 8, 2023

Given this was a private API and has been deprecated for a while, I think it is fine to just remove it. But it is a good idea to mention in the release notes the worker process init hook you are working on :)

@pcmoritz
Copy link
Contributor

pcmoritz commented Jun 8, 2023

Looks like one more lint is failing. I'll also try to get the remaining code owner approvals :)

@pcmoritz
Copy link
Contributor

pcmoritz commented Jun 8, 2023

Copy link
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

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

Stamping

@scv119 scv119 merged commit 30e6b29 into ray-project:master Jun 8, 2023
99 of 104 checks passed
@scv119
Copy link
Contributor Author

scv119 commented Jun 8, 2023

@pcmoritz
Copy link
Contributor

pcmoritz commented Jun 8, 2023

Haha nice :)

krfricke pushed a commit that referenced this pull request Jun 16, 2023
…6402)

#30895 upgraded the pinned version of modin, removing support for python <= 3.7. All the release tests run with py37 by default, so the cluster env was failing to build due to no compatible modin version. This PR runs these release tests with py38 instead, which aligns with the us moving to testing with py38 for all of CI.

Signed-off-by: Justin Yu <[email protected]>
vitsai pushed a commit to vitsai/ray that referenced this pull request Jun 21, 2023
…y-project#36402)

ray-project#30895 upgraded the pinned version of modin, removing support for python <= 3.7. All the release tests run with py37 by default, so the cluster env was failing to build due to no compatible modin version. This PR runs these release tests with py38 instead, which aligns with the us moving to testing with py38 for all of CI.

Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: vitsai <[email protected]>
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…ay-project#35179)

I spent quite a bit of time debugging the test failure in ray-project#34393 (see also ray-project#35108)

It turns out the PR slightly made the _do_importing race condition (first time call in the import thread) more likely to happen. There is already a plan / PR to get rid of it (ray-project#30895) but it is currently waiting for having a replacement mechanism that @rkooo567 is working on.

I synced with @scv119 and for the time being, we are planning to skip the offending test on Windows and once we got rid of the import thread, we can re-activate it.

Signed-off-by: e428265 <[email protected]>
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…_on_all_workers (ray-project#30895)

This function is deprecated. The only use of run_funcion_on_all_workers in ray core has been replaced by ray-project#31383
Delete it to make our worker prestart change simpler.
This PR depends on ray-project#31383 ray-project#31528

Signed-off-by: e428265 <[email protected]>
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…y-project#36402)

ray-project#30895 upgraded the pinned version of modin, removing support for python <= 3.7. All the release tests run with py37 by default, so the cluster env was failing to build due to no compatible modin version. This PR runs these release tests with py38 instead, which aligns with the us moving to testing with py38 for all of CI.

Signed-off-by: Justin Yu <[email protected]>
Signed-off-by: e428265 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. Ray 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants