mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5044] [CLOSED] [Engine] fix refused batch accounting, engine output decoding and q36 OOM messages #5297
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5297
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5044
Author: @bahooo22
Created: 11/3/2026
Status: ❌ Closed
Base:
main← Head:upstream-patches📝 Commits (3)
1bbdb32serve: refused batch admissions are errors, not completed requests (#3040)5d2fb57serve: decode the engine output with errors="replace"0c4ba48q36: report need/free MiB on expert-buffer and staging OOM📊 Changes
3 files changed (+65 additions, -28 deletions)
View changed files
📝
serve/server.py(+31 -20)📝
serve/test_parallel.py(+9 -1)📝
src/qwen35/q36_engine.cu(+25 -7)📄 Description
Problem and result
Three independent defects on the Windows/CUDA engine side.
no BGEN slot returned 503, but its history row was recorded as
lengthwith non-zeroprompt_tokens, and the totals, latencies andlast_timingsincluded it. After the changesuch a request is an
errorrow withprompt_tokens=0; the monitor keeps the row, whilecompletion and latency totals stay unchanged. The next admitted request counts normally.
non-UTF-8 bytes (e.g. 0x8e) to stdout;
_readerthreadraisedUnicodeDecodeError: 'utf-8' codec can't decode byte 0x8eand the server lost the engineoutput. After the change both engine and vision-encoder
Popencalls useerrors="replace"; an undecodable byte becomes U+FFFD in diagnostic text only, protocollines stay ASCII.
the failing line number but not how much it needed or had free, so a user could not tell
whether to shrink the context, MTP, slots or the quant.
alloc_vramnow covers the expertslots (
L.blobs, the all-in-VRAM case included), the slot table, the expert scratch andthe prompt staging, and reports need/free MiB with ctx, chunk, top_k and n_embd. Successful
loads are unchanged.
Related discussion
PR #3336; if that PR lands first, drop commit
1bbdb329.https://github.com/Niko1221/Strata/issues/4215 — OOM tail diagnostics.
Approach
Three small, independent commits; none changes a successful path. The accounting fix mirrors
the approach discussed in #3040/#3336: a local
admission_rejectedflag set only whenGpuBusyarrives before any segment and with zero tokens. The decoding fix is limited to thetwo
Popencalls that read the engine's stdout. The q36 patch moves the existing helper abovethe expert-placement loop and routes the three remaining
cudaMalloccalls through it; thereturn codes and
errstrings keep their shape ("out of memory: needs N MiB, M MiBfree").
Validation
Passed:
python -m py_compile serve/server.py serve/test_parallel.pyonffa80d73+ the threecommits — OK.
python -m unittest serve.test_parallel.ParallelService.test_bgen_refused_for_good_is_a_retryable_503_and_frees_the_slots -von
ffa80d73+ the three commits — 1/1 OK (4.6 s): 503, an error row with zero tokens andprompt_read=None, totals 1, and 2 after an admitted request.build-verify.bat— 25/25; the OOM message wasobserved on a real 8 GiB RTX 3060 Ti run of KAT Q5 80k:
prompt staging (E.stage[1]) allocation failed: need 528.0 MiB, free 1260.0 MiB (ctx 81920, chunk 512, top_k 8, n_embd 2048). With--vram-reserve-mib 1200the enginestarts (9 slots, 1.03 GiB staging).
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8e; with it the reader continues.Failed:
Not run:
ffa80d73+these three commits; the q36 hunk applies cleanly, but a fresh upstream build was not made).
Limits
1bbdb329duplicates the open PR #3336; drop it if that one is merged first.not attempt to guess the original encoding.
smaller chunk/reserve.
report the same fields.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
UD-IQ2_XSmatches GSQ-RCOIQ3_S#3160