-
Notifications
You must be signed in to change notification settings - Fork 153
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
[1/n] Add graph function to list DataPipes from graph #888
Conversation
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
f65a440
to
5993878
Compare
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
LGTM!
for dp_id, (dp, src_graph) in g.items(): | ||
if dp_id not in cache: | ||
cache.add(dp_id) | ||
dps.append(dp) |
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.
Side note, this doesn't guarantee any order and returns a list. This should suffice for the current use case.
I wonder if people will want a Dict
(basically just traverse_dps
without the IDs). To be clear, this seems fine to me for now.
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.
If we treat the graph as a tree, there can be in different orders like how do we traverse a tree. Pre-order; post-order, etc. It highly depends on users' preference especially our graph can be more complicated than a tree. I would say let's wait until we have received any use case.
@ejguan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Add a
list_dps
function to listDataPipes
from the graph.get_all_graph_pipes
from pytorch coreexclude_dps
to exclude theDataPipe
and its prior graph from the result.Reason to add this function:
sharding_filter
Step 1 for #885