- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.2k
feat: preview filename from tuning_fused_moe_triton.py #12276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Summary of ChangesHello @lianakoleva, 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 enhances the user experience of the  Highlights
 Using Gemini Code AssistThe 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  
 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  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
 | 
There was a problem hiding this 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 refactors the tuning_fused_moe_triton.py script to preview the output configuration filename before starting the potentially long-running tuning process. The change is a good improvement for user experience. The refactoring splits the filename generation logic from the file saving logic into a new get_filename function. My review includes suggestions to improve the signature and type hinting of the new function for better code clarity and correctness.
| filename = get_filename( | ||
| E, | ||
| shard_intermediate_size, | ||
| hidden_size, | ||
| topk, | ||
| dtype, | ||
| use_fp8_w8a8, | ||
| use_int8_w8a8, | ||
| use_int8_w8a16, | ||
| per_channel_quant, | ||
| block_shape, | ||
| ) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to make this change if desired, I just kept it close to the original
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Co-authored-by: Xiaoyu Zhang <[email protected]>
Motivation
Since the
tuning_fused_moe_triton.pyscript may be used when working backwards from the following warning, and the tuning process can take some time, it would be helpful to preview the filename of the generated config to ensure that the desired one is being created:[2025-10-28 09:42:18 TP0] Using default MoE kernel config. Performance might be sub-optimal! Config file not found at /sgl-workspace/sglang/python/sglang/srt/layers/moe/fused_moe_triton/configs/triton_3_4_0/E=60,N=704,device_name=NVIDIA_B200,dtype=fp8_w8a8.json, you can create them with https://github.com/sgl-project/sglang/tree/main/benchmark/kernels/fused_moe_tritonModifications
The filename now displays before the tuning begins:
Accuracy Tests
Benchmarking and Profiling
Checklist