mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #808] [CLOSED] hip/gfx906: cudaFuncSetAttribute must be a function, not a macro (ROCm 7.2.1 build fix) #2842
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#2842
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/808
Author: @xxDoman
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:fix-gfx906-cudafuncsetattribute📝 Commits (1)
0b542cahip/gfx906: cudaFuncSetAttribute as a function, not a macro📊 Changes
1 file changed (+11 additions, -1 deletions)
View changed files
📝
include/strata/platform/hip_compat/strata_hip.h(+11 -1)📄 Description
Problem
Building the gfx906 backend (
-DSTRATA_HIP_GFX906=ON) from source fails on ROCm 7.2.1:cudaFuncSetAttributeis a function-like macro ininclude/strata/platform/hip_compat/strata_hip.h, and the call sites pass a template instantiation whose argument list contains commas — the preprocessor splits on them and the macro gets too many arguments.Environment
Error
include/strata/platform/hip_compat/strata_hip.h:154:src/kernels/cuda/fused_gr.cu:1089-1093:5 errors (lines 1089-1093). The preprocessor reads
gr_down_v3_kernel<1, kFusedGrMaxT, false>as several macro arguments (<1,kFusedGrMaxT, …) and chokes on the rest. This is standard preprocessor behaviour, not a toolchain quirk — a plaingcc -Eon the same construct gives "passed 5 arguments, but takes just 3".Fix (2 changes, both in
strata_hip.h)(1)
cudaFuncSetAttributeback to a template function — as it was in 0.1.38'ship_compat/cuda_runtime.h:130(which is why the wave32 backend never tripped on this):(2) Two definitions used beside it were missing from the platform header (present in the old one):
Scope / safety
include/strata/platform/hip_compat/is only added to the include path insideif(STRATA_HIP_GFX906)(CMakeLists.txt:106-120), and the affected calls are inside#if defined(STRATA_HIP_GFX906). CUDA builds use the real CUDA function and the wave32 RDNA backend uses the older header — neither is touched. The change only makes the gfx906 build compile.Verified on MI50 32 GB (IQ2_XS, 4k prompt, 256 decode,
--spec 3)Correctness on both:
17*23 → 391. After the fixmakeis EXIT 0, the binary linkslibhipblas/librocblas, 108gfx906code objects, engine loads and serves.Question for @JeanP00l
Thanks for the gfx906 port — it works great once building. We don't know which ROCm/toolchain you built on: on ROCm 7.2.1 the macro above is a hard error here, yet it built for you (and gcc/clang agree the construct is malformed regardless of version). Could you share your HIP/ROCm version? If your build took a path that skips these lines, that would explain it — and is worth documenting either way.
(We also have a community MI50 benchmark open as #758.)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.