Skip to content

fix(glm5-next): remap quantized lm head parameters - #2231

Open
raullenchai wants to merge 1 commit into
Blaizzy:mainfrom
raullenchai:fix/glm5-next-quantized-lm-head
Open

raullenchai wants to merge 1 commit into
Blaizzy:mainfrom
raullenchai:fix/glm5-next-quantized-lm-head

Conversation

@raullenchai

Copy link
Copy Markdown
Contributor

Summary

GLM-5-Next checkpoints with a quantized output head carry lm_head.weight, lm_head.scales, and lm_head.biases. The multimodal sanitizer previously remapped only the weight, leaving scales and biases at the checkpoint root; strict model loading then failed with Received 2 parameters not in model: lm_head.biases, lm_head.scales.

This remaps the complete lm_head.* parameter family under language_model.*, while preserving already-remapped keys on repeated sanitizer passes.

Verification

  • pytest mlx_vlm/tests/test_glm5_next_sanitize.py -q — 2 passed
  • ruff check and ruff format --check on changed files
  • Real-model load on Apple M3 Ultra, macOS 26.5.2, MLX 0.32.2: Vontra/GLM-5.3-Flash-MLX-4bit-MTP (184 GB target) now completes strict loading; before this patch it failed on the two orphaned quantization tensors.
  • The loaded model plus a 3.9 GB target-matched MTP drafter completed all 6/6 coding, knowledge, math, instruction-following, creative-writing, and long-context qualification tasks.

@github-actions

Copy link
Copy Markdown

⚠️ GitHub does not mark 1 commit in this PR as Verified.

Please sign every commit, then update the PR. You can review the commits on the commits tab and follow GitHub's commit-signing guide if needed.

@raullenchai
raullenchai force-pushed the fix/glm5-next-quantized-lm-head branch from 0f5c1db to 2720675 Compare September 13, 2026 16:57
@raullenchai

Copy link
Copy Markdown
Contributor Author

The sole commit has been re-signed and force-updated as 2720675d; the GitHub commit-signature check now passes. The code diff is unchanged.

@Lazarus-931 Lazarus-931 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

see comment

@@ -0,0 +1,46 @@
from types import SimpleNamespace

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we squeeze this into another test file?

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants