Skip to content

CUDA: consistent use of __restrict__ + PDL for FA - #25185

Merged
JohannesGaessler merged 1 commit into
ggml-org:masterfrom
JohannesGaessler:cuda-fattn-restrict-pdl
Jul 1, 2026
Merged

CUDA: consistent use of __restrict__ + PDL for FA#25185
JohannesGaessler merged 1 commit into
ggml-org:masterfrom
JohannesGaessler:cuda-fattn-restrict-pdl

Conversation

@JohannesGaessler

Copy link
Copy Markdown
Contributor

The auxiliary kernel flash_attn_mask_to_KV_max is only partially enrolled into PDL. It has a call to ggml_cuda_pdl_sync
but is still launched via <<<...>>> and has __restrict__ pointers in its signature. This PR fully enrolls flash_attn_mask_to_KV_max in PDL to make its usage consistent with the surrounding FA kernels.

Requirements

@JohannesGaessler
JohannesGaessler requested a review from a team as a code owner June 30, 2026 20:54
@github-actions github-actions Bot added ggml changes relating to the ggml tensor library for machine learning CUDA Related to the CUDA backend labels Jun 30, 2026

@ORippler ORippler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JohannesGaessler
JohannesGaessler merged commit b820cc8 into ggml-org:master Jul 1, 2026
20 checks passed
DFveloper pushed a commit to DFveloper/aikar-engine that referenced this pull request Jul 3, 2026
LostRuins added a commit to LostRuins/koboldcpp that referenced this pull request Jul 3, 2026
adrianhoehne pushed a commit to adrianhoehne/llama.cpp that referenced this pull request Jul 5, 2026
giveen added a commit to giveen/llama-cpp-turboquant that referenced this pull request Jul 18, 2026
Port upstream commit b820cc8 (CUDA: consistent use of __restrict__
+ PDL for FA ggml-org#25185). Avoids compiler race condition between PDL and
__restrict__ on Hopper+ GPUs by using GGML_CUDA_RESTRICT (which is a
no-op when PDL is active) instead of raw __restrict__ on kernel params.
Also switches the kernel launch to ggml_cuda_kernel_launch() for PDL
enrollment.
CowboyTim pushed a commit to aardbeiplantje/llama.cpp that referenced this pull request Jul 21, 2026
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CUDA Related to the CUDA backend ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants