[GH-ISSUE #4849] [Engine] Automatic resident mode skips file-tier recheck on Linux HIP: RX 7900 XTX A/B and patch #2228

Open
opened 2026-11-04 01:57:42 +07:00 by bsakaguchi · 2 comments
Owner

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-experts on 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 with STRATA_FILE_CACHE_OLD_RULE=1 completed 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 skips src.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

Item Tested configuration
Source v0.2.9, c62d5e3a15b40ea51c96aae9e8d36928965f53ab
Engine 0.1.55, local Release HIP build, gfx1100, CUDA disabled
GPU One AMD Radeon RX 7900 XTX, 24 GiB VRAM
CPU Intel Core i7-10700K, 8 physical / 16 logical cores
RAM 32 GB installed; /proc/meminfo MemTotal 32,765,792 kB
Swap SwapTotal 46,137,336 kB; enabled and unchanged throughout
OS / kernel CachyOS Linux / 7.3.0-4-cachyos
ROCm System /opt/rocm, 7.2.4; not a bundled release runtime
hipBLASLt Runtime reported 100202; existing matching gfx1100 tuning table enabled
ggml Pinned 3cf03257f219afbe7334045ff7c6a06ac68c627d
Model Qwen3.8-Flash-Next GSQ-RCO Q2_0; existing pack with experts.bin, two native GGUF shards, MTP

Shard filenames: Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00001-of-00002.gguf and ...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):

--serve --pack <Q2_0_PACK>
--native <SHARD_1> --ple-gguf <SHARD_2>
--expert-profile <EXPERT_PROFILE>
--expert-cache auto --prefill auto
--spec 4 --spec-min-p 0.5 --mtp <MTP_DIR>
--max-context 131072 --kv k8v4
--resident-experts --vision --vram-reserve-mib 3072

No --resident-budget-gib is supplied. Common environment:

STRATA_HIPBLASLT_TUNING=<matching gfx1100 table>
STRATA_RESIDENT_PIN=0
STRATA_RESIDENT_HEADROOM_GIB=4
HSA_USERPTR_FOR_PAGED_MEM=0
STRATA_STAGER_THREADS=4
STRATA_STAGER_RING=16
STRATA_VERIFY_TRACE=1

A: unmodified source, STRATA_FILE_CACHE_OLD_RULE unset.
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=1 was 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=8192 in both arms; requests used max_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.

  1. Start only one engine and wait for /v1/status to report loaded.
  2. Count the four generated requests below with /v1/messages/count_tokens: 22219, 22602, 38351, 38734 input tokens, respectively.
  3. Send them sequentially to /v1/messages, non-streaming. After each tool response, send the tool-result continuation described below before moving to the next fixture.
  4. Repeat the cycle once on the same engine: 4 main requests + 2 continuations per cycle, hence 12 responses per start.
  5. Stop at the first HTTP error, wrong output, or sustained lack of progress; do not retry or auto-reload. Repeat on independent starts in order A / B / A / B.

The local supervisor sampled metrics and /proc every 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.

"""Public synthetic workload. No user session or project content."""
import json


def requests():
    result = []
    for rows in (580, 1000):
        filler = '\n'.join(
            f'const item_{i:04d} = {{id: {i}, category: "cacao", stock: {i % 17}, price_cents: 1290}};'
            for i in range(rows))
        common = dict(model='qwen3.8-flash-next-q2_0', temperature=0, seed=4242, max_tokens=8192)
        result.append(dict(common, messages=[dict(role='user', content=filler +
            '\nPour vérifier la lecture : réponds uniquement par un objet JSON avec code="CACAO-4729" et values=[1,2,...,512], tous les entiers inclus.')]))
        result.append(dict(common, messages=[dict(role='user', content=filler +
            '\nAppelle report_total : 2 tablettes à 1290 centimes + 1 coffret à 4500 + livraison 590. Devise EUR.')],
            tools=[dict(name='report_total', description='Enregistrer un total calculé en centimes.',
                input_schema=dict(type='object', properties=dict(total_cents=dict(type='integer'),
                    currency=dict(type='string')), required=['total_cents', 'currency'], additionalProperties=False))],
            tool_choice=dict(type='tool', name='report_total')))
    return result


if __name__ == '__main__':
    print(json.dumps(requests(), ensure_ascii=False))

Checks actually applied:

  • JSON: concatenate text blocks, parse JSON, require exact equality to {"code":"CACAO-4729","values":list(range(1,513))} and stop_reason == "end_turn".
  • Tool: exactly one tool_use block with a nonempty ID, name report_total, input exactly {"total_cents":7670,"currency":"EUR"}, and stop_reason == "tool_use".
  • Continuation: copy the tool request, remove tool_choice, retain tools, append the complete assistant response content, then append a user message with these blocks (using the returned ID):
[
    {"type": "tool_result", "tool_use_id": call["id"], "content": "7670"},
    {"type": "text", "text": "Réponds uniquement 7670."}
]

Require the next response's concatenated text, stripped, to equal 7670, with stop_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-host and the separate strata-vision process. They exited cleanly and are excluded from the workload results.

Order / arm Correct responses before stop Peak sampled process VmSwap Outcome
A3, official 0 7536.8 MiB First 22219-token prompt read; 1849 generated tokens, then HTTP 503 after about 112 s; verification layer 15
B1, patched + old rule 12/12 58.7 MiB Two complete cycles; clean shutdown
A4, official 1 11356.6 MiB JSON passed; second 22602-token request stalled in prefill, layer 8; bounded stop
B2, patched + old rule 12/12 145.1 MiB Two complete cycles; clean shutdown

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-host in lock_mm_and_find_vma; another thread waited in __gup_longterm_locked. Selected native trace, pointer addresses omitted:

TIMEOUT         window 478 step 15 layer 15 aux 600 | seq 15 flag 15 A 15 B 15
RELEASE         window 478 step -1 layer -1 aux 5000 | seq 15 flag 15 A 15 B 15
RELEASE-DRAINED window 478 step -1 layer -1 aux 953 | seq 48 flag 4294967295 A 4294967295 B 4294967295

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:

strata serve: no progress for 60 s during a request (reading the prompt (batched): waiting for the GPU (attention, router) at layer 8 of the prompt chunk from token 0) - stopping the engine so the server starts it again (issue #29)
strata serve: stall report (engine 0.1.55): stage "reading the prompt (batched): waiting for the GPU (attention, router) at layer 8 of the prompt chunk from token 0" for 61 s; 0 layers served since the last finished step (0 = stopped, more = slow)
  VRAM free when this request began: 3162 MiB
  expert pool: epoch 39230, batch epoch 39230: 24 of 24 jobs claimed, 24 done; 7 of 7 workers parked, 7 sleeping; mode 0
  verify window (last window, not the current stage): 4 tokens at position 24315, host at layer step 48; the GPU rang 48; flags: served 48, plan (A) 48, copies (B) 48

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 explicit resident_budget > 0; budget defaults to zero and is assigned by the explicit budget option.
  • expert_source.cpp: existing STRATA_FILE_CACHE_OLD_RULE policy override. gfx906 defaults to the old rule; this gfx1100 build does not.

The added condition uses actual allocated resident bytes. It preserves the mmap_experts and !startup_kept conditions 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.

--- a/src/program/generate.cpp
+++ b/src/program/generate.cpp
@@ -9267,7 +9267,11 @@
         // the file cache keeps those, and every refill after a prompt read the drive instead).  Windows and Linux: the
         // unbuffered reads exist there
 #if defined(_WIN32) || defined(__linux__)
-        if (o.mmap_experts && o.resident_budget > 0 && !startup_kept) {
+        if (o.mmap_experts && (o.resident_budget > 0
+#if defined(__linux__) && defined(STRATA_USE_HIP)
+                              || src.resident_bytes() > 0
+#endif
+                             ) && !startup_kept) {
             std::string why;
             const bool was = src.unbuffered();
             const bool ub = src.recheck_unbuffered(why);

B additionally sets the existing STRATA_FILE_CACHE_OLD_RULE=1. No change to expert_source.cpp is 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:

strata generate: the file tier reads unbuffered (changed) (re-checked with the RAM copy built (17.96 GiB): 5.7 GiB available, 0.0 GiB of it still to be taken by the RAM copy, 13.7 GiB of experts read from the files: the file cache cannot keep the ones that come back)

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:

python -B -m unittest serve.test_frontend serve.test_history_tools \
  serve.test_chat_tool_results serve.test_context_overflow serve.test_lifecycle

Build commands, with paths generalized:

cmake -S <checkout> -B <checkout>/build-hip -G Ninja \
  -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=OFF \
  -DSTRATA_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx1100 \
  -DSTRATA_GGML_DIR=<pinned-ggml-checkout>
cmake --build <checkout>/build-hip --target strata -j2

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:

A e7a3e00be1a71d6928740ddcdfe96688e52051aad043ace44aa70495bc21480e
B ba4f2cb6ba217014668f79fdd9667f5e8c2131ca514c77370ddfd21726d6e26e

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.

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-experts` on 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 with** `STRATA_FILE_CACHE_OLD_RULE=1` completed 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 skips `src.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](https://github.com/Niko1221/Strata/issues/3021#issuecomment-6526653679), 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 | Item | Tested configuration | | --- | --- | | Source | v0.2.9, `c62d5e3a15b40ea51c96aae9e8d36928965f53ab` | | Engine | 0.1.55, local Release HIP build, `gfx1100`, CUDA disabled | | GPU | One AMD Radeon RX 7900 XTX, 24 GiB VRAM | | CPU | Intel Core i7-10700K, 8 physical / 16 logical cores | | RAM | 32 GB installed; `/proc/meminfo` MemTotal 32,765,792 kB | | Swap | SwapTotal 46,137,336 kB; enabled and unchanged throughout | | OS / kernel | CachyOS Linux / `7.3.0-4-cachyos` | | ROCm | System `/opt/rocm`, 7.2.4; not a bundled release runtime | | hipBLASLt | Runtime reported 100202; existing matching gfx1100 tuning table enabled | | ggml | Pinned `3cf03257f219afbe7334045ff7c6a06ac68c627d` | | Model | Qwen3.8-Flash-Next GSQ-RCO Q2_0; existing pack with `experts.bin`, two native GGUF shards, MTP | Shard filenames: `Qwen3.8-Flash-Next-GSQ-RCO-Q2_0-00001-of-00002.gguf` and `...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): ```text --serve --pack <Q2_0_PACK> --native <SHARD_1> --ple-gguf <SHARD_2> --expert-profile <EXPERT_PROFILE> --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <MTP_DIR> --max-context 131072 --kv k8v4 --resident-experts --vision --vram-reserve-mib 3072 ``` **No `--resident-budget-gib` is supplied.** Common environment: ```text STRATA_HIPBLASLT_TUNING=<matching gfx1100 table> STRATA_RESIDENT_PIN=0 STRATA_RESIDENT_HEADROOM_GIB=4 HSA_USERPTR_FOR_PAGED_MEM=0 STRATA_STAGER_THREADS=4 STRATA_STAGER_RING=16 STRATA_VERIFY_TRACE=1 ``` A: unmodified source, `STRATA_FILE_CACHE_OLD_RULE` unset. 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=1` was 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=8192` in both arms; requests used `max_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. 1. Start only one engine and wait for `/v1/status` to report loaded. 2. Count the four generated requests below with `/v1/messages/count_tokens`: **22219, 22602, 38351, 38734** input tokens, respectively. 3. Send them sequentially to `/v1/messages`, non-streaming. After each tool response, send the tool-result continuation described below before moving to the next fixture. 4. Repeat the cycle once on the same engine: 4 main requests + 2 continuations per cycle, hence 12 responses per start. 5. Stop at the first HTTP error, wrong output, or sustained lack of progress; do not retry or auto-reload. Repeat on independent starts in order **A / B / A / B**. The local supervisor sampled metrics and `/proc` every 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. <details> <summary>Exact synthetic request generator and output checks</summary> 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. ```python """Public synthetic workload. No user session or project content.""" import json def requests(): result = [] for rows in (580, 1000): filler = '\n'.join( f'const item_{i:04d} = {{id: {i}, category: "cacao", stock: {i % 17}, price_cents: 1290}};' for i in range(rows)) common = dict(model='qwen3.8-flash-next-q2_0', temperature=0, seed=4242, max_tokens=8192) result.append(dict(common, messages=[dict(role='user', content=filler + '\nPour vérifier la lecture : réponds uniquement par un objet JSON avec code="CACAO-4729" et values=[1,2,...,512], tous les entiers inclus.')])) result.append(dict(common, messages=[dict(role='user', content=filler + '\nAppelle report_total : 2 tablettes à 1290 centimes + 1 coffret à 4500 + livraison 590. Devise EUR.')], tools=[dict(name='report_total', description='Enregistrer un total calculé en centimes.', input_schema=dict(type='object', properties=dict(total_cents=dict(type='integer'), currency=dict(type='string')), required=['total_cents', 'currency'], additionalProperties=False))], tool_choice=dict(type='tool', name='report_total'))) return result if __name__ == '__main__': print(json.dumps(requests(), ensure_ascii=False)) ``` Checks actually applied: - JSON: concatenate text blocks, parse JSON, require exact equality to `{"code":"CACAO-4729","values":list(range(1,513))}` and `stop_reason == "end_turn"`. - Tool: exactly one `tool_use` block with a nonempty ID, name `report_total`, input exactly `{"total_cents":7670,"currency":"EUR"}`, and `stop_reason == "tool_use"`. - Continuation: copy the tool request, remove `tool_choice`, retain `tools`, append the complete assistant response content, then append a user message with these blocks (using the returned ID): ```python [ {"type": "tool_result", "tool_use_id": call["id"], "content": "7670"}, {"type": "text", "text": "Réponds uniquement 7670."} ] ``` Require the next response's concatenated text, stripped, to equal `7670`, with `stop_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. </details> ### 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-host` and the separate `strata-vision` process. They exited cleanly and are excluded from the workload results. | Order / arm | Correct responses before stop | Peak sampled process VmSwap | Outcome | | --- | ---: | ---: | --- | | A3, official | 0 | 7536.8 MiB | First 22219-token prompt read; 1849 generated tokens, then HTTP 503 after about 112 s; verification layer 15 | | B1, patched + old rule | 12/12 | 58.7 MiB | Two complete cycles; clean shutdown | | A4, official | 1 | 11356.6 MiB | JSON passed; second 22602-token request stalled in prefill, layer 8; bounded stop | | B2, patched + old rule | 12/12 | 145.1 MiB | Two complete cycles; clean shutdown | 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-host` in `lock_mm_and_find_vma`; another thread waited in `__gup_longterm_locked`. Selected native trace, pointer addresses omitted: ```text TIMEOUT window 478 step 15 layer 15 aux 600 | seq 15 flag 15 A 15 B 15 RELEASE window 478 step -1 layer -1 aux 5000 | seq 15 flag 15 A 15 B 15 RELEASE-DRAINED window 478 step -1 layer -1 aux 953 | seq 48 flag 4294967295 A 4294967295 B 4294967295 ``` 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: ```text strata serve: no progress for 60 s during a request (reading the prompt (batched): waiting for the GPU (attention, router) at layer 8 of the prompt chunk from token 0) - stopping the engine so the server starts it again (issue #29) strata serve: stall report (engine 0.1.55): stage "reading the prompt (batched): waiting for the GPU (attention, router) at layer 8 of the prompt chunk from token 0" for 61 s; 0 layers served since the last finished step (0 = stopped, more = slow) VRAM free when this request began: 3162 MiB expert pool: epoch 39230, batch epoch 39230: 24 of 24 jobs claimed, 24 done; 7 of 7 workers parked, 7 sleeping; mode 0 verify window (last window, not the current stage): 4 tokens at position 24315, host at layer step 48; the GPU rang 48; flags: served 48, plan (A) 48, copies (B) 48 ``` 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`](https://github.com/Niko1221/Strata/blob/c62d5e3a15b40ea51c96aae9e8d36928965f53ab/src/program/generate.cpp#L9270): post-allocation recheck guarded by explicit `resident_budget > 0`; budget defaults to zero and is assigned by the explicit budget option. - [`expert_source.cpp`](https://github.com/Niko1221/Strata/blob/c62d5e3a15b40ea51c96aae9e8d36928965f53ab/src/core/expert_source.cpp#L925): existing `STRATA_FILE_CACHE_OLD_RULE` policy override. gfx906 defaults to the old rule; this gfx1100 build does not. The added condition uses actual allocated resident bytes. It preserves the `mmap_experts` and `!startup_kept` conditions 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. ```diff --- a/src/program/generate.cpp +++ b/src/program/generate.cpp @@ -9267,7 +9267,11 @@ // the file cache keeps those, and every refill after a prompt read the drive instead). Windows and Linux: the // unbuffered reads exist there #if defined(_WIN32) || defined(__linux__) - if (o.mmap_experts && o.resident_budget > 0 && !startup_kept) { + if (o.mmap_experts && (o.resident_budget > 0 +#if defined(__linux__) && defined(STRATA_USE_HIP) + || src.resident_bytes() > 0 +#endif + ) && !startup_kept) { std::string why; const bool was = src.unbuffered(); const bool ub = src.recheck_unbuffered(why); ``` B additionally sets the existing **`STRATA_FILE_CACHE_OLD_RULE=1`**. No change to `expert_source.cpp` is 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: ```text strata generate: the file tier reads unbuffered (changed) (re-checked with the RAM copy built (17.96 GiB): 5.7 GiB available, 0.0 GiB of it still to be taken by the RAM copy, 13.7 GiB of experts read from the files: the file cache cannot keep the ones that come back) ``` 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: ```sh python -B -m unittest serve.test_frontend serve.test_history_tools \ serve.test_chat_tool_results serve.test_context_overflow serve.test_lifecycle ``` Build commands, with paths generalized: ```sh cmake -S <checkout> -B <checkout>/build-hip -G Ninja \ -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=OFF \ -DSTRATA_ENABLE_HIP=ON -DCMAKE_HIP_ARCHITECTURES=gfx1100 \ -DSTRATA_GGML_DIR=<pinned-ggml-checkout> cmake --build <checkout>/build-hip --target strata -j2 ``` **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: ```text A e7a3e00be1a71d6928740ddcdfe96688e52051aad043ace44aa70495bc21480e B ba4f2cb6ba217014668f79fdd9667f5e8c2131ca514c77370ddfd21726d6e26e ``` 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.
Author
Owner

@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:

  • Fill in "Area".
  • Fill in "Desktop app, Terminal or source?".
  • Fill in "Strata version".
  • Fill in "Graphics card, memory and system".

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

<!-- gh-comment-id:6548038842 --> @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: - [ ] Fill in "Area". - [ ] Fill in "Desktop app, Terminal or source?". - [ ] Fill in "Strata version". - [ ] Fill in "Graphics card, memory and system". 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](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6548153473 --> @github-actions[bot] commented on GitHub (Oct 31, 2026): Thanks, this follows the format now.
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#2228
No description provided.