-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[Models] Add SharedFusedMoE support to Qwen3MoE
#32082
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
Merged
+56
−16
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
771c078
update
Isotr0py 52354de
fix
Isotr0py 5c86899
fix
Isotr0py 53285d9
Merge branch 'main' into qwen3moe-share-expert
Isotr0py e3c875d
fix
Isotr0py de59bc0
reduce_results=False
Isotr0py bf79a7a
Merge branch 'main' into qwen3moe-share-expert
Isotr0py f4ebf48
revert accident change
Isotr0py 48e8f00
Merge branch 'main' into qwen3moe-share-expert
Isotr0py a81f67a
Merge branch 'main' into qwen3moe-share-expert
Isotr0py 658ecea
pre-commit
Isotr0py File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
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.
Incorrect type hint causes wrong tensor indexing
Low Severity
The
expert_gateparameter is typed astorch.nn.Linear | Nonebut is actually aReplicatedLinear. The code doesself.expert_gate(x)[0]to extract the output from a tuple returned byReplicatedLinear.forward. However,torch.nn.Linear.forwardreturns a tensor directly, not a tuple, so[0]would incorrectly index into the first dimension of the tensor instead of extracting the output. While the current code works because onlyReplicatedLinearis passed, the type annotation is misleading and usingtorch.nn.Linearas documented would produce silently incorrect results.Additional Locations (1)
vllm/model_executor/models/qwen3_moe.py#L122-L123