Skip to content

[Performance][阻塞] [VPTO][A5] tied operand copy 物化未接入默认调度,precise FP32 division 性能差距仍存在 #1448

Description

@W4termy

Summary

PR #1351pto.vmulapto.vmadd 等 destructive two-address
指令补充了 tied operand 建模,并通过
VPTOMaterializeTiedOperandCopiesPass 显式插入 pto.vmov

该修改解决了 PTOAS scheduler 无法看到 Bisheng 后端隐式 VMOV 的问题,
但尚未完整解决 #1327 的性能问题:

  • copy 物化 pass 未接入默认 ptoas pipeline;
  • pto.vmov 尚未由 VPTO scheduler 完整调度;
  • VMOV latency、vector pipe resource 和寄存器压力尚未完成目标建模;
  • original-register owner 与其他 read/copy 之间的 anti-dependency
    尚未完整接入调度;
  • precise FP32 division 修正链在默认路径下仍无法达到
    Bisheng vector MI scheduler 路径的性能。

希望继续完成 tied-copy 物化、VPTO scheduler 和默认 pipeline 的集成。

Command line

python repro_precise_div.py --launches 100

Reproduction input

复用 #1327 中已经公开的完整独立 MLIR:

https://github.com/hw-native-sys/PTOAS/issues/1327

该输入不依赖 TileLang 或其他编译器前端。核心 tied operand pattern 为:


%r0 = pto.vmula %acc, %x0, %y, %mask : ...
%r1 = pto.vmula %acc, %x1, %y, %mask : ...
%r2 = pto.vmula %acc, %x2, %y, %mask : ...

Expected performance

#1327 的 precise FP32 division 复现用例中,默认路径性能应接近
开启 Bisheng vector MI scheduler 的结果,且数值输出保持一致。

### Actual performance

- 默认 PTOAS:1853.857 us
- 开启 Bisheng vector MI scheduler:1744.257 us
- 开启后提速:5.91%
- 两种路径输出校验值一致

PR #1351 当前只注册独立的 copy 物化 pass,不改变默认 `ptoas`
pipeline,也不负责 scheduler 选点。因此它解决了 IR 可见性问题,
但默认编译路径的性能问题仍未闭环。

### Profiling data (optional)

_No response_

### Git commit

359a3886d160cd954ebe07cfe890db6f6eefbbb9

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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