Skip to content

Revamp CUDA extension based on new cuDNN wrappers#738

Draft
maleadt wants to merge 10 commits into
FluxML:masterfrom
maleadt:cudnn_revamp
Draft

Revamp CUDA extension based on new cuDNN wrappers#738
maleadt wants to merge 10 commits into
FluxML:masterfrom
maleadt:cudnn_revamp

Conversation

@maleadt

@maleadt maleadt commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

JuliaGPU/CUDA.jl#3191 modernizes CUDA.jl's cuDNN wrappers, deprecating the old imperative interface, instead adding one based on the new back-end API, with a higher-level interface on top. This PR builds off of #719 and reworks the extension here to be built on top of that new API.

Since I'm not actually a user of these interfaces, I'd appreciate if people would take a look and suggest any changes to make to the cuDNN wrappers to facilitate use here (I already had LLMs do as much as possible, taking into account what NNlib.jl and LuxLib.jl require, and how NVIDIA's high-level wrappers are implemented).

cc @CarloLucibello

CarloLucibello and others added 10 commits July 14, 2026 13:04
Introduce `scaled_dot_product_attention` and `scaled_dot_product_attention_scores`
taking inputs shaped `(head_dim, nheads, seq_len, batch...)`, PyTorch-style, with
the number of heads inferred from the tensor shape rather than a `nheads` keyword.

- `scaled_dot_product_attention` returns only the attention output; the scores are
  available separately via `scaled_dot_product_attention_scores`.
- Grouped-query attention (GQA): key/value may have fewer heads than the query.
- New `scale` and `is_causal` keywords; `make_causal_mask` now defaults to `dims=3`.
- Deprecate the old packed-head `dot_product_attention` /
  `dot_product_attention_scores`, forwarding through the new implementation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maleadt maleadt changed the title Revamp CUDA integration based on new wrappers Revamp CUDA extension based on new cuDNN wrappers Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants