Skip to content

[executorch][cuda] Run packed noncausal DFlash draft steps on the cell cache - #24036

Merged
Gasoonjia merged 1 commit into
mainfrom
gh/Gasoonjia/77/orig
Oct 21, 2026
Merged

Gasoonjia merged 1 commit into
mainfrom
gh/Gasoonjia/77/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: #23978 by @Gasoonjia
^ 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/Gasoonjia/77/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/77/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/77/orig
Differential Revision: D125705710
@diff-train-skip-merge

…l cache

Pull Request resolved: #23978

MLX batches DFlash drafts by packing every owner's new target context and
query block into one noncausal draft step. Let the CUDA cell cache serve the
same step so the CUDA DFlash executor can reuse the off-graph KV path.

- CacheGeometry::dflash_block_size (already on main) now selects a packed
  draft layout on CUDA: context rows commit, query rows are scratch.
- CudaCellCache prepares packed draft steps (declared context + block rows per
  owner) and lowers the noncausal mask the draft attends with.
- lower_offgraph_kv / cuda_backend learn the draft step width spec.
- Drop the "DFlash is unsupported on CUDA" builder guard.
ghstack-source-id: 453099239
@exported-using-ghexport

Differential Revision: [D125705710](https://our.internmc.facebook.com/intern/diff/D125705710/)
@pytorch-bot

pytorch-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

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 Oct 21, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@Gasoonjia
Gasoonjia added this pull request to stack #24044 October 21, 2026 06:44
@Gasoonjia
Gasoonjia merged commit 5467c27 into main Oct 21, 2026
315 of 325 checks passed
@Gasoonjia
Gasoonjia deleted the gh/Gasoonjia/77/orig branch October 21, 2026 06:48
@pytorchbot
pytorchbot deployed to upload-benchmark-results October 22, 2026 01:43 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
upload-benchmark-results — 8abeae2e Deployed Oct 22, 2026 by pytorchbot via upload-benchmark-results #21158
cadence — 8abeae2e Deployed Oct 21, 2026 by pytorchbot via hifi-op-test / hifi4 #34250
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