Merge blocked
变更摘要
本 PR 新增社区任务「aclsparseAxpyi 算子开发(950/910)」的设计文档 04_tasks/01_community-task-2026/tasklist/74296a70c935433ebb056acf0e39d094-aclsparseAxpyi/nullptr4/docs/design.md,围绕稀疏 BLAS Level-1 更新算子 ,给出了 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+aclrtMemcpyAsyncD2D 拷贝 +aclsparseAxpyiRaw实现非原地返回,保证不修改输入y。 - 精度与性能验收标准:按 dtype 分别给出
fp32/fp16/bf16的 rtol、atol 阈值及alpha == 0逐位一致要求;性能上以 RTX 5880 Ada 为标杆,A2/A3需 、Ascend 950需 ,并覆盖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等约束及退化场景语义。


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
/approveor/lgtm- Commenting
/approveimplies 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. 👍


/check-cla


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


/compile


| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


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


提交 2026 年 12 月社区任务「aclsparseAxpyi算子开发(950/910)」(任务ID:
74296a70c935433ebb056acf0e39d094)算子设计文档。arch22) 与 Ascend 950 (arch35) 双架构独立设计aclsparseAxpyi/aclsparseAxpyiRawC API 及 PyTorch 封装层torch_npu.sparse.aclsparse_axpyiTC-01 ~ TC-11测试验收方案关联任务贴:https://gitcode.com/Ascend/model-agent/discussions/5