Skip to content

[executorch][native-ggml] Enable CUDA graphs in CMake builds - #24849

Open
SS-JIA wants to merge 1 commit into
gh/SS-JIA/705/basefrom
gh/SS-JIA/705/head
Open

SS-JIA wants to merge 1 commit into
gh/SS-JIA/705/basefrom
gh/SS-JIA/705/head

Conversation

@SS-JIA

@SS-JIA SS-JIA commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Ulterior Motive

Closing the decode gap between ExecuTorch Native's GGML engine and llama.cpp on CUDA, measured with Gemma 4 31B Q4_K_M on an A100.

Rationale

What: The GGML engine's CMake turns ggml's GGML_CUDA_GRAPHS option on unless the user sets it.

Why: ggml defaults the option to off and llama.cpp's own CMake turns it on. The engine adds ggml as a subdirectory, so its CMake CUDA builds launched each kernel of a decode step separately: about 1,900 launches per Gemma 4 31B step, which cost 2.2–2.5 ms of a ~26 ms step.

Details

  • Before: GGML_CUDA_GRAPHS off unless set; ggml-cuda never captured or replayed CUDA graphs.
  • After: on unless set, as in llama.cpp's CMake; -DGGML_CUDA_GRAPHS=OFF still turns it off.

Buck builds already compile ggml-cuda with CUDA graphs.

Authored with Claude Code.

Differential Revision: D130721993

[ghstack-poisoned]
@SS-JIA
SS-JIA requested a review from larryliu0820 as a code owner November 10, 2026 18:17
@pytorch-bot

pytorch-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ You can merge normally! (4 Unrelated Failures), 4 Unclassified Failures

As of commit 8ecfa50 with merge base 4529a94 (image):

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:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

@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.

This branch was previously deployed

1 inactive deployment
cadence — 8ecfa505 Deployed Nov 10, 2026 by SS-JIA via hifi-op-test / hifi4 #37639
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