Skip to content
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

update lately npu modification #2387

Merged
merged 58 commits into from
Nov 15, 2022
Merged

update lately npu modification #2387

merged 58 commits into from
Nov 15, 2022

Conversation

ckirchhoff2021
Copy link
Collaborator

@ckirchhoff2021 ckirchhoff2021 commented Nov 4, 2022

Motivation

This PR contains some npu-adapters of mmcv ops, which contain nms, focal_loss, masked_conv and modulated_deform_conv. we can run these ops(above) on ascend-npu device by these adapters.

Modification

nms_npu.cpp is added to the PR which is used for nms npu-adaptation, while focal_loss_npu.cpp, masked_conv,py, modulated_deform_conv.py and test_masked_conv.py are modified by the PR. we have fixed some kernel bugs and modify the focal_loss adapter to improve the op performance. masked_conv and modulated_deform_conv can be conveniently adapted by some torch_npu.ops, as a result , we can make them available for npu by just modifying the py scripts. Finally, we modify the ut test for masked_conv2d which can make it running on npu-device.

Q & A

welcome to contact us for more information if you have any questions about the PR.

wangjiangben-hw and others added 30 commits September 14, 2022 12:02
[Feature] Support engine with NPU backend.
fix autocast bugs on npu (#2273)
add npu extension and focal loss adapter
* fix autocast bugs on npu
* using scatter_kwargs in mmcv.device.scatter_gather
* add npu test case
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Npu-dev: FocalLoss Adapter BugFix
@zhouzaida zhouzaida added the NPU Ascend label Nov 8, 2022
mmcv/ops/masked_conv.py Outdated Show resolved Hide resolved
mmcv/ops/masked_conv.py Outdated Show resolved Hide resolved
weight,
offset_all,
conv2d_bias,
kernel_size=[k2, k1],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the order of these two parameters, (h, w) or (w, h)?

Clean code: fix the clean code problem in masked_conv2d and modulated…
@zhouzaida zhouzaida merged commit de6b002 into master Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPU Ascend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants