已合并
feat add shim_npu #35590
zzhongmin创建于 5月13日
feat add shim_npu #35590
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 zzhongmin 的贡献)ascend-robot
5月13日 评论:
5月13日 评论:
openLiBingCI
5月13日 评论:
5月13日 评论:
本PR中共发现代码检查告警抑制3处,请Committer检视合理性
本评论自动扫描PR中使用的开源代码检查工具(ruff、clang-tidy、CodeQL等)的屏蔽注释。
这些屏蔽注释会阻止开源代码检查工具对特定代码区域的检测,可能导致潜在问题被忽略。
| 文件路径 | 行号 | 屏蔽类型 | 代码片段 | 工具名称 |
|---|---|---|---|---|
| test/_inductor/test_npu_aoti_shim.py | 21 | 行级屏蔽 | 15: sys.path.remove(path) 16: if BUILD_PACKAGES_DIR.exists(): 17: sys.path.insert(0, str(BUILD_PACKAGES_DIR)) 19: import torch 21: from torch_npu.testing.testcase import run_tests, TestCase # noqa: F401 24: CPP_EXTENSIONS_DIR = REPO_ROOT / "test" / "cpp_extensions" 25: sys.path.insert(0, str(CPP_EXTENSIONS_DIR)) 27: from torch_test_cpp_extension.load_npu_aoti_shim import load_npu_aoti_shim_extension 30: class TestNpuAOTIShim(TestCase): 31: module = None |
flake8 |
| test/cpp_extensions/torch_test_cpp_extension/ load_npu_aoti_shim.py |
39 | 行级屏蔽 | 33: check=True, 34: env=env, 35: ) 38: def load_npu_aoti_shim_extension(): 39: import torch # noqa: F401 41: import torch_npu # noqa: F401 43: try: 44: return importlib.import_module(MODULE_NAME) 45: except ImportError: 46: _build_extension_inplace() |
flake8 |
| test/cpp_extensions/torch_test_cpp_extension/ load_npu_aoti_shim.py |
41 | 行级屏蔽 | 34: env=env, 35: ) 38: def load_npu_aoti_shim_extension(): 39: import torch # noqa: F401 41: import torch_npu # noqa: F401 43: try: 44: return importlib.import_module(MODULE_NAME) 45: except ImportError: 46: _build_extension_inplace() 47: sys.modules.pop(MODULE_NAME, None) |
flake8 |


ascend-robot
5月13日 评论:
5月13日 评论:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here。
You can get sig-info at here
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-Ascend/pytorch | ✅ chujinjin, liujunzhu, hbhu_bin (3/3) | ✅ chujinjin (1/1) |
| test | ✅ chujinjin, liujunzhu, hbhu_bin (3/3) | ✅ chujinjin (1/1) |
| torch_npu/_inductor | ✅ chujinjin, liujunzhu, hbhu_bin (3/3) | ✅ chujinjin (1/1) |
| torch_npu/csrc/inductor | ✅ hbhu_bin, chujinjin, liujunzhu (3/3) | ✅ chujinjin (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zzhongmin, thanks for your pull request. All authors of the commits have signed the CLA. 👍


5月13日 添加了label:ascend-cla/yes
此处折叠了158条消息 查看更多
5月18日 添加了label:approved
5月18日 添加了label:lgtm
ascend-robot
5月18日 评论:
5月18日 评论:
5月18日 合入了pull request
【合入来源】
【修改方案】
将 NPU AOTI Shim 层对齐到上游 CUDA 实现(shim_cuda.cpp),补齐缺失的设备管理、流管理、内存分配等关键 shim 函数。
【资料变更】
【接口变更】
【功能验证】
【CheckList】