Repository navigation
fix(rocke): centralize dtype names and shared MXFP contracts - #12287
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
|
Follow-up to the review, which was submitted against Addressed in this PR
Deferred to follow-up
These follow-up items remain outside this PR. Intentional architectural choices / no further change planned here
Validation at Fresh native build and 11/11 CTests; 52 focused Python tests plus 26 subtests; full parity for 70 families / 780 configurations per LLVM flavor. LLVM20/22 each have 727 identical outputs and 53 matching rejections; LLVM23 has 737 identical outputs and 43 matching rejections. All 2,340 verdicts/output hashes match the parent. Also passed: 34 before/after native LLVM/HIP artifact comparisons, shared goldens for all three flavors, full-PR hooks and the relative-path guard. All 1,179 platform file hashes match the validated source. The prior Assistance: codex / astra / medium. |
CongMa13
left a comment
There was a problem hiding this comment.
Static review of 76b60c7c7bbd80d059e353487a4fdcaad260b901 found one P2 issue in the C/C++ rocke.core.arch helper mirror: the canonical catalog lookup gained a scale filter, but the helper-level rocke_archtarget_op_for_shape still drops that dimension. The latest MmaScaleDType change appears to address the existing E5M3/E5M2 discussion, so I have not duplicated that thread.
Static review only; no build, tests, or project-code execution performed.
`platform/tests/run_all.py` fails its existing architecture-isolation test after #12287 because `core/arch/wmma_scale.py` constructs LLVM intrinsic names. Move the LLVM carrier types, intrinsic names, and declaration keys into `core/isa/wmma_scale.py`, and make the ISA emitter consume that representation. Scale packing and catalog metadata remain in `core/arch`. The existing isolation guard is unchanged. Update the scaled-WMMA tests to check LLVM spelling through the ISA representation while keeping catalog assertions about fragment metadata. Native code and golden files are unchanged. ISSUE ID : AICK-2417 Validation: - Focused architecture, scaled-WMMA, catalog, and debug object tests: 78 passed plus 26 subtests. The four debug object tests use ROCm 7.14's LLVM tools. - Fresh native build and 11/11 CTests passed. - Python/C++ LLVM-IR parity covers all 70 families / 785 configurations for LLVM20, LLVM22, and LLVM23. LLVM20/22: 732 identical outputs and 53 matching rejections each; LLVM23: 742 identical outputs and 43 matching rejections. The initial LLVM22 pass hit three Python emitter timeouts; rerunning all 20 configurations in those three families passed. - Repository pre-commit hooks and relative-path guard passed. - Host `tests/run_all.py --no-gate --build-root <fresh-build>` is GREEN: 1,036 passed, 92 skipped, and 11/11 CTests. ROCm 7.14 is selected specifically for the debug object tools via `ROCKE_TEST_LLVM_BIN`. The optional `ROCKE_BACKEND=both` pytest pass is skipped because the pybind extension is not installed; native/Python comparison is covered separately by the byte-identity gates. - Full suite with `module load ubuntu-24 rocm/7.14.0`, compared with unchanged base `3066840e5a0e`: 9 failures / 1,034 passes before, 8 failures / 1,035 passes after; 92 skips in each. The removed failure is the architecture guard. Both revisions retain seven datalayout subtest failures from reference-toolchain version detection and one portable-recipe HSACO parity failure. No GPU numerical validation was performed for this Python organization change.
TheRock Submodule Bump ActivityNewest first
|

Native FP8/BF8 lookup must use canonical dtype keys, and scaled WMMA selection must distinguish matrix dtypes from scale types and their shared K-group size. This PR centralizes dtype normalization and adds a compact scaled-WMMA contract shared by the Python and C++ engines.
a_scale_dtype/b_scale_dtypefields and one sharedscale_block_k: PythonMmaScaleBlockK.K16/K32, mirrored by a C enum. All-absent metadata denotes an unscaled atom; partial contracts and invalid sizes reject.scales=(a_type, b_type, block_k); C queries accept an optionalrocke_mma_scale_filter_tpointer. An omitted filter is unconstrained; an all-absent filter explicitly selects unscaled atoms. Exact selection and largest-K ties reject ambiguity.wmma_scaledfamily. Builders emit generictile.mma. IDs extend the existing underscore convention, for examplewmma_gfx1250_f32_16x16x128_fp8_fp8_scale_e8m0_e8m0_k32; existing unscaled IDs retain their spelling.i32source elements.Compatibility: the old scaled-WMMA IDs and dedicated builder wrappers are removed without aliases; serialized IR using them must be regenerated. Native consumers must rebuild for the added fields and query argument. C++ catalog query calls may omit the trailing filter; C callers pass a filter pointer or NULL. The ArchTarget helper requires the trailing filter argument in both languages; existing unscaled helper calls pass nullptr.
Validation
The scale-helper follow-up
d6606f7d03883db907b0d5b0011bdb5b89aa2782passes the scale filter throughrocke_archtarget_op_for_shape, updates all 17 existing unscaled callers to passnullptr, and extends the catalog-row test to cover helper selection, including the real FP8/BF8 K16/K32 contracts. A fresh native Release build, 11/11 CTests, C99 header/call compilation, and full LLVM20/22/23 parity passed: 70 families and 785 configurations per flavor, with zero drift. LLVM20/22 each have 732 identical outputs and 53 matching rejections; LLVM23 has 742 identical outputs and 43 matching rejections. The regression test fails with the expected ambiguity error when the filter is deliberately dropped. Full-PR hooks passed on a byte-identical local snapshot after an NFS stall; source hashes were verified before committing. No GPU rerun was performed for this host-side forwarding change.The earlier host lookup follow-up is
0026b45992d0df58184dda254f515e6b93c2bf38: 11/11 native CTests, 52 Python tests plus 26 subtests, full LLVM20/22/23 parity, shared goldens and full-PR hooks passed. All 2,340 parity verdicts/output hashes match the parent; 34 captured native LLVM/HIP artifacts are byte-identical before/after. All 1,179 platform file hashes match the validated source. No GPU rerun was performed for this host-only change.The implementation and GPU validation below apply to parent
082651964df5de0090e65135dcb2067b2ddd38ce. All 1,178 platform source-file hashes were verified against the tested archive when committing; the worktree is clean. GPU archive SHA-256:1e6ff5ec74677a61658dbfcd7a18f363dcc5f5d3e5974dd99034cdfe72f459a9.GPU coverage is the bounded FP8/BF8 SCALE/SCALE16 suite through the Python backend against a CPU NumPy reference. Native C++ is covered by build/tests/emission parity; native C++ GPU runtime and arbitrary format combinations are outside this validation.
ISSUE ID : AICK-2056