已合并
feat(native_package): engram_gate接入Native打包 #176
luohui46创建于 24 天前
feat(native_package): engram_gate接入Native打包 #176
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 luohui46 的贡献)24 天前 添加了label:cann-cla/yes
CANN-robot
24 天前 评论:
24 天前 评论:
CANN-robot
24 天前 评论:
24 天前 评论:
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-dsl | ✅ yang-jiwei, liujun2025 (2/2) | ✅ yang-jiwei, liujun2025 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
luohui46, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了80条消息 查看更多
liujun2025
23 天前 评论:
23 天前 评论:
/lgtm
/approve


23 天前 添加了label:approved
yang-jiwei
23 天前 评论:
23 天前 评论:
/lgtm
/approve


23 天前 添加了label:lgtm
23 天前 合入了pull request
当前PR是否有AI参与:
[ ] 否
[x] 是
__1. AI Agent 平台: opencode(CANNBot 编程助手)
__2. AI 模型: cannbot/glm-5.3
__3. Prompt上下文 : 用户提出"参考 #172(attn_epilogue 接入 Native 打包)为 indexer_prologue_k 和 engram_gate 算子补充 net/native_package/",AI 完成代码实现、AOT 构建、测试与真机验证;rebase 解决与 cdb49b4(上游已合入 indexer_prologue_qw/k 的 Native 打包)的冲突后,按检视意见收敛为仅保留 engram_gate 的接入
PR功能描述 / 为什么需要这个合入**:
将 engram_gate 算子接入
net/native_package的 Native 打包,部署时通过 Native wheel 直接命中 AOT 二进制,省去首次调用 JIT 编译开销:engram_gate:新增@export("engram_gate")。T、mask ABI 与核配额参与编译(张量形状、launch grid 与 host launcher 随之变化),默认按 56/64 核配额 ×T=72× 有/无image_mask共 4 个配置;eps/clamp_value默认导出1e-6,其余取值回退 JIT。支持CANNBOTDSL_DS41_PROFILES的engram_gate键覆盖默认集合,枚举前预清模块编译缓存(对齐 mqsmla/qli 写法)。operator_groups.toml登记engram_gate并加入ds41组;sample README 增加"安装包调用"章节,CHANGELOG 补充条目。net/native_package/test_build.py两处既有失败:export 探测不识别@aot.export(...)属性写法(flash_kda);test_ds41_selection断言未随算子集更新(--group k3已是合法组,且 ds41 组已含 indexer_prologue_qw/k)。该PR关联的issue
(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #<待填写>
希望检视人员了解:
engram_gate的block_num = min(max_blocks, rows)在@host内求值并烙进二进制(max_blocks取设备向量核数),故需按 56/64 配额枚举:T=72时 rows=288,56 与 64 是两个不同的二进制。对比 indexer_prologue_k:launch 核数是运行时 int32 标量,二进制与核数无关(见 cdb49b4)。engram_gate默认仅枚举T=72(模型 token 数),其他T/eps/clamp_value回退 JIT,可通过CANNBOTDSL_DS41_PROFILES的engram_gate键补充({"max_blocks": int, "tokens": [int, ...], "has_mask": [bool, ...]})。cannbot-dsl <0.8,>=0.7.0,test_build_wheel_contains_sources_and_native_resources在本地环境失败(未改动 pyproject/setup)。改动类型 / Change Type
测试信息 / Testing
检查清单 / Checklist