已合并
torch_extension目录整改 #6973
torch_extension目录整改 #6973
已合并
jinying创建于 6月16日
jinying
jinying
6月16日

描述

torch_extension目录整改
对外API命名整改

关联的Issue

https://gitcode.com/cann/ops-transformer/issues/3130

测试

文档更新

更新了attention/flash_attn/tests/pytests/readme.md,attention/mixed_quant_sparse_flash_mla/README.md,attention/sparse_flash_mla/README.md
torch_extension/cann_ops_transformer/docs

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 jinying 的贡献)
jinyingjinying
6月16日 创建了 pull request,commit 9f838d7c
openLiBingCI6月16日进行代码检视1
attention/sparse_flash_mla/tests/pytest/batch/sparse_flash_mla_process.py
@@ -25,3 +25,5 @@
2525if TORCH_EXT_PATH not in sys.path:
2626 sys.path.insert(0, TORCH_EXT_PATH)
27-from npu_ops_transformer.ops import sparse_flash_mla as _smla_registration # noqa: F401
28-from npu_ops_transformer.ops import quant_lightning_indexer_v2_metadata as _metadata_registration # noqa: F401
27+from cann_ops_transformer.ops import sparse_flash_mla as _smla_registration # noqa: F401
28+from cann_ops_transformer.ops import sparse_flash_mla_metadata as _metadata_registration # noqa: F401
openLiBingCI6月16日评论:

此条代码评论区间25+28

【openlibing.ci】识别到代码检查告警抑制注释,匹配工具:flake8,请Committer检视其合理性。

likedislike
openLiBingCI6月16日进行代码检视1
attention/sparse_flash_mla/tests/pytest/batch/sparse_flash_mla_process.py
@@ -26,6 +26,6 @@
2626 sys.path.insert(0, TORCH_EXT_PATH)
27-from npu_ops_transformer.ops import sparse_flash_mla as _smla_registration # noqa: F401
28-from npu_ops_transformer.ops import quant_lightning_indexer_v2_metadata as _metadata_registration # noqa: F401
27+from cann_ops_transformer.ops import sparse_flash_mla as _smla_registration # noqa: F401
28+from cann_ops_transformer.ops import sparse_flash_mla_metadata as _metadata_registration # noqa: F401
2929 
3030class Network(torch.nn.Module):
openLiBingCI6月16日评论:

此条代码评论区间+26+30

【openlibing.ci】识别到代码检查告警抑制注释,匹配工具:flake8,请Committer检视其合理性。

likedislike
openLiBingCI6月16日进行代码检视1
attention/sparse_lightning_indexer_kl_loss_grad/tests/pytest/test_sparse_lightning_indexer_kl_loss_grad.py
@@ -34,2 +34,3 @@
3434 sys.path.insert(0, str(MINDSPEED_PATH))
3535 
36-import npu_ops_transformer # noqa: E402,F401 pylint: disable=wrong-import-position,unused-import
36+import cann_ops_transformer # noqa: E402,F401 pylint: disable=wrong-import-position,unused-import
openLiBingCI6月16日评论:

此条代码评论区间34+36

【openlibing.ci】识别到代码检查告警抑制注释,匹配工具:flake8,请Committer检视其合理性。

likedislike
CANN-robotCANN-robot成员
6月16日 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
6月16日 评论:

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
*/*/README.md 陈娇, 黄俊健, 俞郑中 (3/2) 陈娇 (1/1)
attention 俞郑中, wangzhe123456789, 黄俊健 (3/2) 俞郑中, wangzhe123456789 (2/1)
cmake 俞郑中, 黄俊健 (2/2) 俞郑中 (1/1)
docs 俞郑中, 黄俊健 (2/2) 俞郑中 (1/1)
scripts 俞郑中, 黄俊健 (2/2) 俞郑中 (1/1)
sig-ops-transformer 俞郑中, 黄俊健 (2/2) 俞郑中 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

jinyingbo, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
jinying
jinying
6月16日 评论:

compile

likedislike
jinyingjinying
6月16日 update merge request[project id: 7673863, iid: 6973, commit_id: 8f88250a742f8f4cbe77e0e9b370c17a41b621f2] virtual merging success
CANN-robotCANN-robot成员
6月16日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6月16日 评论:

流水线任务触发成功
任务链接 [a57bc0fe46284eb0a711d5086451dc11][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-06-16 10:52:09]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
6月16日 评论:

流水线任务触发成功
任务链接 [df4176ced5ea47bf843097e76cede850][流水线指导]

任务名称状态日志下载链接
codecheck ❌ FAILED >>>>>
SCA ❌ FAILED >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ⚠️ WARNING >>>>>
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ⚠️ WARNING >>>>>
StaticCheck_markdownlint ⚠️ WARNING >>>>>
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ⚠️ WARNING >>>>> >>>>>
likedislike
CANN-robotCANN-robot成员
6月16日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6月16日 添加了label:ci-pipeline-failed
lilongwei_hw
lilongwei_hw成员6月16日进行代码检视2
torch_extension/cann_ops_transformer/ops/csrc/flash_attn.cpp
已过期
@@ -90,0 +77,4 @@
77+ char *layout_out_ptr = const_cast<char *>(layout_out.c_str());
78+ 
79+ ACLNN_CMD(aclnnFlashAttn, q, k, v, block_table, cu_seqlens_q, cu_seqlens_kv, seqused_q, seqused_kv, sinks, attn_mask,
80+ metadata, softmax_scale, mask_mode, win_left, win_right, max_seqlen_q, max_seqlen_kv, layout_q_ptr,
lilongwei_hw
lilongwei_hw6月16日评论:

torch_extension 目录整改涉及公共头/宏迁移。请确认所有 OpBuilder 仍指向新路径且 ACLNN_CMD/ConvertType 行为一致,并跑 FIA/moe/mhc 冒烟 ST。

likedislike
System
系统消息系统
6月16日 评论:

changed this line on a6b9dbfc in version 2 of the diff

jinyingjinying
6月16日 update merge request[project id: 7673863, iid: 6973, commit_id: 4018ce85d9dc242a5da4b1e3ab7b545a5a860b6f] virtual merging success
jinyingjinying
6月16日 推送  1 个提交:740ec42a-codecheck_1
jinyingjinying
6月16日 update merge request[project id: 7673863, iid: 6973, commit_id: 3ce98edb01398d608030dee848b734e3e61cbcdc] virtual merging success
CANN-robotCANN-robot成员
6月16日 添加了label:stat/needs-squash
jinying
jinying
6月16日 评论:

compile

likedislike
jinyingjinying
6月16日 update merge request[project id: 7673863, iid: 6973, commit_id: 4bfa45a9b168b6014b9354c9f1542f2988da41ba] virtual merging success
CANN-robotCANN-robot成员
6月16日 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
6月16日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6月16日 评论:

流水线任务触发成功
任务链接 [9901f153b12d4820a58c6ed3db301f59][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-06-16 11:18:25]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
6月16日 评论:

流水线任务触发成功
任务链接 [3f322541929b4b94a5b7c80e290e1d8d][流水线指导]

任务名称状态日志下载链接
codecheck ❌ FAILED >>>>>
SCA ❌ FAILED >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ⚠️ WARNING >>>>>
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ⚠️ WARNING >>>>>
StaticCheck_markdownlint ⚠️ WARNING >>>>>
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ⚠️ WARNING >>>>> >>>>>
likedislike
CANN-robotCANN-robot成员
6月16日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6月16日 添加了label:ci-pipeline-failed
wangzhe123456789成员
6月16日 评论:

/lgtm
/approve

likedislike
jinying
jinying
6月16日 评论:

compile

likedislike
jinyingjinying
6月16日 update merge request[project id: 7673863, iid: 6973, commit_id: f0435e717005152d5c8121aaba3abe18f7c9cfb6] virtual merging success
CANN-robotCANN-robot成员
6月16日 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
6月16日 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
6月16日 评论:

流水线任务触发成功
任务链接 [d42b980df9224d798559e78fc4f6bf02][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-06-16 12:08:45]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
6月16日 评论:

流水线任务触发成功
任务链接 [274ceb20555f4a8e9deabe79efe0e0d7][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ⚠️ WARNING >>>>>
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ⚠️ WARNING >>>>>
StaticCheck_markdownlint ⚠️ WARNING >>>>>
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ⚠️ WARNING >>>>> >>>>>

[2026-06-16 11:57:01]    CI执行结束

likedislike
CANN-robotCANN-robot成员
6月16日 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
6月16日 添加了label:ci-pipeline-passed
jinyingjinying
6月16日 修改了pull request 的描述
chenjiao成员
6月16日 评论:

/approve

likedislike
monologue815成员
6月16日 评论:

/lgtm

likedislike
YuZhengzhong成员
6月16日 评论:

/approve
/lgtm

likedislike
CANN-robotCANN-robot成员
6月16日 添加了label:lgtmapproved
CANN-robot
CANN-robot成员
6月16日 评论:

The MR can not be merged, because of CodeReview discussion not resolved

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike
lhlh成员
6月16日 解决了最后一个问题
CANN-robotCANN-robot成员
6月16日 合入了pull request