Skip to content

[executorch][cuda] Lower off-graph KV to the batched-sequence layout - #24881

Open
pytorchbot wants to merge 1 commit into
gh/Gasoonjia/91/origfrom
gh/Gasoonjia/92/orig
Open

pytorchbot wants to merge 1 commit into
gh/Gasoonjia/91/origfrom
gh/Gasoonjia/92/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: #24074 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/92/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/92/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/91/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/92/orig
Differential Revision: D125987298
@diff-train-skip-merge

Pull Request resolved: #24074

Teaches `LowerOffGraphKVPass` a third manifest layout, `batched-sequence`, alongside `sequence` (solo) and `cell`. Each `kvcache.update_and_attend` becomes an in-graph write to slot `(position % rows) * columns + seq_cols[i]` followed by `triton::sdpa_varlen` over the column store, with `seq_cols` / `seq_info` as runtime-owned step buffers. The manifest carries `max_seqs`, `max_segments` (= 2 * max_seqs) and `causal` (false for DFlash drafts).

`CudaBackend` treats it as a packed layout like `cell` (step-width check from the packed position source; no joint-graph constant folding of runtime buffers).
ghstack-source-id: 469359741
@exported-using-ghexport

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

pytorch-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ 1 Pending, 1 Unrelated Failure

As of commit 3b3eca1 with merge base 4eb094b (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 11, 2026
@pytorchbot
pytorchbot deployed to upload-benchmark-results November 11, 2026 04:05 — with GitHub Actions Active

This branch was successfully deployed

1 active and 1 inactive deployments
upload-benchmark-results — 3b3eca1a Deployed Nov 11, 2026 by pytorchbot via upload-benchmark-results #22290
cadence — 3b3eca1a Deployed Nov 11, 2026 by pytorchbot via hifi-op-test / hifi4 #37751
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