Skip to content

Fix multi-shard moe-split tensor counting#4

Merged
michaelneale merged 2 commits into
masterfrom
codex/fix-moe-split-n-tensors
Apr 17, 2026
Merged

Fix multi-shard moe-split tensor counting#4
michaelneale merged 2 commits into
masterfrom
codex/fix-moe-split-n-tensors

Conversation

@i386

@i386 i386 commented Apr 17, 2026

Copy link
Copy Markdown

This fixes llama-moe-split on the current master branch.

Users building Mesh-LLM's forked llama.cpp can now compile the MoE split tool again instead of failing with an undeclared n_tensors error in the multi-shard write path.

Root Cause

write_group() was updated to operate on input_shards, but the context-size calculation still referenced a single n_tensors variable from the older single-input implementation.

That made the current multi-shard path fail to compile on master.

Change

  • sum gguf_get_n_tensors(...) across all input_shards
  • size the output ggml context from that total tensor count

Validation

  • cmake --build build --target llama-moe-split -j4

@i386 i386 force-pushed the codex/fix-moe-split-n-tensors branch from 4f91049 to 6cd1324 Compare April 17, 2026 08:31
@i386 i386 changed the title [codex] Fix multi-shard moe-split tensor counting Fix multi-shard moe-split tensor counting Apr 17, 2026
@michaelneale michaelneale marked this pull request as ready for review April 17, 2026 08:45
@michaelneale michaelneale merged commit ed2adb0 into master Apr 17, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants