Skip to content

Conversation

@jeejeelee
Copy link
Collaborator

@jeejeelee jeejeelee commented Jul 22, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

The main motivation is to standardize the model implementation and support BNB quantization

Test Plan

Test Result

(Optional) Documentation Update

Signed-off-by: Jee Jee Li <[email protected]>
@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

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 refactors the Jamba model implementation, primarily by replacing the custom JambaMLP with the more generic LlamaMLP and by simplifying the weight loading logic in JambaForCausalLM to use the AutoWeightsLoader. These changes improve code clarity and maintainability. I've found two high-severity issues related to weight loading that could cause problems.

Comment on lines +381 to +383
("qkv_proj", "q_proj", "q"),
("qkv_proj", "k_proj", "k"),
("qkv_proj", "v_proj", "v"),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The stacked_params_mapping entries for qkv_proj are missing leading dots1. This can cause ambiguous or incorrect weight name matching, as q_proj could match unrelated parameter names. Using .q_proj ensures matching a specific component, improving safety and explicitness. This inconsistency with gate_up_proj mappings and implementations in models like LlamaModel further emphasizes the need for correction.

Style Guide References

Suggested change
("qkv_proj", "q_proj", "q"),
("qkv_proj", "k_proj", "k"),
("qkv_proj", "v_proj", "v"),
(".qkv_proj", ".q_proj", "q"),
(".qkv_proj", ".k_proj", "k"),
(".qkv_proj", ".v_proj", "v"),

Footnotes

  1. Ensure that weight names are explicitly and accurately matched to avoid unintended matches with unrelated parameters. (link)

return hidden_states.view(orig_shape)


class JambaMLP(JambaMoE):
Copy link
Collaborator Author

@jeejeelee jeejeelee Jul 22, 2025

Choose a reason for hiding this comment

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

#7415 Change JambaMLP to MoE , now this PR wants to revert, do you accept? @mzusman
The main motivation is to standardize the model implementation and support BNB quantization

@jeejeelee jeejeelee changed the title [Do not merge] Refactor JambaForCausalLM [Model] Refactor JambaForCausalLM Jul 23, 2025
@jeejeelee jeejeelee requested a review from tlrmchlsmth July 23, 2025 14:47
Comment on lines +119 to +132
if num_experts > 1:
self.feed_forward = JambaMoE(
config,
quant_config=quant_config,
prefix=f"{prefix}.feed_forward",
)
else:
self.feed_forward = JambaMLP(
config.hidden_size,
config.intermediate_size,
config.hidden_act,
quant_config=quant_config,
prefix=f"{prefix}.feed_forward",
)
Copy link
Member

Choose a reason for hiding this comment

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

yeah this is cleaner

Comment on lines +382 to +383
(".gate_up_proj", ".gate_proj", 0),
(".gate_up_proj", ".up_proj", 1),
Copy link
Member

Choose a reason for hiding this comment

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

why do we have to handle these now? (the old code didn't mention these)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

@tlrmchlsmth tlrmchlsmth left a comment

Choose a reason for hiding this comment

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

looks good, thanks - just a couple of nits

@jeejeelee jeejeelee added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 29, 2025
@jeejeelee jeejeelee merged commit 61a6905 into vllm-project:main Jul 29, 2025
78 checks passed
@jeejeelee jeejeelee deleted the refactor-jamba branch July 29, 2025 10:25
liuyumoye pushed a commit to liuyumoye/vllm that referenced this pull request Jul 31, 2025
x22x22 pushed a commit to x22x22/vllm that referenced this pull request Aug 5, 2025
Pradyun92 pushed a commit to Pradyun92/vllm that referenced this pull request Aug 6, 2025
npanpaliya pushed a commit to odh-on-pz/vllm-upstream that referenced this pull request Aug 6, 2025
jinzhen-lin pushed a commit to jinzhen-lin/vllm that referenced this pull request Aug 9, 2025
noamgat pushed a commit to noamgat/vllm that referenced this pull request Aug 9, 2025
paulpak58 pushed a commit to paulpak58/vllm that referenced this pull request Aug 13, 2025
diegocastanibm pushed a commit to diegocastanibm/vllm that referenced this pull request Aug 15, 2025
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 2025
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants