Add SVD quant for Quark - #957
Draft
amd-xiaoyu12 wants to merge 6 commits into
Draft
Conversation
The a8w4 kernel referenced kernels.mma.* (old flat layout) which does not exist in the kernels/gemm + kernels/common layout, so the module failed to import. Point the imports at kernels.common.mma.*. Also forward the epilogue kwarg (none/bias/bias_relu/bias_silu/bias_gelu) from compile_preshuffle_gemm_a8w4 to compile_preshuffle_gemm_a8 so Quark's fused-bias w4a8 path works.
Port the fused epilogue (none/bias/bias_relu/bias_silu/bias_gelu, tanh-approx GELU) into launch_gemm: add arg_bias + epilogue constexpr, fold per-N bias and activation into the C store in f32. Bit-identical to the dedicated preshuffle_gemm_a8w4 bias path (cosine 1.0); activations match torch. Add tests/kernels/test_a8w4_preshuffle.py covering the fp8-A path against a bf16 reference (cosine/max/min/abs/pct metrics, ragged M, 3x repeatability) and all epilogue variants. Drop the stale 'fp8-A not yet supported' skip in test_preshuffle_gemm.py (that test only ever launches fp4-A; a8w4 is now covered by the new file). fp8-A works and is bit-exact vs the dedicated a8w4 kernel. Note: tile_n=64 is a known-degraded config (cosine ~0.957 vs bf16) tracked separately; the small-N test case relaxes its cosine floor accordingly.
Provide the gfx950 fused low-rank epilogue required by Quark without expanding the generic MXFP4 GEMM path. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist