Details
CUDA: do not use restrict in FA vec helpers with PDL (#33384)
ggml_cuda_memcpy_1 and the vec FA dot product / dequantize helpers take
restrict pointers. Once inlined, nvcc emits the Q loads of
flash_attn_ext_vec as read-only (ld.global.nc) loads and hoists them
above ggml_cuda_pdl_sync() (griddepcontrol.wait). With PDL the vec
kernel calls ggml_cuda_pdl_lc() at its start, so it can then read Q
before the producing kernel has finished.
On GB10 this shows up as a Gemma-4 MTP draft acceptance drop with an
F8_E4M3 KV cache (single-token draft decode uses the F8 vec kernel),
fixed by GGML_CUDA_PDL=0 or by not launching the vec kernel with PDL.
Use GGML_CUDA_RESTRICT for these helpers, as was done for the kernel
pointers in #24030. No vec instance loads global memory before the
dependency wait any more.
Fixes #33126
Assisted-by: Claude Opus 5.5
Website:
Attestations:
macOS/iOS:
- macOS Apple Silicon (arm64)
- macOS Apple Silicon (arm64, KleidiAI enabled) DISABLED
- macOS Intel (x64)
- iOS XCFramework
Linux:
- Ubuntu x64 (CPU)
- Ubuntu arm64 (CPU)
- Ubuntu 24.04 s390x (CPU)
- Ubuntu 26.04 s390x (CPU)
- Ubuntu 26.04 s390x (zDNN)
- Ubuntu x64 (Vulkan)
- Ubuntu arm64 (Vulkan)
- Ubuntu x64 (CUDA 12) - CUDA 12.8 libraries
- Ubuntu x64 (CUDA 13) - CUDA 13.5 libraries
- Ubuntu arm64 (CUDA 13) - CUDA 13.5 libraries
- Ubuntu x64 (ROCm 10.0)
- Ubuntu x64 (OpenVINO)
- Ubuntu x64 (SYCL FP32)
- Ubuntu x64 (SYCL FP16)
- Linux arm64 (Snapdragon: CPU, Adreno GPU, Hexagon NPU) - setup guide
Android:
Windows:
- Windows x64 (CPU)
- Windows arm64 (CPU)
- Windows arm64 (OpenCL Adreno)
- Windows x64 (CUDA 12) - CUDA 12.4 DLLs
- Windows x64 (CUDA 13) - CUDA 13.5 DLLs
- Windows arm64 (CUDA 13) - CUDA 13.5 DLLs
- Windows x64 (Vulkan)
- Windows arm64 (Vulkan)
- Windows x64 (OpenVINO)
- Windows x64 (SYCL)
- Windows x64 (ROCm 10.0)
openEuler:
- DISABLED
- openEuler x86 (310p)
- openEuler x86 (910b, ACL Graph)
- openEuler aarch64 (310p)
- openEuler aarch64 (910b, ACL Graph)
UI: