Conversation
paulzzy
left a comment
There was a problem hiding this comment.
This duplicates a hard-coded instruction encoding in two patch passes:
comgr-hotswap-patch-wmma-scale16.cppcomgr-hotswap-patch-wmma-split.cpp
Both independently recognize the same B0 instruction using 0xd0310000 and 0x00100000. That creates two semantic sources of truth and conflicts with amd/comgr/AGENT_CONVENTIONS.md, which requires instruction handling through the MC layer rather than duplicated opcode bytes.
I understand the A0 decoder may not represent this legacy B0 opcode directly, so a documented exception may be necessary. It should still be one shared helper with named ISA fields, an upstream issue/TODO explaining the MC-layer gap, and shared positive plus near-miss negative tests. Please refactor this before merging so the split and scale16 passes cannot drift apart.
paulzzy
left a comment
There was a problem hiding this comment.
The previous hard-coded decoder concern still applies, and I found two additional P1 numerical blockers in the exact current head c76267569454.
-
M32 maps Scale16 scale operands through the active SRC0/SRC1 VGPR-MSB banks (
comgr-hotswap-patch-wmma-scale16.cpparound 733-742 and 1580-1583). Scale-prefix operands ignore VGPR-MSB and always address bank zero. With SRC0 bank 1, for example, this deinterleaves physicalv296:v297while the generated WMMA scale operandv40consumes physical bank-zerov40. The same wrong physical mapping corrupts forward-dead analysis and scratch reservation. The current positive test uses only mode zero and masks the issue. -
Generated M32
s_set_vgpr_msbtransitions do not drain XCNT. Signed #3577 addeds_wait_xcnt 0before changed modes; M32 emits repeated transitions around VALU/WMMA scale permutations and save/restore operations without those waits. The WMMA hazardv_nopdoes not address XNACK replay under a later mapping.
The branch also does not actually descend from signed #3577 2c6a7286; it lacks the final bank-zero, XCNT, generated-operand, and reuse fixes despite declaring that dependency. Rebase requires real semantic conflict resolution, not a mechanical move.
Please rebase the clean M32 feature onto signed #3577, keep scale inputs and their liveness in bank zero, inherit/assert XCNT waits, and centralize the legacy B0 encoding exception used by scale16/split/control-flow code. Add nonzero-MSB bank-zero scale, later Scale/Scale16 liveness, immediate-C/neg_hi/refusal, split-bank scratch, and tensor-mask coexistence regressions.
Finally, the 2,685/2,685 evidence is translation/ELF/idempotence only; it does not establish M32 numerical equivalence. An executable trusted numerical comparison is still required. Current formatter and GCC/C++17 SCOPED_TRACE(StringRef) CI failures also remain.
|
Review repair is now pushed at Resolved correctness findings:
Focused results on the repaired cumulative head:
Qualification verdict remains INCONCLUSIVE. A clean dependency probe found that this change does not build on #3577 alone: it also consumes the #3610 finite-indirect-flow API, the #3618 current/final-liveness API, and bank-aware helper work from the broader cumulative stack. The PR therefore remains draft. Full |
ddb38ea to
a655e97
Compare
a655e97 to
ddb38ea
Compare
Current-amd-staging review snapshot of the exact ROCm#3598 split 09-m32-wmma.
Add dedicated gfx1250 real records for the legacy d031 load and store forms. Model their zero dim, dmask, and unused vaddr4 fields while keeping canonical assembly on the existing d071 records. Normalize legacy decoder results to the canonical tensor opcodes before operand post-processing so MC clients observe the existing 12-byte instruction model. Cover d2 and d4 load and store forms in both B0 and A0 feature states, and retain the canonical encoder bytes. (cherry picked from commit 2774376fc88c615b723ccf573c91fc2f4d450a5e) (cherry picked from commit 63c2b1e)
Lower regular-scale M32 WMMA into two exact M16 operations and select MATRIX_SCALE_ROW1 for the upper M half. Replace the M32 Scale16 in-place A and scale mutation with a non-mutating scratch schedule. Keep masked A in one contiguous bank-zero interval, gather the four generated scales into dedicated bank-zero registers, and process M0 low/high before M1 low/high. Do not require all 13 scratch registers to be contiguous. When a full dead interval is unavailable, allocate the eight masked-A registers as one block and the four scales plus temporary from independent dead low-bank slots. This avoids unnecessary VGPR growth and the associated metadata-size rewrite failure. Add focused regular-scale, bank-zero, non-mutating, and split-scratch regressions. Co-authored-by: Harsh Menon <harsh.menon@amd.com> (cherry picked from commit bd3c632)
Remove the M32 raw-byte tensor/VOP3 classifiers now that the AMDGPU MC dependency decodes legacy gfx1250 tensor DMA aliases as canonical 12-byte instructions. Let control-flow, VGPR-MSB, and physical-liveness analyses consume the canonical MCInsts through their ordinary paths. Drop the classifier-only unit test; the LLVM MC and COMGR integration tests cover the real encodings. (cherry picked from commit 452bd26)
Assemble legacy gfx1250 tensor load and store d2 and d4 forms through the new LLVM MC records. Verify canonical 12-byte decode boundaries and reuse of the existing tensor-load mask wrappers. Check that stores keep their canonical operands without receiving the load-only wrapper. Also cover ELF validity and byte-identical A0 rewrite. (cherry picked from commit 1dc3ae15754bddb45b591db7533c8044f476db3a) (cherry picked from commit 4f76e86)
ddb38ea to
2cb3c31
Compare
Scope
Lower M32 block-16 scale16 WMMA exactly through four block-32 operations with conservative overlap and continuation-liveness checks.
Review fixes
The review repair commits on this branch:
neg_hi, and A0-to-A0 idempotence.The temporary exact encoding classifier is tracked by #3638 so it can be replaced by an installed MC/TargetParser API.
Review range and dependencies
3c9a16b20ea0f5a99563b33c41b7e8f64792994edc80021da911b5d1f4be07182c436784122e1dafanda655e97001fbaf18ab48cffe2d162d45fed0282fThe dependency audit found that this feature is not buildable on #3577 alone. It also consumes the finite-indirect-control-flow API represented by #3610, the current/final liveness API represented by #3618, and bank-aware helper changes from the larger cumulative stack. The clean-fork base currently imports that broader stack, so this upstream Files changed view remains cumulative.
Review status
Draft and not ready to merge. The branch must be reduced to a complete, explicit, buildable prerequisite chain after those dependencies settle. Do not merge the cumulative snapshot.
#3598 remains unchanged as the immutable 2,685/2,685 integration reference; that historical result is not a corpus qualification claim for this repaired head.
Validation of repaired cumulative head
HotswapMCTests: 214/214 PASSgit diff --check: PASSFull
check-comgr, ASAN, baseline/candidate corpus comparison, and MI400-3 qualification were intentionally not started because the review/dependency/scope gate remains unresolved. They are required after the PR is made independently reviewable and buildable.