Skip to content

Conversation

mlazos
Copy link
Contributor

@mlazos mlazos commented Sep 14, 2025

Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes.

Stack from ghstack (oldest at bottom):

Make custom ops inplace

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @Lucaskabela

Make custom ops inplace

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 14, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/162900

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:

✅ You can merge normally! (3 Unrelated Failures)

As of commit d2053df with merge base ecb5307 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

mlazos added a commit that referenced this pull request Sep 16, 2025
Make custom ops inplace

ghstack-source-id: 729c18a
Pull Request resolved: #162900
mlazos added a commit that referenced this pull request Sep 16, 2025
Make custom ops inplace

ghstack-source-id: 729c18a
Pull Request resolved: #162900
mlazos added a commit that referenced this pull request Sep 16, 2025
Make custom ops inplace

ghstack-source-id: 729c18a
Pull Request resolved: #162900
mlazos added a commit that referenced this pull request Sep 16, 2025
Make custom ops inplace

ghstack-source-id: 729c18a
Pull Request resolved: #162900
Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Sep 16, 2025
Make custom ops inplace

ghstack-source-id: 3b123ec
Pull Request resolved: #162900
Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Sep 16, 2025
Make custom ops inplace

ghstack-source-id: be0bdf0
Pull Request resolved: #162900
Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Sep 17, 2025
Make custom ops inplace

ghstack-source-id: 3bd41a3
Pull Request resolved: #162900
mlazos added a commit that referenced this pull request Sep 18, 2025
Make custom ops inplace

ghstack-source-id: 3bd41a3
Pull Request resolved: #162900
mlazos added a commit that referenced this pull request Sep 18, 2025
Make custom ops inplace

ghstack-source-id: 3bd41a3
Pull Request resolved: #162900
@mlazos mlazos requested a review from zou3519 September 18, 2025 21:07
mlazos added a commit that referenced this pull request Sep 18, 2025
Make custom ops inplace

ghstack-source-id: 3bd41a3
Pull Request resolved: #162900
Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Sep 19, 2025
Make custom ops inplace

ghstack-source-id: 355b1fe
Pull Request resolved: #162900
mlazos added a commit that referenced this pull request Oct 8, 2025
Make custom ops inplace

ghstack-source-id: 3e41664
Pull Request resolved: #162900
@mlazos
Copy link
Contributor Author

mlazos commented Oct 8, 2025

After discussing offline with Brian and Elias, I opted to have a simpler custom op here which just records the from/to streams and we will do more of the dependency tracking after joint graph tracing and functionalization. We no longer have "fake mutation" to get functionalization to stream dependencies properly.

Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes. 


Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Oct 9, 2025
Make custom ops inplace

ghstack-source-id: 1789c82
Pull Request resolved: #162900
Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes. 


Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Oct 9, 2025
Make custom ops inplace

ghstack-source-id: 0de9925
Pull Request resolved: #162900
mlazos added a commit that referenced this pull request Oct 9, 2025
Make custom ops inplace

ghstack-source-id: 0de9925
Pull Request resolved: #162900
Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes. 


Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
@mlazos mlazos mentioned this pull request Oct 9, 2025
mlazos added a commit that referenced this pull request Oct 9, 2025
Make custom ops inplace

ghstack-source-id: 8551357
Pull Request resolved: #162900
Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes. 


Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Oct 11, 2025
Make custom ops inplace

ghstack-source-id: 1fda8ca
Pull Request resolved: #162900
Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes. 


Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Oct 13, 2025
Make custom ops inplace

ghstack-source-id: 08bc532
Pull Request resolved: #162900
Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes. 


Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
mlazos added a commit that referenced this pull request Oct 13, 2025
Make custom ops inplace

ghstack-source-id: 0b4a244
Pull Request resolved: #162900
Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes. 


Make custom ops inplace

cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
@mlazos
Copy link
Contributor Author

mlazos commented Oct 14, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 14, 2025
@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

Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Oct 21, 2025
Creates the fork/join stream ops. These ops are passthrough ops which mutate all of their args (without actually performing any computation on them) so that during functionalization, implicit dependencies are added on all of their args. This allows us to prevent reordering during our pre/post grad graph passes.

Make custom ops inplace

Pull Request resolved: pytorch#162900
Approved by: https://github.com/anijain2305
ghstack dependencies: pytorch#163027, pytorch#162899, pytorch#163028
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants