mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4849] [Engine] Automatic resident mode skips file-tier recheck on Linux HIP: RX 7900 XTX A/B and patch #2228
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#2228
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?
Originally created by @Moltes94 on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4849
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
Reproduction status
Reproduced locally on 2026-10-31.
Strata version
Strata v0.2.9 · engine 0.1.55 · source commit
c62d5e3a15b40ea51c96aae9e8d36928965f53ab.Graphics card, memory and system
One AMD Radeon RX 7900 XTX, 24 GiB VRAM · 32 GB RAM · Intel Core i7-10700K · CachyOS Linux, kernel 7.3.0-4-cachyos · system ROCm 7.2.4.
What happened
With automatic
--resident-expertson one RX 7900 XTX / 32 GB RAM, the official v0.2.9 source (engine 0.1.55) stalled on two independent starts. A small Linux/HIP guard change together withSTRATA_FILE_CACHE_OLD_RULE=1completed the same synthetic workload on two independent starts: 24/24 exact API responses, including tool calls and tool-result round trips.The specific code problem is that the post-allocation file-tier recheck requires
o.resident_budget > 0. Automatic resident mode can allocate a RAM copy while that explicit CLI budget remains zero, so this path skipssrc.recheck_unbuffered()even after substantial RAM has been allocated.Expected: re-evaluate the file-tier policy from actual resident allocation in automatic mode, and finish requests with correct outputs. Actual: no post-allocation recheck in the baseline, multi-GiB process swap and stalls in prefill or intermediate verification. The patch enables the missing recheck; the existing opt-in selects the conservative policy on gfx1100.
This is evidence for a local mitigation, not proof that all ROCm stalls have the same cause. The MM-lock owner and the internal ROCm/kernel mechanism remain unverified. The patch and policy switch were tested together, not in separate GPU ablations.
Related: #1705 (host-memory waits), #1691 / #1752 (file-tier policy), and #3021. The latter also has a single-card unbuffered-I/O report, from a different system and model; those measurements are not mine. This report adds the automatic-resident guard omission and a same-day A/B/A/B on engine 0.1.55. It does not attribute this machine's failures to commit
805088d: an older incident also occurred on v0.1.40.1, before that commit.Version, hardware and software
c62d5e3a15b40ea51c96aae9e8d36928965f53abgfx1100, CUDA disabled/proc/meminfoMemTotal 32,765,792 kB7.3.0-4-cachyos/opt/rocm, 7.2.4; not a bundled release runtime3cf03257f219afbe7334045ff7c6a06ac68c627dexperts.bin, two native GGUF shards, MTPShard filenames:
Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00001-of-00002.ggufand...00002-of-00002.gguf. Model repository revision was not re-resolved during this campaign. Existing tokenizer, expert profile, Python environment and vision encoder were reused unchanged. The server source was v0.2.9. Vision was enabled, but the workload used text only.Configuration and reproduction
Relevant engine arguments (paths replaced with placeholders):
No
--resident-budget-gibis supplied. Common environment:A: unmodified source,
STRATA_FILE_CACHE_OLD_RULEunset.B: diff below, plus
STRATA_FILE_CACHE_OLD_RULE=1.No watchdog, kernel, driver, swap or pinning setting was changed between A and B.
STRATA_UNBUFFERED_LOAD=1was not a separate tested arm.The Python server was started with
python -B serve/server.py --engine strata --config <trial.json> --host 127.0.0.1 --port 18080. Each trial config selected the corresponding binary and arguments above.reasoning_budget_tokens=8192in both arms; requests usedmax_tokens=8192, temperature 0 and seed 4242. The server capped thinking at 6144 to reserve 2048 for the answer. The new engine can capture windows up to 6 despite requested--spec 4; both arms used this same behavior./v1/statusto report loaded./v1/messages/count_tokens: 22219, 22602, 38351, 38734 input tokens, respectively./v1/messages, non-streaming. After each tool response, send the tool-result continuation described below before moving to the next fixture.The local supervisor sampled metrics and
/procevery 3 seconds, attempted thread-stack capture after 30 seconds without progress, and stopped its own server at 300 seconds without progress or 900 seconds per request. Kernel stack reads were permission-denied; thread wait channels were available. No debugger was attached and no engines ran concurrently.Exact synthetic request generator and output checks
The generator below was checked offline against all four request dictionaries used in the campaign: exact equality. It generates synthetic data only. It does not start an engine or send requests.
Checks actually applied:
{"code":"CACAO-4729","values":list(range(1,513))}andstop_reason == "end_turn".tool_useblock with a nonempty ID, namereport_total, input exactly{"total_cents":7670,"currency":"EUR"}, andstop_reason == "tool_use".tool_choice, retaintools, append the complete assistant response content, then append a user message with these blocks (using the returned ID):Require the next response's concatenated text, stripped, to equal
7670, withstop_reason == "end_turn". No generated tool is executed on the host. These are functional checks, not just HTTP-success checks. Reasoning text was not required to be byte-identical.A/B/A/B results
Original trial labels are retained so they can be correlated with local artifacts. Two preflight starts, A1/A2, sent no model requests: the harness's process-identity check needed adjustment for
strata-hostand the separatestrata-visionprocess. They exited cleanly and are excluded from the workload results.Thus B passed 24 responses = 16 main requests + 8 tool continuations, on 2 independent starts / 4 cycles. This is not 24 independent engine starts. Token counts matched on all workload starts.
Logs and wait localization
A3: window 477 completed; window 478 had 4 tokens at position 24067, host/GPU/served/A/B all at 15. Repeated samples put
strata-hostinlock_mm_and_find_vma; another thread waited in__gup_longterm_locked. Selected native trace, pointer addresses omitted:The native per-layer verify wait is 20 s; kernel waits can delay checking that bound. After release, GPU markers progressed to 48. The Python server recognized the fatal verify error and terminated the engine (exit -15), then returned HTTP 503. The supervisor subsequently closed its server.
Caveat:
release_gpu_waits()currently treats a stream-query result other than NotReady as drained; the printed message alone is not proof of HIP success. The marker progression is additional evidence, not proof of a correctly completed request. This is not the historical final-window freeze where releasing flags still failed to drain the GPU.A4: native log:
The 48 counters belong to the previous request's last verify window, not the current prefill stage. They do not establish completion of current layer 8 or prove a worker-pool deadlock. Multiple thread samples showed
lock_mm_and_find_vma, including the watchdog thread later. The engine remained present after printing its diagnostic. At 300 s without progress, the supervisor sent SIGTERM to its server child; the engine later exited -6 and the server reported about 310 s for the request. This was not an entirely unassisted native abort observation.A filtered accessible kernel journal search over the campaign found no OOM kill, GPU reset, VM fault or ring timeout entries. This does not exclude kernel/ROCm memory interaction. Full kernel stacks and MM-lock ownership were not obtained; no KFD eviction tracing was performed.
Suspected defect and minimal tested patch
Pinned-source locations:
generate.cpp: post-allocation recheck guarded by explicitresident_budget > 0; budget defaults to zero and is assigned by the explicit budget option.expert_source.cpp: existingSTRATA_FILE_CACHE_OLD_RULEpolicy override. gfx906 defaults to the old rule; this gfx1100 build does not.The added condition uses actual allocated resident bytes. It preserves the
mmap_expertsand!startup_keptconditions and is limited to Linux/HIP. The runtime evidence agrees with the source-path reading: no post-allocation recheck line in A; B prints the recheck and changes to unbuffered reads.B additionally sets the existing
STRATA_FILE_CACHE_OLD_RULE=1. No change toexpert_source.cppis needed on this version. Merely selecting the policy does not remove the skipped call in the automatic-resident path; an environment-only GPU arm was not run.B1 startup:
The 13.7 GiB above is the policy's reported read-set estimate, not measured storage traffic. The separate prefill planner reported a 0.0 GiB file tier on that start; these diagnostics use different accounting and must not be treated as measured I/O. Automatic resident sizes also differed: A3 16.63 GiB (partial fallback), A4 17.48 GiB, B1 17.96 GiB. OS cache and background desktop state were not identical.
Validation and limits
Passed: both Release HIP builds; four cycles on the corrected variant with the strict output checks above;
git diff --check; 50 selected Python server tests:Build commands, with paths generalized:
Failed: both official-source workload starts, with the distinct failure phases documented above.
Not run / unresolved: separate patch-only and policy-only GPU ablations; CUDA/SYCL/Windows builds or hardware runs; real coding-agent task evaluation; vision requests; proof of long-term stability; root cause of every historical final-verify freeze. No system cache flushing or deliberate memory-stress process was used. Automatic RAM placement and conversation-cache allocation were not fixed, and desktop activity was not eliminated. This is a custom regression workload, not a standard approved Strata benchmark or a cross-hardware performance claim.
Binary SHA256 for local provenance:
The evidence supports fixing the missing automatic-resident recheck and retaining the conservative policy as an opt-in on this machine. It does not yet justify forcing that policy on every HIP GPU. Maintainer feedback on the guard and the best follow-up measurement to separate file-cache pressure from the underlying ROCm/MM wait would be useful.
@github-actions[bot] commented on GitHub (Oct 31, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Oct 31, 2026):
Thanks, this follows the format now.
video_urlparts through strata-vision, in the Qwen3-VL layout #3559