Environment
ROCm 7.1.1 clang 21.0.0git + MSVC 14.51.36231 STL, Windows. (Compiles fine on Linux/libstdc++, which lacks the annotation.) rocWMMA 2.1.0.
Problem
library/include/rocwmma/internal/float8.hpp and rocwmma_xfloat32.hpp specialize standard <type_traits> templates for rocWMMA's fp8/xfloat32 types, e.g.:
template <> struct is_arithmetic<hip_fp8_e4m3> : true_type {};
template <> struct is_floating_point<hip_fp8_e4m3> : true_type {};
template <> struct is_signed<hip_fp8_e4m3> : true_type {};
The current MSVC STL marks these traits [[clang::no_specializations]] (per N5014 [meta.rqmts]/4, which forbids user specialization of them), so clang errors:
error: 'is_arithmetic' cannot be specialized: Specializing this standard library template is forbidden by N5014 [meta.rqmts]/4 [-Winvalid-specialization]
This makes rocWMMA fail to compile on Windows with a current MSVC toolset (e.g. downstream llama.cpp -DGGML_HIP_ROCWMMA_FATTN=ON).
Minimal repro
#include <type_traits>
struct hip_fp8_e4m3 {};
namespace std { template <> struct is_arithmetic<hip_fp8_e4m3> : true_type {}; }
int main() { return 0; }
clang++ -x c++ -std=gnu++17 -c repro.cpp (with MSVC 14.51 STL) → error. Adding -Wno-invalid-specialization compiles.
Suggested fix
Avoid specializing standard <type_traits> templates for rocWMMA types; use a rocWMMA-internal trait (e.g. rocwmma::is_arithmetic) instead.
Workaround for consumers: build with -Wno-invalid-specialization.
Also
The Windows ROCm 7.1 HIP SDK does not appear to ship rocWMMA at all — it must be vendored from this repo. A note in the docs about Windows + current-MSVC support would help.
Environment
ROCm 7.1.1 clang 21.0.0git + MSVC 14.51.36231 STL, Windows. (Compiles fine on Linux/libstdc++, which lacks the annotation.) rocWMMA 2.1.0.
Problem
library/include/rocwmma/internal/float8.hppandrocwmma_xfloat32.hppspecialize standard<type_traits>templates for rocWMMA's fp8/xfloat32 types, e.g.:The current MSVC STL marks these traits
[[clang::no_specializations]](per N5014 [meta.rqmts]/4, which forbids user specialization of them), so clang errors:This makes rocWMMA fail to compile on Windows with a current MSVC toolset (e.g. downstream
llama.cpp -DGGML_HIP_ROCWMMA_FATTN=ON).Minimal repro
clang++ -x c++ -std=gnu++17 -c repro.cpp(with MSVC 14.51 STL) → error. Adding-Wno-invalid-specializationcompiles.Suggested fix
Avoid specializing standard
<type_traits>templates for rocWMMA types; use a rocWMMA-internal trait (e.g.rocwmma::is_arithmetic) instead.Workaround for consumers: build with
-Wno-invalid-specialization.Also
The Windows ROCm 7.1 HIP SDK does not appear to ship rocWMMA at all — it must be vendored from this repo. A note in the docs about Windows + current-MSVC support would help.