C++-accessible Placements via pybind11#163030
C++-accessible Placements via pybind11#163030swolchok wants to merge 20 commits intogh/swolchok/839/basefrom
Conversation
This makes Placement data representation available in C++ via pybind11. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/163030
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 54c6509 with merge base e5c0e6b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
I was overthinking how to do this. The overhead for grabbing the object from the pybind11 object is higher than I'd like but I think using this still results in a performance win despite that (see #163031). |
| } // namespace torch::autograd | ||
|
|
||
| // XXX: Move this somewhere | ||
| static const char placement_class_docstring[] = |
There was a problem hiding this comment.
Should also be constexpr
|
|
||
| class Replicate : public Placement { | ||
| public: | ||
| ~Replicate() {} |
There was a problem hiding this comment.
Should be equals default, right?
| explicit Partial(std::string reduce_op_) : reduce_op(std::move(reduce_op_)) {} | ||
|
|
||
| ~Partial() {} | ||
|
|
| } | ||
| }; | ||
|
|
||
| Placement::~Placement() {} |
There was a problem hiding this comment.
Shouldn't this be equals default too? Why is it out of line?
There was a problem hiding this comment.
Why is it out of line?
It's pure virtual, but still needs an implementation. Can't do both inline.
This makes Placement data representation available in C++ via pybind11. [ghstack-poisoned]
This makes Placement data representation available in C++ via pybind11. [ghstack-poisoned]
|
I'm not sure why BC Lint is so unhappy with what I've done here, especially now that I've updated |
This makes Placement data representation available in C++ via pybind11. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci [ghstack-poisoned]
…pybind11" This makes Placement data representation available in C++ via pybind11. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci [ghstack-poisoned]
…"C++-accessible Placements via pybind11" This makes Placement data representation available in C++ via pybind11. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci [ghstack-poisoned]
… uncertainty on "DTensor: C++ compute_global_tensor_info"
compute_global_tensor_info is on the hot path for DTensor.{from,to}_local. More incremental progress toward C++.
cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci
[ghstack-poisoned]
… uncertainty on "Use C++-accessible Placement in compute_global_tensor_info" This seems to speed things up, though there is more overhead than I'd like to unwrap a Placement via pybind11. Might be time to introduce nanobind; I'm not sure that we can use it in general, but the Placement type system is (currently?) isolated. (Alternatively, I could look into whether we can cut this overhead.) [ghstack-poisoned]
… uncertainty on "C++-accessible Placements via pybind11" This makes Placement data representation available in C++ via pybind11. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci [ghstack-poisoned]
|
@swolchok your PR has been successfully reverted. |
This makes Placement data representation available in C++ via pybind11. Reapply with fix for internal errors. Differential Revision: [D83788896](https://our.internmc.facebook.com/intern/diff/D83788896/) [ghstack-poisoned]
This makes Placement data representation available in C++ via pybind11. Reapply with fix for internal errors. Differential Revision: [D83788896](https://our.internmc.facebook.com/intern/diff/D83788896/) ghstack-source-id: 313745131 Pull Request resolved: #164519
Pull Request resolved: #164519 This makes Placement data representation available in C++ via pybind11. Reapply with fix for internal errors. ghstack-source-id: 313909406 @exported-using-ghexport Differential Revision: [D83788896](https://our.internmc.facebook.com/intern/diff/D83788896/)
…ind11 (#163030)"" This makes Placement data representation available in C++ via pybind11. Reapply with fix for internal errors. Differential Revision: [D83788896](https://our.internmc.facebook.com/intern/diff/D83788896/) cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela [ghstack-poisoned]
This makes Placement data representation available in C++ via pybind11. Reapply with fix for internal errors. Differential Revision: [D83788896](https://our.internmc.facebook.com/intern/diff/D83788896/) cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela [ghstack-poisoned]
This makes Placement data representation available in C++ via pybind11. Reapply with fix for internal errors. D83788896 Pull Request resolved: #164519 Approved by: https://github.com/Skylion007, https://github.com/ezyang
…Partial to placement_types to improve discoverability" Had trouble finding this one myself in #163030. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci [ghstack-poisoned]
…ment_types to improve discoverability" Had trouble finding this one myself in #163030. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci [ghstack-poisoned]
…rove discoverability" Had trouble finding this one myself in #163030. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci [ghstack-poisoned]
…lity" Had trouble finding this one myself in #163030. cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci [ghstack-poisoned]
…164519)" This reverts commit 8c0bc87. Reverted #164519 on behalf of https://github.com/malfet due to Still breaks internal workflows ([comment](#164519 (comment)))
Was reverted due to internal signal. After internal discussion with @fadeputr, reapplying with no further changes seems to be the right call. Differential Revision: [D84515401](https://our.internmc.facebook.com/intern/diff/D84515401/) [ghstack-poisoned]
Was reverted due to internal signal. After internal discussion with fadeputr, reapplying with no further changes seems to be the right call. Differential Revision: [D84515401](https://our.internmc.facebook.com/intern/diff/D84515401/) ghstack-source-id: 315835168 Pull Request resolved: #165335
…pybind11 (#163030)"" Was reverted due to internal signal. After internal discussion with fadeputr, reapplying with no further changes seems to be the right call. Differential Revision: [D84515401](https://our.internmc.facebook.com/intern/diff/D84515401/) cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela [ghstack-poisoned]
…"" Was reverted due to internal signal. After internal discussion with fadeputr, reapplying with no further changes seems to be the right call. Differential Revision: [D84515401](https://our.internmc.facebook.com/intern/diff/D84515401/) cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta msaroufim dcci voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela [ghstack-poisoned]
Pull Request resolved: #165335 Was reverted due to internal signal. After internal discussion with @fadeputr, reapplying with no further changes seems to be the right call. ghstack-source-id: 315881161 @exported-using-ghexport Differential Revision: [D84515401](https://our.internmc.facebook.com/intern/diff/D84515401/)
Was reverted due to a merge conflict that crept in sometime during the "export to github -> land internally -> merge on github" process. Differential Revision: [D84862100](https://our.internmc.facebook.com/intern/diff/D84862100/) [ghstack-poisoned]
Was reverted due to a merge conflict that crept in sometime during the "export to github -> land internally -> merge on github" process. Differential Revision: [D84862100](https://our.internmc.facebook.com/intern/diff/D84862100/) ghstack-source-id: 316992680 Pull Request resolved: #165764
This makes Placement data representation available in C++ via pybind11. Pull Request resolved: pytorch#163030 Approved by: https://github.com/ezyang
This reverts commit 3e03dea. Reverted pytorch#163030 on behalf of https://github.com/swolchok due to doesn't pass pyre ([comment](pytorch#163030 (comment)))
…torch#164519) This makes Placement data representation available in C++ via pybind11. Reapply with fix for internal errors. D83788896 Pull Request resolved: pytorch#164519 Approved by: https://github.com/Skylion007, https://github.com/ezyang
…)" (pytorch#164519)" This reverts commit 8c0bc87. Reverted pytorch#164519 on behalf of https://github.com/malfet due to Still breaks internal workflows ([comment](pytorch#164519 (comment)))
Was reverted (again!) due to a merge conflict that crept in sometime during the "export to github -> land internally -> merge on github" process. Differential Revision: [D85096233](https://our.internmc.facebook.com/intern/diff/D85096233/) [ghstack-poisoned]
Was reverted (again!) due to a merge conflict that crept in sometime during the "export to github -> land internally -> merge on github" process. Differential Revision: [D85096233](https://our.internmc.facebook.com/intern/diff/D85096233/) ghstack-source-id: 318252481 Pull Request resolved: #166132
Pull Request resolved: #166132 Was reverted (again!) due to a merge conflict that crept in sometime during the "export to github -> land internally -> merge on github" process. ghstack-source-id: 318928038 @exported-using-ghexport Differential Revision: [D85096233](https://our.internmc.facebook.com/intern/diff/D85096233/)
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Stack from ghstack (oldest at bottom):
This makes Placement data representation available in C++ via pybind11.
cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta @msaroufim @dcci @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @Lucaskabela @jataylo @ezyang @chenyang78