Skip to content

Conversation

@masnesral
Copy link
Contributor

@masnesral masnesral commented Jan 30, 2025

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?

Summary:

Test Plan:

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 30, 2025

🔗 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 SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit fd75193 with merge base 354fe48 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

masnesral added a commit that referenced this pull request Jan 30, 2025
Summary:

Test Plan:

ghstack-source-id: 3d8fbfa
Pull Request resolved: #146102
@masnesral masnesral added the topic: not user facing topic category label Jan 31, 2025
@masnesral masnesral changed the title User OrderedSet in partitioners Use OrderedSet in partitioners Jan 31, 2025
@masnesral masnesral changed the title Use OrderedSet in partitioners Make partitioning more deterministic Jan 31, 2025
@masnesral masnesral requested review from Chillee and oulgen January 31, 2025 17:12
@masnesral masnesral marked this pull request as ready for review January 31, 2025 17:12
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]
Copy link
Contributor

@eellison eellison left a 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]
Comment on lines 1405 to 1409
OrderedSet(fusible_ops),
OrderedSet(compute_intensive_ops),
OrderedSet(random_ops),
OrderedSet(view_ops),
OrderedSet(recomputable_ops),
Copy link
Contributor

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]
masnesral added a commit that referenced this pull request Jan 31, 2025
Summary:

Test Plan:

ghstack-source-id: daf1fd4
Pull Request resolved: #146102
@masnesral masnesral added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 1, 2025
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"]
Copy link
Collaborator

@Skylion007 Skylion007 Feb 1, 2025

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]
masnesral added a commit that referenced this pull request Feb 1, 2025
Summary:

Test Plan:

ghstack-source-id: 900c5bd
Pull Request resolved: #146102
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]
masnesral added a commit that referenced this pull request Feb 4, 2025
Summary:

Test Plan:

ghstack-source-id: 54ad819
Pull Request resolved: #146102
@masnesral masnesral changed the title Make partitioning more deterministic Use OrderedSet in _functorch/partitioners Feb 4, 2025
@masnesral
Copy link
Contributor Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

masnesral added a commit that referenced this pull request Feb 5, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants