mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2459] gfx906/HIP build broken on v0.1.44.1: two compile blockers (platform/hip_compat/cublas_v2.h missing three cublas maps, and the new strata_mmq_w4a4 target missing GGML_USE_HIP) #1001
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#1001
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 @kietq8684-design on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2459
Summary
-DSTRATA_HIP_GFX906=ONno longer builds on the latest tag. v0.1.42 (61b3fb5) builds clean; v0.1.44.1 (296b59d)fails with two independent blockers, both introduced after 0.1.42.
docs/AMD_HIP.md:472says the gfx906 engine"is checked to compile for gfx906", so this is a regression rather than a missing feature. A 9-line patch makes
ninja -C build-906 stratafinish with 149/149 linked, exit 0.Environment
0x66af) + Radeon Pro VII / Instinct MI50 16 GB (0x66a1), both gfx906mixa3607/rocm-gfx906:7.14-completeHSA_OVERRIDE_GFX_VERSION=9.0.6-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906 -DSTRATA_GGML_DIR=/llama -DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++, Ninja3cf03257f)git describeon the tree: v0.1.42 (61b3fb5) builds; worktree at v0.1.44.1 (296b59d) failsBlocker 1 —
include/strata/platform/hip_compat/cublas_v2.his missing three mappingsinclude/strata/hip_compat/cublas_v2.hgainedcublasSgemm,cublasSgemmStridedBatchedandcublasGemmStridedBatchedExbetween 0.1.42 and 0.1.44.1, andsrc/qwen35/q36_engine.cu(new in 0.1.44.1) usesthem. But that file is not on the gfx906 include path:
CMakeLists.txt:60says the cuBLAS names are mapped byinclude/strata/platform/hip_compat/, lines 138/141/142 attach itBEFORE INTERFACE, and the only strata-side-Iincompile_commands.jsonis-I/src/include/strata/platform/hip_compat. That second file still mapscublasGemmExonly, so the three names are undeclared.Fix — add to
include/strata/platform/hip_compat/cublas_v2.h:Blocker 2 — the new
strata_mmq_w4a4target has noGGML_USE_HIPmmq_nvfp4_w4a4.cuincludes llama.cpp'scommon.cuh, which selectsvendors/hip.honly under#if defined(GGML_USE_HIP)and otherwise pullsvendors/cuda.h(<cuda.h>,<cuda_bf16.h>— absent in a HIPenvironment;
platform/hip_compat/provides onlycuda_fp16.h,cuda_runtime.h,math_constants.h).CMakeLists.txt:1791setsGGML_USE_HIPonstrata_mmqfor the gfx906 branch and:1576has the=1form forgfx11, but the
strata_mmq_w4a4target added at:1449-1457was missed. Its siblingmmq_nvfp4_w4a8.cuhas thedefine and compiles (877 KB
.o), which is what identifies this as an omission rather than a design choice.CUDA builds are unaffected — they want
vendors/cuda.h.Fix — in
CMakeLists.txt, aftertarget_link_libraries(strata_mmq PRIVATE strata_mmq_w4a4):Result with the patch
ninja -C build-906 strata→ 149/149 linked, exit 0,build-906/strata= 26,224,152 B (v0.1.42 is 21 MB).Patch total: 9 lines (
cublas_v2.h+3,CMakeLists.txt+6). The 0.1.42 tree is untouched.Note (not a blocker, just a build-time observation)
strata_mmq_w4a4is a unit that the gfx906/HIP path does not use at all, so an alternative to the define aboveis to skip the target on this branch entirely — either way the HIP build should not be pulling CUDA vendor headers
for it.
@matusnovak commented on GitHub (Oct 17, 2026):
I can confirm that when using the
mainbranch SHA477ac13cbe8e582c20484871ce459d20d82df09d(more-less the latest SHA at the time of writing this comment) has the problem as the issue says.Working patch
I can confirm that this patch solves the compilation problem. This is not the same patch as the OP posted. This one below is slightly different and specific to the setup (see below the building & running instructions).
How to compile it and how to run it
Prepare a building environment. Building needs newer ROCm, so use the one from docker image
mixa3607/rocm-gfx906:7.14-complete. Like this:Then execute inside the running container to build Strata:
Verification after building:
Create a wrapper
/home/ubuntu/Strata/engine/stratato run Strata with these contents:Make it executable:
Then prepare a point the JSON config and set the
exeproperty to the wrapper/home/ubuntu/Strata/engine/strata. Example:Running it as:
@kietq8684-design commented on GitHub (Oct 18, 2026):
Thanks for confirming on main
477ac13and for the patch. Two notes:GGML_USE_HIPoverlap with #2460 (same fix, different placement — #2460's guard also coversSTRATA_ENABLE_HIPbuilds).moe_f16_kq.culine is new and needed: main added the F16 path tomoe_fused_iq.cuafter 0.1.44.1, and the basestrata_mmqsource list never included it (only the Aurora/gfx11 branch does).I've rebased the patch onto current main (
477ac13) locally with that line folded in and verified the build:ninja -C build-906 strata strata-devicefinishes 152/152, exit 0, in arocm-gfx906-build:7.14(ROCm 7.14) container with-DSTRATA_GGML_DIRpointed at the pinned llama.cpp checkout (3cf03257f);strata --helpandstrata-device --selftestboth pass.@ken2425pm commented on GitHub (Oct 18, 2026):
Two data points from a system-ROCm build (no container; 2x Instinct MI50, ROCm 6.3.3 at /opt/rocm-6.3.3, clang 18):
Past the cublas maps + the w4a4
GGML_USE_HIPdefine (covered here and in #2460), five more spots block-DSTRATA_HIP_GFX906=ONon this toolchain: the[[nodiscard]]-typedhipError_tcall sites instrata_hip.h,__shared__ alignas(16) int4iniq_kernels.cu,__ldg/host-side__half_as_ushortinq36_engine.cu,cudaInitDeviceinremote_experts.cpp, and the sm_80+ device-attribute gate inqsa_prompt_attn_parity.cpp. PR #3078 carries those on top of the maps — every hunk inside a HIP guard or HIP-only macro branch, so CUDA/SYCL compile as main does by construction. On 2x MI50 the strata target links clean with-Wall -Wextraand generation runs.The gfx900 side: current-base build confirmed (details in #2009) —
build-gfx900links clean on the same toolchain with the gfx900-only fixes in place. Runtime remains untested: the MI-25 cards are on another machine.@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.
@kietq8684-design commented on GitHub (Oct 19, 2026):
Updating my note: #2459, #2460 and #3078 were all closed in the 0.2.0-beta tracker reset (all unmerged) — posting here since this is still the original discussion thread.
Thanks for scoping #3078 to not touch #2460's files. One data point from my side: the rebased #2460 on the same base (
477ac13) builds clean in the ROCm 7.14 container (152/152 targets, selftest + --help pass) without the five fixes, so on that toolchain they aren't blockers. Do you read the five as ROCm 6.3.3-specific, or a macro-set difference — e.g. the gfx906 build not defining STRATA_USE_HIP, which would explain the two guard-widening hunks? If you reopen #3078 under the new rules, happy to continue the toolchain question there.@ken2425pm commented on GitHub (Oct 25, 2026):
Measured answer from this box — 2x Instinct MI50, system ROCm 6.3.3 (
/opt/rocm-6.3.3, clang 18), v0.2.6, the pinned ggml as cmake fetches it (3cf03257f):Your macro-set reading holds, and v0.2.6 settles most of it:
__ldg, host-side__half_as_ushort) and the whole cublas territory do not apply there. Upstream also added its owncudaInitDeviceshim instrata_hip.h, which retires theremote_expertsguard widening.dflash2.cppsettles the__HIPCC__/STRATA_USE_HIPquestion in your favour: it branches onSTRATA_USE_HIPexplicitly, the gfx906 build defines neither that nor__HIPCC__in the C++ TUs, so it takes the CUDA branch — exactly the two-lines-in-strata_hip.hgap posted in #3172.__shared__ alignas(16) int4iniq_kernels.cu("'alignas' attribute cannot be applied to types", two expdec tiles). A macro next to the existingSTRATA_SHARED_ALIGN16_U32(same file, same pattern) fixes it. With that plus the #3172 two-liner,ninja -C build-906 stratalinks on this box:[5/5] Linking HIP executable strata, 35.7 MB.So your 7.14 datapoint (152/152 without the five) and this box agree: the five were ROCm 6.3.3/clang-18-specific or macro-set artifacts, and after 0.2.x only the alignas class survives on this toolchain. Reopened #3078 carries just the alignas mapping; the nodiscard-wrapper commit from the old PR is dropped — the v0.2.6 gfx906 build carries ~1,250 pre-existing
-Wunused-resultwarnings across the HIP files, so that sweep is its own change set if anyone wants it.