-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Use OrderedSet in _functorch/partitioners #146102
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
Conversation
Summary: Test Plan: [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/146102
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit fd75193 with merge base 354fe48 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Copied from #145024, but made _all_ sets OrderedSets and fixed mypy complaints. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach? [ghstack-poisoned]
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 add these files to the OrderedSet linter ? this will make the changes automatically, and update future set uses. ty @rec
Copied from #145024, but made _all_ sets OrderedSets and fixed mypy complaints. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach? [ghstack-poisoned]
Copied from #145024, but made _all_ sets OrderedSets and fixed mypy complaints. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach? [ghstack-poisoned]
torch/_functorch/partitioners.py
Outdated
| OrderedSet(fusible_ops), | ||
| OrderedSet(compute_intensive_ops), | ||
| OrderedSet(random_ops), | ||
| OrderedSet(view_ops), | ||
| OrderedSet(recomputable_ops), |
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.
arent some of these already orderedset?
Copied from #145024, but made _all_ sets OrderedSets and fixed mypy complaints. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach? [ghstack-poisoned]
torch/_functorch/partitioners.py
Outdated
| node.name for node in bw_module.graph.nodes if node.op == "call_function" | ||
| } | ||
| fw_module_nodes = OrderedSet( | ||
| [node.name for node in fw_module.graph.nodes if node.op == "call_function"] |
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.
These list comprehensions can be generators if you do not want an extra copy (input only needs to be an Iterable)
Copied from #145024, but made _all_ sets OrderedSets and fixed mypy complaints. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach? [ghstack-poisoned]
Copied from #145024, but made _all_ sets OrderedSets and fixed mypy complaints. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach? [ghstack-poisoned]
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
In an attempt to make partitioning more deterministic, change all sets in partitioners.py to OrderedSets. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach? Pull Request resolved: #146102 Approved by: https://github.com/oulgen ghstack-source-id: 3cc1c96
Stack from ghstack (oldest at bottom):
In an attempt to make partitioning more deterministic, change all sets in partitioners.py to OrderedSets. Note that this change does not fix the non-determinism we're seeing in the internal model. But let's at least eliminate this potential source of non-determinism before investigating any changes to the mincut approach?