Skip to content

Fixed gpt-oss _load_weights_other() parameter position bug#28715

Merged
heheda12345 merged 1 commit intovllm-project:mainfrom
River12:export-D87021773
Nov 16, 2025
Merged

Fixed gpt-oss _load_weights_other() parameter position bug#28715
heheda12345 merged 1 commit intovllm-project:mainfrom
River12:export-D87021773

Conversation

@River12
Copy link
Contributor

@River12 River12 commented Nov 14, 2025

Summary:
Signed-off-by: Dezhan Tu dezhantu@gmail.com

For _load_weights_other(), ep_rank_start and ep_rank_end positions are wrongly placed, leading to the failure of loading expert data in expert parallelim. This diff fixed this bug.

Test Plan:

from vllm import LLM
llm = LLM("openai/gpt-oss-120b", tensor_parallel_size=2, enable_expert_parallel)
output = llm.generate("Hi, vLLM is a")

Reviewed By: helunwencser, jackm321

Differential Revision: D87021773

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 correctly fixes a bug where parameters were passed in the wrong order to the _load_weights_other function. The change is correct and addresses the issue described. I've added one high-severity comment regarding maintainability to prevent similar bugs in the future by making the code more robust.

ep_rank_start,
ep_rank_end,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While this change correctly fixes the argument order, the root cause of the bug is the inconsistent parameter order between _load_weights_other and _load_weights_mxfp4. To improve readability and prevent similar bugs in the future, it's highly recommended to use keyword arguments for this call. This makes the code more explicit and robust against parameter reordering. For example:

return self._load_weights_other(
    ep_rank_start=ep_rank_start,
    ep_rank_end=ep_rank_end,
    heads_per_rank=heads_per_rank,
    head_start=head_start,
    weights=weights,
    stacked_params_mapping=stacked_params_mapping,
)

@River12 River12 force-pushed the export-D87021773 branch 5 times, most recently from eee7487 to 722f941 Compare November 14, 2025 08:53
…ect#28715)

Summary:
Signed-off-by: Dezhan Tu <dztu@meta.com>

For `_load_weights_other()`, `ep_rank_start` and `ep_rank_end` positions are wrongly placed, leading to the failure of loading expert data in expert parallelism

Test Plan:
```
from vllm import LLM
llm = LLM("openai/gpt-oss-120b", tensor_parallel_size=2, enable_expert_parallel)
output = llm.generate("Hi, vLLM is a")
```

Reviewed By: helunwencser, jackm321

Differential Revision: D87021773
Copy link
Collaborator

@heheda12345 heheda12345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Nov 16, 2025
@heheda12345 heheda12345 enabled auto-merge (squash) November 16, 2025 07:36
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 16, 2025
@heheda12345 heheda12345 merged commit af02c40 into vllm-project:main Nov 16, 2025
52 checks passed
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
kitaekatt pushed a commit to kitaekatt/vllm that referenced this pull request Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpt-oss Related to GPT-OSS models ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants