Repository navigation
[GEMM] Add gemm_a8w8_blockscale_group32_supported - #8086
Conversation
Whether this arch has a group32 GEMM for a weight layout: the Triton group32 GEMM's arch for a row-major weight (its assert now asks the same function), bmm_a8w8_mxfp8_supported for a (16, 16)-preshuffled one, as gemm_a8w8_blockscale_bpreshuffle routes group32 scales.
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
The row-major branch states the Triton group32 GEMM's gfx950 gate itself; the Triton module and its test are main's again.
native_group32_runs_bf16 asks gemm_a8w8_blockscale_group32_supported for a 32x32 weight in the layout weight_is_stored_preshuffled keeps, instead of matching the arch name.
…he AITER floor - A native W4A8 linear no longer calls native_group32_runs_bf16. - Docs: native group32 FP8 linears need ROCm/aiter#8086 on every arch (the V4.1 performance guide, ATOM_GROUP32_WEIGHT_PRESHUFFLE, the MiniMax-M3 recipe, native_quant_linear); MXFP4 sources are never streamed, and a Linear refuses one.
* feat(dsv41): DeepSeek-V4.1-Flash on MI308X (gfx942) Runs the FP4PTPC checkpoint on gfx942, with and without DSpark: per-channel FP8 dense linears and shared expert (fused into FusedMoE's shared slot), routed experts converted from FP4 to per-channel FP8 at load and run on AITER's FlyDSL fused_moe with swiglu_limit, native group32 layers in BF16, gfx942 FP8 index formats, CSA decode split-KV and DSpark on gfx94x. * dsv41: require the FP4PTPC recipe; guard the BF16 fallback FP4PTPC without its routed experts converted to per-channel FP8 is refused with the recipe; the BF16 fallback asserts it gets no x_scale; the a8w4 attention test's take() mock returns what it is given. * dsv4: a BF16 shared-expert w2 takes the unfused activation The fused clamp-act-mul quantizes w2's input for a native group32 w2; where that w2 runs in BF16 (gfx942 at TP1/TP2) it must not. * dsv41: the FP4PTPC recipe needs a routed-expert layer pattern make_v4_quant_config converts the routed experts only on a layer pattern; a global ptpc_fp8 spec leaves them MXFP4. * dsv41: third review round The DP+EP guard reads Config.enable_expert_parallel; a native group32 linear records its BF16 fallback once (runs_bf16) and callers gate on it; Fp8MoEMethod takes fnuz_fixup; the FP4 online source reuses dequant_fp4_e2m1; the FP4PTPC recipe check uses online_pattern_spec; tests for CSA split-KV vs unsplit, the padded-source trim, the DP+EP guard and the fp4ptpc compile key. * tests: skip the FP4PTPC recipe test without AITER Its QuantizationConfig resolves AITER's QuantType; the non-GPU CI has no AITER. * dsv41: per-expert trim test; comments for the BF16 fallback The per-expert online-quant loop gets the padded MXFP4 source case; comments on wo_a, the native group32 weight and the shared-expert copy say what runs_bf16 and FNUZ do. * dsv41: the loader asks the built FusedMoE; no getattr defenses V4.1 models answer the loader's shared-expert rename from the FusedMoE they built (fuses_shared_expert), in place of a moe_quant_config probe; FusedMoEMethodBase declares need_normalize_e4m3fn_to_e4m3fnuz; MoE._fuse_shared_into_routed is read directly; the FP4PTPC recipe check also needs FP8. * dsv41: V4.1 publishes quant_config; PTPC shared staging is its own class - The V4.1 backbone and DSpark draft expose their MoE quant config as `quant_config`, which the loader's shared-expert rename already reads (as V4's); `fuses_shared_expert` and its loader hunk go. - A `runs_bf16` linear returns on every `process_weights_after_loading`. - `Config.compute_hash` loses the `fp4ptpc` factor: the text-config field is keyed by `_hf_architecture_factor` already. - `PtpcSharedStaging` takes the per-channel FP8 shared expert; `Mxfp8SharedIntoMxfp4` and the MiniMax tests are main's again. - `QueryRows.take` passes a None scale through; the BF16-Q branches go. - Tests: the draft's BF16 `project_context`, the MXFP4 hidden-pad/bias refusal, a None-scale take. * moe: rename the shared-expert staging instead of splitting it `Mxfp8SharedIntoMxfp4` (which also stages the per-channel FP8 shared expert with `ptpc`) becomes `SharedExpertStaging` in `fused_moe/shared_expert_staging.py`; `PtpcSharedStaging` goes. The `--load_dummy` return applies to the PTPC staging only. The PTPC tests use the MiniMax test's FusedMoE stand-in. * dsv41: read shared_expert_staging directly; test the quant_config contract - FusedMoE.weight_loader reads the declared `shared_expert_staging`; the rollout test double declares it too. - A test that the backbone and the draft publish `quant_config` and that the loader's `_fuse_shared_expert` asks with it; the comments say so. - DualRMSNormPerToken overrides only the launch: the reshape, allocation and return are DualRMSNormBF16's. * linear: ask AITER whether a group32 GEMM exists (needs ROCm/aiter#8086) native_group32_runs_bf16 asks gemm_a8w8_blockscale_group32_supported for a 32x32 weight in the layout weight_is_stored_preshuffled keeps, instead of matching the arch name. * dsv41: a BF16 main_proj takes the joined DSpark taps unquantized Main's in-place tap quantization (#3131) handed the draft's main_proj FP8 taps also where it runs in BF16 (gfx94x), which refuses them. * dsv41: test the BF16 wo_a projection and the BF16 context-KV fallback - `_project_out` with a BF16 `wo_a`: inverse RoPE and the strided bmm against the CPU rotation and a grouped einsum (GPU, two groups). - `_context_kv_fusion` keeps BF16 shards per stage. - `_project_taps`' docstring covers the BF16 `main_proj`. * dsv41: the _project_out docstring covers the BF16 wo_a * dsv41: FP4PTPC review fixes: fused-act scale layout, streaming, loader hook, validation, docs - Expert: the fused clamp-act-mul only for a w2 that reads its group32 or 1x128 x_scale; a per-channel w2 quantizes its own input. - A per-channel shared expert is not staged into streamed routed experts, and FP4PTPC refuses ATOM_ONLINE_QUANT_STREAMING up front. - A runs_bf16 weight keeps weight_loader_process. - validate_fp4ptpc_recipe checks every layer; online quantization of the native checkpoint is refused again. - _project_out calls the RoPE module; paged_2src shares paged_decode's _cu_count and returns one split for an empty step. - The draft's wkv_shard view stays out of _modules. - Recipe: gfx942 (MI308X) section and the AITER pin; MXFP4 sources in the online quantization docs. * dsv41 recipe: the BF16 fallback's memory per GPU at TP4 * dsv41: refuse the FP4PTPC layouts that are not run; MXFP4 linears stay refused - V4.1's MoE refuses an FP4PTPC layer whose shared expert did not fuse, and the draft refuses unconverted routed experts; this replaces validate_fp4ptpc_recipe. Expert parallel and data parallel are refused. - A Linear refuses an MXFP4 online source, as before; only MoE experts convert from MXFP4. MXFP4 sources are not streamed, as before. - Recipe: the AITER pin is ROCm/aiter#8178's merge commit. * linear: only FP8 native linears ask AITER's group32 query; document the AITER floor - A native W4A8 linear no longer calls native_group32_runs_bf16. - Docs: native group32 FP8 linears need ROCm/aiter#8086 on every arch (the V4.1 performance guide, ATOM_GROUP32_WEIGHT_PRESHUFFLE, the MiniMax-M3 recipe, native_quant_linear); MXFP4 sources are never streamed, and a Linear refuses one.
3102 (since 3f109db) builds the DSpark draft's block-32 FP8 linears through aiter's gemm_a8w8_blockscale_group32_supported (ROCm/aiter#8086); an aiter without it fails the draft with an ImportError. #7820, #7407 and #8086 are all merged, so state the requirement as an aiter main at ff2f0ce27 or later, and name the validated aiter: the #7820 head 7bec3c672 with #8086's function added (False on gfx942: the BF16 fallback, as before). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Adds
gemm_a8w8_blockscale_group32_supported(w_scale_block, bpreshuffle=False)toaiter/ops/gemm_op_a8w8.py. It reports whether this arch has a group32 (E8M0) GEMM for a weight layout, so callers stop matching arch names. ATOM's native group32 FP8 linears will use it to decide when to fall back to BF16 (ROCm/ATOM#3102).gemm_a8w8_blockscale_group32(gfx950).(16, 16)-preshuffled weight:bmm_a8w8_mxfp8_supported, the checkgemm_a8w8_blockscale_bpreshuffleuses to route group32 scales.No dispatch change.
Test
On hardware, gfx942 returns False for 1x32 and 32x32 in both layouts. gfx950 returns True for all four.