Enable loading of fused expert weights in the Transformers modelling backend#36997
Merged
DarkLight1337 merged 1 commit intovllm-project:mainfrom Mar 14, 2026
Merged
Conversation
…backend Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Code Review
The pull request refactors the Mixture of Experts (MoE) weight loading mechanism to support both fused and non-fused expert weight formats. In vllm/model_executor/layers/fused_moe/layer.py, the load_weights method is updated to differentiate between 3D tensors representing fused expert weights and single expert weights, applying a unified loading logic that iterates through individual experts. Concurrently, vllm/model_executor/models/transformers/moe.py introduces an explicit expert_mapping for fused experts, ensuring proper identification and handling of these weight structures during model loading.
DarkLight1337
approved these changes
Mar 14, 2026
siewcapital
pushed a commit
to siewcapital/vllm
that referenced
this pull request
Mar 15, 2026
…backend (vllm-project#36997) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Siew's Capital Jarvis <brayden.stanley.0127@gmail.com>
Lucaskabela
pushed a commit
to Lucaskabela/vllm
that referenced
this pull request
Mar 17, 2026
…backend (vllm-project#36997) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
wendyliu235
pushed a commit
to wendyliu235/vllm-public
that referenced
this pull request
Mar 18, 2026
…backend (vllm-project#36997) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
khairulkabir1661
pushed a commit
to khairulkabir1661/vllm
that referenced
this pull request
Mar 27, 2026
…backend (vllm-project#36997) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
mtparet
pushed a commit
to blackfuel-ai/vllm
that referenced
this pull request
Apr 9, 2026
…backend (vllm-project#36997) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
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 pull request introduces improvements to the handling and loading of fused Mixture-of-Experts (MoE) weights in the Transformers modelling backend:
save_original_format=False. This mapping repurposesexpert_idasshard_idxfor deconcatenatingw1andw3weights.FusedMoE.load_weightsto handle both fused (3D tensor) and non-fused (single expert) weights, simplifying the process and reducing code duplication.