]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
HIP: add CDNA4 (gfx950) architecture support for MI350X/MI355X (llama/21570)
authorandyluo7 <redacted>
Thu, 9 Apr 2026 19:13:32 +0000 (22:13 +0300)
committerGeorgi Gerganov <redacted>
Thu, 30 Apr 2026 08:29:05 +0000 (11:29 +0300)
commitc77a33df06f64eda3cff5dd54a99e7b3fdbb152c
tree726c0f94de89715fff4c57e246c595a7dee5cc4a
parentbb895c843d249ee4a15dcfa19caf2d78ad5e2aa0
HIP: add CDNA4 (gfx950) architecture support for MI350X/MI355X (llama/21570)

Add AMD Instinct MI350X/MI355X (gfx950, CDNA4) support:

- vendors/hip.h: Add CDNA4 preprocessor define for __gfx950__
- common.cuh: Add GGML_CUDA_CC_CDNA4 and GGML_CUDA_CC_IS_CDNA4 macros
- mma.cuh: Route CDNA4 to compatible MFMA instructions:
  * f32 matmul: mfma_f32_16x16x4f32 (xf32 variant unavailable on gfx950)
  * bf16 matmul: mfma_f32_16x16x16bf16_1k (same as CDNA3)
  * int8 matmul: mfma_i32_16x16x32_i8/32x32x16 (same as CDNA3)
- mmq.cuh: Include CDNA4 in stream-k kernel dispatch

CDNA4 is largely compatible with CDNA3 except:
- No xf32 MFMA (mfma_f32_16x16x8_xf32) — routes to f32 path
- Different FP8 format (e4m3fn vs e4m3_fnuz) — not changed here

Tested on AMD Instinct MI355X (gfx950), ROCm 7.0.1:
- Build: compiles cleanly with -DAMDGPU_TARGETS=gfx950
- llama-bench (Qwen2.5-1.5B Q4_K_M, single GPU):
  * f16+FA: 40,013 tok/s prefill, 254 tok/s decode
  * q8_0+FA: functional
- Flash attention: works correctly
- MMQ: works correctly with stream-k dispatch

Co-authored-by: Andy Luo <redacted>
ggml/src/ggml-cuda/common.cuh
ggml/src/ggml-cuda/mma.cuh
ggml/src/ggml-cuda/mmq.cuh
ggml/src/ggml-cuda/vendors/hip.h