[Triton/Gluon] Satya/unify gluon a8w8 blockscale config resolution - #4947
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
There was a problem hiding this comment.
Pull request overview
This PR centralizes GEMM config directory resolution across Triton/Gluon backends and migrates Gluon A8W8 blockscale config lookup toward the nested <arch>/<backend>/gemm/<dtype_dir>/ layout, adding new nested config JSONs for gfx950/gfx1250.
Changes:
- Added a shared
resolve_config_dir()helper and refactoredget_gemm_config()to use it for nested-vs-legacy probing. - Updated Gluon
gemm_a8w8_blockscaleto use the shared resolver and loadDEFAULT.jsonin the nested layout. - Added new nested Gluon config JSONs for
GEMM-A8W8_BLOCKSCALEandGEMM-A8W8_BLOCKSCALE_PRESHUFFLEDfor gfx950/gfx1250.
Reviewed changes
Copilot reviewed 2 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| aiter/ops/triton/utils/gemm_config_utils.py | Adds resolve_config_dir() and refactors GEMM config probing to reuse it. |
| aiter/ops/triton/gluon/gemm_a8w8_blockscale.py | Switches Gluon A8W8 blockscale config resolution to resolve_config_dir() and nested DEFAULT.json. |
| aiter/ops/triton/configs/gfx950/gluon/gemm/gemm_a8w8_blockscale/DEFAULT.json | Adds nested default config for gfx950 Gluon A8W8 blockscale. |
| aiter/ops/triton/configs/gfx950/gluon/gemm/gemm_a8w8_blockscale/GEMM-A8W8_BLOCKSCALE-N=7168-K=256.json | Adds gfx950 Gluon specialized config (N=7168, K=256). |
| aiter/ops/triton/configs/gfx950/gluon/gemm/gemm_a8w8_blockscale/GEMM-A8W8_BLOCKSCALE-N=7168-K=2048.json | Adds gfx950 Gluon specialized config (N=7168, K=2048). |
| aiter/ops/triton/configs/gfx950/gluon/gemm/gemm_a8w8_blockscale/GEMM-A8W8_BLOCKSCALE-N=512-K=7168.json | Adds gfx950 Gluon specialized config (N=512, K=7168). |
| aiter/ops/triton/configs/gfx950/gluon/gemm/gemm_a8w8_blockscale/GEMM-A8W8_BLOCKSCALE-N=4608-K=7168.json | Adds gfx950 Gluon specialized config (N=4608, K=7168). |
| aiter/ops/triton/configs/gfx950/gluon/gemm/gemm_a8w8_blockscale/GEMM-A8W8_BLOCKSCALE-N=3072-K=1536.json | Adds gfx950 Gluon specialized config (N=3072, K=1536). |
| aiter/ops/triton/configs/gfx950/gluon/gemm/gemm_a8w8_blockscale/GEMM-A8W8_BLOCKSCALE-N=2112-K=7168.json | Adds gfx950 Gluon specialized config (N=2112, K=7168). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale/DEFAULT.json | Adds nested default config for gfx1250 Gluon A8W8 blockscale. |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/DEFAULT.json | Adds nested default config for gfx1250 Gluon A8W8 blockscale preshuffled. |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=8192-K=1536.json | Adds gfx1250 Gluon preshuffled specialized config (N=8192, K=1536). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=8192-K=1024.json | Adds gfx1250 Gluon preshuffled specialized config (N=8192, K=1024). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=768.json | Adds gfx1250 Gluon preshuffled specialized config (N=7168, K=768). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=4096.json | Adds gfx1250 Gluon preshuffled specialized config (N=7168, K=4096). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=3072.json | Adds gfx1250 Gluon preshuffled specialized config (N=7168, K=3072). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=7168-K=16384.json | Adds gfx1250 Gluon preshuffled specialized config (N=7168, K=16384). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=65536-K=1536.json | Adds gfx1250 Gluon preshuffled specialized config (N=65536, K=1536). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=6144-K=7168.json | Adds gfx1250 Gluon preshuffled specialized config (N=6144, K=7168). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=4096-K=8192.json | Adds gfx1250 Gluon preshuffled specialized config (N=4096, K=8192). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=4096-K=4096.json | Adds gfx1250 Gluon preshuffled specialized config (N=4096, K=4096). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=4096-K=2048.json | Adds gfx1250 Gluon preshuffled specialized config (N=4096, K=2048). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=32768-K=1024.json | Adds gfx1250 Gluon preshuffled specialized config (N=32768, K=1024). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=2048-K=7168.json | Adds gfx1250 Gluon preshuffled specialized config (N=2048, K=7168). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=16384-K=1536.json | Adds gfx1250 Gluon preshuffled specialized config (N=16384, K=1536). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=1536-K=7168.json | Adds gfx1250 Gluon preshuffled specialized config (N=1536, K=7168). |
| aiter/ops/triton/configs/gfx1250/gluon/gemm/gemm_a8w8_blockscale_preshuffled/GEMM-A8W8_BLOCKSCALE_PRESHUFFLED-N=1536-K=4096.json | Adds gfx1250 Gluon preshuffled specialized config (N=1536, K=4096). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
409dde5 to
d9ccb7d
Compare
d9ccb7d to
79c2560
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 28 changed files in this pull request and generated no new comments.
Suppressed comments (1)
aiter/ops/triton/gluon/gemm_a8w8_blockscale.py:995
- The device-availability error message still says "requires CDNA4", but
arch_info.is_gluon_avail()returns true for both gfx950 and gfx1250. This message will mislead users running on gfx1250 (which is now documented as supported).
"Gluon implementation is not supported on this device (requires CDNA4)."
)
# This family's configs live in the nested layout, so its directory is the
# only candidate and the returned name prefix is always empty: nested files
e38d981 to
7d078b3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 28 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
aiter/ops/triton/gluon/gemm_a8w8_blockscale.py:991
- The error message is out of date:
arch_info.is_gluon_avail()currently allows bothgfx950andgfx1250, so saying it "requires CDNA4" is misleading and makes triage harder on non-gfx950 devices.
"Gluon implementation is not supported on this device (requires CDNA4)."
…onfig resolution Add resolve_config_dir(), the shared op-parameterized directory probe from configs/CLAUDE.md section 5 step 1, and refactor _get_gemm_config_cached onto it behavior-identically. Rewrite the last hand-built config path in gluon/gemm_a8w8_blockscale.py to use the probe (the custom _SUPPORTED_TILES bucket walk is preserved), move the 25 gluon GEMM-A8W8_BLOCKSCALE(_PRESHUFFLED) configs from configs/gemm/gluon/ into configs/<arch>/gluon/gemm/<d_type>/, and drop the flat-layout fallback from the caller: with its own family nested, the nested directory is the only candidate it needs. Includes the gluon README update from review.
7d078b3 to
34e855c
Compare
brunomazzottiamd
left a comment
There was a problem hiding this comment.
@Boss2002n, I was deliberately very strict with the resolve_config_dir function. I think it's a very important function and it should have a solid implementation and documentation. So, I started many related discussions... please don't get me wrong, it's for our own good!
Once this PR is merged, we can proceed faster with the following ones.
|
This PR is just an intermediary PR so that the other Config move PRs do not fail CI |
utils/ reorganized for reuse: ONE config_utils.py absorbs core.py and the gemm/conv/mhc/tuned config_utils modules, laid out in five clearly-banded sections (shared core, GEMM, conv, MHC, tuned kernel entries) so each op family stays visibly separate inside the single import surface. The duplicate utils/mha_kernel_utils.py is dropped in favor of the byte-equal utils/_triton copy; every importer tree-wide is updated. gmm_common stays put under utils/ so tests and benchmarks keep importing a public module. The MHC section is absorbed verbatim and still reads the legacy flat layout -- the MHC config-file migration later flips only this section's path builders. resolve_config_dir() gets the contract the #4947/#5019 reviews asked for, hardened: an Args/Returns/Raises/Example docstring; every argument validated against a whitelist with assertions (op, config_name and the programmer-written arch= override must match strict identifier patterns, the driver-derived running arch tolerates vendor formats but must stay path-safe, backend is checked against ("triton", "gluon")) so a bad value fails closed instead of resolving an escaped or wrong directory; a single str return value (the unused name_prefix tuple element is gone, no caller unpacks a tuple); and fully deterministic behavior -- the directory is built, never probed, so nothing silently returns a bogus last candidate: a missing required table fails loudly in load_config_json() naming the exact nested path, and optional tables pass required=False. The MOE dispatch loaders now declare their backend per dispatch path (a8w4's triton path resolves backend="triton", the gluon paths "gluon"; a4w4 is gluon-only), and gfx1250 gains byte-identical triton seeds copied from gfx950 (GEMM-AFP4WFP4, moe A8W4, HSTU fwd/bwd) so the one resolution the caller-declared policy changes -- triton GEMM-AFP4WFP4 on gfx1250 no longer borrowing gluon tables -- stays launchable until gfx1250 is tuned natively. Gluon configs are never copied across arches. Conv's section carries the variant-aware walk from #4869 unchanged (its M-bounds renamed CONV_STANDARD_M_BOUNDS to coexist with GEMM's).
utils/ reorganized for reuse: ONE config_utils.py absorbs core.py and the gemm/conv/mhc/tuned config_utils modules, laid out in five clearly-banded sections (shared core, GEMM, conv, MHC, tuned kernel entries) so each op family stays visibly separate inside the single import surface. The duplicate utils/mha_kernel_utils.py is dropped in favor of the byte-equal utils/_triton copy; every importer tree-wide is updated. gmm_common stays put under utils/ so tests and benchmarks keep importing a public module. resolve_config_dir() gets the contract the #4947/#5019 reviews asked for, hardened: an Args/Returns/Raises/Example docstring; every argument validated against a whitelist with assertions (op, config_name and the programmer-written arch= override must match strict identifier patterns, the driver-derived running arch tolerates vendor formats but must stay path-safe, backend is checked against ("triton", "gluon")) so a bad value fails closed instead of resolving an escaped or wrong directory; a single str return value (the unused name_prefix tuple element is gone, no caller unpacks a tuple); and fully deterministic behavior -- the directory is built, never probed, and the legacy escape hatches are deleted, so nothing silently returns a bogus last candidate: a missing required table fails loudly in load_config_json() naming the exact nested path, and optional tables pass required=False. The MOE dispatch loaders now declare their backend per dispatch path (a8w4's triton path resolves backend="triton", the gluon paths "gluon"; a4w4 is gluon-only), and gfx1250 gains byte-identical triton seeds copied from gfx950 (GEMM-AFP4WFP4, moe A8W4, HSTU fwd/bwd) so the one resolution the caller-declared policy changes -- triton GEMM-AFP4WFP4 on gfx1250 no longer borrowing gluon tables -- stays launchable until gfx1250 is tuned natively. Gluon configs are never copied across arches. Conv's section carries the variant-aware walk from #4869 unchanged (its M-bounds renamed CONV_STANDARD_M_BOUNDS to coexist with GEMM's).
#4927
satya/migrate-configs-gemm-a8w8-blockscale must land before this