[MoE] Qwen3MoE, Qwen3VLMoE, GPT OSS, Glm 4.7, DeepseekV3 MoE kernels 🚀#450
Merged
Conversation
This reverts commit 169b1ea.
This was referenced Feb 3, 2026
Closed
Two fixes: 1. Early return when HAS_TRITON_KERNELS=False to skip MXFP4 patches gracefully 2. Move mlp_forward inside if HAS_TRITON_KERNELS block since it uses routing variable
The file already has AGPLv3 license header at top, so inline comments are unnecessary for trivial 1-line functions: - native_moe_grouped_mm() - _should_use_separated_lora() - register_weight_preprocessor() - get_weight_preprocessor()
This reverts commit 690f25ede162777ace69f08dbf7fe83bbc3a4db5.
This reverts commit e9dddc3597b2dd333b10278951591c07aa811fa5.
Removed random AI mat muls and lora extractions that slowed down entire MoE forward pass
This reverts commit 39c68f1.
This reverts commit 44f50c2.
This was referenced Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extensively improves fine tuning performance for the above mentioned MoE models, but is reliant on some changes that are integral to transformers V5.
PS: If we want to use triton kernels or grouped_mm as mentioned here, we need the changes in unsloth
Note that along with speed improvements, I also observed memory usage improvements wherein the grouped_mm was able to do a 8192 sequence length fine-tuning on H100 in 16-bit LoRA, but the same was not true for pure PyTorch code which threw OOMs
Extensive benchmarks and release blog
Transformers v4 unsloth latest release

Transformers v5 + pure pytorch

Transformers v5 + grouped_mm

Transformers v5 + unsloth triton kernels

Previous PRs: #396 #447