已合并
Add A5 VfSim tileop costmodel tests #1372
Chonghao-Wang创建于 27 天前
Add A5 VfSim tileop costmodel tests #1372
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 Chonghao-Wang 的贡献)27 天前 创建了 pull request,commit 062f884a
atomgit-bot
27 天前 评论:
27 天前 评论:
🤖 正在生成合并请求摘要,请稍候…


atomgit-bot
27 天前 评论:
27 天前 评论:
🤖 AI 代码检视正在进行中,请稍候…


27 天前 添加了label:cann-cla/no
27 天前 添加了label:stat/needs-squash
此处折叠了116条消息 查看更多
CANN-robot
26 天前 评论:
26 天前 评论:
流水线 PR-pipeline_cann_pto-isa#4689 [ commitID:5123a6a0 ] 已完成


csjlchen
26 天前 评论:
26 天前 评论:
/lgtm


26 天前 添加了label:lgtmapproved
26 天前 合入了pull request
描述
在 A5 代际中以 CCE mock 的方式接入 VfSim costmodel,支持对 pto-isa 中 tileop 指令进行时间预测。后端 VfSim 模型以
VfInfo为统一接口,后续可继续扩展支持任意 VF 算子的时间预测。实现逻辑
__VEC_SCOPE__内部的循环结构。VfInfo是当前 PTO 和 VfSim costmodel 之间的接口数据结构,包含 VF loop、micro-op、operand、memory location 等信息。PredictVfCycles调用 VfSim costmodel,返回 tileop 的预测 cycle。VfInfo调用 VfSim 预测,并将各段 VF cycle 累加后返回。repeat times * 单指令 cycle 数的形式返回预测结果。plt_b32等非 micro-op 指令进行了过滤,避免进入 VfSim 预测链路。VfInfocore API unification、dtype/memory info、loop unroll native runner 等相关更新,并完成 PTO 侧适配。
A5 costmodel入口与调用方式
A5 代际 costmodel 与 A2/A3 代际 costmodel 入口保持一致,使用 PTO 统一入口:
#include <pto/pto-inst.hpp>使用方式保持 tileop 调用形式不变,例如:
TADD(dstTile, src0Tile, src1Tile);
编译 A5 costmodel 测试或预测链路时需要开启对应宏:
-D__COSTMODEL
-D__NPU_ARCH__=3101
其中:
测试
新增并验证了 A5 VfSim costmodel 的 ST 测试用例,测试目录为:
tests/costmodel/st_a5/testcase
测试用例结构仿照既有 ST 测试:
tests/costmodel/st/testcase
验证内容包括: