Skip to content

Conversation

@valarLip
Copy link
Collaborator

@valarLip valarLip commented Sep 27, 2025

Motivation

  1. add env "AITER_LOG_TUNED_CONFIG" to control log for tuned shape
  2. add env "AITER_CONFIG_GEMM_A4W4" for load specified config by User, like
    • AITER_CONFIG_GEMM_A4W4=xxxx/llama_a4w4_config.csv --->for llama
    • AITER_CONFIG_GEMM_A4W4=xxxx/qwen_a4w4_config.csv --->for qwen

Technical Details

Test Plan

Test Result

Submission Checklist

Copilot AI review requested due to automatic review settings September 27, 2025 09:33
Copy link
Contributor

Copilot AI left a comment

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 adds environment variable support for tuning utility configuration in the AITER library. It introduces two new environment variables to control logging behavior and allow users to specify custom configuration files for GEMM A4W4 operations.

  • Adds AITER_LOG_TUNED_CONFIG environment variable to control logging of tuned shape configurations
  • Adds AITER_CONFIG_GEMM_A4W4 environment variable to specify custom configuration files for GEMM A4W4 operations
  • Updates code organization and imports in several files to support these new features

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
csrc/ck_gemm_a4w4_blockscale/gen_instances.py Reorganizes imports and updates default tune file path to use the new environment variable
csrc/ck_gemm_a4w4_blockscale/gemm_a4w4_blockscale_tune.py Reorganizes imports and updates default tune file path
aiter/ops/gemm_op_a4w4.py Adds environment variable definitions and conditional logging based on AITER_LOG_TUNED_CONFIG
aiter/jit/optCompilerConfig.json Updates blob generation command to use the new environment variable
aiter/jit/core.py Adds AITER_LOG_TUNED_CONFIG definition and improves type hints

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@dhonnappa-amd
Copy link
Collaborator

Jenkins CI skipped: Check lint failed. Exiting the entire job...

@dhonnappa-amd
Copy link
Collaborator

Jenkins CI skipped: Check lint failed. Exiting the entire job...

@valarLip valarLip self-assigned this Oct 10, 2025
@valarLip valarLip merged commit ddcc4ea into main Oct 12, 2025
16 of 17 checks passed
@valarLip valarLip deleted the tuning_utilily_update branch October 12, 2025 07:40
yzhou103 added a commit that referenced this pull request Oct 13, 2025
* update

* fix

* fix2

* update

* update gemm/fmoe tune

* modify README.md

* update gen_instances.py

* fix lint error

* fix typo

* rm env AITER_CONFIG_** in ck gen_instances.py

* update a8w8_blockscale_bpreshuffle

* support to read config from multiple tuned files

* fix error in batch_gemm

---------

Co-authored-by: Ying.Zhou2 <Ying.Zhou2@amd.com>
Co-authored-by: Xin Huang <Xin.Huang@amd.com>
valarLip added a commit that referenced this pull request Oct 20, 2025
* add asm bf16_gemm to gemm tuner

* mdf_fileName (#1160)

* Tuning Utility update (#1102)

* update

* fix

* fix2

* update

* update gemm/fmoe tune

* modify README.md

* update gen_instances.py

* fix lint error

* fix typo

* rm env AITER_CONFIG_** in ck gen_instances.py

* update a8w8_blockscale_bpreshuffle

* support to read config from multiple tuned files

* fix error in batch_gemm

---------

Co-authored-by: Ying.Zhou2 <Ying.Zhou2@amd.com>
Co-authored-by: Xin Huang <Xin.Huang@amd.com>

* [MI35X] Fix meta mha 950 error to make guard return bool func itself (#1170)

* Make bool guard return func itself

* make all return func

* write querysol fake

* Migrate tests to mi325-1gpu runner due to the slow network issues on TW cluster (#1166)

* Temporarily using mi355 runners util issues on mi325 runners are fixed (#1176)

* Update sglang_downstream.yaml to use aiter-mi325-1gpu runner (#1181)

* CI: Add Aiter Release Package CI (#1171)

* update gemmTuner

* update tuned_gemm.py

* fix lint error

* update asm maxSplitK and tuned_gemm.csv

* Add AITER_CONFIG_GEMM_BF16 and profile_file params to save all temp results

* fix error

* add padded_m logic and update gemm_common

* refactor get tuned config in tuned_gemm
rm  m < 256 limitation in gemm_op_a4w4.py

* fix lint err

* wrapper the get_gemm_a16w16_config using torch_compile_guard

* fix lint error

* refactor tuned_gemm.py

* wrapper gemm_a16w16 with torch_compile_guard

* fix lint error

* add gen_fake func

* update

* updae GemmTuner --profile_file

---------

Co-authored-by: amd-ruitang3 <145657428+amd-ruitang3@users.noreply.github.com>
Co-authored-by: Lingpeng Jin <103567126+valarLip@users.noreply.github.com>
Co-authored-by: Xin Huang <Xin.Huang@amd.com>
Co-authored-by: ZhangLirong <lirzhang@amd.com>
Co-authored-by: valarLip <340077269@qq.com>
eliotwang pushed a commit to eliotwang/aiter that referenced this pull request Oct 21, 2025
* update

* fix

* fix2

* update

* update gemm/fmoe tune

* modify README.md

* update gen_instances.py

* fix lint error

* fix typo

* rm env AITER_CONFIG_** in ck gen_instances.py

* update a8w8_blockscale_bpreshuffle

* support to read config from multiple tuned files

* fix error in batch_gemm

---------

Co-authored-by: Ying.Zhou2 <Ying.Zhou2@amd.com>
Co-authored-by: Xin Huang <Xin.Huang@amd.com>
eliotwang pushed a commit to eliotwang/aiter that referenced this pull request Oct 21, 2025
* add asm bf16_gemm to gemm tuner

* mdf_fileName (ROCm#1160)

* Tuning Utility update (ROCm#1102)

* update

* fix

* fix2

* update

* update gemm/fmoe tune

* modify README.md

* update gen_instances.py

* fix lint error

* fix typo

* rm env AITER_CONFIG_** in ck gen_instances.py

* update a8w8_blockscale_bpreshuffle

* support to read config from multiple tuned files

* fix error in batch_gemm

---------

Co-authored-by: Ying.Zhou2 <Ying.Zhou2@amd.com>
Co-authored-by: Xin Huang <Xin.Huang@amd.com>

* [MI35X] Fix meta mha 950 error to make guard return bool func itself (ROCm#1170)

* Make bool guard return func itself

* make all return func

* write querysol fake

* Migrate tests to mi325-1gpu runner due to the slow network issues on TW cluster (ROCm#1166)

* Temporarily using mi355 runners util issues on mi325 runners are fixed (ROCm#1176)

* Update sglang_downstream.yaml to use aiter-mi325-1gpu runner (ROCm#1181)

* CI: Add Aiter Release Package CI (ROCm#1171)

* update gemmTuner

* update tuned_gemm.py

* fix lint error

* update asm maxSplitK and tuned_gemm.csv

* Add AITER_CONFIG_GEMM_BF16 and profile_file params to save all temp results

* fix error

* add padded_m logic and update gemm_common

* refactor get tuned config in tuned_gemm
rm  m < 256 limitation in gemm_op_a4w4.py

* fix lint err

* wrapper the get_gemm_a16w16_config using torch_compile_guard

* fix lint error

* refactor tuned_gemm.py

* wrapper gemm_a16w16 with torch_compile_guard

* fix lint error

* add gen_fake func

* update

* updae GemmTuner --profile_file

---------

Co-authored-by: amd-ruitang3 <145657428+amd-ruitang3@users.noreply.github.com>
Co-authored-by: Lingpeng Jin <103567126+valarLip@users.noreply.github.com>
Co-authored-by: Xin Huang <Xin.Huang@amd.com>
Co-authored-by: ZhangLirong <lirzhang@amd.com>
Co-authored-by: valarLip <340077269@qq.com>
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