Skip to content

[executorch][native-ggml] Store attention-only KV caches in F16 on CUDA and HIP - #25580

Open
pytorchbot wants to merge 1 commit into
gh/digantdesai/281/origfrom
gh/digantdesai/282/orig
Open

pytorchbot wants to merge 1 commit into
gh/digantdesai/281/origfrom
gh/digantdesai/282/orig

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #25489 by @digantdesai
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/digantdesai/282/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/282/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/digantdesai/281/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/282/orig
Differential Revision: D132607617
@diff-train-skip-merge

…DA and HIP

On CUDA and HIP the ggml engine now stores a zero-initialized F32 mutable
buffer in F16 when its only uses are row writes and flash attention keys or
values that the GPU runs; the PTN still declares an F32 cache. The testing
option `f32_gpu_kv_cache_for_testing` (a ggml_ptn_runner flag) keeps these
in-graph caches F32; off-graph caches take CacheConfig::kv_dtype.

ggml-cuda's flash attention rounds F32 keys and values to F16 on every call,
as an F16 `set_rows` does, so results are unchanged at half the cache bytes.

Authored with assistance from Claude and Codex.

Differential Revision: [D132607617](https://our.internmc.facebook.com/intern/diff/D132607617/)


ghstack-source-id: 480469663
Pull-Request: #25489
@pytorch-bot

pytorch-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/25580

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 6a251e7 with merge base 8c3f75d (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 23, 2026

This branch was previously deployed

1 inactive deployment
cadence — 6a251e7d Deployed Nov 23, 2026 by pytorchbot via hifi-op-test / hifi4 #40280
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants