Repository navigation
add a8w8 fp8 ck gemm tune support - #1782
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds FP8 (8-bit floating point) support to the CK GEMM tuning infrastructure, expanding beyond the existing INT8 quantization. The changes enable tuning and execution of GEMM operations with FP8 quantized inputs while maintaining the existing INT8 functionality.
Key changes:
- Extended instance generation to support both INT8 and FP8 kernel variants during tuning
- Added FP8 data generation and reference computation paths in the Python tuning script
- Modified the CUDA kernel dispatcher to handle both INT8 and FP8 input types with appropriate template parameters
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| csrc/ck_gemm_a8w8/gen_instances.py | Refactored instance generation to create separate I8 and F8 kernel instances for tuning with appropriate dtype template parameters |
| csrc/ck_gemm_a8w8/gemm_a8w8_tune.py | Added quant_dtype parameter support, FP8 data generation logic, and updated reference computation to handle both I8 and FP8 quantization types |
| csrc/ck_gemm_a8w8/gemm_a8w8_tune.cu | Updated kernel dispatcher to detect input dtype (I8 vs FP8) and dispatch to appropriate kernel templates with matching scale dtypes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
LGTM |
yadaish
previously approved these changes
Jan 8, 2026
yzhou103
reviewed
Jan 9, 2026
Contributor
|
LGTM |
yzhou103
approved these changes
Jan 12, 2026
yadaish
self-requested a review
January 12, 2026 06:01
yadaish
approved these changes
Jan 12, 2026
zhuyuhua-v
pushed a commit
that referenced
this pull request
Jan 14, 2026
* add a8w8 fp8 tune support * add q_dtype_w to deal with different type and refine config csv file --------- Co-authored-by: solin <[email protected]> Co-authored-by: yzhou103 <[email protected]>
valarLip
pushed a commit
that referenced
this pull request
Mar 18, 2026
* add a8w8 fp8 tune support * add q_dtype_w to deal with different type and refine config csv file --------- Co-authored-by: solin <[email protected]> Co-authored-by: yzhou103 <[email protected]>
ThomasNing
pushed a commit
to ThomasNing/aiter
that referenced
this pull request
Sep 19, 2026
…pandas
get_CKGEMM_config's own default raises. Calling it as documented --
get_CKGEMM_config(M, N, K), no tuned_file -- loads
configs/a8w8_tuned_gemm.csv and dies with
ValueError: DataFrame index must be unique for orient='index'
which names neither the file, nor the shapes, nor the reason.
The reason is a schema that grew a key column and only one reader
learned. ROCm#1782 (2026-01-12) added q_dtype_w to a8w8_tuned_gemm.csv, so it
holds an int8 row and an fp8 row for the same shape -- for gfx950/256 at
M=1 N=1280 K=8192, 17.69 us on a8w8_rowwise_256x16x64x512 and 7.68 us on
a8w8_rowwise_128x16x32x128. Both are correct; they are different kernels
for different weight dtypes. ROCm#2645 (2026-04-17) then gave
get_CKGEMM_config a (gfx, cu_num, M, N, K) index, five columns for a
six-column key. 42 shapes collide. get_GEMM_config_with_quant_type keys
on all six and reads the file correctly.
This has been latent since April because every in-tree caller passes an
explicit tuned_file. It surfaces here because this branch's miss
recorder has a `uses_quant_schema = tuned_file is None` path that is
unreachable -- the load raises before any miss can be recorded.
So the load now says what is wrong:
/app/aiter-test/aiter/configs/a8w8_tuned_gemm.csv is not uniquely
keyed by ('gfx', 'cu_num', 'M', 'N', 'K'): 42 shape(s) carry more
than one row. Its rows are distinguished by q_dtype_w
(torch.float8_e4m3fn, torch.int8), which this lookup does not key on
-- use get_GEMM_config_with_quant_type() for this table.
Deliberately not changed: the default tuned_file, and which rows win.
Silently picking one of two kernels that differ 2.3x would be worse than
refusing. This makes the existing failure legible; choosing a default
that works is a separate decision with an owner.
The two index branches also collapse into one -- they differed only in
the column list and the warning.
Tests: the colliding table produces a message naming the file, the shape
count, q_dtype_w and the right function; and a uniquely-keyed table is
accepted, so the guard can distinguish the two rather than always
firing. 16 passed on MI350X, and the production blockscale-bpreshuffle
lookup is unaffected.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
5 of 9 tasks
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