[PR #3078] [CLOSED] [Engine] gfx906/HIP: __shared__ alignas(16) int4 does not compile (clang 18 / ROCm 6.3.3) #4441

Closed
opened 2026-11-07 15:35:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3078
Author: @ken2425pm
Created: 10/18/2026
Status: ❌ Closed

Base: main ← Head: fix-hip633-build


📝 Commits (2)

  • 7bee026 hip_compat: void wrappers for the unchecked calls; the nodiscard type needs them
  • 8aefd93 gfx906: compile the engine on a system ROCm 6.3.3 (blockers past the cublas maps)

📊 Changes

5 files changed (+57 additions, -22 deletions)

View changed files

📝 include/strata/platform/hip_compat/strata_hip.h (+23 -9)
📝 src/core/remote_experts.cpp (+1 -1)
📝 src/kernels/cuda/iq_kernels.cu (+8 -2)
📝 src/kernels/qsa_prompt_attn_parity.cpp (+1 -1)
📝 src/qwen35/q36_engine.cu (+24 -9)

📄 Description

Problem and result: on ROCm 6.3.3 (clang 18) the gfx906 build stops in src/kernels/cuda/iq_kernels.cu — error: 'alignas' attribute cannot be applied to types at the two expdec kernels' __shared__ alignas(16) int4 staging tiles. After this change that error is gone.

Related discussion: #2459 (the build thread; the closed #3078 was rescoped after the 0.2.0-beta tracker reset), #3172 (same-class compat gaps, dflash2.cpp), #2460 (the cublas maps — merged upstream in 0.2.1, not touched here).

Approach: the uint32_t macro right above (STRATA_SHARED_ALIGN16_U32) already handles this exact class for HIP; the two int4 tiles get the same treatment. STRATA_SHARED_ALIGN16_INT4 keeps the CUDA spelling and takes __attribute__((aligned(16))) under HIPCC. Two call sites change spelling; no behaviour change on CUDA — the macro's CUDA branch is the previous text.

Validation:

  • Passed: v0.2.6, system ROCm 6.3.3 (/opt/rocm-6.3.3, clang 18), gfx906, the pinned ggml as cmake fetches it (3cf03257f): without the change ninja -C build-906 strata fails at iq_kernels.cu:2477 and :2664 only; with this and the dflash2.cpp stream-priority mapping reported in #3172, the build links — [5/5] Linking HIP executable strata, 35.7 MB.
  • Failed: none observed beyond the two named blockers.
  • Not run: CUDA and SYCL builds (no CUDA/oneAPI toolkit on this box) — the macro's CUDA branch is character-identical to the previous spelling, so those paths compile as before by construction; a -Werror build (the build is not -Werror and carries the upstream warning set).

Limits: the second link blocker (dflash2.cpp, two compat lines) is reported with a fix offered in #3172 — left to that thread so this PR stays one change. The earlier #3078 commits that 0.2.x made obsolete (q36_engine __ldg/__half_as_ushort, the cudaInitDevice guard, the qsa sm_80 gate) are dropped — upstream now covers or no-longer-compiles each (qwen35 is not part of the v0.2.6 gfx906 build).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3078 **Author:** [@ken2425pm](https://github.com/ken2425pm) **Created:** 10/18/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-hip633-build` --- ### 📝 Commits (2) - [`7bee026`](https://github.com/Niko1221/Strata/commit/7bee0269f08f086db633e9f8b87892c59876022f) hip_compat: void wrappers for the unchecked calls; the nodiscard type needs them - [`8aefd93`](https://github.com/Niko1221/Strata/commit/8aefd93cdc00baf5e29ded2e5db8cf596a742eb4) gfx906: compile the engine on a system ROCm 6.3.3 (blockers past the cublas maps) ### 📊 Changes **5 files changed** (+57 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `include/strata/platform/hip_compat/strata_hip.h` (+23 -9) 📝 `src/core/remote_experts.cpp` (+1 -1) 📝 `src/kernels/cuda/iq_kernels.cu` (+8 -2) 📝 `src/kernels/qsa_prompt_attn_parity.cpp` (+1 -1) 📝 `src/qwen35/q36_engine.cu` (+24 -9) </details> ### 📄 Description Problem and result: on ROCm 6.3.3 (clang 18) the gfx906 build stops in `src/kernels/cuda/iq_kernels.cu` — `error: 'alignas' attribute cannot be applied to types` at the two expdec kernels' `__shared__ alignas(16) int4` staging tiles. After this change that error is gone. Related discussion: #2459 (the build thread; the closed #3078 was rescoped after the 0.2.0-beta tracker reset), #3172 (same-class compat gaps, dflash2.cpp), #2460 (the cublas maps — merged upstream in 0.2.1, not touched here). Approach: the `uint32_t` macro right above (`STRATA_SHARED_ALIGN16_U32`) already handles this exact class for HIP; the two int4 tiles get the same treatment. `STRATA_SHARED_ALIGN16_INT4` keeps the CUDA spelling and takes `__attribute__((aligned(16)))` under HIPCC. Two call sites change spelling; no behaviour change on CUDA — the macro's CUDA branch is the previous text. Validation: - Passed: v0.2.6, system ROCm 6.3.3 (`/opt/rocm-6.3.3`, clang 18), gfx906, the pinned ggml as cmake fetches it (`3cf03257f`): without the change `ninja -C build-906 strata` fails at `iq_kernels.cu:2477` and `:2664` only; with this and the `dflash2.cpp` stream-priority mapping reported in #3172, the build links — `[5/5] Linking HIP executable strata`, 35.7 MB. - Failed: none observed beyond the two named blockers. - Not run: CUDA and SYCL builds (no CUDA/oneAPI toolkit on this box) — the macro's CUDA branch is character-identical to the previous spelling, so those paths compile as before by construction; a `-Werror` build (the build is not `-Werror` and carries the upstream warning set). Limits: the second link blocker (`dflash2.cpp`, two compat lines) is reported with a fix offered in #3172 — left to that thread so this PR stays one change. The earlier #3078 commits that 0.2.x made obsolete (q36_engine `__ldg`/`__half_as_ushort`, the `cudaInitDevice` guard, the qsa sm_80 gate) are dropped — upstream now covers or no-longer-compiles each (qwen35 is not part of the v0.2.6 gfx906 build). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:45 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4441
No description provided.