Pull Request has been successfully merged by CANN-robot.
(Thank you for zhiweiyuan's contribution.)变更摘要
本 PR 是 #6521 向 9.2.0 分支的 cherry-pick,用于修复任务级仿真(--run_mode sim)在执行包含 ERF 指令的内核(如 activation.py 中的 GELU/GeGLU)时因 F16766 INVALID_PIPE_TYPE 而中断的问题。核心改动是在 SCHED_CORE_PIPE_TYPE 中补充 ERF 到 CorePipeType::PIPE_VECTOR_ALU 的映射,并重构 TileOp::GetPipeType(),使未知 opcode 不再触发断言中止,而是回退到 PIPE_VECTOR_ALU 并输出 SIMULATION_LOGW 告警。
主要改动
- 新增 ERF 管道类型映射:在
ISA.h的SCHED_CORE_PIPE_TYPE中注册{"ERF", CorePipeType::PIPE_VECTOR_ALU},使仿真能识别 ERF 指令对应的向量 ALU 管道类型。 - 未知 opcode 回退处理:
TileOp::GetPipeType()移除对未知 opcode 的ASSERT中止逻辑,改为在查表失败时回退到CorePipeType::PIPE_VECTOR_ALU,并输出SIMULATION_LOGW告警,避免仿真直接中断。 - 调整管道类型判定分支:将原先的
IsCall()/else二分逻辑改为IsCall()、查表命中、查表未命中三分支,查表结果仅在命中时赋值,消除对end()迭代器的错误解引用风险。 - 行为变更:
LOOP等不在映射表中的 opcode 不再走特殊豁免路径,统一由回退分支处理,行为与未知 opcode 保持一致。


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 |
|---|---|---|
| 9.2.0 | ✅ gcw_kUomxQ2l, caodongdong (2/2) | ✅ gcw_kUomxQ2l (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
zhiweiyuan, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


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


/lgtm


/approve


fix(simulation): Register ERF pipe type and fallback unknown opcodes
Cherry-pick of #6521 (master) into 9.2.0.
Task-level simulation (--run_mode sim) aborts with F16766 INVALID_PIPE_TYPE
when executing kernels containing the ERF opcode (e.g. GELU/GeGLU in
activation.py). Root cause: SCHED_CORE_PIPE_TYPE lacks the ERF mapping, and
TileOp::GetPipeType() hard-asserts on unknown opcodes with no fallback path.
Changes:
PIPE_VECTOR_ALU with a SIMULATION_LOGW warning instead of aborting;
this also fixes the pre-existing UB where the LOOP exemption path
dereferenced end() when LOOP was absent from the table
Related Issues: #3392