mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1396] [CLOSED] hip/gfx906: the tree does not build (q6_k MMQ instance and cudaEventBlockingSync) #3427
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#3427
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1396
Author: @phoenixclyde
Created: 10/7/2026
Status: ❌ Closed
Base:
main← Head:gfx906-build-fixes-402📝 Commits (1)
87c6d02hip/gfx906: the tree does not build (q6_k MMQ instance and cudaEventBlockingSync)📊 Changes
2 files changed (+3 additions, -2 deletions)
View changed files
📝
CMakeLists.txt(+2 -2)📝
include/strata/platform/hip_compat/strata_hip.h(+1 -0)📄 Description
Two gfx906 build failures on v0.1.40.2 (
main=e8ca9afd03d8). Both are one-line gates that know about the wave32 HIP backend but not aboutSTRATA_HIP_GFX906-- the same class as #808 and #1083, and neither is fixed onmain.1.
prefill.cppdoes not compile --cudaEventBlockingSyncis not mapped for gfx906hip_compathas two headers. The wave32 one,include/strata/hip_compat/cuda_runtime.h(line 39), has the mapping:The gfx906 one,
include/strata/platform/hip_compat/strata_hip.h, maps only its two neighbours:Fix -- add the one missing line:
I diffed the whole set of
cuda*defines between the two headers. The only other name the gfx906 header lacks iscudaDevAttrIntegrated, and that one is already handled:src/core/expert_cache.cpp:31guards its use with#if defined(__linux__) && !defined(STRATA_HIP_GFX906). So this adds exactly the one mapping that a live call site needs, and nothing else.2. The link fails -- the q6_k MMQ instance is never built
(ggml_type)14isGGML_TYPE_Q6_K. Two halves disagree:src/prefill/moe_mmq.cu:219is gated on the compiler, so any HIP compilation references it:mmq.cuh'sDECL_MMQ_CASEis anextern template(implicit instantiation suppressed), so the definition has to come fromtemplate-instances/mmq-instance-q6_k.cu, which the CUDA branch ofCMakeLists.txtadds only underSTRATA_Q6K_EXPERTS(line 1270):STRATA_HIP_GFX906=ONforcesSTRATA_ENABLE_CUDA=ON, so the gfx906 build takes the CUDA branch while its.cufiles are compiled as HIP =>__HIPCC__is defined => the call is there and the instance is not. The HIP branch (line 1330) already appendsq6_kunconditionally underSTRATA_MMQ_KQUANTS; the CUDA branch is the one that does not know about gfx906.Fix -- widen the gate:
This adds one MMQ instance to
strata_mmq. It does not enableSTRATA_Q6K_EXPERTS(the grouped Q6_K expert kernels, which are what allocate the extra VRAM), andSTRATA_HIP_GFX906is only ever ON in the gfx906 build, so CUDA and wave32 builds are untouched.Verified
Single Instinct MI50 32 GB (gfx906, wave64), ROCm/HIP 7.14,
-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906 -DSTRATA_MMQ_KQUANTS=ON:ninja stratacompletes, and the engine serves UD-IQ4_XS (Qwen3.8-Flash-Next) end to end:/v1/models, chat completions, tool calls, MTP drafts accepted;nm -C stratashowsmul_mat_q_case<(ggml_type)14>in the binary (13 instances: 7 8 12 13 14 16 17 18 20 21 22 23 42);libstrata_mmq.aholds exactly oneUreference and oneWdefinition of that symbol; after removingmmq-instance-q6_k.cu.ofrom the archive, relinking with the same link command line fails with exactly the error quoted above, while the untouched archive relinks cleanly;cudaFuncSetAttributeand #1083's threeSTRATA_USE_HIPgates are already onmain; this PR does not touch them.Notes
tests/, I am happy to add one.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.