Skip to content

fix tuning_fused_moe_triton_sep tool per_channel_quant bug#13027

Merged
yuan-luo merged 5 commits intomainfrom
fix_tune_sep_tool_bug
Nov 11, 2025
Merged

fix tuning_fused_moe_triton_sep tool per_channel_quant bug#13027
yuan-luo merged 5 commits intomainfrom
fix_tune_sep_tool_bug

Conversation

@BBuf
Copy link
Copy Markdown
Collaborator

@BBuf BBuf commented Nov 11, 2025

Motivation

图片 图片

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @BBuf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a bug in the tuning_fused_moe_triton_sep tool by correctly integrating the per_channel_quant setting. Previously, this quantization option was not properly exposed or utilized, potentially leading to inaccurate tuning results. The changes ensure that the tool can now be configured to accurately reflect per-channel quantization during the benchmarking and tuning of fused Mixture-of-Experts (MoE) Triton kernels.

Highlights

  • Per-channel quantization parameter exposure: The per_channel_quant boolean parameter has been added to the benchmark_config function signature, allowing it to be dynamically controlled during the tuning process.
  • Dynamic per_channel_quant usage: The run_moe_fused_triton_kernel function call within the tuning script now correctly passes the per_channel_quant value, replacing a previously hardcoded False.
  • Command-line argument for per_channel_quant: A new command-line argument, --per-channel-quant, has been introduced, enabling users to specify per-channel quantization directly when running the tuning tool.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix a bug related to per_channel_quant in the tuning_fused_moe_triton_sep.py tool by adding a corresponding command-line argument and plumbing it through. While the intent is correct, the implementation is incomplete. The new parameter added to benchmark_config breaks existing function calls, which will cause the script to crash. Furthermore, the per_channel_quant flag is only applied to one of the two MoE kernel calls, which is likely an oversight that could lead to incorrect tuning results.

Comment thread benchmark/kernels/fused_moe_triton/tuning_fused_moe_triton_sep.py Outdated
Comment thread benchmark/kernels/fused_moe_triton/tuning_fused_moe_triton_sep.py Outdated
@BBuf BBuf requested a review from yuan-luo November 11, 2025 02:30
@yuan-luo yuan-luo merged commit f18ec92 into main Nov 11, 2025
27 checks passed
@yuan-luo yuan-luo deleted the fix_tune_sep_tool_bug branch November 11, 2025 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants