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

[Doc] Revamp ray core design patterns doc [6/n]: ray wait limits in-flight tasks #28469

Merged
merged 10 commits into from
Sep 20, 2022

Conversation

jjyao
Copy link
Collaborator

@jjyao jjyao commented Sep 13, 2022

Signed-off-by: Jiajun Yao [email protected]

Why are these changes needed?

  • Edit pass: the content was wrong: we don't OOM due to pulling too many args, but rather we OOM because the task queue grow indefinitely when we summit tasks faster than they can be processed.
  • Move code to doc_code

Related issue number

#27048

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 :(

Signed-off-by: Jiajun Yao <[email protected]>
Signed-off-by: Jiajun Yao <[email protected]>
Signed-off-by: Jiajun Yao <[email protected]>
Signed-off-by: Jiajun Yao <[email protected]>
Signed-off-by: Jiajun Yao <[email protected]>
Signed-off-by: Jiajun Yao <[email protected]>
@jjyao jjyao marked this pull request as ready for review September 16, 2022 06:05
@jjyao jjyao requested a review from a team as a code owner September 16, 2022 06:05
@ray.remote
class Actor:
def heavy_compute(self, large_array):
async def heavy_compute(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Why async? Did the example not work previously?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea, I chose to use async so tasks are finished in a different order than the submission order so using ray.wait() makes more sense otherwise we could just ray.get() one by one.

doc/source/ray-core/patterns/limit-tasks.rst Show resolved Hide resolved

# __executing_task_start__
NUM_TASKS = 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to make the number of tasks infinite so that it better matches the issue description?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the test code will be run by our CI. I couldn't figure out a good way to show infinite on the example but a small number for CI.

doc/source/ray-core/patterns/limit-tasks.rst Outdated Show resolved Hide resolved
@stephanie-wang stephanie-wang added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Sep 19, 2022
@jjyao jjyao removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Sep 19, 2022
@jjyao jjyao merged commit 805d5dc into ray-project:master Sep 20, 2022
@jjyao jjyao deleted the jjyao/limit branch September 20, 2022 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants