-
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
torch_npu support aclnn and add op #2998
Conversation
ec70350
to
9240489
Compare
cb1bc8e
to
7fb329d
Compare
测试时报错,信息如下,环境与issue#3002一致 |
setup.py
Outdated
@@ -397,12 +397,21 @@ def get_mluops_version(file_path): | |||
elif (os.getenv('FORCE_NPU', '0') == '1'): | |||
print(f'Compiling {ext_name} only with CPU and NPU') | |||
try: | |||
import imp |
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.
[[0.0900, 0.4900, 0.4900, 0.0900], [0.0900, 0.4900, 0.4900, 0.0900], | ||
[0.7200, 0.8500, 0.4900, 0.3600]], | ||
device='cuda') | ||
def torch_type_trans(dtype): |
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.
def torch_type_trans(dtype): | |
def torch_to_np_type(dtype): |
[[1.6, 9.99], [2.3, 9.99], [2.3, 10.39], [1.6, 10.39]]], | ||
device='cuda', | ||
requires_grad=True) | ||
def chamfer_distance_forward_gloden(xyz1, xyz2, dtype): |
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.
def chamfer_distance_forward_gloden(xyz1, xyz2, dtype): | |
def chamfer_distance_forward_groundtruth(xyz1, xyz2, dtype): |
(bs, ns, 2)).astype(torch_type_trans(dtype)) | ||
xyz1_npu = torch.tensor(xyz1, dtype=dtype).to(device) | ||
xyz2_npu = torch.tensor(xyz2, dtype=dtype).to(device) | ||
expected_output = chamfer_distance_forward_gloden(xyz1, xyz2, dtype) |
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.
expected_output = chamfer_distance_forward_gloden(xyz1, xyz2, dtype) | |
expected_output = chamfer_distance_forward_groundtruth(xyz1, xyz2, dtype) |
(bs, ns, 2)).astype(torch_type_trans(dtype)) | ||
xyz2 = np.random.uniform(-10.0, 10.0, | ||
(bs, ns, 2)).astype(torch_type_trans(dtype)) |
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.
(bs, ns, 2)).astype(torch_type_trans(dtype)) | |
xyz2 = np.random.uniform(-10.0, 10.0, | |
(bs, ns, 2)).astype(torch_type_trans(dtype)) | |
(bs, ns, 2)).astype(torch_to_np_type(dtype)) | |
xyz2 = np.random.uniform(-10.0, 10.0, | |
(bs, ns, 2)).astype(torch_to_np_type(dtype)) |
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.
您好,我在使用mmocr的时候遇到了mmcv的算子不在NPU支持的问题,import mmcv & import mmcv.ops都没有问题,也测试了mmocr的几个模型例如dpnet,master,fcenet等都能正常训练,但是涉及到mmcv ops的模型就会报错,具体有sdmgr(RuntimeError: roi_align_forward_impl: implementation for device xla:1 not found.) drrg(RuntimeError: roi_align_rotated_forward_impl: implementation for device xla:1 not found.)以及mask-rcnn(RuntimeError: nms_impl: implementation for device xla:1 not found.)请问该如何解决呢
在相同环境下测试仍然出现同样报错 |
mmcv/mmcv/ops/csrc/common/pytorch_npu_util.hpp:22处建议改为 |
你好,请问这边的环境是什么版本和什么日期的torch_npu? |
pytorch版本为1.11.0,CANN版本为6.3.2,python环境为py_3.7,OS euler_2.8.3-aarch64,torch-npu版本为1.11.0.post1.dev20230719 |
可以升级CANN和torch版本来解决问题 |
您这边测试使用的什么环境?我这边尝试建立一下 |
我这边使用了pytorch:2.0.1-CANN6.3.RC2-py39,torch-npu版本为2.0.1rc1,仍然报相同错误 |
使用CANN7.1.0rc4版本,torch-npu版本为最新的1.11.0,建议使用最近的torch_npu和cann包 |
您这边是使用专门的镜像么,我这边是通过juypterlab进行操作的,无法自行升级 |
目前找不到CANN7.1.0rc4版本,请指下出处 |
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
Please describe the motivation of this PR and the goal you want to achieve through this PR.
Modification
Please briefly describe what modification is made in this PR.
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: