-
Notifications
You must be signed in to change notification settings - Fork 572
[Triton/Gluon] Add gluon support for MXFP4 and MXFP8 quant kernel in gfx1250 #4894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NimitPtl
wants to merge
16
commits into
main
Choose a base branch
from
quant_mxfp8_gfx950_1250_v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4c69d41
Add MXFP4/MXFP8 gfx950/gfx1250 gluon quant kernels
NimitPtl f49c1e0
updating licensing text for newely added files
NimitPtl d998bea
Minor updates
NimitPtl 7b039fc
Working gluon with at par triton performance. M<8 has test failures
NimitPtl 92e10d0
single barrier version
NimitPtl 5228a61
Fine tuning
NimitPtl 5857e54
Merge branch 'main' into quant_mxfp8_gfx950_1250_v2
NimitPtl cd3aec1
Make test case pass for larger block sizes.
NimitPtl c30ac24
addition shapes for testing larger shapes
NimitPtl da99ef5
Remove gfx950 quant kernel and inputs.json, keep gfx1250-only changes
NimitPtl 9d1163f
Merge branch 'main' into quant_mxfp8_gfx950_1250_v2
NimitPtl f846de7
Resolving MXFP4 test issues
NimitPtl fc939d4
Merge branch 'main' into quant_mxfp8_gfx950_1250_v2
NimitPtl 608e478
Fix fp8 TDM async_store corruption on gfx1250, retune large-M mxfp8 b…
NimitPtl 296d8dc
Merge branch 'main' into quant_mxfp8_gfx950_1250_v2
NimitPtl 066a9f7
Merge branch 'main' into quant_mxfp8_gfx950_1250_v2
NimitPtl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
11 changes: 11 additions & 0 deletions
11
aiter/ops/triton/configs/gfx1250/gluon/quant/quant_mxfp8/DEFAULT.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "M_LEQ_512_K_LEQ_1024": { "BLOCK_SIZE_M": 32, "BLOCK_SIZE_N": 128, "NUM_ITER": 1 }, | ||
| "M_LEQ_512_K_GT_1024_LEQ_3072": { "BLOCK_SIZE_M": 32, "BLOCK_SIZE_N": 128, "NUM_ITER": 1 }, | ||
| "M_LEQ_512_K_GT_3072": { "BLOCK_SIZE_M": 32, "BLOCK_SIZE_N": 128, "NUM_ITER": 1 }, | ||
| "M_GT_512_LEQ_4096_K_LEQ_1024": { "BLOCK_SIZE_M": 32, "BLOCK_SIZE_N": 128, "NUM_ITER": 1 }, | ||
| "M_GT_512_LEQ_4096_K_GT_1024_LEQ_3072": { "BLOCK_SIZE_M": 64, "BLOCK_SIZE_N": 128, "NUM_ITER": 1 }, | ||
| "M_GT_512_LEQ_4096_K_GT_3072": { "BLOCK_SIZE_M": 64, "BLOCK_SIZE_N": 128, "NUM_ITER": 2 }, | ||
| "M_GT_4096_K_LEQ_1024": { "BLOCK_SIZE_M": 64, "BLOCK_SIZE_N": 128, "NUM_ITER": 1, "NUM_BUFFERS": 2 }, | ||
| "M_GT_4096_K_GT_1024_LEQ_3072": { "BLOCK_SIZE_M": 64, "BLOCK_SIZE_N": 256, "NUM_ITER": 2, "NUM_BUFFERS": 1 }, | ||
| "M_GT_4096_K_GT_3072": { "BLOCK_SIZE_M": 64, "BLOCK_SIZE_N": 256, "NUM_ITER": 2, "NUM_BUFFERS": 1 } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # SPDX-License-Identifier: MIT | ||
| # Copyright (C) 2024-2026, Advanced Micro Devices, Inc. All rights reserved. | ||
|
|
||
| import functools | ||
|
|
||
| from aiter.ops.triton.utils._triton import arch_info | ||
| from aiter.ops.triton.utils.config_utils import ( | ||
| AITER_TRITON_CONFIGS_PATH, | ||
| USE_LRU_CACHE, | ||
| load_config_json, | ||
| ) | ||
|
|
||
|
|
||
| @functools.lru_cache(maxsize=256 if USE_LRU_CACHE else 0) | ||
| def _get_quant_config_cached(config_name: str, backend: str, key: str) -> dict: | ||
| dev = arch_info.get_arch() | ||
| d_type = config_name.lower().replace("-", "_") | ||
| config_dict = load_config_json( | ||
| f"{AITER_TRITON_CONFIGS_PATH}/{dev}/{backend}/quant/{d_type}/DEFAULT.json" | ||
| ) | ||
| if key not in config_dict: | ||
| raise KeyError( | ||
| f"No matching config in '{config_name}' for key={key!r} on arch " | ||
| f"{dev} backend={backend!r} (keys present: {sorted(config_dict)})." | ||
| ) | ||
| return config_dict[key] | ||
|
|
||
|
|
||
| def get_quant_config(config_name: str, key: str, backend: str = "gluon") -> dict: | ||
| """Load a tuned quant kernel block-config bucket for the running GPU arch. | ||
|
|
||
| Follows the nested config layout | ||
| ``configs/<arch>/<backend>/quant/<d_type>/DEFAULT.json``, where ``<d_type>`` | ||
| is ``config_name.lower().replace("-", "_")`` (mirrors | ||
| ``gemm_config_utils._dtype_dir()``). | ||
|
|
||
| Parameters: | ||
| - config_name: e.g. "QUANT-MXFP4", "QUANT-MXFP8". | ||
| - key: bucket key inside DEFAULT.json, e.g. "M_LEQ_512_N_LEQ_3072". | ||
| Bucket boundaries are the caller's concern; this loader does a single | ||
| exact-key lookup, no bucket-walk. | ||
| - backend: "triton" or "gluon". | ||
|
|
||
| Returns a shallow copy of the bucket dict (safe to mutate). | ||
|
|
||
| Raises KeyError if the bucket key isn't present in the file, or | ||
| FileNotFoundError if DEFAULT.json itself is missing. | ||
| """ | ||
| return _get_quant_config_cached(config_name, backend, key).copy() |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.