Repository navigation
[Bugfix] Load untied Gemma LM head weights - #53170
Merged
Merged
Conversation
Assisted-by: OpenAI Codex Signed-off-by: Kevin Luu <51931015+khluu@users.noreply.github.com>
hmellor
approved these changes
Aug 20, 2026
khluu
marked this pull request as ready for review
August 20, 2026 22:15
khluu
requested review from
AndreasKaratzas,
DarkLight1337 and
ywang96
as code owners
August 20, 2026 22:15
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #84897 for commit |
khluu
enabled auto-merge (squash)
August 20, 2026 23:02
4 tasks
3 of 4 tasks
zufangzhu
pushed a commit
to zufangzhu/vllm
that referenced
this pull request
Aug 24, 2026
Signed-off-by: Kevin Luu <51931015+khluu@users.noreply.github.com> Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
am-cohere
pushed a commit
to am-cohere/vllm
that referenced
this pull request
Sep 1, 2026
Signed-off-by: Kevin Luu <51931015+khluu@users.noreply.github.com>
michael-gpu
pushed a commit
to practical-inference/vllm-ampere-extended
that referenced
this pull request
Oct 20, 2026
Signed-off-by: Kevin Luu <51931015+khluu@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.
Purpose
Fix Gemma checkpoint loading after #51665 when a config declares tied word embeddings but the checkpoint contains a physical
lm_head.weight.Checkpoint inspection deliberately flips
tie_word_embeddingstoFalseso the physical head can be compared with the input embeddings after loading.GemmaForCausalLMdid not construct anlm_head, so GPTQ Gemma checkpoints failed withThere is no module or parameter named 'lm_head'. This change constructs the output head, ties it to the input embeddings for normally tied configs, and uses it for logits.Duplicate-work check: searched open PRs and issues for
Gemma lm_head weight,tie_word_embeddings Gemma, and the affectedTechxGenus/gemma-1.1-2b-it-GPTQmodel. No open change addresses this Gemma loader failure; #30412 is scoped to GGUF mapping.AI assistance was used to investigate the regression, implement the change, and draft the test. The submitting human reviewed the changed lines and validation results.
Test Plan
TechxGenus/gemma-1.1-2b-it-GPTQat this PR head.Test Result
.venv/bin/python -m pytest tests/models/language/generation/test_gemma.py -q -k checkpoint_lm_head_can_override_tied_config:1 passed, 3 deselected.uvx pre-commit run --files vllm/model_executor/models/gemma.py tests/models/language/generation/test_gemma.py: all applicable hooks passed, including ruff and mypy.d3494fc2on H200 (h200-ci-3). The complete Quantized Models suite finished22 passed, 32 skipped, 0 failedin 33m16s of pytest time (34m27s job wall time). Both formerly failingTechxGenus/gemma-1.1-2b-it-GPTQcases passed:test_models[5-32-half-model2]andtest_models[5-32-bfloat16-model2]. Proposed fix is validated; the incident remains open until merge and a post-merge main exact-job pass.