-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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][compiled graphs] Rework visualize with channel info and actor coloring #48473
Conversation
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
""" | ||
Return the number of readers for this channel. | ||
""" | ||
return self._inner_channel.num_readers() if self._inner_channel else 0 |
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 there an alternative we should be going to here if the inner channel doesn't exist?
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
@dayshah Is this ready to review? |
ya |
Signed-off-by: dayshah <dhyey2019@gmail.com>
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.
This is a good first step.
In the description, can you show the old visualization as well so the difference will be obvious.
Signed-off-by: dayshah <dhyey2019@gmail.com>
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.
Do you still need to update the example graphs or code? I see some channels are still showing CompositeChannel
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
So it seems like there's actually only one cached channel i printed out all the channels in the channel dict to make sure too and it showed only one cached channel that leads to the two tasks |
python/ray/dag/compiled_dag_node.py
Outdated
if dag_node.type_hint | ||
else "UnknownType" | ||
) + "\n" | ||
get_output_channel_type = ( |
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.
Please also add some unit tests in
def test_visualize_basic(ray_start_regular): |
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
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.
Thanks for adding the coloring!
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.
Can you also add a test for multi-arg and kwarg and make sure it works OK? They will be created as InputAttributeNode
s and a channel is created for each InputAttributeNode
. See how they can be created here:
class TestMultiArgs: |
After addressing these we should be able to merge!
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
added multiarg test and image of multiarg kwarg visualization in description |
python/ray/dag/compiled_dag_node.py
Outdated
@@ -2281,11 +2298,13 @@ def visualize( | |||
|
|||
# Dot file for debuging | |||
dot = graphviz.Digraph(name="compiled_graph", format=format) | |||
|
|||
# Give every actor a unique color (Colors between 24k -> 40k seem readable) |
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.
Did you imply showing up to 16 colors should be OK, but the coloring scheme does not scale well beyond that? If so, please add that to the comment explicitly.
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 the coloring scheme will keep going infinitely and wrap around, but the text is always black, and the colors could end up being too dark so the text isn't as visible, will add that info in comment
python/ray/dag/compiled_dag_node.py
Outdated
else "UnknownType" | ||
) + "\n" | ||
|
||
def get_output_channel_info(output_channel, downstream_actor_id): |
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.
Please move this out of the for loop. Also add docstring.
Let's rename the method to get_channel_details
. Let's just call the arg channel
as opposed to output_channel
.
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 moved it outside the function in general, can be called for debugging purposes on its own
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
test_accelerated_dag failed, please address |
Signed-off-by: dayshah <dhyey2019@gmail.com>
…coloring (ray-project#48473) Signed-off-by: dayshah <dhyey2019@gmail.com> Signed-off-by: hjiang <dentinyhao@gmail.com>
Why are these changes needed?
To give an option for additional channel information for debugging using the new dag visualization functionality.
After:
Before:
Related issue number
Closes #48248
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.