[GH-ISSUE #1929] [Fix] Build failure on gfx906 (Vega20 / Hygon DCU) due to missing STRATA_HIP_GFX906 guard in gr_upmix and hipblas types #763

Closed
opened 2026-11-04 01:45:40 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @hheei on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1929

Environment

  • Target Hardware: Hygon DCU Z100 (amdgcn-amd-amdhsa--gfx906)
  • Toolchain: DTK / HIP Clang 15
  • CMake Flags: -DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906

Description

When building with -DSTRATA_HIP_GFX906=ON, compilation on gfx906 targets hits three issues:

  1. Unconditional WMMA / __bf16 vector kernel in src/prefill/kernels.cu:
    gr_upmix_kernel unconditionally defines and compiles __bf16 vector types and um_wmma under #if defined(__HIPCC__). Because gfx906 does not feature hardware WMMA/MFMA or __bf16 vector extensions, Clang fails with:

    error: cannot compile this __bf16 vector builtin yet
    error: invalid instruction for target 'gfx906'
    

    Suggested Fix: Guard the WMMA kernel with && !defined(STRATA_HIP_GFX906), and provide a stub/no-op fallback returning false early in gr_upmix() for STRATA_HIP_GFX906.

  2. hipBLAS data type mismatch in include/strata/platform/hip_compat/cublas_v2.h:
    CUDA_R_16F / CUDA_R_32F are defined as HIP_R_16F instead of HIPBLAS_R_16F. In certain HIP/ROCm/DTK releases, hipblasGemmEx strictly expects hipblasDatatype_t.

  3. Missing cudaGraphUpload fallback in include/strata/platform/hip_compat/strata_hip.h:
    In older HIP runtimes / DTK (based on ROCm 5.7), hipGraphUpload is not available in libamdhip64.so. Adding an inline no-op fallback prevents link-time undefined reference errors.

Diff

--- a/src/prefill/kernels.cu
+++ b/src/prefill/kernels.cu
@@ -1728,7 +1728,7 @@
-#if defined(__HIPCC__)
+#if defined(__HIPCC__) && !defined(STRATA_HIP_GFX906)
 typedef __bf16 um_b16 __attribute__((ext_vector_type(16)));
 typedef float um_f8 __attribute__((ext_vector_type(8)));
...
+#elif defined(STRATA_HIP_GFX906)
+__global__ void __launch_bounds__(256) gr_upmix_kernel(...) {}
+#endif
@@ -1851,7 +1857,11 @@
 bool gr_upmix(...) {
+#if defined(STRATA_HIP_GFX906)
+    return false;
+#elif defined(__HIPCC__)
Originally created by @hheei on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1929 ### Environment - **Target Hardware**: Hygon DCU Z100 (amdgcn-amd-amdhsa--gfx906) - **Toolchain**: DTK / HIP Clang 15 - **CMake Flags**: `-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906` ### Description When building with `-DSTRATA_HIP_GFX906=ON`, compilation on `gfx906` targets hits three issues: 1. **Unconditional WMMA / __bf16 vector kernel in `src/prefill/kernels.cu`:** `gr_upmix_kernel` unconditionally defines and compiles `__bf16` vector types and `um_wmma` under `#if defined(__HIPCC__)`. Because `gfx906` does not feature hardware WMMA/MFMA or `__bf16` vector extensions, Clang fails with: ```text error: cannot compile this __bf16 vector builtin yet error: invalid instruction for target 'gfx906' ``` **Suggested Fix:** Guard the WMMA kernel with `&& !defined(STRATA_HIP_GFX906)`, and provide a stub/no-op fallback returning `false` early in `gr_upmix()` for `STRATA_HIP_GFX906`. 2. **hipBLAS data type mismatch in `include/strata/platform/hip_compat/cublas_v2.h`:** `CUDA_R_16F` / `CUDA_R_32F` are defined as `HIP_R_16F` instead of `HIPBLAS_R_16F`. In certain HIP/ROCm/DTK releases, `hipblasGemmEx` strictly expects `hipblasDatatype_t`. 3. **Missing `cudaGraphUpload` fallback in `include/strata/platform/hip_compat/strata_hip.h`:** In older HIP runtimes / DTK (based on ROCm 5.7), `hipGraphUpload` is not available in `libamdhip64.so`. Adding an inline no-op fallback prevents link-time undefined reference errors. ### Diff ```diff --- a/src/prefill/kernels.cu +++ b/src/prefill/kernels.cu @@ -1728,7 +1728,7 @@ -#if defined(__HIPCC__) +#if defined(__HIPCC__) && !defined(STRATA_HIP_GFX906) typedef __bf16 um_b16 __attribute__((ext_vector_type(16))); typedef float um_f8 __attribute__((ext_vector_type(8))); ... +#elif defined(STRATA_HIP_GFX906) +__global__ void __launch_bounds__(256) gr_upmix_kernel(...) {} +#endif @@ -1851,7 +1857,11 @@ bool gr_upmix(...) { +#if defined(STRATA_HIP_GFX906) + return false; +#elif defined(__HIPCC__) ```
Author
Owner

@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:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6270706529 --> @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: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#763
No description provided.