[TRITON] Standardize get_config for GEMM kernels and have a unified format for their configs - #1587
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors GEMM configuration management by introducing a centralized get_gemm_config utility function to replace manual configuration loading across multiple kernel files. The configuration keys in JSON files are standardized from descriptive names like "small", "medium", and "large" to systematic M-dimension-based keys like "M_LEQ_8", "M_LEQ_32", and "any". This consolidation removes redundant caching logic and file handling code, improving maintainability and consistency across the codebase.
Reviewed changes
Copilot reviewed 106 out of 135 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| aiter/ops/triton/utils/gemm_config_utils.py | New utility module providing centralized GEMM configuration loading with get_gemm_config and compute_splitk_params functions |
| aiter/ops/triton/configs/gemm/*.json | Standardized configuration keys from descriptive names to M-dimension-based format (e.g., "small" → "M_LEQ_16", "xlarge" → "any") |
| aiter/ops/triton/_triton_kernels/*.py | Replaced manual configuration loading with calls to centralized get_gemm_config utility across 20+ kernel files |
Comments suppressed due to low confidence (1)
aiter/ops/triton/configs/gemm/gfx950-BATCHED_GEMM_PREQUANT-AFP4WFP4-N=128-K=512.json:1
- An entire configuration block for "small_M16" was removed. While consolidation is good, ensure that cases where M is between 16 and 32 are still properly handled by the M_LEQ_32 configuration, as the removed config had different parameter values.
{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
657e056 to
90323e1
Compare
|
Sorry about the massive PR :( |
|
Note: The new files changed view for GitHub does not render the file diffs, we have to switch back to the old view for the diff to be generated due to the large number of files |
90323e1 to
72bd2a3
Compare
brunomazzottiamd
left a comment
There was a problem hiding this comment.
I have no strong objections to this PR, it's OK! However I have some suggestions to harden get_gemm_config. It's a very important function, called by all GEMM kernels. I think it's worth investing in it to avoid future bugs.
2fe2bf1 to
24ea90d
Compare
…nfig` utility across multiple GEMM kernel files Updated configuration keys in JSON files to improve clarity and consistency, changing "large" and "small" to more descriptive keys like "M_GEQ_4096" and "any" Removed redundant caching logic and file handling 1st set of files
1c0d6cb
…ormat for their configs (#1587) * Replaced manual configuration loading with a centralized `get_gemm_config` utility across multiple GEMM kernel files Updated configuration keys in JSON files to improve clarity and consistency, changing "large" and "small" to more descriptive keys like "M_GEQ_4096" and "any" Removed redundant caching logic and file handling * enable LRU caching * fix typecasting from list to tuple
…ormat for their configs (#1587) * Replaced manual configuration loading with a centralized `get_gemm_config` utility across multiple GEMM kernel files Updated configuration keys in JSON files to improve clarity and consistency, changing "large" and "small" to more descriptive keys like "M_GEQ_4096" and "any" Removed redundant caching logic and file handling * enable LRU caching * fix typecasting from list to tuple
…ormat for their configs (#1587) * Replaced manual configuration loading with a centralized `get_gemm_config` utility across multiple GEMM kernel files Updated configuration keys in JSON files to improve clarity and consistency, changing "large" and "small" to more descriptive keys like "M_GEQ_4096" and "any" Removed redundant caching logic and file handling * enable LRU caching * fix typecasting from list to tuple
Replaced manual configuration loading with a centralized
get_gemm_configutility for GEMM kernel filesUpdated configuration keys in JSON files to be consistent, changing "large" and "small" to more descriptive keys like "M_GEQ_4096" and "any"
Removed redundant caching logic and file handling