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] Always make request on fetch_local in wait even if num_objects in memory #50121

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dayshah
Copy link
Contributor

@dayshah dayshah commented Jan 29, 2025

Why are these changes needed?

We always want to make pull requests to get the objects passed into ray.wait on different nodes when ray.wait is called with fetch_local. Right now we don't make that request if we've already gotten num_objects from the core worker memory store.

Related issue number

Closes #49257

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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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 :(

@dayshah dayshah force-pushed the always-wait-fetch-local branch from ebc96c1 to 04eb297 Compare January 31, 2025 00:15
@dayshah dayshah requested a review from jjyao January 31, 2025 00:22
@jjyao jjyao added the go add ONLY when ready to merge, run all tests label Jan 31, 2025
@dayshah dayshah removed the go add ONLY when ready to merge, run all tests label Jan 31, 2025
Signed-off-by: dayshah <[email protected]>
@dayshah dayshah added the go add ONLY when ready to merge, run all tests label Jan 31, 2025
@@ -14,6 +14,7 @@ COPTS_WITHOUT_LOG = select({
"//conditions:default": [
"-Wunused-result",
"-Wconversion-null",
"-Wmisleading-indentation",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@jjyao jjyao left a comment

Choose a reason for hiding this comment

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

Code looks great. Lets think about how to write tests

# to start pulling y and z
ray.wait([x, y, z], num_returns=1, fetch_local=True)
time.sleep(3)

Copy link
Contributor Author

@dayshah dayshah Feb 3, 2025

Choose a reason for hiding this comment

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

memory_summary and list_objects show that objects are all always in the same store? Is making fake nodes using cluster.add_node not a viable solution for this, do we need a test env with two actual nodes

@dayshah dayshah requested a review from jjyao February 3, 2025 05:50
Comment on lines +107 to +111
start_time = time.perf_counter()
ray.get([y, z])
# y and z should be immediately available as pull requests should've
# been made immediately on the ray.wait call
time_to_get = time.perf_counter() - start_time
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can check ray.available_resources()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core] ray.wait doesn't fetch the objects if num_returns are available in memory
2 participants