mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3172] [Engine] gfx906 (2x MI50): build fails on 0.1.44+ and 0.2.0-beta — cublas* in qwen35, cuda.h in the nvfp4 MMQ target #1277
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#1277
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 @romeo5353535353-ui on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3172
Environment
6.8.0-147-generic, amdgpu from the kernelmixa3607/rocm-gfx906:7.14-complete(the onedocs/AMD_HIP.mdnames for gfx906)1002:66af(Vega 20), wave64477ac13(main, 0.1.45):What happens
Two independent failures, both from modules added after 0.1.43:
src/qwen35/q36_engine.cu— CUDA names the gfx906 compat layer does not map:CMakeLists.txtaddsstrata_qwen35(and links it intostrata) unconditionally in the CUDA branch, andSTRATA_HIP_GFX906turns that branch into a HIP build, so the file is compiled with hipcc.src/prefill/mmq_nvfp4_w4a4.cu— the target is built withoutGGML_USE_HIP, so llama.cpp'scommon.cuhfalls through to the CUDA vendor header:Note that
strata_mmqcompiles its llama.cpp objects fine — onlystrata_mmq_w4a4misses the flag.Workaround that works
v0.1.43.1(a0116b2) builds cleanly with the exact command above (that is what the machine now runs). So the regression is confined to 0.1.44+.Suggestions
qwen35block behindif(NOT STRATA_HIP_GFX906):generate.cppalready guards every reference with#if defined(STRATA_HAVE_QWEN35), so a gfx906 build that does not define it links and runs. I verified this locally: with the block wrapped, the qwen35 error disappears and the build proceeds.GGML_USE_HIP(or the gfx906 compat include order) to thestrata_mmq_w4a4target, or skip that target forSTRATA_HIP_GFX906.cublasSgemm/cublasGemmStridedBatchedExneed entries ininclude/strata/platform/hip_compat/.Happy to test a patch on this machine — it is a dedicated 2×MI50 box with the community ROCm image installed.
@romeo5353535353-ui commented on GitHub (Oct 19, 2026):
Confirmed on v0.2.0-beta (
3d1fb480): the gfx906 build fails with the sameqwen35cublas* errors. Details and the proposed guard are in #2883.@Niko1221 commented on GitHub (Oct 20, 2026):
Thank you, your diagnosis was right and your suggested guard is what went in. In 0.2.1 the gfx906 build no longer builds the Qwen3.6 engine (src/qwen35 calls cuBLAS entry points the wave64 layer does not map, and generate.cpp already guards it with STRATA_HAVE_QWEN35), strata_mmq_w4a4 gets GGML_USE_HIP, and the other link errors of #3271 are fixed too: the trellis overlay's quantize.cu and instances, and moe_f16_kq.cu, which were never in the HIP source list. I compiled all 161 targets for gfx906 on ROCm 7.10 (clang 22) and the strata binary links and reports its families (qwen4exp only); I have no gfx906 card, so it was not run on one. If you can try your command on 0.2.1 on the MI50 box, that would close the loop.
This is in Strata 0.2.1: https://github.com/Niko1221/Strata/releases/tag/v0.2.1
@petski3 commented on GitHub (Oct 20, 2026):
0.2.1 built and ran on gfx906 here (2x Radeon Pro VII 16 GB, not MI50), so this is the on-card run you asked for.
Environment: Strata v0.2.1, tag commit
90767252f420e25223c739d604145ad15911d48b, enginestrata --version= 0.1.46,--families= qwen4exp. Ubuntu 24.04.4, kernel 6.8.0-147, in-tree amdgpu, no system ROCm; the build and the engine run in a docker image made frommixa3607/rocm-gfx906:7.14-complete(HIP 7.14.60850, AMD clang 23.0.0git). Ryzen 9 3950X, 64 GB RAM, 2x Radeon Pro VII 16 GB (gfx906), layer split 27. Model Qwen3.8-Flash-Next GSQ-RCO IQ3_S (--nativepack), 262,144 context,--kv fp16 --kv-resident 32768, MTP--spec 4 --spec-min-p 0.5,--prefill 4096,--pcie-frac 0,STRATA_ARENA_MMAP=1,STRATA_STAGE_TRIM=1,STRATA_HIP_PROMPT_F16=1,STRATA_PREFILL_CPU_SHARE=auto,STRATA_ROUTE_TAIL_SKIP=0,STRATA_MMVF_ROWS=1,STRATA_GDN_HEAD=1 STRATA_GDN_PP=2 STRATA_GDN_CONVL2=1 STRATA_GDN_NOY=1, CPU vision encoder on. One local patch on top of the tag: thedrop_supersededprefix rule from #2930 (#342), 84 lines, not build-related.Build (passed):
(
/llama= llama.cpp at the pinned 3cf0325.) No source changes were needed: the three 0.1.44-0.2.0 blockers are gone, and the trellis MMQ overlay now configures ("overlay on the pinned ggml-cuda in build-906/ggml-tq-overlay") and links; on 0.2.0-beta we had to build with-DSTRATA_MMQ_TQ_OVERLAY=OFF. Only thestrata,strata-deviceandstrata-visiontargets were built, not all 161.Served and measured (passed):
serve/server.py --engine strata --host 127.0.0.1(0.2.1 refuses a non-loopback bind without an API key, so our usual0.0.0.0needed that change). Start-up identical to our live 0.1.43.1 engine: same 15 pool workers, 6656 + 5505 expert slots, mapped read-only expert arena. A/B against 0.1.43.1 on the same box and settings, fresh engine per arm, interleaved order old / new / new / old, fixed-nonce greedy requests (presence_penalty 0set in the config, since the model-card 1.5 would otherwise apply to thinking-off requests), 4K / 32K / 64K prompts x2 each plus a 6-prompt decode bench, 0 stall reports:Prompt speed equal; decode +1.8 % at 32K and +2.9 % at 64K (both 0.2.1 arms above both 0.1.43.1 arms), decode bench equal. All 24 output texts and the drafts accepted / offered counts are identical across the four arms, so 0.2.1 = 0.1.43.1 in answers here. This is a nonstandard A/B (our own harness, medians of 2), not a BENCHMARK_PROTOCOL run.
Not run on 0.2.1: Qwen3.6 (not in the gfx906 build, as documented), needles at 256K and the VRAM peak, images through
--vision, conversation parking,--parallel, the ctest suite. Not tried: a system ROCm instead of the 7.14 image.Developed with an AI coding assistant; every number above was measured on the machine described here.
@romeo5353535353-ui commented on GitHub (Oct 20, 2026):
Confirmed on the MI50 box: 0.2.1 builds for gfx906 with no local patches and runs on the cards.
Build — the documented command, unchanged:
No
cublas*errors, nocuda.h, nof16kq::*link errors —strata(32 MB) andstrata-devicelink.strata --versionreports 0.1.46;strata-device --selftest→ selftest OK, with the plan at--max-context 20480: KV + indexer 0.27 GB, expert cache 5.68 GB (4105 slots), 15.97 GiB card free, FITS.One toolchain note that may be worth knowing: with ROCm 7.14 / clang 23, a 16-way parallel build crashed
clang-23itself (SIGSEGV in theglobaloptandcgsccpasses) onllama/ggml/src/ggml-cuda/template-instances/mmq-instance-q2_0.cuandmmq-instance-q4_k.cu. Both TUs compilefine on their own and with
-j8, so this looks like a compiler-side limit at high parallelism on these largetemplate units, not a source problem — no patch was needed, just
-j8and a retry pass.Runtime, Ubuntu 24.04,
mixa3607/rocm-gfx906:7.14-complete, 2x Instinct MI50 16 GB (1002:66af),Ryzen 7 5700X, 64 GB DDR4-3600, engine 0.1.46, IQ3_S pack, 131,072 context:
Numbers (greedy, unique prompts so the prompt cache never helps, medians):
(One card was run on the same build with the other card physically absent: 4,805 slots, 9.4 GiB cache,
expert cache hit rate 57-94% instead of 98-99.7%, 116 W at 99% GPU.)
Against our own 0.1.43.1 numbers on the same box (
#3173), with the same flags: 1.6K decode 64.4 -> 74.5 tok/sand 31K prefill 685 -> 694 tok/s, 31K decode 73.6 -> 74.5. The expert cache holds fewer slots than 0.1.43.1
(12,245 vs 14,587) and decode is still faster, so something in the 0.1.46 decode path is doing more with less.
Config used:
--max-context 131072 --kv int8 --kv-resident 32768 --layer-split 27 --spec 3 --spec-min-p 0.9 --prefill 2048 --vram-reserve-mib 1024 --pipeline-windows 2 --trim-stage-weights --vision, vision encoder on CPU.So the gfx906 path is current again — no pinning to 0.1.43.1. Thank you for fixing this.
@Niko1221 commented on GitHub (Oct 24, 2026):
This is fixed in Strata 0.2.1. Please update to the latest release (in the Terminal:
strata update; in the app: download the newest installer from the releases page). If it still happens on the latest version, reply here and we will reopen it. Thank you for the report.@romeo5353535353-ui commented on GitHub (Oct 25, 2026):
0.2.6 (engine 0.1.51) on gfx906: one more two-line compat gap, and it is worth fixing for the speed
Tried the current release on the same MI50 box. The gfx906 build of 0.2.6 stops on a new file,
src/core/dflash2.cpp,with three errors that are the same class as the old
cublas*ones — CUDA names used in shared code, no mapping inthe HIP compat layer:
include/strata/platform/hip_compat/strata_hip.hmapscudaStreamCreateandcudaStreamCreateWithFlags(around line131) but not these two. Two lines next to them fix it:
With that,
ninja -C build-906 strata strata-devicefinishes (80/80,strata --version= 0.1.51),strata-device --selftestpasses, and the engine runs.Why it matters: 0.1.51 is 13% faster at long context on this box
Same hardware, same flags (
--layer-split 24 --kv int8 --kv-resident 32768 --spec 3 --spec-min-p 0.9 --prefill 2048 --pipeline-windows 2 --trim-stage-weights --ple-io ram --max-context 262144), 2x MI50 16 GB, Ryzen 7 5700X,128 GB RAM (4x32 GB), IQ4_XS, five runs of a 31K prompt and two of 118K, unique text per run:
The two 118K runs are tight (60.0 and 60.5 against 52.6 and 54.0 before), so this is not MTP luck: something in the
0.1.47-0.1.51 decode path pays off exactly where KV streaming dominates. If "fewer GPU launches per layer" is what
did it, it also works on gfx906.
Happy to open a PR with the two-line patch if you would rather take it that way than write it yourself.