Add a8w4 kernel for Quark mix-precision#837
Open
amd-xiaoyu12 wants to merge 1 commit into
Open
Conversation
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
Add a modified A8W4 preshuffle GEMM kernel (from v0.1.7) at kernels/gemm/preshuffle_gemm_a8w4.py.
Port the A8W4 kernel to the current FlyDSL kernels/gemm/ layout and kernels.mma.* imports.
Include the ragged-M OOB fix by sizing A/C buffer descriptors with exact runtime num_records_bytes, preventing out-of-bounds reads/writes for non-tile-aligned M.
Quark integration: https://gitenterprise.xilinx.com/AMDNeuralOpt/Quark/pull/5866
Test Plan
Finished end to end test on Quark diffusion model Wan2.2 mix precision - w4a4/w4a8.
Compile verification:
python -m py_compile kernels/gemm/preshuffle_gemm_a8w4.py.
GPU correctness/perf tests not run locally. Recommended follow-up: run the A8W4 ragged-M validation on gfx950 with the Quark integration test once the Quark patch is applied.
Test Result
Submission Checklist