-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Migrate THCState to ATen #66765
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
Migrate THCState to ATen #66765
Conversation
This guts `THCState` to simply be an empty struct, as well as: - moving `THCState_getPeerToPeerAccess` and its cache into `ATen`. - cleaning up dead code in `THCGeneral.cpp` - moving `THCudaInit` and `THCMagma_init` into `CUDAHooks::initCUDA` [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
You can add a comment to the PR and tag @pytorchbot with the following commands: # ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun
# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow For more information, please take a look at the CI Flow Wiki. |
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 919050f (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
@pytorchbot ciflow rerun -l ciflow/cuda |
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
I'm getting the same error in internal builds
any advice why that would happen? |
That means The old code just ignored it if this happened, so it's possible this was happening silently before. |
I've added prints to verify that initializer in cuda/BatchLinearAlgebra.cpp has run before the initialization is performed in CUDAHooks, and the function is correctly set in the initializer and can be called, but yet in CUDAHooks somehow it is unset again? |
This guts `THCState` to simply be an empty struct, as well as: - moving `THCState_getPeerToPeerAccess` and its cache into `ATen`. - cleaning up dead code in `THCGeneral.cpp` - moving `THCudaInit` and `THCMagma_init` into `CUDAHooks::initCUDA` ghstack-source-id: e3a38ee Pull Request resolved: pytorch#66765
This guts `THCState` to simply be an empty struct, as well as: - moving `THCState_getPeerToPeerAccess` and its cache into `ATen`. - cleaning up dead code in `THCGeneral.cpp` - moving `THCudaInit` and `THCMagma_init` into `CUDAHooks::initCUDA` Differential Revision: [D31721648](https://our.internmc.facebook.com/intern/diff/D31721648) [ghstack-poisoned]
My next best guess would be static initialization order issues. I've changed the variable from |
@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
This seems to be working on a local repro, I'll wait for all the tests to run and will land. |
Summary: Pull Request resolved: #66765 This guts `THCState` to simply be an empty struct, as well as: - moving `THCState_getPeerToPeerAccess` and its cache into `ATen`. - cleaning up dead code in `THCGeneral.cpp` - moving `THCudaInit` and `THCMagma_init` into `CUDAHooks::initCUDA` Test Plan: Imported from OSS Reviewed By: zou3519 Differential Revision: D31721648 Pulled By: ngimel fbshipit-source-id: 772b24787656a95f9e3fcb287d912b1c3400f32d
Fix open-mmlab#900. Support PyTorch version >= 1.11. Referring to pytorch/pytorch#66765 and https://github.com/pytorch/pytorch/wiki/TH-to-ATen-porting-guide.
* feat: support torch>=1.11 Fix #900. Support PyTorch version >= 1.11. Referring to pytorch/pytorch#66765 and https://github.com/pytorch/pytorch/wiki/TH-to-ATen-porting-guide. * fix: Remove preproc torch version check macros
* feat: support torch>=1.11 Fix #900. Support PyTorch version >= 1.11. Referring to pytorch/pytorch#66765 and https://github.com/pytorch/pytorch/wiki/TH-to-ATen-porting-guide. * fix: Remove preproc torch version check macros
Stack from ghstack:
This guts
THCState
to simply be an empty struct, as well as:THCState_getPeerToPeerAccess
and its cache intoATen
.THCGeneral.cpp
THCudaInit
andTHCMagma_init
intoCUDAHooks::initCUDA
Differential Revision: D31721648