Skip to content

[PTO 0.58.6] reduction B.DIM 错用 destination 几何,row 崩溃/column 静默错算 #63

Description

@zhoubot

问题概述

TileOP API linx@05662833bd7bf71420b15b8f7ba8727a4569e897 在 row/column reduction
的 B.DIM 中写入 destination 几何,而 PTO ISA 0.58.6 的 reduction schema
要求 B.DIM 描述并匹配 source reduction geometry。

结果表现为:

  • row reduction:目的 Mx1 被编码为 LB0=1/LB1=M/LB2=1,模型因 source 为 MxN 而拒绝;
  • column reduction:只按 destination 的单行维度归约,可能正常退出但结果等于 source row0,属于静默错算。

当前代码证据

include/jcore/template_asm.hpp 的 TROWSUM/MAX/MIN/PROD/ARGMAX/ARGMIN:

// static branch
"i"(tile_shape_out::ValidCol),
"i"(tile_shape_out::ValidRow),
"i"(tile_shape_out::Cols),

// dynamic branch
"r"(dst.GetValidCol()),
"r"(dst.GetValidRow()),
"i"(tile_shape_out::Cols),

column reduction 族存在同类 destination-derived lowering。

规范依据

PTO-SPEC main@dea0b75e803cffa873982c90f9aa0cd17c6d243b

https://github.com/PTO-ISA/pto-spec/blob/dea0b75e803cffa873982c90f9aa0cd17c6d243b/asl/block/model/dispatch/reduction-schema.asl#L67-L87

SelectedBundleClosedReductionSchemaLegal 最终执行:

SelectedBundleComparisonShapeMatches(source)

destination 的 Mx1 / 1xN 则由 source descriptor 单独派生,不应反向覆盖 B.DIM source geometry。

复现

完整复现和 release 参考 kernel 证据见:
https://github.com/LinxISA/SuperScalarModel/issues/560#gfrun-2--%E8%A1%8C%E5%88%97%E5%BD%92%E7%BA%A6-headermodel-%E7%BB%B4%E5%BA%A6-skew

bash microbenchmark/tileop-guard/run_guard.sh sfu trowmax
bash microbenchmark/tileop-guard/run_guard.sh sfu tcolmax

根因分类

这是 TileOP API lowering 缺陷。模型以 B.DIM 校验 source geometry 与当前 ASL 一致,
不应通过放宽模型修复。

建议 owner

  • TileOP reduction header/lowering 维护者
  • SuperNPUBench reduction 与 tileop-guard 维护者协助端到端回归

最小修复方向

  • 静态分支使用 tile_shape_in::{ValidCol,ValidRow,Cols}
  • 动态分支使用 src.GetValidCol()/GetValidRow() 和 source physical columns;
  • destination 仍保持 row=Mx1、column=1xN 的独立 descriptor/capacity。

验收条件

  1. row/column 的 SUM/MAX/MIN/PROD/ARGMIN/ARGMAX 均覆盖静态和动态 source。
  2. 检查反汇编中的 LB0/LB1/LB2 等于 source geometry。
  3. row reduction 不再 descriptor fault;column reduction 不再只计算 row0。
  4. gfrun/gfsim 使用同一 ELF,逐元素比较独立 golden。
  5. 完整 make check 通过。

关联汇总 issue:
https://github.com/LinxISA/SuperScalarModel/issues/560

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions