-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[JIT] make RegisterCudaFuseGraph use TORCH_API instead of C10_EXPORT #73742
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
I think this was causing multiple implementations of RegisterCudaFuseGraph on windows. It looks like both torch_cpu.dll and torch_python.dll were exporting RegisterCudaFuseGraph implementations, so RegisterCudaFuseGraph::isRegistered() would refer to a _different_ static bool depending on whether the caller was in torch_cpu.dll or torch_python.dll. See #73717 for a demonstration. [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
|
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 595968a (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
…C10_EXPORT" I think this was causing multiple implementations of RegisterCudaFuseGraph on windows. It looks like both torch_cpu.dll and torch_python.dll were exporting RegisterCudaFuseGraph implementations, so RegisterCudaFuseGraph::isRegistered() would refer to a _different_ static bool depending on whether the caller was in torch_cpu.dll or torch_python.dll. See #73717 for a demonstration. [ghstack-poisoned]
|
@davidberard98 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
eellison
left a comment
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.
Should we just grep replace C10_EXPORT with TORCH_API everywhere in torch/csrc/jit ?
Similar question, we are also using |
jjsjann123
left a comment
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.
Thanks for the fix!
|
@eellison @jjsjann123 I think some of them belong to |
These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 ghstack-source-id: 9c08b52 Pull Request resolved: #73818
These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 [ghstack-poisoned]
…73742) Summary: Pull Request resolved: #73742 I think this was causing multiple implementations of RegisterCudaFuseGraph on windows. It looks like both torch_cpu.dll and torch_python.dll were exporting RegisterCudaFuseGraph implementations, so RegisterCudaFuseGraph::isRegistered() would refer to a _different_ static bool depending on whether the caller was in torch_cpu.dll or torch_python.dll. See #73717 for a demonstration. Test Plan: Imported from OSS Reviewed By: eellison Differential Revision: D34618623 Pulled By: davidberard98 fbshipit-source-id: f9bc4fe792098bfabf50ecfcd1f785ed039184bd
|
Hey @davidberard98. |
These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 [ghstack-poisoned]
These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 ghstack-source-id: 9ca88a0 Pull Request resolved: #73818
These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 Differential Revision: [D34698175](https://our.internmc.facebook.com/intern/diff/D34698175) [ghstack-poisoned]
These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 Differential Revision: [D34698175](https://our.internmc.facebook.com/intern/diff/D34698175) [ghstack-poisoned]
These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 ghstack-source-id: 73592b7 Pull Request resolved: #73818
…(#73742) Summary: Pull Request resolved: pytorch/pytorch#73742 I think this was causing multiple implementations of RegisterCudaFuseGraph on windows. It looks like both torch_cpu.dll and torch_python.dll were exporting RegisterCudaFuseGraph implementations, so RegisterCudaFuseGraph::isRegistered() would refer to a _different_ static bool depending on whether the caller was in torch_cpu.dll or torch_python.dll. See #73717 for a demonstration. Test Plan: Imported from OSS Reviewed By: eellison Differential Revision: D34618623 Pulled By: davidberard98 fbshipit-source-id: f9bc4fe792098bfabf50ecfcd1f785ed039184bd (cherry picked from commit 2de58679342914f456d63a9f952357ac163cc4ec)
…(#73742) Summary: Pull Request resolved: pytorch/pytorch#73742 I think this was causing multiple implementations of RegisterCudaFuseGraph on windows. It looks like both torch_cpu.dll and torch_python.dll were exporting RegisterCudaFuseGraph implementations, so RegisterCudaFuseGraph::isRegistered() would refer to a _different_ static bool depending on whether the caller was in torch_cpu.dll or torch_python.dll. See #73717 for a demonstration. Test Plan: Imported from OSS Reviewed By: eellison Differential Revision: D34618623 Pulled By: davidberard98 fbshipit-source-id: f9bc4fe792098bfabf50ecfcd1f785ed039184bd (cherry picked from commit 2de58679342914f456d63a9f952357ac163cc4ec)
Summary: Pull Request resolved: #73818 These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 Test Plan: Imported from OSS Reviewed By: george-qi Differential Revision: D34698175 Pulled By: davidberard98 fbshipit-source-id: cb871e861cf966bff596cfa8340a32a17fca0b66
Summary: Pull Request resolved: #73818 These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: #73742 Test Plan: Imported from OSS Reviewed By: george-qi Differential Revision: D34698175 Pulled By: davidberard98 fbshipit-source-id: cb871e861cf966bff596cfa8340a32a17fca0b66 (cherry picked from commit 6b9988e)
Summary: Pull Request resolved: pytorch/pytorch#73818 These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: pytorch/pytorch#73742 Test Plan: Imported from OSS Reviewed By: george-qi Differential Revision: D34698175 Pulled By: davidberard98 fbshipit-source-id: cb871e861cf966bff596cfa8340a32a17fca0b66 (cherry picked from commit 6b9988e5688e6d4a9928c3e331efb74f000a9e4a)
Summary: Pull Request resolved: pytorch/pytorch#73818 These all appear to be defined in libtorch_cpu.so, so they should be marked with TORCH_API. TORCH_API means that these symbols are exported from libtorch_cpu.so and no other libraries. In comparison, C10_EXPORT will export the symbol in _all_ built libraries, if it's available. I think most of these were fine because most were only defined in cpp files (which would only be included in the targets for one .so file). However, the change in pass_manager.h affects behavior, since the class is defined in the .h file, which could result in two separate implementations of the same static functions. Previously we saw issues on windows with this: pytorch/pytorch#73742 Test Plan: Imported from OSS Reviewed By: george-qi Differential Revision: D34698175 Pulled By: davidberard98 fbshipit-source-id: cb871e861cf966bff596cfa8340a32a17fca0b66 (cherry picked from commit 6b9988e5688e6d4a9928c3e331efb74f000a9e4a)
Stack from ghstack:
I think this was causing multiple implementations of
RegisterCudaFuseGraph on windows. It looks like both torch_cpu.dll and
torch_python.dll were exporting RegisterCudaFuseGraph implementations,
so RegisterCudaFuseGraph::isRegistered() would refer to a different
static bool depending on whether the caller was in torch_cpu.dll or
torch_python.dll. See #73717 for a demonstration.
Differential Revision: D34618623