-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[ADAG] Support multi-args and kwargs in Accelerate DAG #45545
Merged
stephanie-wang
merged 7 commits into
ray-project:master
from
ruisearch42:dag_multi_args
May 29, 2024
Merged
[ADAG] Support multi-args and kwargs in Accelerate DAG #45545
stephanie-wang
merged 7 commits into
ray-project:master
from
ruisearch42:dag_multi_args
May 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruisearch42
changed the title
[ADAG] Support args and kwargs in Accelerate DAG
[ADAG] Support multi-args and kwargs in Accelerate DAG
May 24, 2024
ruisearch42
commented
May 24, 2024
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.
Nice! The logic looks good to me; I left some suggestions for cleanup.
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
May 24, 2024
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
ruisearch42
force-pushed
the
dag_multi_args
branch
from
May 25, 2024 01:46
b71f9cf
to
6c6b0df
Compare
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
Signed-off-by: Rui Qiao <[email protected]>
ruisearch42
removed
the
@author-action-required
The PR author is responsible for the next step. Remove tag to send back to the reviewer.
label
May 27, 2024
stephanie-wang
approved these changes
May 28, 2024
Signed-off-by: Rui Qiao <[email protected]>
8 tasks
richardsliu
pushed a commit
to richardsliu/ray
that referenced
this pull request
Jun 12, 2024
…5545) This PR adds multi-arg and kwarg support by serializing all positional args and kwargs and passing it through the channel. When the channel is read at runtime, the individual args are extracted first before passing to the consuming tasks. Closes ray-project#42793 --------- Signed-off-by: Rui Qiao <[email protected]> Signed-off-by: Rui Qiao <[email protected]> Signed-off-by: Richard Liu <[email protected]>
8 tasks
stephanie-wang
added a commit
that referenced
this pull request
Jun 27, 2024
A performance regression was noticed after #45545 was merged, as the node input was changed from a single bytes object to a tuple of lists (to support multiple arguments). ``` Before: [unstable] compiled single-actor DAG calls per second 35571.54 +- 416.15 After Regression: [unstable] compiled single-actor DAG calls per second 11037.4 +- 59.79 ``` The default serialization engine in Ray does not need to serialize a bytes object, but it does have to serialize other Python types, including tuples of lists. Thus, the serialization engine needed to perform more work with tuples of lists. The default serialization engine took ~30 µs to serialize the tuple of lists, which seemed expensive. Passing a single bytes object is a common case, so this PR creates a fast path for this case while passing everything else (multiple arguments, nested Python objects, etc.) to the Ray serializer. ``` Disable Multi-Args (New Baseline): [unstable] compiled single-actor DAG calls per second 28858.82 +- 270.54 Multi-Args with Fix: [unstable] compiled single-actor DAG calls per second 27812.58 +- 536.67 ``` The PR that introduced the regression was merged nearly a month ago, so the "Before" case above is a bit stale. Thus, I disabled multi-args and use that as the new baseline to which I compare the performance results of this current PR. --------- Signed-off-by: Jack Humphries <[email protected]> Signed-off-by: Stephanie Wang <[email protected]> Co-authored-by: Stephanie Wang <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Currently accelerated DAG only supports a single argument per task. We would like to add general support for multi-args and kwargs.
This PR adds multi-arg and kwarg support by serializing all positional args and kwargs and passing it through the channel. When the channel is read at runtime, the individual args are extracted first before passing to the consuming tasks.
Related issue number
Closes #42793
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.