Skip to content

[TRITON] Standardize get_config for GEMM kernels and have a unified format for their configs - #1587

Merged
Boss2002n merged 20 commits into
mainfrom
amd/satya/standardise_GEMM_configs
Dec 16, 2025
Merged

Boss2002n merged 20 commits into
mainfrom
amd/satya/standardise_GEMM_configs

Conversation

@Boss2002n

@Boss2002n Boss2002n commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Replaced manual configuration loading with a centralized get_gemm_config utility for GEMM kernel files

Updated 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

Comment thread aiter/ops/triton/configs/gemm/gfx950-GEMM-A8W8_BLOCKSCALE-N=512-K=7168.json Outdated
Comment thread aiter/ops/triton/configs/gemm/gfx950-GEMM-A8W8_BLOCKSCALE-N=7168-K=2048.json Outdated
Comment thread aiter/ops/triton/configs/gemm/gfx950-GEMM-A8W8_BLOCKSCALE-N=7168-K=256.json Outdated
Comment thread aiter/ops/triton/configs/gemm/gfx950-GEMM_PREQUANT-AFP4WFP4.json
@Boss2002n Boss2002n self-assigned this Dec 9, 2025
@Boss2002n
Boss2002n marked this pull request as ready for review December 9, 2025 20:30
Copilot AI review requested due to automatic review settings December 9, 2025 20:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread aiter/ops/triton/utils/gemm_config_utils.py
Comment thread aiter/ops/triton/_triton_kernels/gemm_a16w16_atomic.py
Comment thread aiter/ops/triton/_triton_kernels/gemm_a16w16.py
Comment thread aiter/ops/triton/_triton_kernels/gemm_a16w8_blockscale.py Outdated
Comment thread aiter/ops/triton/_triton_kernels/fused_gemm_afp4wfp4_a16w16.py
@Boss2002n
Boss2002n force-pushed the amd/satya/standardise_GEMM_configs branch from 657e056 to 90323e1 Compare December 10, 2025 07:06
@Boss2002n
Boss2002n requested a review from a team December 10, 2025 07:06
@Boss2002n Boss2002n changed the title GEMM config files changes [TRITON] Standardize get_config for GEMM kernels and have a unifies format for their configs Dec 10, 2025
@Boss2002n

Copy link
Copy Markdown
Contributor Author

Sorry about the massive PR :(

@Boss2002n Boss2002n changed the title [TRITON] Standardize get_config for GEMM kernels and have a unifies format for their configs [TRITON] Standardize get_config for GEMM kernels and have a unified format for their configs Dec 10, 2025
@Boss2002n

Copy link
Copy Markdown
Contributor Author

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

@Boss2002n
Boss2002n force-pushed the amd/satya/standardise_GEMM_configs branch from 90323e1 to 72bd2a3 Compare December 12, 2025 13:41

@brunomazzottiamd brunomazzottiamd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread aiter/ops/triton/_triton_kernels/batched_gemm_a16wfp4.py Outdated
Comment thread aiter/ops/triton/utils/gemm_config_utils.py
Comment thread aiter/ops/triton/utils/gemm_config_utils.py
Comment thread aiter/ops/triton/utils/gemm_config_utils.py
Comment thread aiter/ops/triton/utils/gemm_config_utils.py Outdated
Comment thread aiter/ops/triton/utils/gemm_config_utils.py Outdated
Comment thread aiter/ops/triton/utils/gemm_config_utils.py Outdated
Comment thread aiter/ops/triton/_triton_kernels/batched_gemm_a8w8.py Outdated
@Boss2002n
Boss2002n force-pushed the amd/satya/standardise_GEMM_configs branch 3 times, most recently from 2fe2bf1 to 24ea90d Compare December 14, 2025 21:31
…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
@Boss2002n
Boss2002n requested a review from k50112113 December 15, 2025 19:35
azaidy
azaidy previously approved these changes Dec 15, 2025

@azaidy azaidy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

cagrikymk
cagrikymk previously approved these changes Dec 15, 2025

@azaidy azaidy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Boss2002n
Boss2002n merged commit 46902fa into main Dec 16, 2025
22 of 24 checks passed
@Boss2002n
Boss2002n deleted the amd/satya/standardise_GEMM_configs branch December 16, 2025 07:07
zhuyuhua-v pushed a commit that referenced this pull request Dec 17, 2025
…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
ZhangLirong-amd pushed a commit that referenced this pull request Dec 29, 2025
…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
@Boss2002n
Boss2002n restored the amd/satya/standardise_GEMM_configs branch December 31, 2025 15:35
@Boss2002n
Boss2002n deleted the amd/satya/standardise_GEMM_configs branch December 31, 2025 16:07
valarLip pushed a commit that referenced this pull request Mar 18, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants