-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Feature] Support DeformRoiPool with cambricon MLU backend #2137
Conversation
e992e78
to
2d03582
Compare
2d03582
to
0a4cd90
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.
build Failed with:
./mmcv/ops/csrc/common/mlu/deform_roi_pool_mlu_kernel.mlu:132:26: error: no matching function for call to 'max'
static_cast<T>(std::max(roi_bin_grid_height * roi_bin_grid_width, 1));
@grimoire Hi, I build mmcv successfully. How do you build?What is your build environment?Such as pytorch version and neuware_home version(in virtual environment pytorch folder neuware_home/version.txt) |
@grimoire hi, I remove the use of std libaray, you can rebuild mmcv. But I still want to know your neuware_home version、pytorch and torch_mlu version. |
Compile passed. Unit test failed with log:
|
@grimoire hi, the error information in my code is wrong, I just fixed it. You can rebuild mmcv and test again. According to your error information, I think the dim of offset tensor is wrong. |
failed with new logs: RuntimeError: offset should be 4d tensor, got 1D. |
@grimoire Is the test code used provided by test_deform_roi_pool_allclose in test_deform_roi_pool.py? The offset is created in DeformRoIPoolPack by input tensor. I have tested the test code is ok locally. Maybe you can print the input tensor information. |
the test passed after 1e998ac, did |
Hi, @grimoire. I find the reason for failure. Due to I used |
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.
Works now! LGTM
…b#2137) * [Feature] Support DeformRoiPool with cambricon MLU backend * [Fix] Remove use of std library * [Fix] Correct the error information * [Refactor] Refactor test deform_roi_pool code * [Fix] Fix judgment error * [Fix] Modify the large tensor check Co-authored-by: budefei <budefei@cambricon.com>
…b#2137) * [Feature] Support DeformRoiPool with cambricon MLU backend * [Fix] Remove use of std library * [Fix] Correct the error information * [Refactor] Refactor test deform_roi_pool code * [Fix] Fix judgment error * [Fix] Modify the large tensor check Co-authored-by: budefei <budefei@cambricon.com>
* [Feature] Support DeformRoiPool with cambricon MLU backend * [Fix] Remove use of std library * [Fix] Correct the error information * [Refactor] Refactor test deform_roi_pool code * [Fix] Fix judgment error * [Fix] Modify the large tensor check Co-authored-by: budefei <budefei@cambricon.com>
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
The motivation of the PR is to support running DeformRoiPool with Cambricon MLU backend.
It includes three parts:
Modification
Add MLU src code of DeformRoiPool in directory mmcv/ops/csrc/common/mlu/deform_roi_pool_mlu_kernel.mlu.
Adapt DeformRoiPool for PyTorch in mmcv/ops/csrc/pytorch/mlu/deform_roi_pool_mlu.cpp.
Surpport test DeformRoiPool with various backends in tests/test_ops/test_deform_roi_pool.py.
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist
Before PR:
After PR: