Skip to content

refactor fmoe tuner profile - #1614

Merged
yzhou103 merged 2 commits into
mainfrom
refactor_fmoe_profile
Dec 12, 2025
Merged

yzhou103 merged 2 commits into
mainfrom
refactor_fmoe_profile

Conversation

@yzhou103

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

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 the fmoe (Fused Mixture of Experts) tuner profile handling by consolidating profile file management, improving sort key handling, and fixing a boundary condition bug.

  • Modifies profile file handling to support optional profile saving and consolidates append logic
  • Introduces configurable sort keys for GEMM tuners to swap M and N positions for better ordering
  • Fixes an off-by-one error in kernel ID validation

Reviewed changes

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

File Description
hsa/gfx942/fmoe_2stages/tune.py Changes default profile_file to empty string, adds conditional profile saving logic, and hardcodes fallback profile path to "aiter/configs/profile_fmoe.csv"
csrc/cktile_gemm_a8w8_bpreshuffle/gen_instances.py Fixes boundary condition from > to >= for kernel ID validation to prevent invalid array access
aiter/utility/base_tuner.py Adds sort_keys attribute for flexible sorting, implements profile file append logic in base tuner, and adds M/N position swap in GemmCommonTuner for proper ordering
aiter/fused_moe.py Adds informative logging message about tuned config file location and environment variable usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread aiter/utility/base_tuner.py

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@yzhou103
yzhou103 merged commit 97ac929 into main Dec 12, 2025
22 checks passed
@yzhou103
yzhou103 deleted the refactor_fmoe_profile branch December 12, 2025 05:41
zhuyuhua-v pushed a commit that referenced this pull request Dec 17, 2025
* refactor fmoe profile data, and log

* Update fused_moe.py
ZhangLirong-amd pushed a commit that referenced this pull request Dec 29, 2025
* refactor fmoe profile data, and log

* Update fused_moe.py
valarLip pushed a commit that referenced this pull request Mar 18, 2026
* refactor fmoe profile data, and log

* Update fused_moe.py
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.

3 participants