Skip to content

[Engine] gfx1102: 0.2.20-poly.2 crashes in amdhip64_7.dll (0xC0000005 @ 0x2d874a) on first agentic request after expert-cache growth #305

Backlog

Description

@JuggyBob

Area

[Engine] (speed, kernels, models, the server and API)

The defect is in the inference engine's HIP path: a deterministic access violation in
amdhip64_7.dll while serving requests, reached right after the engine's dynamic
expert-cache growth. It is not a web UI, Terminal/launch, docs or benchmark issue.

Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

Specifically a local HIP build of release tag v0.2.20-poly.2, because the
ready-made Windows engine is CUDA-only and this is an RDNA3 card. The exact CMake and
build command is in "Build command" below. The baseline comparison is the local
pre-poly.10 engine already on the same machine.

Reproduction status

Reproduced locally

Six crashes in two independent guarded runs (three per run): identical faulting
module, exception code and fault offset each time, and identical client symptom. The
second run had a 90-second cooldown and a fresh expert-profile copy, so this is not a
one-off or a VRAM handoff race.

POLYSTRATA VERSION

  • Reported build: PolyStrata 0.2.20-poly.2, tag v0.2.20-poly.2, commit
    5c838331cb8f99b0ef27630846dcca99505ee207, cloned from
    https://github.com/simplexai-labs/PolyStrata.git. Engine binary: locally built
    strata-poly.exe, 20,148,224 bytes, SHA-256
    86238C662C1A547D8F2EE318F79F8D18B2CDB2053533B1F7D260708EF789A600.
  • Baseline build (identical workload, no crash): local pre-poly.10 engine, git
    7a6c098362d014cd7a0b498897ae387635169c41 (tag
    pre-poly10-20261118-poly10), SHA-256
    3A50C224D8244421E64F7C5E2F9079DD24227E38E56EF24BB562760E5B6F379F.
  • HIP runtime: amdhip64_7.dll, 16,399,360 bytes. The file on disk in the packaged
    ROCm toolchain reports version 10.0.3686.0; the Windows Error Reporting record
    names 10.0.3683.0. Both engines were given the same DLL path from
    A:\StrataTools\PolyStrata\.rocm-win\Lib\site-packages\_rocm_sdk_devel\bin.

GRAPHICS CARD, MEMORY AND SYSTEM

  • GPU 0: AMD Radeon RX 7600 XT, 16 GB, RDNA3 / gfx1102, device id 0x7480,
    driver 32.0.32015.16001. Secondary: AMD Radeon(TM) Graphics iGPU, 512 MB.
  • CPU: AMD Ryzen 5 7600X (6 cores / 12 threads), Gigabyte B650 EAGLE AX board.
  • RAM: 31.1 GiB. OS: Windows 11 Home, 10.0.26300 build 26300.

MODEL, SIZE AND SETTINGS

  • Model: Qwen3.6-35B-A3B-UD-Q3_K_M.gguf (MoE, 10,496 routed experts).
  • Both engines served through serve/server.py --engine strata, on port 8082, with
    identical args:
    --max-context 98304 --expert-profile <copy> --conversation-cache-mib 0 --tail-skip 6 --kv-whole --cache-bias 0.25 --vram-reserve-mib 2000.
  • Each engine got its own copy of the same expert profile, byte-identical at
    load. No daily config, profile, binary or user setting was modified for the trial.

WHAT HAPPENED

poly.2 loads dramatically faster than the baseline (6.2 s vs 37.2 s) and serves a
long chat completion at 79.3 tok/s. It then dies with an access violation inside the
AMD HIP runtime on the first request of a real agentic session, and every
automatic restart dies the same way. The daily pre-poly.10 engine ran the identical
workload through all four repair fixtures (121 logged requests, mean 78.7 tok/s
decode) without a single crash.

The last engine-log line before every crash is a dynamic expert-cache growth:

strata-poly: the expert cache 5452 -> 5504 experts (7.10 GiB) for the VRAM free now, 2068 MiB left

It appears immediately after the long completion and before the next agentic request.
The single chat completion alone does not trigger the fault; the first tool-use
turn of the agentic stream does.

Memory was never the cause: commit stayed around 30/57 GiB, the guard never aborted,
and the engine printed 2068 MiB of VRAM left at the moment of the resize.

SMALLEST STEPS OR COMMAND THAT REPRODUCE IT

  1. Clone tag v0.2.20-poly.2, build a gfx1102 HIP engine (exact command below).
  2. Host the model with the flags above on port 8082 via serve/server.py --engine strata.
  3. POST one chat completion:
    {"model":"anything","messages":[{"role":"user","content":"tell me a nice long sci-fi story"}],"max_tokens":2048,"temperature":0.9,"stream":false}.
    It succeeds (~79 tok/s) and the engine grows its expert cache afterwards.
  4. Send a second, ordinary follow-up request with a few thousand tokens of context
    (an agent tool-use turn is what we used). The engine faults in amdhip64_7.dll;
    the server restarts it three times and each restart faults again.
  5. Read the fault records with
    Get-WinEvent -FilterHashtable @{LogName='Application'; Level=2}.

Build command

call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set PATH=C:\Program Files\CMake\bin;A:\Strata\terminal\.venv\Scripts;%PATH%
set HIP_PLATFORM=amd
set HIP_PATH=A:\StrataTools\PolyStrata\.rocm-win\Lib\site-packages\_rocm_sdk_devel
set ROCM_PATH=%HIP_PATH%
set PATH=%HIP_PATH%\bin;%HIP_PATH%\lib\llvm\bin;%PATH%
cmake -G Ninja -S "<src>\engine" -B "<build>" -DCMAKE_BUILD_TYPE=Release ^
  -DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DSTRATA_BUILD_TESTS=OFF ^
  -DSTRATA_PREFILL_MMQ=ON -DSTRATA_PORTABLE=OFF ^
  -DCMAKE_HIP_ARCHITECTURES=gfx1102 ^
  "-DCMAKE_C_COMPILER=%ROCM_F%/lib/llvm/bin/clang.exe" ^
  "-DCMAKE_CXX_COMPILER=%ROCM_F%/lib/llvm/bin/clang++.exe" ^
  "-DCMAKE_HIP_COMPILER=%ROCM_F%/lib/llvm/bin/clang++.exe" ^
  "-DCMAKE_HIP_COMPILER_ROCM_ROOT=%ROCM_F%" "-DCMAKE_PREFIX_PATH=%ROCM_F%" ^
  "-DCMAKE_HIP_FLAGS=--rocm-path=%ROCM_F% --rocm-device-lib-path=%ROCM_F%/lib/llvm/amdgcn/bitcode"
cmake --build "<build>" --target strata-poly -j 6

Build flags were matched to the daily engine (STRATA_PORTABLE=OFF,
STRATA_PREFILL_MMQ=ON, same ROCm toolchain, gfx1102) to rule out a simple flag
difference. STRATA_GGML_DIR cannot be matched: poly.2 uses vendored ggml.

LOGS

Engine log, first attempt (the ready and prompt lines show the successful probe;
the resize is the last line before the restart):

[strata] 2026-11-23 23:21:24 engine started: ...\build-matched\strata-poly.exe --serve --model ... --max-context 98304 ...
strata-poly: STRATA_GDN_MMA: unchanged (needs a CUDA build)
strata: Windows budgets 15557 of this card's 16368 MiB for this process; free VRAM is counted within that (STRATA_WDDM_BUDGET=0: off)
strata: other programs hold 1186 MiB of card 0; free VRAM is counted without it and a 1024 MiB margin (STRATA_WDDM_OTHERS=0: off, STRATA_WDDM_MARGIN_MIB=N)
strata-poly: loaded in 6.3 s; 5332 of 10496 routed experts in VRAM (6.9 GiB), 8 CPU threads
strata-poly: cache bias 0.25: a token that comes a few at a time routes with 0.25 added to the score of each expert in VRAM; the weights stay the router's own
strata-poly: tail skip 6: an expert outside VRAM that every token of a window ranks at place 7 or later among its experts is left out; STRATA_ROUTE_TAIL_SKIP=0 turns it off
strata-poly: ready for requests (context 98304); an engine that waits for one uses no CPU
strata serve: prompt 20 tokens = 0 reused + 20 read in 281 ms (71.1 tok/s), 2048 generated in 25822 ms (79.3 tok/s), drafts accepted 1105 of 1573
strata-poly: the expert cache 5452 -> 5504 experts (7.10 GiB) for the VRAM free now, 2068 MiB left
[strata] 2026-11-23 23:22:11 engine started: ...
... (two more identical start/crash cycles)

Windows Application Error records (all six, identical apart from time and PID):

Faulting application name: strata-poly.exe, version: 0.0.0.0, time stamp: 0x6b04b7f3
Faulting module name:      amdhip64_7.dll, version: 10.0.3683.0, time stamp: 0x6ac83dd1
Exception code:            0xc0000005   (access violation)
Fault offset:              0x00000000002d874a   (IDENTICAL in all 6 events)
Times, attempt 1:          23:22:05, 23:22:18, 23:22:33
Times, attempt 2:          23:25:38, 23:25:51, 23:26:06

Client-side symptom, repeated after each of the three automatic retries:

custom didn't answer after 3 attempts — it looks temporarily unavailable. Wait a minute and send /retry, or switch models with /model.
Provider said: the engine stopped unexpectedly (exit code 3221225477); the next request restarts it
Your request was not processed. Send it again if you still want me to carry it out.

3221225477 decimal = 0xC0000005 hex.

POLYMATH HARNESS — POSSIBLE COMPATIBILITY FACTOR

The agentic workload comes from polymath, an open local-model test harness at
https://github.com/JuggyBob/polymath (local commit
eb7e220ccb60504d6bc9b777cfc0959d02758a23). The failing fixture is
repair/python/v5 — an async job coordinator with 25 visible and 55 hidden tests.
The client is Hermes using the already-existing qwen96k profile
(base_url: http://127.0.0.1:8082/v1), launched with:

hermes -m qwen96k -z "<task prompt: fix the bugs in this repository, workspace is trial dir, ignore parent READMEs, re-run tests after each fix because failures may be masked>" --yolo --reasoning none

That prompt produces a multi-turn, tool-heavy stream with long, heavily
prefix-cached prompts. The server log shows requests such as
prompt 32225 tokens = 31853 reused + 372 read in 1196 ms (311.0 tok/s), 215 generated in 2710 ms (79.3 tok/s),
arriving every few seconds.

Why this may matter:

  • The crash did not happen with a single long chat completion. It happened on the
    first request of the agentic stream, directly after the expert-cache resize. A
    rapid series of prefix-cached tool-use turns may be the trigger, or it may simply be
    the first request after the resize.
  • The same polymath v5 harness, Hermes profile, config and prompts ran the
    pre-poly.10 engine through python, cpp, js and rust — 121 logged requests, no
    crashes. So this is not a generic harness defect. It is an interaction between
    poly.2's changed cache behaviour and this request pattern; worth checking whether
    your own benchmark suites exercise that shape (high reuse ratio, many small
    subsequent reads, rapid client turns).
  • One unrelated detail, so it is not mistaken for an engine fault: the v5 C++ fixture's
    own scorer has a bug (NameError: shutil in
    repair/cpp/v5/_grader/score.py). It fails identically for both engines.

The full evidence file, with every request line, command and guard outcome, is
A:\StrataTools\docs\reports\POLY2-SERVER-AB-FULL-2026-11-23.md on the reporting
machine. I can paste any section here on request.

WHAT I TRIED

  • Two independent guarded runs, each with a fresh expert-profile copy and identical
    flags. Six crashes total, same fault address.
  • A 90-second cooldown after stopping the baseline engine before starting poly.2.
    The "other programs hold ~1068 MiB" line persists afterwards, so the reported VRAM
    held by other processes is not the 1-second handoff from the previous run.
  • Matched build flags with the daily engine to rule out a simple build-option cause.
  • STRATA_FREEZE_EXPERTS=1 is being tested now (see next section); the engine log
    confirms it took effect: "the experts' split is frozen for the engine's whole run
    (STRATA_FREEZE_EXPERTS)".

SEARCHED FIRST

QUESTIONS

  1. Is the dynamic expert-cache growth path (the expert cache N -> M experts ... for the VRAM free now) known to fault on RDNA3/gfx1102 when a rapid agentic request
    stream follows? The identical offset six times points to one specific code path.
  2. Is STRATA_FREEZE_EXPERTS=1 the recommended workaround, or is there a cheaper way
    to pin or stabilize the split (for example an --expert-cache N flag)?
  3. Are the build differences relevant — vendored ggml instead of STRATA_GGML_DIR,
    and STRATA_GDN_MMA: unchanged (needs a CUDA build) — or is that message expected
    and inert on HIP?
  4. What debug output would help? I can provide a minidump, per-kernel logs or an
    instrumented build if you say what is useful.

Note: poly.2's ~6 s load time against ~37 s is a major improvement for us. If the
crash can be fixed or reliably worked around, I would switch to this build immediately.

Activity

  1. added
    needs-format
    on Nov 24, 2026
  2. github-actions commented on Nov 24, 2026

    @github-actions

    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 "Terminal or source?".
    • Fill in "Reproduction status".

    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

  3. removed
    needs-format
    on Nov 24, 2026
  4. github-actions commented on Nov 24, 2026

    @github-actions

    Thanks, this follows the format now.

  5. JuggyBob commented on Nov 24, 2026

    @JuggyBob
    Author

    Update on STRATA_FREEZE_EXPERTS=1, requested in #289 as a possible workaround.

    Result: inconclusive, but it did not reach the crash. With the flag set, the engine
    accepted it and printed:

    strata-poly: the experts' split is frozen for the engine's whole run (STRATA_FREEZE_EXPERTS): greedy answers are a function of the request alone, and the only cache change after load is the serve VRAM resize
    

    It then never became READY. The start script gave up after 600 s
    (NOT READY after 600s), the guard exited 1 at 605.4 s, and no request was served,
    so no v5 campaign ran and the original 0xC0000005 crash was not reproduced in this
    mode. The engine log's last line was:

    rocBLAS error during freeing of allocated memory in handle destructor: rocblas_status_internal_error
    

    Windows Error Log shows no strata-poly.exe fault during this run. Machine was
    verified clean afterwards (no model processes, no listener, 11.6/57.1 GiB commit).

    Important caveat: this run happened right after a PC reboot, so the model file's OS
    cache was cold. The earlier 6.2 s poly.2 loads were with a warm cache; a cold load of
    this ~20 GB model can take several minutes. So the 600 s readiness window may simply
    have been too short, and the rocBLAS destructor message may be a shutdown artifact
    when the guard tore the tree down. This does not yet tell us whether freezing the
    expert split prevents the access violation.

    If it is useful, I will repeat with a warmed file cache and a 1,200 s readiness window,
    so the frozen run actually gets to the agentic request. Please say whether that is worth
    doing, or whether the fault offset and logs already give you enough to go on.

  6. okada-shogo commented on Nov 24, 2026

    @okada-shogo
    Contributor

    @JuggyBob Thank you for the detailed report.

    Can you try port/hip-win-no-lend on https://github.com/okada-shogo/PolyStrata?

    There seems to be an issue with lending buffers to the expert cache between prompts. I saw this crash when testing with WSL2 but it's possibly related to the Windows AMD driver.

    If it still crashes, these would help most:

    1. The engine's stderr with AMD_LOG_LEVEL=4 set for the engine (a lot of output, so only the last ~200 lines before the crash). It shows the last HIP call.
    2. A minidump of the crash (WER LocalDumps for strata-poly.exe).

    On your other questions: STRATA_FREEZE_EXPERTS=1 does not fully turn the lending off (the prompt's work memory is still lent from the start), so it is not a workaround here. STRATA_GDN_MMA: unchanged (needs a CUDA build) is expected on HIP and does nothing. -DSTRATA_PREFILL_MMQ=ON is not read by this CMake tree, so it changes nothing; the build flags are not the cause.

  7. JuggyBob commented on Nov 25, 2026

    @JuggyBob
    Author

    @okada-shogo Tested port/hip-win-no-lend (PR #334, commit 9f9c9bb66b2a32073aaea3a014871abcdb0977a0) on the same RX 7600 XT / gfx1102 / Windows 11 host as this report. It does not fix the crash.

    Build: local HIP gfx1102 Release, STRATA_PORTABLE=OFF, vendored ggml, same ROCm toolchain. Engine SHA-256 7B07414FF7467A977EFA92BE5EFF38E3DB1D10336AED1046F6B3C550B6FD2BBB. I reviewed the 4-file +26/−13 diff (only the STRATA_VMM_RELEASE_WITH_ADDRESSES → STRATA_VMM_NO_PROMPT_LEND switches plus a doc note) and confirmed the macro and call sites are in the compiled binary. The run used its own config, its own byte-identical expert-profile copy, and port 8093; nothing in the daily install was changed.

    Two guarded runs, each: one real long chat completion (max_tokens=2048), then prefix-cached follow-ups shaped like agent tool turns.

    Run AMD_LOG_LEVEL Load Result
    1 default 52.4 s engine died on the first long request (~3 s), exit 3221225477, 1 WER fault
    2 4 8.1 s died on the first long request, auto-restarted and died again, 2 WER faults

    Run 1's load was slow because the engine reported 11.8 GiB of RAM free for 7.8 GiB of experts outside VRAM and kept 7,197 MiB of them in RAM (4,511 of 10,496 experts in VRAM). With more RAM free, run 2 loaded in 8.1 s, so the load-time improvement is real — but the engine is still unusable.

    All three faults have the identical signature as the six from the original report:

    Faulting application name: strata-poly.exe
    Faulting module name:      amdhip64_7.dll, version 10.0.3683.0
    Exception code:            0xc0000005
    Fault offset:              0x00000000002d874a
    

    One new detail: with this branch the crash happens on the first long prompt, before any expert cache N -> M growth line appears — matching the symptom your PR text predicted, but with lending off. So on this host the lending path is not the cause.

    Diagnostic tail from the AMD_LOG_LEVEL=4 run (observations only, no cause claimed). Last logged HIP activity before the fault, in order: hipExtModuleLaunchKernel for dequant_flat_kernel<__half>, rocBLAS Cijk_Alik_Bljk_HSS_BH_MT128x32x16_SE_1LDSB0_..., Cijk_S_PostGSU3, then __amd_rocclr_fillBufferAligned on a 505,479,168-byte buffer. The trace also contains Failed to discover binary path for kpack loading and one hipModuleGetFunction: hipErrorNotFound followed by a successful lookup of a different kernel.

    Tell me what would help next. I can provide the full AMD_LOG_LEVEL=4 engine log (large) or set up WER LocalDumps for a minidump; I have not enabled LocalDumps. The daily pre-poly.10 engine remains unchanged.

  8. okada-shogo commented on Nov 25, 2026

    @okada-shogo
    Contributor

    Thanks for testing the branch and for the AMD_LOG_LEVEL=4 tail. So lending isn't it; that branch can be dropped.

    One thing in your report we'd like to check first: the WER record names amdhip64_7.dll 10.0.3683.0, but the
    SDK DLL you list (16,399,360 bytes) matches the 10.2.0a20260930 wheel's, which is 10.0.3686.0. So the process may
    have loaded another copy of the HIP runtime, for example one an AMD driver put in System32. Windows looks in the
    exe's folder first, then System32, then PATH; setup's own build copies the runtime next to strata-poly.exe, a
    plain cmake --build does not.

    Could you try:

    1. The WER record's "Faulting module path" line (or where amdhip64_7.dll), to see which file it was.

    2. Copy amdhip64_7.dll and amd_comgr*.dll from your .rocm-win SDK bin folder next to the poly.2
      strata-poly.exe, and run the same session again.

    3. If it still crashes, a minidump would help:

      reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\strata-poly.exe" /v DumpType /t REG_DWORD /d 1 /f
      reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\strata-poly.exe" /v DumpFolder /t REG_EXPAND_SZ /d "C:\dumps" /f
      

      plus the last ~300 lines of the AMD_LOG_LEVEL=4 log, including the hipMemsetAsync line before the fault, and the
      length of the first long prompt.

    For reference: we have not reproduced the crash. Your model and flags ran clean on an RX 9070 XT (native Linux) and an
    RX 7800 XT (WSL2), but neither is native Windows on gfx1102, so this doesn't rule out an engine bug. In those runs the
    engine's largest prompt-time memset was well under the 505,479,168 bytes in your log, so we don't know yet where that
    fill comes from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions