-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MTIAGraph][Pytorch][2/n] Add binding for Python to C++, and hook for Pytorch to Fbcode #165963
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/165963
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3b7017a with merge base f5543e3 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@andyanwang has exported this pull request. If you are a Meta employee, you can view the originating Diff in D84457757. |
torch/csrc/mtia/Module.cpp
Outdated
|
|
||
| _MTIAGraph(bool keep_graph = false) | ||
| : handle_(at::detail::getMTIAHooks().mtiagraphCreate(keep_graph)) {} | ||
| ~_MTIAGraph() {} |
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.
Shouldn't this equal default?
e8cd700 to
ffdb0f6
Compare
… Pytorch to Fbcode (pytorch#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Reviewed By: chaos5958 Differential Revision: D84457757
… Pytorch to Fbcode (pytorch#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode {F1982920659} [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Reviewed By: chaos5958 Differential Revision: D84457757
ffdb0f6 to
0a0ef5e
Compare
… Pytorch to Fbcode (pytorch#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode {F1982920659} [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Reviewed By: chaos5958 Differential Revision: D84457757
0a0ef5e to
991cc2b
Compare
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
|
|
||
| #include <c10/util/python_stub.h> | ||
| #include <ATen/detail/AcceleratorHooksInterface.h> | ||
| #include <c10/util/python_stub.h> |
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.
Why change the header order here (and may be move all c10 headers to one block)
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.
I think it's done by lintrunner. I'll double check
| } | ||
|
|
||
| virtual void setCurrentStream(const c10::Stream& /*stream*/ ) const { | ||
| virtual void setCurrentStream(const c10::Stream& /*stream*/) const { |
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.
Feels like could be done by separate commit
991cc2b to
c65c76c
Compare
… Pytorch to Fbcode (#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode {F1982920659} [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Reviewed By: chaos5958 Differential Revision: D84457757
c65c76c to
be99ded
Compare
… Pytorch to Fbcode (#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode {F1982920659} [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Reviewed By: chaos5958 Differential Revision: D84457757
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.
SGTM
… Pytorch to Fbcode (pytorch#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode {F1982920659} [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Reviewed By: chaos5958 Differential Revision: D84457757
be99ded to
3b7017a
Compare
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
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 |
… Pytorch to Fbcode (#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode <img width="1780" height="754" alt="image" src="https://github.com/user-attachments/assets/31e24e5b-8324-42d8-8d3b-59536bc18340" /> [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Differential Revision: D84457757 Pull Request resolved: #165963 Approved by: https://github.com/malfet, https://github.com/albanD
Per suggestion from the previous PR(#165963), separating clang-format changes. Differential Revision: [D86031474](https://our.internmc.facebook.com/intern/diff/D86031474/) [ghstack-poisoned]
I missed this API for MTIAGraph in D84457757(#165963) Differential Revision: [D86026706](https://our.internmc.facebook.com/intern/diff/D86026706/) [ghstack-poisoned]
I missed this API for MTIAGraph in D84457757(#165963) Differential Revision: [D86026706](https://our.internmc.facebook.com/intern/diff/D86026706/) ghstack-source-id: 320301565 Pull Request resolved: #166806
Pull Request resolved: #166806 I missed this API for MTIAGraph in D84457757(#165963) Differential Revision: [D86026706](https://our.internmc.facebook.com/intern/diff/D86026706/) ghstack-source-id: 320385344
…les" Per suggestion from the previous PR(#165963), separating clang-format changes. Differential Revision: [D86031474](https://our.internmc.facebook.com/intern/diff/D86031474/) cc egienvalue [ghstack-poisoned]
Per suggestion from the previous PR(#165963), separating clang-format changes. Differential Revision: [D86031474](https://our.internmc.facebook.com/intern/diff/D86031474/) cc egienvalue [ghstack-poisoned]
…troy graph C++ instance" I missed this API for MTIAGraph in D84457757(#165963) Differential Revision: [D86026706](https://our.internmc.facebook.com/intern/diff/D86026706/) cc egienvalue [ghstack-poisoned]
…nstance" I missed this API for MTIAGraph in D84457757(#165963) Differential Revision: [D86026706](https://our.internmc.facebook.com/intern/diff/D86026706/) cc egienvalue [ghstack-poisoned]
Per suggestion from the previous PR(#165963), separating clang-format changes. Differential Revision: [D86031474](https://our.internmc.facebook.com/intern/diff/D86031474/) Pull Request resolved: #166805 Approved by: https://github.com/Skylion007, https://github.com/albanD
…66806) I missed this API for MTIAGraph in D84457757(#165963) Differential Revision: [D86026706](https://our.internmc.facebook.com/intern/diff/D86026706/) Pull Request resolved: #166806 Approved by: https://github.com/albanD ghstack dependencies: #166805
… Pytorch to Fbcode (pytorch#165963) Summary: This diff is the binding and hook layer for MTIA Graph, including 1. binding between Python and C++ 2. hook between Pytorch and mtia fbcode <img width="1780" height="754" alt="image" src="https://github.com/user-attachments/assets/31e24e5b-8324-42d8-8d3b-59536bc18340" /> [Doc](https://docs.google.com/document/d/1Q3xdZAIqhBvuy2HxGDfJyXVmxYXUEeYSZSwsp7bcJF8/edit?tab=t.osb46a42t6wb#heading=h.ayp9tkk08x00) Test Plan: Will be tested in the python implementation which will use the binding and hook Differential Revision: D84457757 Pull Request resolved: pytorch#165963 Approved by: https://github.com/malfet, https://github.com/albanD
Per suggestion from the previous PR(#165963), separating clang-format changes. Differential Revision: [D86031474](https://our.internmc.facebook.com/intern/diff/D86031474/) Pull Request resolved: #166805 Approved by: https://github.com/Skylion007, https://github.com/albanD
…66806) I missed this API for MTIAGraph in D84457757(#165963) Differential Revision: [D86026706](https://our.internmc.facebook.com/intern/diff/D86026706/) Pull Request resolved: #166806 Approved by: https://github.com/albanD ghstack dependencies: #166805
Summary:
This diff is the binding and hook layer for MTIA Graph, including
Doc
Test Plan: Will be tested in the python implementation which will use the binding and hook
Differential Revision: D84457757
cc @egienvalue