Merged
feat(cake): 导入 EasyAsc 轨五个技能 #63
JunyiAdd on Sep 28
feat(cake): 导入 EasyAsc 轨五个技能 #63
Merged
Pull Request has been successfully merged by CANN-robot.
(Thank you for Junyi's contribution.)Sep 28 Added label: stat/needs-squash
Sep 28 Added label: cann-cla/yes
CANN-robot
Sep 28 Comments:
Sep 28 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
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| repo-cann/cannbot | ✅ 宋恺, 汤平川 (2/2) | ✅ 汤平川 (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
gcw_P2Mh5H1S, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Junyi
Sep 28 Comments:
Sep 28 Comments:
compile


145 messages are collapsed here。 See more
TangPC
Oct 8 Comments:
Oct 8 Comments:
/lgtm
/approve


Oct 8 Added label: approved
songkai111
Oct 16 Comments:
Oct 16 Comments:
/lgtm


Oct 16 Added label: lgtm
Oct 16 Merged pull request
这个 MR 做什么
从 cann/cannbot-skills(4d9ec423)搬入 cake 的 EasyAsc 轨,五个技能、149 个文件,全部为新增,不改动任何既有文件。
A skills/dsl-baseline-generation-easyasc/ 102 文件
A skills/dsl-easyasc-codegen/ 24 文件
A skills/dsl-easyasc-post/ 14 文件
A skills/easyasc-codegen/ 6 文件
A skills/easyasc-dsl-bridge/ 3 文件
技能数 19 → 24,按目录约定发现,无需改 manifest。三个 agent 暂不引用这五个技能,接线另行提交。
这个特性是什么
cake 现有两条从 PyTorch 描述生成昇腾算子的路径:AscendDSL 轨(dsl-baseline-generation → dsl-lowering)与 CV 轨。本 MR 增加第三条——EasyAsc 轨,用 easyasc 这套 Python DSL 直接编写 kernel,并走 easyasc 自带的 codegen 产出 AscendC 工程。
与现有两轨的区别在于生成方式:AscendDSL 轨生成 DSL 后需经 dsl-lowering 降级,EasyAsc 轨的 DSL 文件本身既是算法规格(人可读、可评审)又是codegen 输入,由 OpExec(simulator=False) 直接吐出 AscendC,不再经过 cake 自己的降级环节。
流程
五个技能串成一条链,接在 functional-conversion 之后:
硬件与适用范围
默认目标 a2(ascend910b,cake 的评估硬件)。a2 同时暴露 Vector 的 UB 原语与 cube 原语(DBuff、Position.L1/L0C、matmul()、GetCubeNum()),所以 Vector 类(Sigmoid、Softmax、LayerNorm)与 CV/矩阵乘类(matmul、批量 matmul、注意力 QK^T)都能在同一目标下编写,无需切到 a5。两类均已在 910B2 上端到端验证,bf16 矩阵乘精度 5/5 通过。
a5(ascend950)额外提供 @vf 寄存器 kernel、cumsum 式 scan、Position.L0A/L0B 直访、fp8 微转换。在非 a5 主机上该路径为仅仿真——codegen 阶段拒绝执行,验证退化为 DSL 文件自身的 main 自检。
依赖
easyasc 库不随插件分发,由 EASYASC_DSL_HOME 环境变量解析。未设置时明确报错并指向 docs/EXTERNAL_DEPENDENCIES.md,不猜路径、不静默继续。仓内已有的 plugins-community/ops-easyasc-dsl 只提供该 DSL 到 AscendC 的工作流文档,不含库本体,不能作为该变量的来源。
检查结果
CodeCheck 1982 → 1584(库代码 225 → 16),整改部分以组合用例与子进程逐流比对验证,输出逐字节一致;剩余条目的分类与逐条理由见屏蔽申请书。OAT 检查 cake 由 19 降至 12,剩余中 5 个文件由 MR !54 登记解决。SCA 4 项命中建议判定为误报,见 SCA 审核意见。
🤖 Generated with Claude Code