Skip to content

feat: fixpipe tpipe design#883

Open
HecreReed wants to merge 17 commits into
hw-native-sys:mainfrom
HecreReed:codex/fixpipe-tpipe-design-draft
Open

feat: fixpipe tpipe design#883
HecreReed wants to merge 17 commits into
hw-native-sys:mainfrom
HecreReed:codex/fixpipe-tpipe-design-draft

Conversation

@HecreReed

Copy link
Copy Markdown
Collaborator

Summary

  • add a design draft for tpipe support of fixpipe-style TPUSH
  • document why PTOAS should model fixpipe config per pipe instead of per tpush
  • scope the first implementation cut to C2V + Acc producer + no-split, with vector quant included

Notes

  • docs-only change, no code changes in this PR
  • the draft compares current pto-isa TPUSH/TPOP/FixpipeParams semantics with PTOAS frontend pipe IR
  • the design recommends lowering pipe-level config into TPUSH<Pipe, TileProd, TConfig> during EmitC

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@reedhecre

reedhecre commented Jun 30, 2026

Copy link
Copy Markdown

Codex Review

该评论由 review 机器人自动更新。

  • PR: feat: fixpipe tpipe design #883 feat: fixpipe tpipe design
  • Author: HecreReed
  • Base/Head: main / codex/fixpipe-tpipe-design-draft
  • Head SHA: c8471c5b160b
  • Trigger: PR 有新提交
  • Generated At: 2026-07-09T06:30:42Z
  • Previous Head SHA: 83efcf8a12b5
  • Status: failed at codex-review (exit=1)

Summary

Review failed at stage codex-review: exit=1

Findings

未生成结构化 findings,因为 review 过程提前失败。

Log Tail

 ...pipe_frontend_verify_quant_state_binding_a5.pto |  352 +++++
 ...ipe_frontend_verify_req8_vec_ui8_invalid_a5.pto |   59 +
 ...verify_set_quant_vector_bad_payload_type_a3.pto |   62 +
 ...verify_set_quant_vector_bad_payload_type_a5.pto |   62 +
 ...pipe_frontend_verify_slot_size_too_small_a5.pto |  113 ++
 ...ixpipe_frontend_verify_split_ops_invalid_a5.pto |  223 +++
 .../fixpipe_frontend_verify_src_type_invalid.pto   |  435 ++++++
 ...xpipe_frontend_verify_tpop_split_invalid_a5.pto |   58 +
 ...ipe_frontend_verify_untraceable_peer_buf_a5.pto |   62 +
 test/lit/pto/fixpipe_invalid_dir_mask.pto          |   32 +
 test/lit/pto/fixpipe_invalid_dir_mask_both.pto     |   29 +
 .../scripts/run_remote_npu_validation.sh           |    2 +-
 test/samples/Movfp/movfp_fixpipe_reuse-pto.pto     |  190 +++
 test/samples/Movfp/movfp_fixpipe_reuse_a3-pto.pto  |  208 +++
 .../Movfp/movfp_fixpipe_reuse_a3_compare.py        |   22 +
 .../samples/Movfp/movfp_fixpipe_reuse_a3_golden.py |   90 ++
 test/samples/Movfp/movfp_fixpipe_reuse_compare.py  |   22 +
 test/samples/Movfp/movfp_fixpipe_reuse_golden.py   |   82 +
 test/samples/runop.sh                              |   37 +-
 tools/ptoas/ptoas.cpp                              |    2 +
 70 files changed, 9288 insertions(+), 54 deletions(-)
===== END STAGE clone rc=0 @ 2026-07-09 14:30:34 =====

===== STAGE codex-review @ 2026-07-09 14:30:34 =====
set -euo pipefail
cd '/tmp/ptoas-pr-review-monitor/runs/20260709_143026_pr883/repo'
'codex' exec -C '/tmp/ptoas-pr-review-monitor/runs/20260709_143026_pr883/repo' -s read-only -c 'model_provider="codereview"' -c 'model="gpt-5.4"' -c 'model_reasoning_effort="xhigh"' --output-schema '/tmp/ptoas-pr-review-monitor/runs/20260709_143026_pr883/review_schema.json' -o '/tmp/ptoas-pr-review-monitor/runs/20260709_143026_pr883/codex_last_message.json' --color never - < '/tmp/ptoas-pr-review-monitor/runs/20260709_143026_pr883/review_prompt.txt'
[monitor] stage timeout: 1800s
OpenAI Codex v0.115.0 (research preview)
--------
workdir: /tmp/ptoas-pr-review-monitor/runs/20260709_143026_pr883/repo
model: gpt-5.4
provider: codereview
approval: never
sandbox: read-only
reasoning effort: xhigh
reasoning summaries: none
session id: 019f4592-2a70-7691-b75e-fb27123e8686
--------
user
你现在在审查 GitHub PR。

仓库:hw-native-sys/PTOAS
PR:#883 feat: fixpipe tpipe design
作者:HecreReed
base branch:origin/main
head branch:HEAD(当前已 checkout 到 PR head)

要求:
1. 只审查这个 PR 相对 origin/main 的改动,必要时可以看上下文文件。
2. 重点找真实的 correctness / regression / contract mismatch / CI / runtime / compatibility 问题。
3. 不要提纯风格建议,不要提低价值猜测。
4. 严格按优先级输出:
   - P1:高概率会导致错误结果、编译/运行失败、严重回归、发布阻断
   - P2:重要缺陷、行为回归、遗漏校验/测试、较大兼容性问题
   - P3:次要但明确可改的问题
5. 如果没有问题,summary 直接写:未检查到 PR #883 存在问题,并返回 findings=[]。
6. 如果有问题,summary 简洁概括,findings 里每条都要给出:
   - severity
   - title
   - body(说明为什么是问题,尽量具体)
   - file(尽量给相对路径)
   - line(能确定就填整数,否则 null)

建议先查看:
- git status --short
- git diff --stat origin/main...HEAD
- git diff --unified=80 origin/main...HEAD

最终输出必须严格匹配 JSON schema。

mcp startup: no servers
Reconnecting... 1/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18547e5297d22b3-LAX, request id: 048271cc-860c-4719-8562-1de2d4e5d068)
Reconnecting... 2/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18547e7dcefe004-LAX, request id: 8dc18288-393c-431e-be3a-251224df6778)
Reconnecting... 3/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18547ebef1b2f5d-LAX, request id: 0ddd6306-95a8-4d5e-92f4-944f2d85cbcc)
Reconnecting... 4/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18547f23d4d446c-LAX, request id: 5690f74a-ef62-42f6-8b37-5a5d5499546b)
Reconnecting... 5/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a18547fd6e4b933b-LAS, request id: adbeeb3a-da29-4962-9311-21e901edaba0)
ERROR: unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a1854813487fd7ab-LAX, request id: 03635fa7-f7a8-4701-afc2-5a792623d41b
Warning: no last agent message; wrote empty content to /tmp/ptoas-pr-review-monitor/runs/20260709_143026_pr883/codex_last_message.json
===== END STAGE codex-review rc=1 @ 2026-07-09 14:30:42 =====

@HecreReed HecreReed force-pushed the codex/fixpipe-tpipe-design-draft branch 10 times, most recently from 57383b6 to 85f7319 Compare July 1, 2026 02:07
@HecreReed HecreReed marked this pull request as ready for review July 1, 2026 02:45
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85f7319d98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

推荐把 fixpipe 配置挂到 `initialize_pipe`:

```mlir
pto.aic_initialize_pipe {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mirror the fixpipe contract on the consumer init

In the current frontend pipe flow, each data op resolves its id against an initialize_pipe in the same function, so a Vector-side tpop_from_aic will only see the peer function's aiv_initialize_pipe, not this Cube-side init. If the fixpipe attrs are only shown/defined on pto.aic_initialize_pipe, verifier rules that check the consumer result type/layout and any consumer lowering have no local pipe-level contract unless a new cross-function propagation path is designed. Please require the peer aiv_initialize_pipe to carry the same attrs (and verify equality), or document the cross-function lookup explicitly.

Useful? React with 👍 / 👎.

Comment thread docs/designs/fixpipe-tpipe-design.md Outdated
@HecreReed HecreReed force-pushed the codex/fixpipe-tpipe-design-draft branch from 85f7319 to 9a54ecb Compare July 1, 2026 03:17
@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a3 rope_kv_cache

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 rope_kv_cache

@reedhecre

Copy link
Copy Markdown

已接收 /run a5 rope_kv_cache,A5 板测器会处理这条请求。

页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。

@reedhecre

Copy link
Copy Markdown

A5 板测成功

  • 触发方式:manual
  • 源码提交:abb5b4638c31
  • 结果汇总:OK 1 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260701_153506_manual_pr883.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260701_153506_manual_pr883.tsv
  • 手动指令:/run a5 rope_kv_cache
  • 触发人:HecreReed
  • 指定用例:rope_kv_cache
  • 触发评论:feat: fixpipe tpipe design #883 (comment)

@HecreReed HecreReed force-pushed the codex/fixpipe-tpipe-design-draft branch from 9a54ecb to 11c96f4 Compare July 1, 2026 07:48
@reedhecre

Copy link
Copy Markdown

已接收 /run a3 rope_kv_cache,A3 板测器会处理这条请求。

页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。

@reedhecre

Copy link
Copy Markdown

A3 板测成功

  • 触发方式:manual
  • 源码提交:5e9fc35cd34d
  • 结果汇总:OK 1 / FAIL 0 / SKIP 0
  • 日志:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260701_155420_manual_pr883.log
  • LLVM cache:/home/zhongxuan/ptoas-board-monitor/cache/llvm-project-vpto-feature/build-shared
  • 结果 TSV:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260701_155420_manual_pr883.tsv
  • 手动指令:/run a3 rope_kv_cache
  • 触发人:HecreReed
  • 指定用例:rope_kv_cache
  • 触发评论:feat: fixpipe tpipe design #883 (comment)

@HecreReed HecreReed force-pushed the codex/fixpipe-tpipe-design-draft branch 7 times, most recently from 88a1fe2 to 7662777 Compare July 2, 2026 04:44
@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a3 movfp_fixpipe_reuse_a3

@reedhecre

Copy link
Copy Markdown

已接收 /run a3 movfp_fixpipe_reuse_a3,A3 板测器会处理这条请求。

页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。

@reedhecre

Copy link
Copy Markdown

A3 板测失败

  • 触发方式:manual
  • 源码提交:67d65e8af0f7
  • 结果汇总:OK 0 / FAIL 1 / SKIP 0
  • 日志:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260707_101606_manual_pr883.log
  • LLVM cache:/home/zhongxuan/ptoas-board-monitor/cache/llvm-project-vpto-llvm21/build-shared
  • 手动指令:/run a3 movfp_fixpipe_reuse_a3
  • 触发人:HecreReed
  • 指定用例:movfp_fixpipe_reuse_a3
  • 触发评论:feat: fixpipe tpipe design #883 (comment)
  • 失败阶段:board-validation / exit=1

失败用例

  • movfp_fixpipe_reuse_a3 (run, exit=2)

@reedhecre

Copy link
Copy Markdown

A3 板测失败详情:PR #883

movfp_fixpipe_reuse_a3

stage=run info=exit=2

/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/npu/a2a3/TMov.hpp:79:5: error: static assertion failed due to requirement 'std::is_same<half, unsigned long>::value || std::is_same<half, long>::value': TMov: Invalid data type.
    static_assert(std::is_same<DstType, uint64_t>::value || std::is_same<DstType, int64_t>::value,
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/npu/a2a3/TMov.hpp:167:9: note: in instantiation of function template specialization 'pto::TMovToFb<pto::Tile<pto::TileType::Scaling, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>, pto::Tile<pto::TileType::Mat, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>>' requested here
        TMovToFb<DstTileData, SrcTileData>(dst.data(), src.data());
        ^
/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/npu/a2a3/TMov.hpp:186:9: note: in instantiation of function template specialization 'pto::TMOV_TILE_IMPL<pto::Tile<pto::TileType::Scaling, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>, pto::Tile<pto::TileType::Mat, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>>' requested here
        TMOV_TILE_IMPL(dst, src);
        ^
/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/common/pto_instr.hpp:1265:5: note: in instantiation of function template specialization 'pto::TMOV_IMPL<pto::Tile<pto::TileType::Scaling, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>, pto::Tile<pto::TileType::Mat, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>>' requested here
    MAP_INSTR_IMPL(TMOV, dst, src);
    ^
/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/common/pto_instr.hpp:23:34: note: expanded from macro 'MAP_INSTR_IMPL'
#define MAP_INSTR_IMPL(API, ...) API##_IMPL(__VA_ARGS__)
                                 ^
<scratch space>:110:1: note: expanded from here
TMOV_IMPL
^
/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/npu_validation/Movfp/movfp_fixpipe_reuse_a3/movfp_fixpipe_reuse_a3_kernel.cpp:203:3: note: in instantiation of function template specialization 'pto::TMOV<pto::Tile<pto::TileType::Scaling, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>, pto::Tile<pto::TileType::Mat, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>>' requested here
  TMOV(v54, v46);
  ^
In file included from /home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/npu_validation/Movfp/movfp_fixpipe_reuse_a3/movfp_fixpipe_reuse_a3_kernel.cpp:32:
In file included from /home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:126:
/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/payload/pto-isa/include/pto/npu/a2a3/TMov.hpp:82:5: error: static assertion failed due to requirement 'Tile<pto::TileType::Mat, half, 1, 32, pto::BLayout::RowMajor, 1, 32, pto::SLayout::NoneBox, 512, pto::PadValue::Null, pto::CompactMode::Null>::Cols * sizeof(half) % BURST_LEN_UNIT == 0': TMov: When TileType is Scaling, col * sizeof(srcType) must be aligned to 128
    static_assert(SrcTileData::Cols * sizeof(SrcType) % BURST_LEN_UNIT == 0,
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
gmake[2]: *** [CMakeFiles/movfp_fixpipe_reuse_a3_kernel.dir/build.make:76: CMakeFiles/movfp_fixpipe_reuse_a3_kernel.dir/movfp_fixpipe_reuse_a3_kernel.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/movfp_fixpipe_reuse_a3_kernel.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
[2026-07-07 10:21:43] ERROR: testcase failed (exit 2): movfp_fixpipe_reuse_a3
[2026-07-07 10:21:43] === SUMMARY ===
[2026-07-07 10:21:43] OK=0 FAIL=1 SKIP=0
[2026-07-07 10:21:43] RESULTS_TSV=/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_101606_manual_pr883/remote_npu_validation_results.tsv
[npu-lock] 已释放设备 1 的锁
=== 任务失败 (exit=1) ===
task-submit wait rc=1
completed (exit=1)

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a3 movfp_fixpipe_reuse_a3

@reedhecre

Copy link
Copy Markdown

已接收 /run a3 movfp_fixpipe_reuse_a3,A3 板测器会处理这条请求。

页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。

@reedhecre

Copy link
Copy Markdown

A3 板测失败

  • 触发方式:manual
  • 源码提交:98611b6689ab
  • 结果汇总:OK 0 / FAIL 1 / SKIP 0
  • 日志:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260707_110913_manual_pr883.log
  • LLVM cache:/home/zhongxuan/ptoas-board-monitor/cache/llvm-project-vpto-llvm21/build-shared
  • 手动指令:/run a3 movfp_fixpipe_reuse_a3
  • 触发人:HecreReed
  • 指定用例:movfp_fixpipe_reuse_a3
  • 触发评论:feat: fixpipe tpipe design #883 (comment)
  • 失败阶段:board-validation / exit=1

失败用例

  • movfp_fixpipe_reuse_a3 (run, exit=1)

@reedhecre

Copy link
Copy Markdown

A3 板测失败详情:PR #883

movfp_fixpipe_reuse_a3

stage=run info=exit=1

[ERROR] aclrtSynchronizeStream(stream) failed: 507015 (/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_110913_manual_pr883/npu_validation/Movfp/movfp_fixpipe_reuse_a3/main.cpp:170)
[ERROR] RecentErrMsg: EZ9999: Inner Error!
EZ9999[PID: 1682908] 2026-07-07-11:15:07.796.960 (EZ9999):  The error from device(chipId:2, dieId:0), serial number is 170, there is an exception of fftsplus aicore error, core id is 6, error code = 0, dump info: pc start: 0x124800000168, current: 0x124800000308, vec error info: 0, mte error info: 0x61030000d6, ifu error info: 0x1000000000000, ccu error info: 0x40a0190000000000, cube error info: 0, biu error info: 0, aic error mask: 0x6500020bd00028c, para base: 0x12c100000080.[FUNC:PrintCoreInfo][FILE:device_error_core_proc.cc][LINE:645]
        TraceBack (most recent call last):
       The extend info: errcode:(0, 0x8000, 0) errorStr: When the D-cache reads and writes data to the UB, the response value returned by the bus is a non-zero value. fixp_error0 info: 0x30000d6, fixp_error1 info: 0x61, fsmId:0, tslot:0, thread:0, ctxid:0, blk:0, sublk:0, subErrType:4.[FUNC:PrintCoreInfo][FILE:device_error_core_proc.cc][LINE:658]
       Kernel task happen error, retCode=0x26, [aicore exception].[FUNC:PreCheckTaskErr][FILE:davinci_kernel_task.cc][LINE:1729]
       AICORE Kernel task happen error, retCode=0x26.[FUNC:GetError][FILE:stream.cc][LINE:1475]
       [AIC_INFO] after execute:args print end[FUNC:GetError][FILE:stream.cc][LINE:1475]
       [AIC_INFO] after execute:mixCtx print end[FUNC:GetError][FILE:stream.cc][LINE:1475]
       [DFX_INFO]Aicore kernel execute failed, device_id=4, stream_id=46, report_stream_id=46, task_id=0, flip_num=0, fault kernel_name=movfp_fixpipe_reuse_a3, fault kernel info ext=movfp_fixpipe_reuse_a3, program id=0, hash=17004211563810698533.[FUNC:GetError][FILE:stream.cc][LINE:1475]
       rtStreamSynchronize execution failed, reason=aicore exception[FUNC:FuncErrorReason][FILE:error_message_manage.cc][LINE:65]
       synchronize stream failed, runtime result = 507015[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:148]
[2026-07-07 11:15:09] ERROR: testcase failed (exit 1): movfp_fixpipe_reuse_a3
[2026-07-07 11:15:09] === SUMMARY ===
[2026-07-07 11:15:09] OK=0 FAIL=1 SKIP=0
[2026-07-07 11:15:09] RESULTS_TSV=/home/zhongxuan/ptoas-board-monitor/runtime/runs/20260707_110913_manual_pr883/remote_npu_validation_results.tsv
[npu-lock] 已释放设备 4 的锁
=== 任务失败 (exit=1) ===
task-submit wait rc=1
completed (exit=1)

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a3 movfp_fixpipe_reuse_a3

@reedhecre

Copy link
Copy Markdown

已接收 /run a3 movfp_fixpipe_reuse_a3,A3 板测器会处理这条请求。

页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。

@reedhecre

Copy link
Copy Markdown

A3 板测成功

  • 触发方式:manual
  • 源码提交:98611b6689ab
  • 结果汇总:OK 1 / FAIL 0 / SKIP 0
  • 日志:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260707_111605_manual_pr883.log
  • LLVM cache:/home/zhongxuan/ptoas-board-monitor/cache/llvm-project-vpto-llvm21/build-shared
  • 结果 TSV:/home/zhongxuan/ptoas-board-monitor/runtime/logs/20260707_111605_manual_pr883.tsv
  • 手动指令:/run a3 movfp_fixpipe_reuse_a3
  • 触发人:HecreReed
  • 指定用例:movfp_fixpipe_reuse_a3
  • 触发评论:feat: fixpipe tpipe design #883 (comment)

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 movfp_fixpipe_reuse

@reedhecre

Copy link
Copy Markdown

已接收 /run a5 movfp_fixpipe_reuse,A5 板测器会处理这条请求。

页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。

@reedhecre

Copy link
Copy Markdown

A5 板测成功

  • 触发方式:manual
  • 源码提交:98611b6689ab
  • 结果汇总:OK 0 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260707_112305_manual_pr883.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260707_112305_manual_pr883.tsv
  • 手动指令:/run a5 movfp_fixpipe_reuse
  • 触发人:HecreReed
  • 指定用例:movfp_fixpipe_reuse
  • 触发评论:feat: fixpipe tpipe design #883 (comment)

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 test/samples/Movfp/movfp_fixpipe_reuse-pto.pto

@reedhecre

Copy link
Copy Markdown

已接收 /run a5 test/samples/Movfp/movfp_fixpipe_reuse-pto.pto,A5 板测器会处理这条请求。

页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。

@reedhecre

Copy link
Copy Markdown

A5 板测成功

  • 触发方式:manual
  • 源码提交:98611b6689ab
  • 结果汇总:OK 1 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260707_113605_manual_pr883.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260707_113605_manual_pr883.tsv
  • 手动指令:/run a5 test/samples/Movfp/movfp_fixpipe_reuse-pto.pto
  • 触发人:HecreReed
  • 直接PTO:test/samples/Movfp/movfp_fixpipe_reuse-pto.pto
  • 触发评论:feat: fixpipe tpipe design #883 (comment)

@zhangstevenunity zhangstevenunity left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review: fixpipe tpipe design (head d0f8726f)

Focused on what changed since my last pass at 2418a9ab. The headline item is d07f6b06, which addresses the P2 latent silent-miscompile I flagged: a vector-quant scaling tile could be reused before a later reusing tpush's rematerialized SET_QUANT_VECTOR read it back.

The P2 fix looks sound. The new pto-rematerialize-fixpipe-vector-quant pass runs after PTOViewToMemref and before PlanMemory (ptoas.cpp:2895-2905), rewriting each reusing tpush's implicit binding into an explicit pto.set_quant_vector clone so memref liveness sees it. Verified:

  • SetQuantVectorOp::getEffects declares MemoryEffects::Read on the scaling_tile operand (PTO.cpp:17862), and PlanMemory already treated the single set as a liveness point; replicating it before each reusing tpush genuinely extends the scaling tile's live interval to the last reuse, so PlanMemory will not reuse its slot in the gap.
  • The pass is a faithful mirror of the vector arm of rematerializeFixpipeQuantBindings in PTOToEmitC.cpp (same per-block map, same id keying, same L2L/L2G2L-only coverage). Running both is idempotent for vector: EmitC erases and re-clones one-per-tpush, so no double emission (the A5 FileCheck still shows exactly one SET_QUANT_VECTOR per TPUSH).
  • Ordering is safe: PTOLowerFrontendPipeOps (2863) lowers aic/aiv inits to L2L/L2G2L before the new pass runs, so handling only those two init types is complete.
  • The new PLAN FileCheck in fixpipe_frontend_emitc_vector_remat_a5.pto runs in build-and-test and confirms the three explicit set_quant_vector ops survive to after PlanMemory.

Non-blocking residuals:

1. Coverage: the A5 reuse path (the actual P2 repro) is still not numerically validated. movfp_fixpipe_reuse-pto is the reuse case (id=0 rebound at the third tpush_to_aiv with no fresh set), but remote-npu-validation is SKIPPED, vpto-sim-validation runs only PyPTO smoke (not these samples), and the manual A5 board run reported OK 0 / FAIL 0 / SKIP 0 -- zero cases executed -- while A3 reported OK 1. So the one arch where scaling tiles are planned memory (A5) never actually ran this kernel end to end. The sample is also minimal (two 1x32 scaling tiles, no buffer pressure between the set and the reusing tpush), so it would not clobber even against the pre-fix compiler. The PLAN check proves the IR transform, not clobber-prevention under pressure. A buffer-pressure A5 case (or fixing the A5 sample so the board actually runs it) would close this. As a bonus, extending scaling-tile liveness is a real memory tradeoff -- worth confirming no tight-UB A5 sample now overflows PlanMemory where it previously (mis)compiled.

2. A3 ui64 verifier relaxation (85258771) contradicts this PR's own design rules 24-25 and the ODS description. Inline.

3. Helper duplication across the two remat paths is a latent drift risk that could resurrect exactly this clobber. Inline.

Net: the P2 fix is correct and no new blocker; posting as COMMENT.

Comment thread lib/PTO/Transforms/PTORematerializeFixpipeVectorQuant.cpp Outdated
Comment thread lib/PTO/IR/PTO.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants