Skip to content

Fix GLM-DSA MTP split-stage load crash - #899

Merged
i386 merged 1 commit into
mainfrom
jd/fix-glm-dsa-mtp-split-load
Jun 23, 2026
Merged

Fix GLM-DSA MTP split-stage load crash#899
i386 merged 1 commit into
mainfrom
jd/fix-glm-dsa-mtp-split-load

Conversation

@i386

@i386 i386 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a llama patch-queue fix that checks whether a GLM-DSA final split stage has the tensors needed by the native MTP sidecar
  • skip optional native MTP draft context creation when those tensors are absent, instead of letting the reused DeepSeek MTP graph dereference null token/head tensors
  • keep non-GLM native MTP behavior unchanged

Why

GLM-DSA split serving can load a final stage with output tensors but without the token embedding/head tensors used by the native MTP graph fallback. In that shape, llama_init_from_model(... LLAMA_CONTEXT_TYPE_MTP ...) can crash in ggml_get_rows during graph reservation.

Validation

  • LLAMA_WORKDIR=/tmp/mesh-llm-llama-validate.1782193330 scripts/prepare-llama.sh pinned
  • MESH_LLM_DYNAMIC_NATIVE_RUNTIME=0 LLAMA_STAGE_BACKEND=metal RUSTC_WRAPPER=/opt/homebrew/bin/sccache just release-build

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced model processing validation to prevent incomplete initialization of internal components when required model tensors and dependencies are unavailable, improving overall system robustness.
    • Improved diagnostic messaging to clearly indicate when internal processing components are intentionally skipped due to missing prerequisites, enhancing visibility for troubleshooting.

@github-actions
github-actions Bot requested a review from ndizazzo June 23, 2026 05:46
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5f12b91-a746-4cb0-b024-6ce9dfd7ffe8

📥 Commits

Reviewing files that changed from the base of the PR and between 3e6805d and 43ab2c0.

📒 Files selected for processing (1)
  • third_party/llama.cpp/patches/0111-Skip-native-MTP-sidecar-when-split-stage-lacks-tensors.patch

📝 Walkthrough

Walkthrough

A new patch file adds skippy_should_create_native_mtp_sidecar to src/skippy.cpp, which checks config->include_output, n_layer_nextn, model architecture, and required MTP block tensor presence before creating the native MTP sidecar. skippy_finish_model_open is updated to use this helper and emit a specific diagnostic when skipping.

Changes

Conditional Native MTP Sidecar Creation

Layer / File(s) Summary
MTP sidecar guard helper and call site
third_party/llama.cpp/patches/0111-Skip-native-MTP-sidecar-when-split-stage-lacks-tensors.patch
Adds skippy_should_create_native_mtp_sidecar gating on config->include_output, n_layer_nextn > 0, architecture type, and required tensor presence in the split-stage layer metadata. Updates skippy_finish_model_open to call this helper; logs a "missing required MTP graph tensors" message and continues without drafts when the helper returns false while the base condition is still satisfied.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix GLM-DSA MTP split-stage load crash' directly addresses the main issue being fixed - a crash when loading final stages in GLM-DSA split serving configurations with native MTP sidecars.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jd/fix-glm-dsa-mtp-split-load

Comment @coderabbitai help to get the list of available commands.

@i386
i386 merged commit d389841 into main Jun 23, 2026
33 checks passed
@i386
i386 deleted the jd/fix-glm-dsa-mtp-split-load branch June 23, 2026 20:36
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