Add the EAGLE-3 speculator CUDA export#20155
Draft
digantdesai wants to merge 1 commit into
Draft
Conversation
Contributor
Author
This was referenced Jun 9, 2026
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20155
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 5 PendingAs of commit 480a068 with merge base dc55469 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exports a registered target (--target-model; gemma4-31B is the reference, see
target.py) and an EAGLE-3 draft head to a single .pte with three methods lowered
together via the CUDA (AOTI) backend: prefill and target_verify (sharing the
target KV cache) and draft_decode (the draft KV cache). The load and the target's
forward-length bounds (min/max tokens in one forward) come from its TargetSpec,
not gemma-specific code; a standalone target decode is omitted because the
shifted runner reseeds from target_verify's feature.
The model stays on the host during export so AOTInductor streams weights to the
GPU per kernel, keeping peak device memory low for the INT4 31B target. For the
static chain_len+1 verify forward to use the small-M INT4 GEMM, the export raises
int4_dispatch.MATVEC_MAX_M to 8 for this export only and restores it afterward;
prefill's dynamic length is then exported with min = max(min_forward_len, 9) and
published as get_min_prefill_chunk (the runner enforces it; no chunking). The
verify window (chain_len+1) is validated against the target's min/max forward
length and the GEMM limit.
Also slices instead of chunks in the draft's rotary helper: chunk lowers to
aten::split_copy, which the AOTI CUDA backend has no fallback kernel for.
Authored with assistance from Claude Code.