Pull Request has been successfully merged by CANN-robot.
(Thank you for huairuchen's contribution.)变更摘要
本 PR 为 ops-math 的 7 个算子(Polar、CdistGrad、StatelessExponential、StatelessSampleMultinomial、ChunkCat、DropOutV3Grad、UnfoldGrad)补充 ascend960dt/ascend960pr 平台支持,涉及算子定义中的 AddConfig 平台注册、op_host/config 下的 binary 配置与 simplified_key.ini,并把芯片架构判断统一放行 DAV_9201/DAV_9202,使 960 系列复用 Ascend950 的 arch35 实现路径,同时把部分 SocVersion/单值 NpuArch 判断替换为等价的范围判断。
主要改动
- 平台注册扩展(算子定义):
ChunkCat、StatelessExponential、StatelessSampleMultinomial在*_def.cpp中新增AddConfig("ascend960pr"),CdistGrad、Polar、DropOutV3Grad则同时新增ascend960dt与ascend960pr,复用既有aicoreConfig。 - 二进制造型与编译配置新增: 为
CdistGrad、ChunkCat、DropOutV3Grad新增ascend960dt/ascend960pr目录下的*_binary.json(描述 dtype/format/attr 组合,如CdistGrad的 fp16/bf16/fp32、DropOutV3Grad的uint8/uint1mask 组合)与*_simplified_key.ini(default=0),StatelessExponential补充ascend960pr的simplified_key.ini。 - Kernel 编译宏与 tiling 判断放行 960:
chunk_cat.cpp、chunk_cat_arch35.h、chunk_cat_common.h中__NPU_ARCH__ == 9201条件统一扩展为|| __NPU_ARCH__ == 9202,ChunkCatTiling::GetPlatformInfo的isAscend960dt_同时匹配DAV_9201/DAV_9202。 - 接口门禁与 arch35 判定放宽:
aclnnDropoutV3Grad的CheckSocVersion由仅DAV_3510扩展为DAV_3510/DAV_9201/DAV_9202;stateless_sample_multinomial的IsArch35、unfold_grad的isArch35、dsa_random_uniform的uniformDavidPath/uniformTensorDavidPath改用含 9201/9202 的 arch 判断或IsRegBase。 - 判断方式统一与融合规则扩展:
CdistGrad的 BF16 转 FP32 条件由SocVersion::ASCEND910B/ASCEND910_93改为等价的NpuArch::DAV_2201;drop_out_v3、random_uniform_v2、truncated_normal_v2三个 fusion pass 的supportedArch集合新增DAV_9201、DAV_9202。
🧩 本次 Review 已使用自定义 Skill:


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
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| */*/op_host/*_def.cpp | ✅ 汤磊, xuejinghui, 宋恺 (3/2) | ✅ 汤磊 (1/1) |
| conversion/unfold_grad | ✅ xuejinghui, 宋恺 (2/2) | ✅ xuejinghui (1/1) |
| math/transform_bias_rescale_qkv | ✅ xuejinghui, 宋恺 (2/2) | ✅ xuejinghui (1/1) |
| repo-cann/ops-math | ✅ xuejinghui, 宋恺 (2/2) | ✅ xuejinghui (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
huairuchen, thanks for your pull request. All authors of the commits have signed the CLA. 👍


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.


描述
DV122迭代:为下列算子新增 ascend960dt/ascend960pr 平台支持(四部分:CMakeLists / op def AddConfig / op_host config 目录 / binary 配置),并将涉及芯片的运行时与编译期判断放行 DAV_9201/DAV_9202:
四部分补充
芯片判断放行 DAV_9201/9202
Polar 全套适配及 drop_out_v3 / truncated_normal_v2 / random_uniform_v2 三个 fusion pass 的 supportedArch 扩展,与 master 已合入内容(b58f9e3cf 及已有提交)完全重复,rebase 至最新 master 后不再携带。
写法与已合入的 DV121/DV122 适配(!6151/!6401/!6651/!6663 及 RandomStandardNormalV1 融合规则 !6608)保持一致,不涉及 UB/切分逻辑改动。
关联的Issue
https://gitcode.com/cann/ops-math/issues/4838
测试
泛化黄区ttk
文档更新
类型标签