mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2706] [Engine] STRATA_HC_UPMIX on a gfx11 + gfx12 layer split corrupts prefill on the gfx12 stage (gr_upmix caches its arch check from the first device); still on 0.2.0-beta #1076
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#1076
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 @jiayeZhu on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2706
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
On a layer split across a Radeon 8060S (gfx1151, Strix Halo iGPU, first stage) and a Radeon AI PRO R9700 (gfx1201,
second stage),
STRATA_HC_UPMIX=1gives wrong prefill results on every layer that runs on the gfx1201 stage. Nothingcrashes and nothing is logged; generation stays fluent, so it is easy to miss. It shows up as worse answers: on BFCL
parallel function calling the model emits one call where it should emit several.
Re-tested on 0.2.0-beta (tag v0.2.0-beta, engine 0.1.45.3) on 2026-10-19: still there, same numbers.
gr_upmix()insrc/prefill/kernels.cu(line 2523 on v0.2.0-beta) is unchanged: it decides "is this gfx11?" once, ina function-local
static, from whichever device calls it first, and then launchesgr_upmix_kernelon the gfx1201device too. That device's code object was compiled with the non-gfx11 branch of
um_wmma(), which isreturn c;,so the WMMA step does nothing.
The engine's own check (
STRATA_HC_UPMIX_CHECK=400, which runs the default pair beside the fused kernel and reportsthe difference of
mixed) on 0.2.0-beta, three prompts of 364 / 372 / 443 tokens, two halves each, six checks per layer:Every one of the 18 gfx1201 layers is in the 0.43-0.56 range on all six checks (layer 43 reaches 0.70, 44 reaches 0.57).
Sample lines:
Effect on output, 0.2.0-beta, the same 38 BFCL v4
parallel/parallel_multipleitems as below (the exact BFCLOpenAI-FC request: tools, the "Python 3 syntax" hint, temperature 0.001, 4 at once; each correct answer needs 2 or
more tool calls), one fresh engine per row,
STRATA_PREFILL_WARM=0on both (#3204, unrelated):STRATA_HC_UPMIX=1(with the check on)STRATA_HC_UPMIXThe earlier versions gave the same picture: v0.1.43.1 (
a0116b27) and v0.1.44 (ed4773eb) 3/38 against 28/38, withthe per-layer check at ~1e-7 on layers 0-29 and 0.42-0.74 on layers 30-47; still present on v0.1.44.1 (
296b59d2).Workaround: unset
STRATA_HC_UPMIXon a mixed-architecture split. (On the 8060S alone it is fine and stays on here.)Smallest steps or command that reproduce it
Build one engine for both GPUs:
-DSTRATA_ENABLE_HIP=ON -DSTRATA_PREFILL_MMQ=ON -DCMAKE_HIP_ARCHITECTURES="gfx1151;gfx1201", HIP flags-DSTRATA_W_LB=8, ggml at the pinned 3cf03257.Run any gfx11 + gfx12 layer split with the gfx11 device first (here:
"gpu": [<gfx1151>, <gfx1201>],"layer_split": "30"throughserve/server.py, 4 slots) withSTRATA_HC_UPMIX=1 STRATA_HC_UPMIX_CHECK=400in the environment. The engine arguments:
The rest of the environment:
Send any chat request. Any prompt length works, since
STRATA_PF_SWITCH_MIN_Tdefaults to 0 andhc_upmix_min_t()is 0 on HIP.grep STRATA_HC_UPMIX_CHECK engine.log: ~1e-7 on every gfx1151 layer, ~0.4-0.7 on every gfx1201 layer.Every build in this report carries one small local patch elsewhere in the prefill path (the
STRATA_PF_PADper-devicecheck that the gfx1201 stage needs in order to start; see #3204). It does not touch
gr_upmixor its call site.Root cause.
src/prefill/kernels.cuon v0.2.0-beta:The call site in
src/prefill/prefill.cpp(line 3149 on v0.2.0-beta) has no per-device check either:if (wu->q8_scale == nullptr && hc_upmix() && T >= std::max(pf_switch_min_t(), hc_upmix_min_t()) && !gr_unfused() && ...).With the gfx1151 stage first,
gfx11is cached astrue, and the "runtime gate" theum_wmmacomment relies onlets the gfx1201 launch through. With the gfx12 device first the cache would hold
falseand the fused path would beskipped on both GPUs: slower but correct (not tested).
Other device-specific checks in the tree already cache per device:
strata_wmma_gfx11_device()inwmma_gemm.cu(
std::atomic<int> cache[64]),sel_gfx12_device()inqsa_select.cu, and thearch[dev]lookup inqsa_prompt_attn.cu. The samegr_upmixpattern is mirrored insycl/src/prefill/kernels.dp.cpp.Suggested fix. Cache per device, the way
strata_wmma_gfx11_device()does:Or have the call site in
prefill.cppask the stage's device. As a defensive extra, the non-gfx11 branch ofum_wmmacould trap (__builtin_trap()) instead ofreturn c, so a launch that slips past the gate fails loudlyinstead of computing wrong numbers.
Reproduction status
Reproduced locally
Strata version
Strata 0.2.0-beta (tag v0.2.0-beta, engine 0.1.45.3), built from source; re-tested 2026-10-19. Also reproduced on
v0.1.43.1 (
a0116b27), v0.1.44 (ed4773eb) and v0.1.44.1 (296b59d2).Graphics card, memory and system
Radeon 8060S (gfx1151, AMD Ryzen AI MAX+ 395, 1 GB carve-out + 120 GB GTT; first stage, layers 0-29) + Radeon AI PRO R9700 32 GB (gfx1201, as an eGPU; second stage, layers 30-47 with the head and the draft layer) · 128 GB RAM · Ubuntu 26.04.1, kernel 7.0.0-38, ROCm 7.14.1 (TheRock) built for both architectures, hipBLASLt 1.4.1 (version 100401)
Model, size and settings
Qwen3.8-Flash-Next UD-IQ4_XS (unsloth, native pack) · 262K context · int8 KV · MTP drafter · 4 slots · pictures on (CPU reader)
Logs
How it was found, on v0.1.43.1 (not re-run on 0.2.0-beta): benchmarks on the same service (UD-IQ4_XS, no thinking)
before and after removing only
STRATA_HC_UPMIXfrom the split's environment:parallel(first 100)parallel_multiple(first 100)irrelevance(first 100)On v0.1.43.1, removing one env switch at a time on the split (the 38 items, responses with 2+ calls):
Only
HC_UPMIXbrings the split back to the single-GPU result (the 8060S alone, same env: 28/38). Temperature andconcurrency are not factors (1 or 4 workers, temperature 0 or 0.001: 18/38 every time with the hint removed). Prefill
speed without
STRATA_HC_UPMIXon the split: 38 prompts (17.5K tokens) cold in 32.4 s against 31.5-33.9 s for theother single-switch arms, so no measurable cost.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@jiayeZhu commented on GitHub (Oct 19, 2026):
/reopen
@github-actions[bot] commented on GitHub (Oct 19, 2026):
Reopened, thank you. A maintainer will pick it up from here.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.