Fix SM120 triton_kernels MXFP4 block_k for GPT-OSS#20040
Fix SM120 triton_kernels MXFP4 block_k for GPT-OSS#20040Kangyan-Zhou merged 1 commit intosgl-project:mainfrom
triton_kernels MXFP4 block_k for GPT-OSS#20040Conversation
Summary of ChangesHello, 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 resolves a critical issue affecting the GPT-OSS model on SM120 GPUs when utilizing MXFP4 quantization. Previously, the system would crash due to an out-of-budget shared memory allocation during kernel compilation. The implemented solution configures the kernel to use a specific block size ( Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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.
Code Review
This pull request addresses a runtime assertion failure on SM120 hardware by constraining block_k to 128 for the MXFP4 Triton kernel path. No security vulnerabilities were found. A suggestion has been made to use a named constant to improve code maintainability.
b8zhong
left a comment
There was a problem hiding this comment.
Thanks! This makes sense... it was a bit puzzling. I also encountered this bug at BS > 1
|
/tag-and-rerun-ci |
Motivation
On SM120, the
triton_kernelsMXFP4 path can pick a tile that exceeds the per-block shared-memory budget and hitsassert num_stages >= 1during GPT-OSS startup. This setsblock_k=128for the SM120 MXFP4 path, which is the largest power-of-two tile that fits this kernel’s requirements and the SM120 shared-memory limit.Full crash log
@b8zhong
Accuracy Tests
python -m gpt_oss.evals --model openai/gpt-oss-120b --eval gpqa --n-threads 2048 --reasoning-effort low --base-url http://127.0.0.1:30000/v1 Writing report to /tmp/gpqa_openai__gpt-oss-120b-low_temp1.0_20260306_124153.html {'chars': np.float64(97.75126262626263), 'chars:std': np.float64(264.199135273403), 'score': np.float64(0.6527777777777778), 'score:std': np.float64(0.4760871250278503)} Writing results to /tmp/gpqa_openai__gpt-oss-120b-low_temp1.0_20260306_124153.json Writing all results to /tmp/gpqa_openai__gpt-oss-120b-low_temp1.0_20260306_124153_allresults.json [{'eval_name': 'gpqa', 'model_name': 'openai__gpt-oss-120b-low_temp1.0_20260306_124153', 'metric': 0.6527777777777778}]