[Engine] --pipeline-windows 2 with the MTP drafter: the first non-streaming chat request fails "mtp prefill: invalid argument" and the next one exits the process
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 32/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- backend, performance
Línea de trabajo
Start with the reported paths in program/generate.cpp around lines 8191, 13698, 21705, and core/mtp.cpp around lines 1778–1801. Trace how pipelined MTP capture handles the non-streaming prefill row counts and how the penalty gate selects the serial loop; reproduce with the two-card setup and compare streaming and non-streaming requests. Done means the non-streaming request no longer errors or exits the process, and the pipeline runs when penalty coefficients are neutral.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
On a two-card layer split, --pipeline-windows 2 beside the MTP drafter takes the first ordinary
non-streaming /v1/chat/completions request down with mtp prefill: invalid argument, and the
request after it exits the engine process. Streaming requests succeed, so a streaming benchmark sees
a healthy server right up to the first client that asks for a complete response.
Separately: on the same build the pipeline is unreachable in serve mode for the traffic that a
normal client sends, for two documented reasons that compound (below). Both are worth fixing before
anyone reads the pipelined loop's numbers again.
Environment
- Strata engine 0.1.66, tree
HEAD-6c6c22d8(6c6c22d84320eacf70a5bba3907e51dcfc96fa78, 2026-11-23), built for sm_86. - Linux
7.0.14-15-pve, NVIDIA driver 595.71.05, 2x RTX 3090 24 GB. - Qwen3.8-Flash-Next
UD-Q4_K_XLGGUF, native pack,--layer-splitauto (24/48),parallel: 2
(so the start carries--batch 2),--spec 4 --mtp .../mtp/rt,--kv int8,--max-context 524288,
--resident-budget-gib 64. - Started from the JSON config through the normal launcher; nothing hand-fed.
Reproduce
Boot with --serve on the above, with the drafter set to MTP, and add:
--pipeline-windows 2 (and STRATA_PW_WITH_BATCH=1, required beside --batch: see below)
Then:
POST /v1/chat/completions {"messages":[{"role":"user","content":"List five ways a paged key-value cache saves VRAM during decode, one line each."}],"max_tokens":40,"temperature":0.6}
-> 200 {"error":{"type":"invalid_request_error","message":"mtp prefill: invalid argument"}}
POST again, any shape
-> {"error":{"type":"server_error","message":"the engine stopped unexpectedly (process exited; status unavailable): mtp prefill: invalid ar..."}
[strata] 2026-11-26 20:12:59 native ERR mtp prefill: invalid argument
Reproduced nine times across four boots in three separate jobs (20:12, 20:19 x3, 20:20, 20:21, 20:24, 20:26 x2). The prompt is irrelevant: 8-word, 40-word and 300-word user turns all failed identically. max_tokens 300 and 40 both failed.
What does not trigger it
Same box, same boot, five request shapes each (user turn only / streaming / system+user / explicit repeat_penalty 1.1 / max_tokens 1):
| arm | result |
|---|---|
DFlash2 drafter (--draft dflash2 --draft-model ... --draft-conf 0.7) |
all five fine |
--mtp, pipeline off (auto) |
all five fine |
--mtp, --pipeline-windows 0 + STRATA_MTP_STAGE0=1 |
fine |
--mtp + --pipeline-windows 2 (+ STRATA_PW_WITH_BATCH=1) |
error, then process exit |
| same arm, streaming request | fine (the next non-streaming one kills it) |
So it is the combination pipeline_windows >= 2 and the MTP drafter and a non-streaming
request, and it is not the STRATA_MTP_STAGE0 env on its own.
Where the error comes from
core/mtp.cpp:1791 (also 1801, 1824): the device-input prefill path, cudaGraphLaunch(prefill_dev_exec_[T], cs_)
or the sync after it returning cudaErrorInvalidValue - i.e. launching a graph that was never captured
for that row count. capture_prefill_dev() at core/mtp.cpp:~1778 returns early when
prefill_dev_exec_[T] is already set, so a shape that was never captured for the non-streaming path
reaches the launch.
program/generate.cpp:8191-8192 is where pipeline_windows >= 2 changes exactly those shapes:
const int mtp_t = o.pipeline_windows >= 2 ? strata::kernels::kVerifyNarrowT : std::min(o.spec, (int) strata::kernels::kVerifyNarrowT);
if (o.pipeline_windows >= 2) mtp.set_force_capture(true);
and program/generate.cpp:13698 only prepares the chain when pl_snap_ok:
if (o.pipeline_windows >= 2 && pl_snap_ok && !mtp.prepare_chain(e)) return false;
The non-streaming response path appears to take the device-input prefill (d_tk/d_stp, the branch
at 1780-1801) with a T the pipelined capture set never built a graph for.
Second finding: the loop never runs for real traffic, so its nulls are silent
Two gates, in order:
-
--batchrefuses it.program/generate.cpp:6567:strata generate: --pipeline-windows 1 is off: not with --batch slots (STRATA_PW_WITH_BATCH=1 keeps it for the solo path)observed verbatim with
parallel: 2. OnlySTRATA_PW_WITH_BATCH=1keeps it, and the boot then
saysbatch windows run without it- so a served two-slot start never gets the two-window loop. -
The solo path's own gate keys on the window length, not on a real penalty.
program/generate.cpp:21705selects the serial loop whenhist_n > 0, where
hist_n = std::min(req_sp.penalty_last_n, kPenaltyWindowCap)(21340). Every other place that
decides whether a penalty is actually applied requires a non-neutral coefficient:
core/verify.cpp:5593-5599(penalty_last_n > 0 && (penalty_repeat != 1.0f || penalty_freq != 0.0f || penalty_present != 0.0f), and it then zeroespenalty_last_nitself), and the two slot paths at
generate.cpp:19353andgenerate.cpp:23509copy that stronger test. If a request arrives with a
penalty_last_nwindow and neutral coefficients, the pipelined loop is skipped although nothing
needs the serial loop.Proof it is being skipped here: all seven
--pipeline-windows 2boots printedstrata serve: --pipeline-windows: a request with repetition penalties (penalty_last_n) decodes seriallyand a boot run with
STRATA_DECODE_TIMING=1printed 14strata decode timing:lines and zero
strata pipeline:lines. Those two reports are exclusive by construction - the serial one is
behindif (!pl_ran)(23247) and the serial loop iswhile (!pl_ran && ...)(22557), the
pipelined one is inside the loop (22476) - so the overlapped loop did not execute once, on any
request, in seven boots.
Why that matters for the recorded numbers
The comment at generate.cpp:20144-20149 records the gate optimum measured on 2x RTX 3090 at
250 W (0.2, 0.3 and 0.4 measured +7.0%, +7.8% and +7.5% over the serial loop). I could not
reproduce any of that here, and I now know why it looked flat rather than slower: the loop never ran.
What the flag did cost on this box is the reservation the boot announces -
--pipeline-windows 2: 272 MiB of CUDA0 kept out of the expert cache - which reads as 4453 CUDA0
expert slots instead of 4954, decode unchanged, and 10K-token prompt throughput 933/939/941 tok/s
against a 1789-1826 tok/s control (-47 %). A reviewer reading a "pipeline is a wash" report should
know the wash was measured on an inert arm.
Suggestions
- Capture (or assert on) the row counts the non-streaming path can ask
prefill_devfor when
pipeline_windows >= 2, instead of returningmtp prefill: invalid argument- and do not let that
error take the process on the following request. - Make the serial fallback at 21705 use the same "is any coefficient non-neutral" predicate as
verify.cpp:5593, so a neutralpenalty_last_ndoes not disable the pipeline. - It took three probes to find out the loop had never run, because the fact is only printable under
STRATA_DECODE_TIMING=1. A single startup line naming the reason the loop will not be used for
served requests (batch slots / penalty window / no snapshot) would have saved the whole investigation.
- Lenguaje dominante
- C++
- Estrellas
- 11.6k
- Forks
- 1k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Niko1221/Strata
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Niko1221/Strata#7365 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 4 días
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Niko1221/Strata#7276 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Niko1221/Strata#7230 · 1 comentario ·
Los mantenedores suelen responder en 4 días
Todos los issues de Niko1221/Strata
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Quantinuum/tket#2282 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
Los mantenedores suelen responder en 10 días
-
Server crashes when a mob dies to poisonPosiblemente ocupada @joelstiller la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DarkCastleMUD/DarkCastle#305 ·
Los mantenedores suelen responder en 1 día
-
[Issue]: RAS status report lists the wrong pids for an outlier nodePosiblemente ocupada @bhargavchintam la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 2 días