fix: Add AccPhase support for matmul and gemv ops#700
Conversation
Codex Review该评论由 review 机器人自动更新。
SummaryPR #700的 AccPhase 支持存在覆盖缺口:mixed-precision 的 accumulate/bias matmul/gemv 变体仍然不会携带或下发该模板参数。 Findings
The new feature is wired through |
There was a problem hiding this comment.
Code Review
This pull request introduces precision mode attributes for various mathematical operations (such as division, exponentiation, logarithm, square root, etc.) and accumulation phase attributes for matrix multiplication and GEMV operations in the PTO dialect. It also updates the verification logic, the conversion patterns to EmitC, and the view-to-memref lowering passes to propagate these attributes correctly. The review feedback correctly identifies a critical issue in the EmitC conversion patterns for TGEMV_BIAS, TMATMUL_BIAS, and TMATMUL_MX. Because these underlying C++ functions are void and modify buffers in-place, generating an emitc::CallOpaqueOp with non-empty result types produces invalid C++ assignments (e.g., auto var = TGEMV_BIAS(...)) that will fail compilation. The suggested fixes correctly replace these patterns to use TypeRange{} and replace the MLIR operations with the destination buffer dst instead.
|
/review |
731563a to
3840b8e
Compare
Manual Codex Review该评论由
Summary收到 FindingsReview in progress. |
Manual Codex Review该评论由
SummaryPR #700 has a TableGen build blocker plus several accPhase integration gaps that currently break codegen and CI. Findings
The new A5 FileCheck expectations use |
995c088 to
849a301
Compare
|
/run a3 |
|
已接收
页面会自动刷新,可以直接看当前阶段、排队情况和最近结果。 |
A3 板测失败
失败用例
|
A3 板测失败详情:PR #700syncall_binding
tprefetch_async_binding
|
|
/review |
Manual Codex Review该评论由
Summary收到 FindingsReview in progress. |
Manual Codex Review该评论由
SummaryPR #700 regresses Findings
|
Summary
Add
AccPhasesupport for matmul/gemv-related PTO ops and lower it tothe corresponding
pto-isatemplate arguments.Affected ops
pto.tmatmulpto.tmatmul.accpto.tmatmul.biaspto.tmatmul.mxpto.tgemvpto.tgemv.accpto.tgemv.biaspto.tgemv.mxChanges
PTO_AccPhaseAttraccPhaseon the affected PTO ops with defaultUnspecifiedaccPhaseinPTOViewToMemrefaccPhaseto EmitC / generated C++ template argumentsPartial/FinalcasesValidation
Validated in a clean worktree on
dev-481211.Passed FileCheck-based tests:
tmatmul_accphase_emitc.ptotgemv_accphase_emitc.ptotmatmul_mx_accphase_emitc.ptotgemv_mx_accphase_emitc.ptoVerified generated forms include:
pto::AccPhase::Partialpto::AccPhase::Final