Skip to content

fix: slice exp_probs_b tensors in moe-split for GLM-5.1 compatibility - #6

Merged
i386 merged 1 commit into
Mesh-LLM:masterfrom
ventz:fix/moe-split-exp-probs-b
Apr 17, 2026
Merged

fix: slice exp_probs_b tensors in moe-split for GLM-5.1 compatibility#6
i386 merged 1 commit into
Mesh-LLM:masterfrom
ventz:fix/moe-split-exp-probs-b

Conversation

@ventz

@ventz ventz commented Apr 17, 2026

Copy link
Copy Markdown

Summary

Fixes Mesh-LLM/mesh-llm#318

GLM-5.1 has per-expert exp_probs_b.bias tensors with shape [n_expert x 1 x 1] that are expert-count-dependent but not matched by is_expert_tensor(). The split reduces expert count in metadata but these tensors pass through unsliced, causing llama-server to reject the shard with a shape mismatch.

Fix

Add exp_probs_b to the expert tensor name matching in is_expert_tensor().

Verification

With the fix, all 79 blocks show correct slicing ([256 x 1 x 1] → [192 x 1 x 1]). No shape mismatch, shard loads successfully.

GLM-5.1 has per-expert `exp_probs_b.bias` tensors ([n_expert x 1 x 1])
that depend on expert count but were not recognized by is_expert_tensor().
The split reduced expert count (e.g. 256 -> 192) but left exp_probs_b at
the original dimension, causing llama-server to reject the shard with:
  "tensor 'blk.3.exp_probs_b.bias' has wrong shape; expected 192, got 256"

Add exp_probs_b to the expert tensor pattern match.

Fixes Mesh-LLM/mesh-llm#318
@i386
i386 merged commit c96ffc8 into Mesh-LLM:master Apr 17, 2026
1 check passed
i386 added a commit to Mesh-LLM/mesh-llm that referenced this pull request Apr 17, 2026
@i386

i386 commented Apr 17, 2026

Copy link
Copy Markdown

@ventz would you be able to share your full analysis of GLM 5.1 using mesh-llm moe share ?

I'd recommend doing mesh-llm update --version 0.63.0-rc.1

@ventz

ventz commented Apr 18, 2026

Copy link
Copy Markdown
Author

No problem. Will be traveling for a week but will after that.

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.

llama-moe-split: exp_probs_b tensors not sliced, causing shape mismatch on GLM-5.1

2 participants