Pull Request has been successfully merged by CANN-robot.
(Thank you for 高前程's contribution.)变更摘要
本 PR 修复了 framework/src/interface/function/function.cpp 中函数 Magic 哈希生成不完整导致的碰撞问题:a_trans 场景下矩阵 A 的 shape 为 [K, M],K 位于 rawshape[0],而原实现要么跳过 dim0(当作 batch 处理)、要么只在 STATIC 边界操作时哈希 rawshape,使得仅 K 不同的两个 matmul(如 C1 K=6144 与 C2 K=8192)生成相同的哈希,进而共享同一个 dy_kernel_<hash>.o / leafDict。改动将 rawshape 的哈希改为包含 dim0,并扩展到所有函数类型。
主要改动
ProducerMagicLookup哈希范围改为从索引 0 开始:STATIC 函数边界操作的rawshape哈希循环由idx = 1改为idx = 0,不再默认跳过 dim0,从而将K纳入哈希,避免仅K不同的 kernel 哈希碰撞。MagicLookup对所有函数类型补充 GMrawshape哈希:当t->tensor != nullptr时,将tensor->rawshape全维度追加进ss,覆盖不进入 STATIC 分支的新 IR 路径(DYNAMIC_LOOP_PATH,其dy_kernel文件名基于 DYNAMIC 父级哈希),补齐a_trans下rawshape[0]上K的哈希。- 保留原有的 shape 信息写入逻辑:
MagicLookup中原有的逻辑 tile/view shape(含 DYNAMIC-1)与 STATIC 类型的oriShape哈希保持不变,仅在哈希内容上增加 GMrawshape。


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 |
|---|---|---|
| framework/src/interface/function | ✅ DCGDDD, tsungl4 (2/2) | ✅ DCGDDD (1/1) |
| framework/src/interface/program | ✅ DCGDDD, tsungl4 (2/2) | ✅ DCGDDD (1/1) |
| framework/src/interface/tensor | ✅ DCGDDD, tsungl4 (2/2) | ✅ DCGDDD (1/1) |
| framework/src/interface/utils | ✅ DCGDDD, tsungl4 (2/2) | ✅ DCGDDD (1/1) |
| repo-cann/pypto | ✅ DCGDDD, tsungl4 (2/2) | ✅ DCGDDD (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
Immutable01, thanks for your pull request. All authors of the commits have signed the CLA. 👍


/lgtm


/approve


将DYNAMIC类型的Function magic与其他function分开管理,并且在复跑时不复用,避免在这一层计算哈希时哈希冲突