Skip to content

[executorch][cuda] Add step_plan for the CUDA batching executor - #23369

Open
Gasoonjia wants to merge 1 commit into
gh/Gasoonjia/36/basefrom
gh/Gasoonjia/36/head
Open

Gasoonjia wants to merge 1 commit into
gh/Gasoonjia/36/basefrom
gh/Gasoonjia/36/head

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Step slicing for the CUDA batching executor, in backends/cuda/batching:
plan_slices (step_plan.h, header-only) cuts a batch of packed tokens into
forwards the exported decode/prefill methods can run, in order, so a slice
attends every cell its predecessors wrote.

Slices take up to max_step_tokens each. A one-token slice runs Decode (the
static, one-token method a CUDA graph is captured for). A slice shorter than
min_prefill_tokens -- the lower bound the prefill method was exported
with -- runs as that many Decode forwards; anything else runs Prefill (dynamic
over [min_prefill_tokens, max_step_tokens]).

Builds with Buck (step_plan + test_step_plan) and CMake (header-only
install, test_step_plan under BUILD_TESTING; the batching dir is added from
the OSS root after extension/llm/batching). The OSS unittest-cuda-runtime job
builds and runs test_step_plan. The CudaExecutor itself, which consumes this
header, follows in the child diff.

Differential Revision: D123066805

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 4 Unclassified Failures

As of commit 80bfc20 with merge base c16dd0a (image):

NEW FAILURE - The following job has failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

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

@github-actions

github-actions Bot commented Oct 2, 2026

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.

This branch was successfully deployed

1 active deployment
cadence — 80bfc209 Deployed Oct 2, 2026 by Gasoonjia via hifi-op-test / hifi4 #31146
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant