[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
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 11.6k
- Fork
- 1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Niko1221/Strata
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Niko1221/Strata#7365 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Niko1221/Strata#7276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Niko1221/Strata#7230 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của Niko1221/Strata
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Quantinuum/tket#2282 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Server crashes when a mob dies to poisonCó thể đã có người làm @joelstiller đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DarkCastleMUD/DarkCastle#305 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Issue]: RAS status report lists the wrong pids for an outlier nodeCó thể đã có người làm @bhargavchintam đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày