[DONOTMERGE] deform_conv2d with headers#3051
[DONOTMERGE] deform_conv2d with headers#3051datumbox wants to merge 12 commits intopytorch:masterfrom
Conversation
77cbf7c to
868de6c
Compare
- Create header files for kernel implementation and remove definitions from vision_*.h files. - Eliminate unnecessary headers and ensure all cpp include their headers.
868de6c to
9026df0
Compare
76e7140 to
f3f8469
Compare
e1ecdcd to
6f87104
Compare
|
Concerning registering the operators in the Operator files (instead in vision.cpp), I checked how PyTorch does this and noticed that they use the I'm not sure whether it's possible for us to use the above macro but I understand that we can't just move the |
|
I'm not sure what problem you're referring to here. TORCH_LIBRARY_IMPL is explicitly designed to be usable from multiple files. The model is:
You can see an example in |
6f87104 to
f6782a0
Compare
…thods around to minimize git blame changes.
f6782a0 to
da80ce1
Compare
@ezyang Thanks that's useful. Based on the example, the registration of the forward/backward methods continues happening in a single file (library.cpp in your example) using macro In our case then, I understand that:
Edit: I implemented the above on df0e8a7 but unfortunately it fails on windows: All other platforms work fine (ignore macOS_py3.7 which currently has an unrelated issue). If you have any recommendation please let me know. |
f3c5a2e to
085ab41
Compare
085ab41 to
df0e8a7
Compare
|
This looks like the library is causing more headers to be included, and the flags you are compiling under trip an error under the flags. To unblock, I'd find the flag controlling "C:/Users/circleci/project/env/lib/site-packages/torch/include\torch/csrc/jit/ir/ir.h(1349): error: member "torch::jit::ProfileOptionalOp::Kind" may not be initialized |
|
@ezyang Thanks for the pointer. We decided to go ahead with the rest of the changes without including the registration move but I'll do the investigation once the main refactoring is completed. |
|
I traced the original problem back to the use of
I think the permanent fix is do replace If you have any pointers will be highly appreciated. |
|
I was hoping the workaround would be simple, guess it's not obvious. Just send in the upstream fix and ping on work chat, I can expedite its review. |
|
It seems that the issue with pickler.h is resolved by pytorch/pytorch#48717 but the ir.h requires additional work. We now fail with: I'm going to try to move the initializer outside of the class on a separate PR but I would really appreciate some input. |
Proof of concept for #2956
Builds upon #2998
_parampostfix from the variables (DeformConv2d specific detail).