[PR #1110] [CLOSED] fix(mtp): --batch-mtp exits on the first admission with a draft-vocab head (slot drafters never copy its type) #3036

Closed
opened 2026-11-04 02:05:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1110
Author: @imanu86
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: contrib/batch-mtp-dhead-type-040


📝 Commits (1)

  • f5a00e2 OPUS-MTP-Copia il tipo della testa del draft condivisa nei drafter di --batch-mtp

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 src/core/mtp.cpp (+1 -0)

📄 Description

Resubmission of #1063 (closed by the history cleanup), cherry-picked onto the new main (82f46a8) as asked. @gl46 hit the same exit on a single RTX 3080 (see #1063).

On 0.1.40, --batch 2 --batch-mtp with an MTP directory that ships draft_vocab.bin exits on the first
request that a batch slot takes:

strata batch: MTP admission for slot 0 failed: mtp: unsupported native MMVQ GGML type

The engine returns 1 and the server reports "the engine stopped unexpectedly". --batch 2 without --batch-mtp runs
fine on the same setup.

Cause. In MtpDrafter::bind (src/core/mtp.cpp) a slot drafter that shares the main drafter's head copies
dhead_, dvocab_ and n_dvocab_, but not dhead_type_. That stays at its default -1, so the first
native_mmvq(sub ? dhead_type_ : ..., ...) in draft_first hits the default: case and throws. Any draft-vocab
subset triggers this, the --mtp-q4 Q4_0 head included.

Fix (one line):

        dhead_ = shared->dhead_;
        dhead_type_ = shared->dhead_type_;
        dvocab_ = shared->dvocab_;
        n_dvocab_ = shared->n_dvocab_;

Setup: RTX 2080 Ti 22 GB (sm_75, our Turing fork on top of 0.1.40), Windows, CUDA 12.6,
Qwen3.8-Flash-Next IQ3_XXS, MTP draft with draft_vocab.bin (48,542 tokens), --spec 4, two concurrent
Claude Code agents (each with a ~40K-token prompt).

Verified with the fix: the same setup starts, two concurrent requests both finish (batch windows average 3.44
rows, i.e. both slots with their MTP proposals, no exit). Without the
fix the first admission exits every time.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1110 **Author:** [@imanu86](https://github.com/imanu86) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `contrib/batch-mtp-dhead-type-040` --- ### 📝 Commits (1) - [`f5a00e2`](https://github.com/Niko1221/Strata/commit/f5a00e2cee4cb9cd817e298337342a334023aab6) OPUS-MTP-Copia il tipo della testa del draft condivisa nei drafter di --batch-mtp ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/core/mtp.cpp` (+1 -0) </details> ### 📄 Description Resubmission of #1063 (closed by the history cleanup), cherry-picked onto the new `main` (82f46a8) as asked. @gl46 hit the same exit on a single RTX 3080 (see #1063). On 0.1.40, `--batch 2 --batch-mtp` with an MTP directory that ships `draft_vocab.bin` exits on the first request that a batch slot takes: ``` strata batch: MTP admission for slot 0 failed: mtp: unsupported native MMVQ GGML type ``` The engine returns 1 and the server reports "the engine stopped unexpectedly". `--batch 2` without `--batch-mtp` runs fine on the same setup. **Cause.** In `MtpDrafter::bind` (`src/core/mtp.cpp`) a slot drafter that shares the main drafter's head copies `dhead_`, `dvocab_` and `n_dvocab_`, but not `dhead_type_`. That stays at its default `-1`, so the first `native_mmvq(sub ? dhead_type_ : ..., ...)` in `draft_first` hits the `default:` case and throws. Any draft-vocab subset triggers this, the `--mtp-q4` Q4_0 head included. **Fix (one line):** ```cpp dhead_ = shared->dhead_; dhead_type_ = shared->dhead_type_; dvocab_ = shared->dvocab_; n_dvocab_ = shared->n_dvocab_; ``` **Setup:** RTX 2080 Ti 22 GB (sm_75, our Turing fork on top of 0.1.40), Windows, CUDA 12.6, Qwen3.8-Flash-Next IQ3_XXS, MTP draft with `draft_vocab.bin` (48,542 tokens), `--spec 4`, two concurrent Claude Code agents (each with a ~40K-token prompt). **Verified** with the fix: the same setup starts, two concurrent requests both finish (batch windows average 3.44 rows, i.e. both slots with their MTP proposals, no exit). Without the fix the first admission exits every time. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:05:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3036
No description provided.