Skip to content

Add the EAGLE-3 speculator CUDA export#20155

Draft
digantdesai wants to merge 1 commit into
gh/digantdesai/59/headfrom
gh/digantdesai/60/head
Draft

Add the EAGLE-3 speculator CUDA export#20155
digantdesai wants to merge 1 commit into
gh/digantdesai/59/headfrom
gh/digantdesai/60/head

Conversation

@digantdesai

Copy link
Copy Markdown
Contributor

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.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🔗 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 Pending

As of commit 480a068 with merge base dc55469 (image):
💚 Looks good so far! There are no failures yet. 💚

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

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.

1 participant