From 44eab261b950b839f80e9b3739d55f8bd45334b4 Mon Sep 17 00:00:00 2001 From: Pr0Wh1teGivee <132029610+Pr0Wh1teGivee@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:04:21 +0800 Subject: [PATCH] [NPU] npu msda supports aclnn (#3149) --- mmcv/ops/csrc/pytorch/npu/ms_deform_attn_npu.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mmcv/ops/csrc/pytorch/npu/ms_deform_attn_npu.cpp b/mmcv/ops/csrc/pytorch/npu/ms_deform_attn_npu.cpp index 453be7034c..14c7e30ad0 100644 --- a/mmcv/ops/csrc/pytorch/npu/ms_deform_attn_npu.cpp +++ b/mmcv/ops/csrc/pytorch/npu/ms_deform_attn_npu.cpp @@ -57,15 +57,9 @@ Tensor ms_deform_attn_forward_npu(const Tensor &value, value.size(0), sampling_locations.size(1), value.size(2) * value.size(3)}; at::Tensor output = at::zeros(output_size, value_fp32.options()); - OpCommand cmd; - cmd.Name("MultiScaleDeformableAttnFunction") - .Input(value_fp32) - .Input(value_spatial_shapes_int32) - .Input(value_level_start_index_int32) - .Input(sampling_locations_fp32) - .Input(attention_weights_fp32) - .Output(output) - .Run(); + EXEC_NPU_CMD(aclnnMultiScaleDeformableAttnFunction, value_fp32, + value_spatial_shapes_int32, value_level_start_index_int32, + sampling_locations_fp32, attention_weights_fp32, output) at::Tensor real_output = output; if (value.scalar_type() != at::kFloat) {