Skip to content

Support low precision A5 tmatmul types#817

Open
jimmychou0 wants to merge 1 commit into
hw-native-sys:mainfrom
jimmychou0:issue810-tmatmul-low-precision
Open

Support low precision A5 tmatmul types#817
jimmychou0 wants to merge 1 commit into
hw-native-sys:mainfrom
jimmychou0:issue810-tmatmul-low-precision

Conversation

@jimmychou0

Copy link
Copy Markdown
Contributor

Summary:

  • Support PTO-ISA low precision input pairs for A5 tmatmul and tmatmul.mx verifiers.
  • Allow tmatmul.mx.bias low precision operands and align MX type checks with fp8/fp4 supported pairs.
  • Add positive/negative lit coverage and document the supported type combinations.

Validation:

  • ninja -C build-local-vpto ptoas
  • llvm-lit -v build-local-vpto/test/lit --filter='tmatmul'
  • git diff --check

Related to #810

@reedhecre

reedhecre commented Jun 15, 2026

Copy link
Copy Markdown

Codex Review

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

  • PR: Support low precision A5 tmatmul types #817 Support low precision A5 tmatmul types
  • Author: jimmychou0
  • Base/Head: main / issue810-tmatmul-low-precision
  • Head SHA: 5b1f67a982e6
  • Trigger: PR 有新提交
  • Generated At: 2026-06-15T09:06:07Z
  • Previous Head SHA: 71d3bc378c56
  • Status: failed at codex-review (exit=1)

Summary

Review failed at stage codex-review: exit=1

Findings

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

Log Tail

git diff --stat 'origin/main...HEAD' || true
Cloning into '/tmp/ptoas-pr-review-monitor/runs/20260615_170527_pr817/repo'...
From https://github.com/hw-native-sys/PTOAS
 * [new ref]         refs/pull/817/head -> pr-817
From https://github.com/hw-native-sys/PTOAS
 * branch            main       -> FETCH_HEAD
Switched to branch 'pr-817'
5b1f67a982e655f92e5ca4947a4004a79254ec35
 docs/PTO_IR_manual.md                              |  24 +-
 lib/PTO/IR/PTO.cpp                                 | 253 ++++++++++++++++-----
 test/lit/pto/tgemv_mx_accphase_emitc.pto           |   4 +
 test/lit/pto/tgemv_mx_emitc.pto                    |   2 +-
 test/lit/pto/tgemv_mx_variants_emitc.pto           |   2 +-
 test/lit/pto/tmatmul_low_precision_emitc.pto       |  31 +++
 test/lit/pto/tmatmul_low_precision_invalid_a5.pto  |  13 ++
 test/lit/pto/tmatmul_mx_accphase_emitc.pto         |  20 +-
 test/lit/pto/tmatmul_mx_emitc.pto                  |  36 +--
 test/lit/pto/tmatmul_mx_f8e5m2_emitc.pto           |  10 +-
 .../pto/tmatmul_mx_low_precision_invalid_a5.pto    |  15 ++
 .../tmatmul_mx_low_precision_variants_emitc.pto    |  25 ++
 test/lit/pto/tmatmul_mx_scale_invalid_a5.pto       |  15 ++
 13 files changed, 356 insertions(+), 94 deletions(-)
===== END STAGE clone rc=0 @ 2026-06-15 17:05:33 =====

===== STAGE codex-review @ 2026-06-15 17:05:33 =====
set -euo pipefail
cd '/tmp/ptoas-pr-review-monitor/runs/20260615_170527_pr817/repo'
'codex' exec -C '/tmp/ptoas-pr-review-monitor/runs/20260615_170527_pr817/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/20260615_170527_pr817/review_schema.json' -o '/tmp/ptoas-pr-review-monitor/runs/20260615_170527_pr817/codex_last_message.json' --color never - < '/tmp/ptoas-pr-review-monitor/runs/20260615_170527_pr817/review_prompt.txt'
OpenAI Codex v0.115.0 (research preview)
--------
workdir: /tmp/ptoas-pr-review-monitor/runs/20260615_170527_pr817/repo
model: gpt-5.4
provider: codereview
approval: never
sandbox: read-only
reasoning effort: xhigh
reasoning summaries: none
session id: 019eca87-6dd5-7211-9884-2dcfebe1750f
--------
user
你现在在审查 GitHub PR。

仓库:hw-native-sys/PTOAS
PR:#817 Support low precision A5 tmatmul types
作者:jimmychou0
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 #817 存在问题,并返回 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 503 Service Unavailable: Service temporarily unavailable, url: https://codex.0u0o.com/responses, request id: 4b164584-3b84-4b83-8cfc-0844963611c7)
Reconnecting... 2/5 (unexpected status 503 Service Unavailable: Service temporarily unavailable, url: https://codex.0u0o.com/responses, request id: ee6ee3be-c52f-451b-bfb6-eede68bb33ef)
Reconnecting... 3/5 (unexpected status 503 Service Unavailable: Service temporarily unavailable, url: https://codex.0u0o.com/responses, request id: e8b11b5d-ba56-4e76-83c1-de53aa2726bb)
Reconnecting... 4/5 (unexpected status 503 Service Unavailable: Service temporarily unavailable, url: https://codex.0u0o.com/responses, request id: a4260bc4-7b70-48da-88a0-048b26710e59)
Reconnecting... 5/5 (unexpected status 503 Service Unavailable: Service temporarily unavailable, url: https://codex.0u0o.com/responses, request id: 65157493-f310-4843-ac2d-beb14850aead)
ERROR: unexpected status 503 Service Unavailable: Service temporarily unavailable, url: https://codex.0u0o.com/responses, request id: 6e979ff5-0cba-42a9-8838-dd90f0547f4f
Warning: no last agent message; wrote empty content to /tmp/ptoas-pr-review-monitor/runs/20260615_170527_pr817/codex_last_message.json
===== END STAGE codex-review rc=1 @ 2026-06-15 17:06:07 =====

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the PTO IR manual and verifier implementation to support low-precision matrix multiplication operations (such as fp8 and fp4) on A5 targets, adding runtime dimension checks and corresponding test cases. The review feedback suggests improving code reuse by forward-declaring and sharing the 'isA5MxFp8InputType' helper function instead of duplicating it as a local lambda. Additionally, it recommends validating both contracting dimensions ('lhsValid[1]' and 'rhsValid[0]') in 'verifyA5MxMatTileOperands' to ensure robust validation when one of the dimensions is dynamic.

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 lib/PTO/IR/PTO.cpp
Comment thread lib/PTO/IR/PTO.cpp
Comment thread lib/PTO/IR/PTO.cpp
@jimmychou0 jimmychou0 force-pushed the issue810-tmatmul-low-precision branch 4 times, most recently from a4560d6 to 71d3bc3 Compare June 15, 2026 07:00
@jimmychou0 jimmychou0 force-pushed the issue810-tmatmul-low-precision branch from 71d3bc3 to 5b1f67a Compare June 15, 2026 09:01
@jimmychou0 jimmychou0 marked this pull request as ready for review June 15, 2026 09:31
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