Open
【社区任务】12月社区任务-aclsparseAxpyi算子开发(950/910)设计文档 #3740
【社区任务】12月社区任务-aclsparseAxpyi算子开发(950/910)设计文档 #3740
Open
nullptr4Add on 4 days ago
nullptr4
nullptr4
4 days ago

提交 2026 年 12 月社区任务「aclsparseAxpyi算子开发(950/910)」(任务ID: 74296a70c935433ebb056acf0e39d094)算子设计文档。

  • 覆盖 Atlas A2/A3 (arch22) 与 Ascend 950 (arch35) 双架构独立设计
  • 覆盖 aclsparseAxpyi / aclsparseAxpyiRaw C API 及 PyTorch 封装层 torch_npu.sparse.aclsparse_axpyi
  • 覆盖精度标准、性能基线及 TC-01 ~ TC-11 测试验收方案

关联任务贴:https://gitcode.com/Ascend/model-agent/discussions/5

likedislike
Merge blocked
nullptr4nullptr4
4 days ago Created pull request, commit f16eb356
atomgit-bot
atomgit-bot
4 days ago Comments:

变更摘要

本 PR 新增社区任务「aclsparseAxpyi 算子开发(950/910)」的设计文档 04_tasks/01_community-task-2026/tasklist/74296a70c935433ebb056acf0e39d094-aclsparseAxpyi/nullptr4/docs/design.md,围绕稀疏 BLAS Level-1 更新算子 y[xInd[k]]←α⋅xVal[k]+y[xInd[k]]y[\text{xInd}[k]] \leftarrow \alpha \cdot \text{xVal}[k] + y[\text{xInd}[k]],给出了 Atlas A2/A3(arch22 / dav-2201)与 Ascend 950(arch35 / dav-3510)双架构独立实现方案、C API 与 PyTorch 封装层接口契约、精度与性能验收标准以及测试方案。文档本身不包含代码实现,仅描述后续开发将落地的接口、目录结构、Kernel 策略与验收口径。

主要改动

  • C API 接口设计:定义 aclsparseAxpyi(标准描述符接口,支持 ACL_SPARSE_POINTER_MODE_HOST 的 alpha)与 aclsparseAxpyiRaw(裸指针快路径,携带 idxType、idxBase、yLen、valueType),明确 nullptr 句柄、非法 dtype/索引类型/越界规模对应的 ACL_SPARSE_STATUS_* 返回约定,以及 C 层原地更新 vecY 的语义。
  • 双架构 Kernel 方案:arch22 采用双缓冲 DataCopyPad 预取、BATCH = 256 批量并发随机读写、连续索引段(Run)合并与 SetAtomicAdd<float> 免读路径三条路径;arch35 基于 __simt_vf__ 实现 Grid-Stride + kAxpyiStrideUnroll = 4 展开,并在 half/bfloat16_t 上以 FP32 计算、末端单次 RN 舍入写回。
  • PyTorch 封装层契约:定义 aclsparse_axpyi(alpha, x_val, x_ind, y) 签名与 TORCH_NPU_SPARSE_FACADE_APIS 注册方式,通过 AxpyiOpBuilder 首次调用 JIT 编译;Wrapper 侧复用 ValidatedIndexBoundsCache 做版本记忆化索引边界校验,并借助 at::empty_like + aclrtMemcpyAsync D2D 拷贝 + aclsparseAxpyiRaw 实现非原地返回,保证不修改输入 y。
  • 精度与性能验收标准:按 dtype 分别给出 fp32/fp16/bf16 的 rtol、atol 阈值及 alpha == 0 逐位一致要求;性能上以 RTX 5880 Ada 为标杆,A2/A3 需 ≥0.15×\ge 0.15\times、Ascend 950 需 ≥0.35×\ge 0.35\times,并覆盖 TC-01 ~ TC-11 的功能、边界与异常用例。
  • 目录结构与约束限制:规定 sparse/axpyi/arch22、sparse/axpyi/arch35、sparse/axpyi/torch_extension、test/axpyi 的分层布局与 include/cann_ops_sparse.h、docs/zh/api_list.md 的登记位置,并明确一维稠密张量、同设备同 dtype、索引值域不重复、nnz <= yLen 等约束及退化场景语义。
likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
4 days ago Added label: cann-cla/no
CANN-robot
CANN-robotCollaborators
4 days ago Comments:

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.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.


PR Approval Progress

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
repo-cann/cann-ops-competitions ❌ (0/2)(You can also ask: jackwangc, fuyangchenghu, syeren, zutao, 颜亚文) ❌ (0/1)(You can also ask: 王艳秋, 傅涛, 颜亚文, jackwangc, Carolina_yuan)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robotCollaborators
4 days ago Set jackwangc,zutao,fuyangchenghu,Albertq,TianXL,yanyawen,fullt,syeren,Carolina_yuan,cherry_03,keloJW,guomin36 as approver
CANN-robotCANN-robotCollaborators
4 days ago Set jackwangc,zutao,fuyangchenghu,Albertq,TianXL,yanyawen,fullt,syeren,Carolina_yuan,cherry_03,keloJW,guomin36 as approver
nullptr4
nullptr4
3 days ago Comments:

/check-cla

likedislike
nullptr4nullptr4
3 days ago Pre merge succeeded (commit_id: f60efe019a76a5da9068ca1078c41d781515583e)
nullptr4nullptr4
3 days ago Force-pushed 1 commits:a3b8df81-docs(axpyi): add aclsparseAxpyi (950/910) operator design doc
nullptr4nullptr4
3 days ago Pre merge succeeded (commit_id: f14653304d94d0b2bef8d517047eb4aaae590b54)
CANN-robot
CANN-robotCollaborators
3 days ago Comments:

CLA检查未通过,详情可参考这里

likedislike
CANN-robotCANN-robotCollaborators
3 days ago Removed label: cann-cla/no
CANN-robotCANN-robotCollaborators
3 days ago Added label: cann-cla/yes
nullptr4
nullptr4
2 days ago Comments:

/compile

likedislike
nullptr4nullptr4
2 days ago Pre merge succeeded (commit_id: d2f3946f8b4c9ad6dbc5d7146171b09b3f70433b)
CANN-robot
CANN-robotCollaborators
2 days ago Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
2 days ago Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
2 days ago Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
2 days ago Added label: ci-pipeline-passed
nullptr4
nullptr4
2 days ago Comments:

@condfuse_3 @guomin36 @fullt @jackwangc @Ascend-CANN 您好,本 PR(12月社区任务 aclsparseAxpyi 950/910 算子设计文档)已完成单 commit 规范整理并通过 CLA 与 CI 门禁检查,双架构算子代码与自验证报告均已就绪,烦请抽空审阅合入,非常感谢!

likedislike