-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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] Improve DAG API to support tensor parallel DAG #41231
Conversation
python/ray/dag/output_node.py
Outdated
IN_CONTEXT_MANAGER = "__in_context_manager__" | ||
|
||
|
||
class OutputNode(DAGNode): |
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.
Is it only useful when there are multiple outputs? If so, how about calling it something like MultiOutputNode?
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.
actually I thought we want this even for a single output (since we need to allocate the buffer ahead of time). cc @stephanie-wang can we allocate the output buffer without this Output node? for an single output case?
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.
For single-output, it's kind of a nuisance to require users to specify it. We don't really need it for compiled DAG; it's just useful to know which node is the sink. My plan for compiled DAG was to add it implicitly if the user didn't specify it.
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.
So yes I agree that we can just call it MultiOutputNode, since users only need to use if there are multiple outputs.
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.
Addressed
the final semantic is
MultiOutputNode([output_1, output_2, ...]) -> [output_1, output2, ...]
cc @ericl @stephanie-wang. I addressed comments! |
Working on CI failures... |
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.
Looks good!
@ericl can you take a look at doc changes? |
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.
Just some nits.
python/ray/actor.py
Outdated
from ray.dag.class_node import ( | ||
PARENT_CLASS_NODE_KEY, | ||
PREV_CLASS_METHOD_CALL_KEY, | ||
ClassMethodNode, | ||
) |
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.
For the test failure, I'm wondering if this is causing an increase in startup time?
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.
Hmm this just adds 1ms overhead when ray.init() is called. but let me try. nothing to lose...
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.
yeah this fixes the issue... I think it is really a bug from that test, and it should be fixed, but I will just move import here for now
Why are these changes needed?
make a task as a starting node of the DAG instead of the actor
This PR also removes the unused code
Related issue number
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.