Skip to content

fix: stabilize remaining A5 board samples - #1395

Open
HecreReed wants to merge 7 commits into
hw-native-sys:mainfrom
HecreReed:codex/a5-board-fixes
Open

fix: stabilize remaining A5 board samples#1395
HecreReed wants to merge 7 commits into
hw-native-sys:mainfrom
HecreReed:codex/a5-board-fixes

Conversation

@HecreReed

Copy link
Copy Markdown
Collaborator

修复最近 A5 Nightly Board 中可复现的普通样例失败,保持 DeepSeek/Qwen 相关样例不变。

已处理:

  • Rowexpandmul/sub/div:A5 32x1 列主序广播输入布局
  • Partmin:float32 golden 与比较
  • Scatter:元素索引与 golden 生成
  • Cmp/Sel/Sels/Cmps:A5 packed mask 的输入、输出与行存储布局
  • Movfp/movfp_fixpipe_reuse:A5 VDEQF16 packed ui64 quant payload,并增加 MAT 到 SCALING 的 tmov

未处理:DeepSeek、Qwen、TquantMx 相关样例。

验证:

  • 修改的 Python 文件通过 python3 -m py_compile
  • git diff --check 通过
  • A5 真机定向回归请在评论区执行:
    /run a5 Rowexpandsub Rowexpanddiv Cmp Sel Rowexpandmul Sels Partmin Scatter Cmps Movfp

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 Rowexpandsub Rowexpanddiv Cmp Sel Rowexpandmul Sels Partmin Scatter Cmps Movfp

@reedhecre

Copy link
Copy Markdown

已接收 /run a5 Rowexpandsub Rowexpanddiv Cmp Sel Rowexpandmul Sels Partmin Scatter Cmps Movfp,A5 板测器会处理这条请求。

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

@reedhecre

Copy link
Copy Markdown

A5 板测成功

  • 触发方式:manual
  • 源码提交:91b9f60767b9
  • 结果汇总:OK 0 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260829_154206_manual_pr1395.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260829_154206_manual_pr1395.tsv
  • 手动指令:/run a5 Rowexpandsub Rowexpanddiv Cmp Sel Rowexpandmul Sels Partmin Scatter Cmps Movfp
  • 触发人:HecreReed
  • 指定用例:Rowexpandsub,Rowexpanddiv,Cmp,Sel,Rowexpandmul,Sels,Partmin,Scatter,Cmps,Movfp
  • 触发评论:fix: stabilize remaining A5 board samples #1395 (comment)

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 rowexpandsub rowexpanddiv cmp sel rowexpandmul sels partmin scatter cmps movfp_fixpipe_reuse

@reedhecre

Copy link
Copy Markdown

已接收 /run a5 rowexpandsub rowexpanddiv cmp sel rowexpandmul sels partmin scatter cmps movfp_fixpipe_reuse,A5 板测器会处理这条请求。

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

@reedhecre

Copy link
Copy Markdown

A5 板测失败

  • 触发方式:manual
  • 源码提交:91b9f60767b9
  • 结果汇总:OK 0 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260829_162206_manual_pr1395.log
  • 手动指令:/run a5 rowexpandsub rowexpanddiv cmp sel rowexpandmul sels partmin scatter cmps movfp_fixpipe_reuse
  • 触发人:HecreReed
  • 指定用例:rowexpandsub,rowexpanddiv,cmp,sel,rowexpandmul,sels,partmin,scatter,cmps,movfp_fixpipe_reuse
  • 触发评论:fix: stabilize remaining A5 board samples #1395 (comment)
  • 失败阶段:sample-build-and-test / exit=1

日志尾部

NotFoundError("cannot locate local _pto extension in _mlir_libs")
FileNotFoundError: cannot locate local _pto extension in _mlir_libs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/ptoas-board-monitor-a5/runs/20260829_162206_manual_pr1395/repo/test/samples/Sels/sels.py", line 10, in <module>
    from mlir.dialects import func, arith, pto
  File "/home/ptoas-board-monitor-a5/llvm-project-vpto-feature/build-shared/tools/mlir/python_packages/mlir_core/mlir/dialects/pto.py", line 46, in <module>
    _pto_mod = importlib.import_module(".._mlir_libs._pto", __package__)
  File "/home/anaconda3/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'mlir._mlir_libs._pto'
========== SUMMARY ==========
Cmp(cmp.py)  OK   generated: cmp-pto.cpp
Cmps(cmps.py) OK   generated: cmps-pto.cpp
Movfp(movfp_fixpipe_reuse-pto.pto) OK   generated: movfp_fixpipe_reuse-pto.cpp
Partmin(partmin.py) OK   generated: partmin-pto.cpp
Rowexpanddiv(rowexpanddiv.py) OK   generated: rowexpanddiv-pto.cpp
Rowexpandmul(rowexpandmul.py) OK   generated: rowexpandmul-pto.cpp
Rowexpandsub(rowexpandsub.py) OK   generated: rowexpandsub-pto.cpp
Scatter(scatter.py) OK   generated: scatter-pto.cpp
Sel(sel.py)  OK   generated: sel-pto.cpp
Sels(sels.py) FAIL python failed: sels.py
-----------------------------
OK=9  FAIL=1  SKIP=0
=============================
BOARD_CASE_MANIFEST=/tmp/ptoas-board-monitor-a5/runs/20260829_162206_manual_pr1395/payload/test/samples/expected_npu_validation_cases.txt (497 cases)
===== END STAGE sample-build-and-test rc=1 @ 2026-08-29 16:35:53 =====

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 sels

@reedhecre

Copy link
Copy Markdown

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

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

@reedhecre

Copy link
Copy Markdown

A5 板测失败

  • 触发方式:manual
  • 源码提交:74d55ff822e5
  • 结果汇总:OK 0 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260829_170706_manual_pr1395.log
  • 手动指令:/run a5 sels
  • 触发人:HecreReed
  • 指定用例:sels
  • 触发评论:fix: stabilize remaining A5 board samples #1395 (comment)
  • 失败阶段:sample-build-and-test / exit=1

日志尾部

ragmentation_two_holes.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_fragmentation_hole_fit.py [not in RUN_ONLY_CASES], test/samples/planmemory/plan_memory_for_iter_args_yield.py [not in RUN_ONLY_CASES], test/samples/Xors/xors.py [not in RUN_ONLY_CASES], test/samples/Xor/xor.py [not in RUN_ONLY_CASES], test/samples/VectorAddition/vectorAddition.py [not in RUN_ONLY_CASES], test/samples/VectorAddition/vadd_validshape_hyper.py [not in RUN_ONLY_CASES], test/samples/VectorAddition/vadd_validshape_dynamic.py [not in RUN_ONLY_CASES], test/samples/VectorAddition/vadd_validshape.py [not in RUN_ONLY_CASES], test/samples/VectorAddition/vadd_pto_ir.py [not in RUN_ONLY_CASES], ... (+953 more)

===== STAGE sample-build-and-test @ 2026-08-29 17:20:27 =====
export PATH=/home/anaconda3/bin:"$PATH"
bash test/samples/runop.sh --enablebc all
PTOAS_OUT_DIR=/tmp/ptoas-board-monitor-a5/runs/20260829_170706_manual_pr1395/payload/test/samples
Traceback (most recent call last):
  File "/tmp/ptoas-board-monitor-a5/runs/20260829_170706_manual_pr1395/repo/test/samples/Sels/sels.py", line 81, in <module>
    print(build())
          ~~~~~^^
  File "/tmp/ptoas-board-monitor-a5/runs/20260829_170706_manual_pr1395/repo/test/samples/Sels/sels.py", line 69, in build
    pto.TSelSOp(tb0, tb1, tb2, c64, tb3)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TSelSOp.__init__() takes 5 positional arguments but 6 were given
========== SUMMARY ==========
Sels(sels.py) FAIL python failed: sels.py
-----------------------------
OK=0  FAIL=1  SKIP=0
=============================
BOARD_CASE_MANIFEST=/tmp/ptoas-board-monitor-a5/runs/20260829_170706_manual_pr1395/payload/test/samples/expected_npu_validation_cases.txt (488 cases)
===== END STAGE sample-build-and-test rc=1 @ 2026-08-29 17:20:32 =====

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 sels

@reedhecre

Copy link
Copy Markdown

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

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

@reedhecre

Copy link
Copy Markdown

A5 板测成功

  • 触发方式:manual
  • 源码提交:132e8fd06865
  • 结果汇总:OK 1 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260829_172306_manual_pr1395.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260829_172306_manual_pr1395.tsv
  • 手动指令:/run a5 sels
  • 触发人:HecreReed
  • 指定用例:sels
  • 触发评论:fix: stabilize remaining A5 board samples #1395 (comment)

@HecreReed
HecreReed marked this pull request as ready for review August 31, 2026 01:10

@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: b395757fea

ℹ️ 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".

Comment thread lib/PTO/IR/PTO.cpp Outdated
Comment on lines +21034 to +21035
return emitOpError("expects 'scaling_tile' element type to be f16, bf16, "
"f32, or packed i64/ui64 on A5");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the A5 negative payload regression

This change makes the exact deqf16_vec/ui64 module in test/lit/pto/fixpipe_frontend_verify_set_quant_vector_bad_payload_type_a5.pto valid, but that test still runs not ptoas --pto-arch=a5 and expects the old error text. The compiler will now succeed, causing the not command—and therefore check-pto—to fail before FileCheck; replace that negative case with a still-invalid payload or convert it into a positive regression.

Useful? React with 👍 / 👎.

Comment thread lib/PTO/IR/PTO.cpp Outdated
Comment on lines +19579 to +19581
// A5 pto-isa uses packed uint64_t FBUF entries for VDEQF16, while other A5
// vector-quant forms expose direct floating-point scaling payloads.
return isPackedI64 || elemTy.isF16() || elemTy.isBF16() || elemTy.isF32();

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 Restrict packed A5 payloads to VDEQF16

When an A5 pipe uses req8_vec, qf322b8_pre_vec, or qs322bf16_pre_vec, this unconditional isPackedI64 branch also accepts an integer payload, even though the adjacent comment identifies packed FBUF entries as the VDEQF16 representation and says the other A5 forms use direct floating-point payloads. Because the caller already resolved quant but does not pass it here, such ill-typed IR passes verification and is forwarded unchanged to SET_QUANT_VECTOR; make the accepted element family depend on the referenced quant mode.

Useful? React with 👍 / 👎.

@HecreReed

Copy link
Copy Markdown
Collaborator Author

/run a5 sels

@reedhecre

Copy link
Copy Markdown

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

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

@reedhecre

Copy link
Copy Markdown

A5 板测成功

  • 触发方式:manual
  • 源码提交:4fa55f427b86
  • 结果汇总:OK 1 / FAIL 0 / SKIP 0
  • 日志:/root/ptoas-board-monitor-a5/logs/20260831_113606_manual_pr1395.log
  • 结果 TSV:/root/ptoas-board-monitor-a5/logs/20260831_113606_manual_pr1395.tsv
  • 手动指令:/run a5 sels
  • 触发人:HecreReed
  • 指定用例:sels
  • 触发评论:fix: stabilize remaining A5 board samples #1395 (comment)

@github-actions
github-actions Bot force-pushed the main branch 2 times, most recently from 4687426 to 7e2ec3e Compare September 4, 2026 10:01
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