Skip to content

Conversation

@sarathc-cerebras
Copy link

@sarathc-cerebras sarathc-cerebras commented Dec 6, 2025

Purpose

Test Plan

Test Result


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.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: sarathc-cerebras <sarath.chandran@cerebras.net>

Signed-off-by: sarathc-cerebras <sarath.chandran@cerebras.net>

Signed-off-by: sarathc-cerebras <sarath.chandran@cerebras.net>
@github-actions
Copy link

github-actions bot commented Dec 6, 2025

👋 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 ask your reviewers to trigger select CI tests on top of fastcheck CI.

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.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@mergify mergify bot added the new-model Requests to new models label Dec 6, 2025
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 adds support for the Jais-2 model. The implementation looks mostly correct, following the patterns of similar models in vLLM. However, I found a critical issue in the weight remapping logic for the MLP layers. The provided mapping is for a gated MLP, while the Jais-2 model uses a standard MLP, which will cause weight loading to fail for certain model formats. I've provided a suggestion to fix this.

Comment on lines +506 to +508
"w1": "gate_proj",
"w2": "down_proj",
"w3": "up_proj",
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The mistral_mapping for the MLP layers appears to be incorrect for the Jais2MLP architecture. Jais2MLP is a standard 2-layer MLP with up_proj and down_proj, but the current mapping is for a 3-layer gated MLP (like SwiGLU), which includes gate_proj.

Specifically, mapping w1 to gate_proj will cause an AttributeError during weight loading because Jais2MLP does not have a gate_proj attribute. This seems to be a copy-paste from a Llama/Mistral implementation.

Assuming the 'mistral format' for a 2-layer MLP uses w1 for the up-projection and w2 for the down-projection, the mapping should be corrected.

Suggested change
"w1": "gate_proj",
"w2": "down_proj",
"w3": "up_proj",
"w1": "up_proj",
"w2": "down_proj",

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +614 to +618
# rotary embeds should be sliced
if "wk" in modules:
loaded_weight = permute(loaded_weight, self.config.num_key_value_heads)
elif "wq" in modules:
loaded_weight = permute(loaded_weight, self.config.num_attention_heads)

Choose a reason for hiding this comment

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

P1 Badge Guard rotary permutation for quantized q/k tensors

The Mistral remapping helper permutes every tensor whose name contains wk or wq (lines 614‑618), regardless of whether it is an actual weight matrix. Quantized checkpoints (e.g., GPTQ/AWQ) include tensors like wk.qweight, wk.qzeros, or 1‑element wk.qscale_weight, and reshaping those to [num_heads, …, hidden_size] will either raise a view error or corrupt the loaded parameters. The Llama implementation gates permutation to .weight/qscale_weight tensors; a similar suffix check is needed here so quantized Jais2 weights in Mistral format load correctly.

Useful? React with 👍 / 👎.

Copy link
Collaborator

@jeejeelee jeejeelee left a comment

Choose a reason for hiding this comment

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

Thank you for contirbution, some NIT comments

"embed_tokens": "input_embeddings",
"lm_head": "output_embeddings",
}
embedding_padding_modules = ["lm_head"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have removed this attribute recently.

embedding_padding_modules = ["lm_head"]

# BitandBytes specific attributes
bitsandbytes_stacked_params_mapping = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

bitsandbytes_stacked_params_mapping has been removed for a long time

"v_proj": ("qkv_proj", 2),
}

mistral_mapping = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just wondering, do we really need this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-model Requests to new models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants