[PR #1066] [CLOSED] hip/gfx906: the 0.1.40 tree does not build (three STRATA_USE_HIP gates miss STRATA_HIP_GFX906) #3002

Closed
opened 2026-11-04 02:04:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1066
Author: @xxDoman
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: gfx906-140-buildfix


📝 Commits (10+)

  • f4e96d5 tests: gdn_rec_head also compares the PP (variant 4) and two-column (variant 5) recurrence kernels, bitwise
  • 16bc95a prefill: STRATA_HCD_EXACT=1 - the HC down projection by a WMMA kernel with hipBLASLt solution 1176/1177 k order (StaggerU included), bitwise
  • 502fcef #606: the fused SwiGLU q8_1 quantizers keep the block's scale and sum finite too
  • 64d0136 cache: preserve checkpoints when split allocation fails
  • a0d0056 prefill: fused-expert exact wins (table16 via direct selector, float4 moe_combine, LDS alias + occupancy)
  • 5f5452b serve: park_current's try covers the checkpoint split too (#752): a host OOM skips parking
  • 8b19a38 Layer split: --vram-reserve-later-mib, a separate reserve for the later cards
  • ea83d0d Resident RAM mode with a layer split
  • d2d981f setup: the low-RAM mode's resident variant on several GPUs (#642)
  • cd62e5e serve: a split's stage-0 GPU profile line keeps its text (#848); later stages say which stage

📊 Changes

3 files changed (+3 additions, -3 deletions)

View changed files

📝 src/core/mtp.cpp (+1 -1)
📝 src/core/vmm.cpp (+1 -1)
📝 src/kernels/cuda/fused_gr.cu (+1 -1)

📄 Description

Problem

Building 0.1.40 for gfx906 (-DSTRATA_HIP_GFX906=ON) fails with three compile errors. The gfx906 build defines STRATA_HIP_GFX906, not STRATA_USE_HIP (that one belongs to the wave32 HIP backend). Three sites gate only on STRATA_USE_HIP, so on gfx906 they keep the CUDA branch and do not compile. #808 already fixed the same class of thing in strata_hip.h.

Errors and fixes

1. src/kernels/cuda/fused_gr.cu — a bare return; in the bool fused_gr_read_multi, inside the STRATA_HIP_GFX906 STRATA_GR_SPLIT block:

fused_gr.cu:1743:9: error: non-void function 'fused_gr_read_multi' should return a value [-Wreturn-mismatch]

→ return false; — the q8_1 contract of the other multi-token paths (no q8_1; the caller quantizes). The v3 path three lines up already returns false.

2. src/core/mtp.cpp — the MTP stream-priority block:

mtp.cpp:421:33: error: 'cudaDeviceGetStreamPriorityRange' was not declared in this scope
mtp.cpp:422:16: error: 'cudaStreamCreateWithPriority' was not declared in this scope

→ gate the block on !defined(STRATA_HIP_GFX906) as well (HIP has no stream priority; the default priority is the intended behaviour, as the file's own comment says).

3. src/core/vmm.cpp (new in 0.1.40) — includes <cuda.h> for the CUDA driver VMM API:

vmm.cpp:4:10: fatal error: cuda.h: No such file or directory

→ the same gate. The file already has the HIP fallback in its #else branch (vmm_available() == false).

Scope / safety

Every affected line is inside an #if that only the gfx906 build reaches, so CUDA and the wave32 RDNA backend are untouched. No behaviour change on any other backend.

Verified

cmake -DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906       -DCMAKE_HIP_COMPILER=/opt/rocm/lib/llvm/bin/clang++       -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_BUILD_TYPE=Release ..

[100%] Linking HIP executable strata, EXIT 0, links only libhipblas/libamdhip64/librocblas/libhipblaslt (ROCm 7.2.1). The engine starts on a 2x gfx906 rig (Instinct MI50 32 GB + Radeon VII 16 GB) and generates.

Separate from this: a performance item (gfx906 has v_dot4_i32_i8 but dp4a falls back to a 4-iteration loop) — I will open that on its own, since it needs a parity test rather than being build-blocking.


🔄 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/1066 **Author:** [@xxDoman](https://github.com/xxDoman) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `gfx906-140-buildfix` --- ### 📝 Commits (10+) - [`f4e96d5`](https://github.com/Niko1221/Strata/commit/f4e96d55b6f13622bae6b3ded2f81ca16cbd78f6) tests: gdn_rec_head also compares the PP (variant 4) and two-column (variant 5) recurrence kernels, bitwise - [`16bc95a`](https://github.com/Niko1221/Strata/commit/16bc95ab3e5293a6dd557ad0ec7e2a5eef23640a) prefill: STRATA_HCD_EXACT=1 - the HC down projection by a WMMA kernel with hipBLASLt solution 1176/1177 k order (StaggerU included), bitwise - [`502fcef`](https://github.com/Niko1221/Strata/commit/502fcef6ff29325427ecfb5409b242ac7bea18e1) #606: the fused SwiGLU q8_1 quantizers keep the block's scale and sum finite too - [`64d0136`](https://github.com/Niko1221/Strata/commit/64d01362bee3aa109fb340d9b4144a62d9192522) cache: preserve checkpoints when split allocation fails - [`a0d0056`](https://github.com/Niko1221/Strata/commit/a0d00560fdb3bd728001cac756e223b12e3a09e9) prefill: fused-expert exact wins (table16 via direct selector, float4 moe_combine, LDS alias + occupancy) - [`5f5452b`](https://github.com/Niko1221/Strata/commit/5f5452bec6fabe7c76b44af2397b29daac95feb4) serve: park_current's try covers the checkpoint split too (#752): a host OOM skips parking - [`8b19a38`](https://github.com/Niko1221/Strata/commit/8b19a38a57a80ee9c2bd03d677d8b55fc961d34b) Layer split: --vram-reserve-later-mib, a separate reserve for the later cards - [`ea83d0d`](https://github.com/Niko1221/Strata/commit/ea83d0dc5ef3fd481c53ee6bd99dd8016e10ce78) Resident RAM mode with a layer split - [`d2d981f`](https://github.com/Niko1221/Strata/commit/d2d981f5b2841cfcefcc88872730785b9d23bd78) setup: the low-RAM mode's resident variant on several GPUs (#642) - [`cd62e5e`](https://github.com/Niko1221/Strata/commit/cd62e5e07f5efa6be42a8ccfbbc82b78f6abfe93) serve: a split's stage-0 GPU profile line keeps its text (#848); later stages say which stage ### 📊 Changes **3 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/core/mtp.cpp` (+1 -1) 📝 `src/core/vmm.cpp` (+1 -1) 📝 `src/kernels/cuda/fused_gr.cu` (+1 -1) </details> ### 📄 Description ## Problem Building 0.1.40 for gfx906 (`-DSTRATA_HIP_GFX906=ON`) fails with three compile errors. The gfx906 build defines `STRATA_HIP_GFX906`, **not** `STRATA_USE_HIP` (that one belongs to the wave32 HIP backend). Three sites gate only on `STRATA_USE_HIP`, so on gfx906 they keep the CUDA branch and do not compile. #808 already fixed the same class of thing in `strata_hip.h`. ## Errors and fixes **1. `src/kernels/cuda/fused_gr.cu`** — a bare `return;` in the `bool fused_gr_read_multi`, inside the `STRATA_HIP_GFX906` `STRATA_GR_SPLIT` block: ``` fused_gr.cu:1743:9: error: non-void function 'fused_gr_read_multi' should return a value [-Wreturn-mismatch] ``` → `return false;` — the q8_1 contract of the other multi-token paths (no q8_1; the caller quantizes). The v3 path three lines up already returns `false`. **2. `src/core/mtp.cpp`** — the MTP stream-priority block: ``` mtp.cpp:421:33: error: 'cudaDeviceGetStreamPriorityRange' was not declared in this scope mtp.cpp:422:16: error: 'cudaStreamCreateWithPriority' was not declared in this scope ``` → gate the block on `!defined(STRATA_HIP_GFX906)` as well (HIP has no stream priority; the default priority is the intended behaviour, as the file's own comment says). **3. `src/core/vmm.cpp`** (new in 0.1.40) — includes `<cuda.h>` for the CUDA driver VMM API: ``` vmm.cpp:4:10: fatal error: cuda.h: No such file or directory ``` → the same gate. The file already has the HIP fallback in its `#else` branch (`vmm_available() == false`). ## Scope / safety Every affected line is inside an `#if` that only the gfx906 build reaches, so CUDA and the wave32 RDNA backend are untouched. No behaviour change on any other backend. ## Verified ``` cmake -DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906 -DCMAKE_HIP_COMPILER=/opt/rocm/lib/llvm/bin/clang++ -DCMAKE_PREFIX_PATH=/opt/rocm -DCMAKE_BUILD_TYPE=Release .. ``` `[100%] Linking HIP executable strata`, EXIT 0, links only `libhipblas/libamdhip64/librocblas/libhipblaslt` (ROCm 7.2.1). The engine starts on a 2x gfx906 rig (Instinct MI50 32 GB + Radeon VII 16 GB) and generates. Separate from this: a performance item (gfx906 has `v_dot4_i32_i8` but `dp4a` falls back to a 4-iteration loop) — I will open that on its own, since it needs a parity test rather than being build-blocking. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:04:49 +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#3002
No description provided.