Skip to content

fix: reduce A5 validation false failures#901

Open
HecreReed wants to merge 2 commits into
hw-native-sys:mainfrom
HecreReed:codex/a5-validation-false-fail-fixes
Open

fix: reduce A5 validation false failures#901
HecreReed wants to merge 2 commits into
hw-native-sys:mainfrom
HecreReed:codex/a5-validation-false-fail-fixes

Conversation

@HecreReed

Copy link
Copy Markdown
Collaborator

Summary

  • fix A5 packed predicate mask handling in test/samples/validation_runtime.py so mask buffers use row-strided storage instead of a dense prefix
  • fix the Sels, Rowexpand{mul,sub,div}, Scatter, and Partmin sample/golden pairs so their inputs and expected outputs match the actual A5 tile-op contracts
  • reduce several false board-validation failures that showed up during the PR896 A5 broad run

What this draft is trying to fix

This draft is aimed at the broad-run failures that look like precision bugs but are actually sample/harness mismatches:

  • cmp / cmps: packed mask layout mismatch in compare/golden handling
  • sel: packed mask input layout mismatch
  • sels: sample/golden semantic mismatch
  • rowexpandmul / rowexpandsub / rowexpanddiv: sample used an invalid full-tile broadcast operand while golden assumed per-row broadcast semantics
  • scatter: golden interpreted indices as row destinations instead of element indices
  • partmin: golden/compare used float16 even though the sample output is float32

Not covered yet

This draft does not try to solve the remaining broad-run failures yet:

  • mgather / mscatter compile failures
  • rope_kv_cache
  • rmsnorm / post_rmsnorm
  • test_tmov_col_major_16x1_align_a5 segfault

Validation

  • python3 -m py_compile test/samples/validation_runtime.py test/samples/Sels/sels.py test/samples/Sels/sels_golden.py test/samples/Rowexpandmul/rowexpandmul.py test/samples/Rowexpandsub/rowexpandsub.py test/samples/Rowexpanddiv/rowexpanddiv.py test/samples/Scatter/scatter_golden.py test/samples/Partmin/partmin_golden.py test/samples/Partmin/partmin_compare.py
  • packed-mask helper self-check for row-strided storage and compare path
  • git diff --check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates several test samples and the validation runtime. Specifically, it changes the data type from float16 to float32 in the Partmin sample, introduces 32x1 tile views and column-major layouts in the Rowexpand samples, and refactors the Sels sample to use a u8 mask instead of float/integer comparisons. Additionally, it simplifies mask packing and comparison logic in validation_runtime.py by removing is_a5_soc() checks. Feedback on scatter_golden.py suggests simplifying the idx array creation and assignment by avoiding redundant reshape and slice operations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread test/samples/Scatter/scatter_golden.py Outdated
Comment on lines 29 to 33
idx = np.arange(n_idx, dtype=np.int64).reshape(rows, cols)
out = src.reshape(rows, cols)
buffers = default_buffers(meta)
buffers[src_name] = src
buffers[idx_name] = idx.astype(meta.np_types[idx_name], copy=False).reshape(-1)[:n_idx]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The idx array is reshaped to (rows, cols) only to be flattened back to a 1D array and sliced with [:n_idx] when assigned to buffers[idx_name]. Since idx is already a 1D array of size n_idx, we can simplify this by keeping idx as a 1D array and avoiding the redundant reshape and slice operations.

Suggested change
idx = np.arange(n_idx, dtype=np.int64).reshape(rows, cols)
out = src.reshape(rows, cols)
buffers = default_buffers(meta)
buffers[src_name] = src
buffers[idx_name] = idx.astype(meta.np_types[idx_name], copy=False).reshape(-1)[:n_idx]
idx = np.arange(n_idx, dtype=np.int64)
out = src.reshape(rows, cols)
buffers = default_buffers(meta)
buffers[src_name] = src
buffers[idx_name] = idx.astype(meta.np_types[idx_name], copy=False)

@reedhecre

reedhecre commented Jul 6, 2026

Copy link
Copy Markdown

Codex Review

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

  • PR: fix: reduce A5 validation false failures #901 fix: reduce A5 validation false failures
  • Author: HecreReed
  • Base/Head: main / codex/a5-validation-false-fail-fixes
  • Head SHA: 447494ed4129
  • Trigger: PR 有新提交
  • Generated At: 2026-07-09T08:55:47Z
  • Previous Head SHA: a61d28e3da75
  • Status: failed at codex-review (exit=1)

Summary

Review failed at stage codex-review: exit=1

Findings

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

Log Tail

git fetch origin 'main' --depth 50 || true
git checkout -f 'pr-901'
git rev-parse HEAD
git diff --stat 'origin/main...HEAD' || true
Cloning into '/tmp/ptoas-pr-review-monitor/runs/20260709_165532_pr901/repo'...
From https://github.com/hw-native-sys/PTOAS
 * [new ref]           refs/pull/901/head -> pr-901
From https://github.com/hw-native-sys/PTOAS
 * branch              main       -> FETCH_HEAD
Switched to branch 'pr-901'
447494ed4129abfd395af2b42709415b2dc0995a
 test/samples/Partmin/partmin_compare.py   | 10 +++++-
 test/samples/Partmin/partmin_golden.py    | 10 +++++-
 test/samples/Rowexpanddiv/rowexpanddiv.py | 10 ++++--
 test/samples/Rowexpandmul/rowexpandmul.py | 10 ++++--
 test/samples/Rowexpandsub/rowexpandsub.py | 10 ++++--
 test/samples/Scatter/scatter_golden.py    | 17 +++++++++--
 test/samples/Sels/sels.py                 | 34 ++++++++++-----------
 test/samples/Sels/sels_golden.py          | 42 ++++++++++++++++++++-----
 test/samples/validation_runtime.py        | 51 +++++++++++--------------------
 9 files changed, 120 insertions(+), 74 deletions(-)
===== END STAGE clone rc=0 @ 2026-07-09 16:55:39 =====

===== STAGE codex-review @ 2026-07-09 16:55:39 =====
set -euo pipefail
cd '/tmp/ptoas-pr-review-monitor/runs/20260709_165532_pr901/repo'
'codex' exec -C '/tmp/ptoas-pr-review-monitor/runs/20260709_165532_pr901/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_165532_pr901/review_schema.json' -o '/tmp/ptoas-pr-review-monitor/runs/20260709_165532_pr901/codex_last_message.json' --color never - < '/tmp/ptoas-pr-review-monitor/runs/20260709_165532_pr901/review_prompt.txt'
[monitor] stage timeout: 1800s
OpenAI Codex v0.115.0 (research preview)
--------
workdir: /tmp/ptoas-pr-review-monitor/runs/20260709_165532_pr901/repo
model: gpt-5.4
provider: codereview
approval: never
sandbox: read-only
reasoning effort: xhigh
reasoning summaries: none
session id: 019f4616-fe63-7912-a191-9eb0d816631d
--------
user
你现在在审查 GitHub PR。

仓库:hw-native-sys/PTOAS
PR:#901 fix: reduce A5 validation false failures
作者: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 #901 存在问题,并返回 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: a1861c6b0e92b4c4-LAX, request id: 128ccfc3-afe3-43ac-9f89-28e063bf4954)
Reconnecting... 2/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a1861c6daf152aaa-LAX, request id: be383be9-6342-4a02-a451-9f9ad416a9c4)
Reconnecting... 3/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a1861c715d3a2ac8-LAX, request id: 147d9e6b-aafd-4cc2-921a-1dccda60012f)
Reconnecting... 4/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a1861c784e3d09f9-LAS, request id: 1c31e366-90d0-4368-b15b-887781d1c2e4)
Reconnecting... 5/5 (unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a1861c844972c3a8-LAX, request id: 2f2b3197-0a46-4ba4-ade2-9b835258af18)
ERROR: unexpected status 403 Forbidden: {"code":"INSUFFICIENT_BALANCE","message":"Insufficient account balance"}, url: https://codex.0u0o.com/responses, cf-ray: a1861c9b5e866c93-LAX, request id: 01c51519-ceb7-4461-a621-3d9ffa7799b3
Warning: no last agent message; wrote empty content to /tmp/ptoas-pr-review-monitor/runs/20260709_165532_pr901/codex_last_message.json
===== END STAGE codex-review rc=1 @ 2026-07-09 16:55:47 =====

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5

@reedhecre

Copy link
Copy Markdown

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

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

@reedhecre

Copy link
Copy Markdown

A5 板测失败

  • 触发方式:manual
  • 源码提交:75e4d9db1b76
  • 结果汇总:OK 219 / FAIL 6 / SKIP 1
  • 日志:/root/ptoas-board-monitor-a5/logs/20260708_111006_manual_pr901.log
  • 手动指令:/run a5
  • 触发人:HecreReed
  • 触发评论:fix: reduce A5 validation false failures #901 (comment)
  • 失败阶段:board-validation / exit=1

失败用例

  • rope_kv_cache (run, exit=2)
  • rmsnorm (run, exit=2)
  • post_rmsnorm (run, exit=2)
  • plan_memory_bind_tile_alias_liveness (run, exit=139)
  • mscatter (run, exit=2)
  • mgather (run, exit=2)

@reedhecre

Copy link
Copy Markdown

A5 板测失败详情:PR #901

rope_kv_cache

stage=run info=exit=2

[ERROR] Mismatch (bf16 golden_v1.bin vs v1.bin): max ulp diff=30463 at idx=26720 (golden_bits=48012, out_bits=15218, golden=-0.0042724609375, out=0.003692626953125)
[ERROR] compare failed
[2026-07-08 11:41:05] ERROR: testcase failed (exit 2): rope_kv_cache
rmsnorm

stage=run info=exit=2

[ERROR] Mismatch (bf16 golden_v2.bin vs v2.bin): max ulp diff=4 at idx=73741 (golden_bits=15203, out_bits=15207, golden=0.0034637451171875, out=0.0035247802734375)
[ERROR] compare failed
[2026-07-08 11:41:17] ERROR: testcase failed (exit 2): rmsnorm
post_rmsnorm

stage=run info=exit=2

[ERROR] Mismatch (bf16 golden_v2.bin vs v2.bin): max ulp diff=3 at idx=8821 (golden_bits=15613, out_bits=15616, golden=0.0308837890625, out=0.03125)
[ERROR] compare failed
[2026-07-08 11:43:15] ERROR: testcase failed (exit 2): post_rmsnorm
plan_memory_bind_tile_alias_liveness

stage=run info=exit=139

./test/npu_validation/scripts/run_remote_npu_validation.sh: line 848: 962896 Segmentation fault      (core dumped) LD_LIBRARY_PATH="${LD_LIBRARY_PATH_NPU}" ./build/${testcase}
[2026-07-08 11:52:11] ERROR: testcase failed (exit 139): plan_memory_bind_tile_alias_liveness
mscatter

stage=run info=exit=2

/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:99:25: error: cannot cast from type 'GlobalTensor<int32_t, pto::Shape<1, 1, 1, 32, 32>, pto::Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>' (aka 'GlobalTensor<int, Shape<1, 1, 1, 32, 32>, Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>') to pointer type '__gm__ int32_t *' (aka '__gm__ int *')
  __gm__ int32_t* v17 = (__gm__ int32_t*) v16;
                        ^~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:301:
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:461:24: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using T = typename TileSrc::DType;
                       ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:2053:5: note: in instantiation of function template specialization 'pto::MSCATTER_IMPL<pto::Coalesce::Row, pto::ScatterAtomicOp::None, pto::ScatterOOB::Undefined, pto::ScatterConflict::Last, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
    MSCATTER_IMPL<Mode>(dst, src, indexes);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:132:3: note: in instantiation of function template specialization 'pto::MSCATTER<pto::Coalesce::Row, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
  MSCATTER<pto::Coalesce::Row>(v17, v28, v29);
  ^
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:301:
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:462:27: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using TIdx = typename TileIdx::DType;
                          ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:466:60: error: member reference base type '__gm__ int *' is not a structure or union
    __gm__ T *tablePtr = reinterpret_cast<__gm__ T *>(table.data());
                                                      ~~~~~^~~~~
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:468:35: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    constexpr int kSrcValidRowS = TileSrc::ValidRow;
                                  ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:469:35: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    constexpr int kSrcValidColS = TileSrc::ValidCol;
                                  ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:473:35: error: member reference base type '__ubuf__ int *' is not a structure or union
    const uint32_t validRows = src.GetValidRow();
                               ~~~^~~~~~~~~~~~
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:474:35: error: member reference base type '__ubuf__ int *' is not a structure or union
    const uint32_t validCols = src.GetValidCol();
                               ~~~^~~~~~~~~~~~
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:477:37: error: type '__gm__ int *' cannot be used prior to '::' because it has no members
        using TableShape = typename GlobalTable::Shape;
                                    ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:480:63: error: member reference base type '__gm__ int *' is not a structure or union
        const uint32_t tableRows = static_cast<uint32_t>(table.GetShape(GlobalTensorDim::DIM_3));
                                                         ~~~~~^~~~~~~~~
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:482:26: error: member reference base type '__ubuf__ int *' is not a structure or union
            tablePtr, src.data(), indices.data(), validRows, validCols, tableRows);
                      ~~~^~~~~
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:394:24: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using T = typename TileSrc::DType;
                       ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:464:5: note: in instantiation of function template specialization 'pto::MScatterCheck<pto::Coalesce::Row, pto::ScatterAtomicOp::None, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
    MScatterCheck<Mode, Atomic>(table, src, indices);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:2053:5: note: in instantiation of function template specialization 'pto::MSCATTER_IMPL<pto::Coalesce::Row, pto::ScatterAtomicOp::None, pto::ScatterOOB::Undefined, pto::ScatterConflict::Last, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
    MSCATTER_IMPL<Mode>(dst, src, indexes);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:132:3: note: in instantiation of function template specialization 'pto::MSCATTER<pto::Coalesce::Row, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
  MSCATTER<pto::Coalesce::Row>(v17, v28, v29);
  ^
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:301:
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:395:27: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using TIdx = typename TileIdx::DType;
                          ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:404:43: error: type '__gm__ int *' cannot be used prior to '::' because it has no members
    static_assert(std::is_same_v<typename GlobalTable::DType, __gm__ T>,
                                          ^
14 errors generated.
gmake[2]: *** [CMakeFiles/mscatter_kernel.dir/build.make:76: CMakeFiles/mscatter_kernel.dir/mscatter_kernel.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/mscatter_kernel.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
[2026-07-08 11:55:38] ERROR: testcase failed (exit 2): mscatter
mgather

stage=run info=exit=2

/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:87:25: error: cannot cast from type 'GlobalTensor<int32_t, pto::Shape<1, 1, 1, 32, 32>, pto::Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>' (aka 'GlobalTensor<int, Shape<1, 1, 1, 32, 32>, Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>') to pointer type '__gm__ int32_t *' (aka '__gm__ int *')
  __gm__ int32_t* v11 = (__gm__ int32_t*) v10;
                        ^~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:300:
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MGather.hpp:513:24: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using T = typename TileDst::DType;
                       ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:2002:5: note: in instantiation of function template specialization 'pto::MGATHER_IMPL<pto::Coalesce::Row, pto::GatherOOB::Undefined, __ubuf__ int *, __gm__ int *, __ubuf__ int *>' requested here
    MGATHER_IMPL<CMode>(dst, src, indexes);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:125:3: note: in instantiation of function template specialization 'pto::MGATHER<pto::Coalesce::Row, __ubuf__ int *, __gm__ int *, __ubuf__ int *>' requested here
  MGATHER<pto::Coalesce::Row>(v26, v11, v25);
  ^
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:300:
/tmp/ptoas-board-monitor-a5/runs/20260708_111006_manual_pr901/payload/pto-isa/include/pto/npu/a5/MGather.hpp:515:19: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    if constexpr (TileDst::Loc == TileType::Mat) {
                  ^
3 errors generated.
gmake[2]: *** [CMakeFiles/mgather_kernel.dir/build.make:76: CMakeFiles/mgather_kernel.dir/mgather_kernel.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/mgather_kernel.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
[2026-07-08 11:56:41] ERROR: testcase failed (exit 2): mgather

@HecreReed HecreReed marked this pull request as ready for review July 9, 2026 08:40
@HecreReed HecreReed force-pushed the codex/a5-validation-false-fail-fixes branch from a61d28e to 447494e Compare July 9, 2026 08:47
@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 rope_kv_cache,rmsnorm,post_rmsnorm,plan_memory_bind_tile_alias_liveness,mscatter,mgather

@reedhecre

Copy link
Copy Markdown

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

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

@reedhecre

Copy link
Copy Markdown

A5 板测失败

  • 触发方式:manual
  • 源码提交:cff63eaa1969
  • 结果汇总:OK 4 / FAIL 2 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260709_171011_manual_pr901.log
  • 手动指令:/run a5 rope_kv_cache,rmsnorm,post_rmsnorm,plan_memory_bind_tile_alias_liveness,mscatter,mgather
  • 触发人:HecreReed
  • 指定用例:rope_kv_cache,rmsnorm,post_rmsnorm,plan_memory_bind_tile_alias_liveness,mscatter,mgather
  • 触发评论:fix: reduce A5 validation false failures #901 (comment)
  • 失败阶段:board-validation / exit=1

失败用例

  • mscatter (run, exit=2)
  • mgather (run, exit=2)

@reedhecre

Copy link
Copy Markdown

A5 板测失败详情:PR #901

mscatter

stage=run info=exit=2

/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:99:25: error: cannot cast from type 'GlobalTensor<int32_t, pto::Shape<1, 1, 1, 32, 32>, pto::Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>' (aka 'GlobalTensor<int, Shape<1, 1, 1, 32, 32>, Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>') to pointer type '__gm__ int32_t *' (aka '__gm__ int *')
  __gm__ int32_t* v17 = (__gm__ int32_t*) v16;
                        ^~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:301:
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:461:24: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using T = typename TileSrc::DType;
                       ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:2055:5: note: in instantiation of function template specialization 'pto::MSCATTER_IMPL<pto::Coalesce::Row, pto::ScatterAtomicOp::None, pto::ScatterOOB::Undefined, pto::ScatterConflict::Last, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
    MSCATTER_IMPL<Mode>(dst, src, indexes);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:132:3: note: in instantiation of function template specialization 'pto::MSCATTER<pto::Coalesce::Row, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
  MSCATTER<pto::Coalesce::Row>(v17, v28, v29);
  ^
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:301:
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:462:27: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using TIdx = typename TileIdx::DType;
                          ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:466:60: error: member reference base type '__gm__ int *' is not a structure or union
    __gm__ T *tablePtr = reinterpret_cast<__gm__ T *>(table.data());
                                                      ~~~~~^~~~~
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:468:35: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    constexpr int kSrcValidRowS = TileSrc::ValidRow;
                                  ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:469:35: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    constexpr int kSrcValidColS = TileSrc::ValidCol;
                                  ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:473:35: error: member reference base type '__ubuf__ int *' is not a structure or union
    const uint32_t validRows = src.GetValidRow();
                               ~~~^~~~~~~~~~~~
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:474:35: error: member reference base type '__ubuf__ int *' is not a structure or union
    const uint32_t validCols = src.GetValidCol();
                               ~~~^~~~~~~~~~~~
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:477:37: error: type '__gm__ int *' cannot be used prior to '::' because it has no members
        using TableShape = typename GlobalTable::Shape;
                                    ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:480:63: error: member reference base type '__gm__ int *' is not a structure or union
        const uint32_t tableRows = static_cast<uint32_t>(table.GetShape(GlobalTensorDim::DIM_3));
                                                         ~~~~~^~~~~~~~~
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:482:26: error: member reference base type '__ubuf__ int *' is not a structure or union
            tablePtr, src.data(), indices.data(), validRows, validCols, tableRows);
                      ~~~^~~~~
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:394:24: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using T = typename TileSrc::DType;
                       ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:464:5: note: in instantiation of function template specialization 'pto::MScatterCheck<pto::Coalesce::Row, pto::ScatterAtomicOp::None, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
    MScatterCheck<Mode, Atomic>(table, src, indices);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:2055:5: note: in instantiation of function template specialization 'pto::MSCATTER_IMPL<pto::Coalesce::Row, pto::ScatterAtomicOp::None, pto::ScatterOOB::Undefined, pto::ScatterConflict::Last, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
    MSCATTER_IMPL<Mode>(dst, src, indexes);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:132:3: note: in instantiation of function template specialization 'pto::MSCATTER<pto::Coalesce::Row, __gm__ int *, __ubuf__ int *, __ubuf__ int *>' requested here
  MSCATTER<pto::Coalesce::Row>(v17, v28, v29);
  ^
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mscatter/mscatter/mscatter_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:301:
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:395:27: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using TIdx = typename TileIdx::DType;
                          ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MScatter.hpp:404:43: error: type '__gm__ int *' cannot be used prior to '::' because it has no members
    static_assert(std::is_same_v<typename GlobalTable::DType, __gm__ T>,
                                          ^
14 errors generated.
gmake[2]: *** [CMakeFiles/mscatter_kernel.dir/build.make:76: CMakeFiles/mscatter_kernel.dir/mscatter_kernel.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/mscatter_kernel.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
[2026-07-09 17:16:38] ERROR: testcase failed (exit 2): mscatter
mgather

stage=run info=exit=2

/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:87:25: error: cannot cast from type 'GlobalTensor<int32_t, pto::Shape<1, 1, 1, 32, 32>, pto::Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>' (aka 'GlobalTensor<int, Shape<1, 1, 1, 32, 32>, Stride<1024, 1024, 1024, 32, 1>, pto::Layout::ND>') to pointer type '__gm__ int32_t *' (aka '__gm__ int *')
  __gm__ int32_t* v11 = (__gm__ int32_t*) v10;
                        ^~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:300:
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MGather.hpp:513:24: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    using T = typename TileDst::DType;
                       ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:2004:5: note: in instantiation of function template specialization 'pto::MGATHER_IMPL<pto::Coalesce::Row, pto::GatherOOB::Undefined, __ubuf__ int *, __gm__ int *, __ubuf__ int *>' requested here
    MGATHER_IMPL<CMode>(dst, src, indexes);
    ^
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:125:3: note: in instantiation of function template specialization 'pto::MGATHER<pto::Coalesce::Row, __ubuf__ int *, __gm__ int *, __ubuf__ int *>' requested here
  MGATHER<pto::Coalesce::Row>(v26, v11, v25);
  ^
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/npu_validation/Mgather/mgather/mgather_kernel.cpp:32:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/pto-inst.hpp:30:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr.hpp:18:
In file included from /tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/common/pto_instr_impl.hpp:300:
/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/payload/pto-isa/include/pto/npu/a5/MGather.hpp:515:19: error: type '__ubuf__ int *' cannot be used prior to '::' because it has no members
    if constexpr (TileDst::Loc == TileType::Mat) {
                  ^
3 errors generated.
gmake[2]: *** [CMakeFiles/mgather_kernel.dir/build.make:76: CMakeFiles/mgather_kernel.dir/mgather_kernel.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/mgather_kernel.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
[2026-07-09 17:16:40] ERROR: testcase failed (exit 2): mgather
[2026-07-09 17:16:40] === SUMMARY ===
[2026-07-09 17:16:40] OK=4 FAIL=2 SKIP=0
[2026-07-09 17:16:40] RESULTS_TSV=/tmp/ptoas-board-monitor-a5/runs/20260709_171011_manual_pr901/remote_npu_validation_results.tsv

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.

2 participants