Skip to content

[executorch][native-ggml] Size the scheduler hash for graph leafs too - #24991

Merged
SS-JIA merged 1 commit into
mainfrom
gh/SS-JIA/703/orig
Nov 12, 2026
Merged

SS-JIA merged 1 commit into
mainfrom
gh/SS-JIA/703/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: #24847 by @SS-JIA
^ 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/SS-JIA/703/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/703/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/702/orig
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/703/orig
Differential Revision: D130721991
@diff-train-skip-merge

@pytorch-bot

pytorch-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit 344b1b6 with merge base ce0d880 (image):
💚 Looks good so far! There are no failures yet. 💚

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 12, 2026
@SS-JIA
SS-JIA added this pull request to stack #24995 November 12, 2026 20:32
@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.

Base automatically changed from gh/SS-JIA/702/orig to main November 12, 2026 21:45
## Ulterior Motive

Running Gemma 4 31B through ExecuTorch Native's GGML engine on CUDA, to find why it decodes slower than llama.cpp on the same GGUF.

## Rationale

**What**: The backend scheduler is created for `2 * graph_size` tensors.

**Why**: `ggml_backend_sched` hashes every node and every leaf of a graph it splits, and asserts that its hash set holds them all. It was sized for `graph_size`, which caps nodes and leafs separately, so a graph whose nodes and leafs together outgrew it failed that assertion, though either count alone fit.

## Details

- **Before**: `ggml_backend_sched_new(..., graph_size, ...)`; ggml's own source notes the hash "needs to be size*2 to account for leafs".
- **After**: `2 * graph_size`, room for a full graph of `graph_size` nodes and `graph_size` leafs.

`test_graph_with_as_many_leafs_as_nodes` adds 2,100 separate constants to an input: 2,100 nodes and as many leafs, within the default graph size of 4,096.

Authored with Claude Code.

Differential Revision: [D130721991](https://our.internmc.facebook.com/intern/diff/D130721991/)


ghstack-source-id: 469829014
Pull-Request: #24847
@SS-JIA
SS-JIA force-pushed the gh/SS-JIA/703/orig branch from 53218c4 to 344b1b6 Compare November 12, 2026 21:45
@SS-JIA
SS-JIA merged commit 6411f1e into main Nov 12, 2026
217 checks passed
@SS-JIA
SS-JIA deleted the gh/SS-JIA/703/orig branch November 12, 2026 23:18

This branch was previously deployed

1 inactive deployment
cadence — 344b1b65 Deployed Nov 12, 2026 by SS-JIA via hifi-op-test / hifi4 #38119
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