Skip to content

Thread kernel_registry through Module::load_method (#19641)#19641

Open
wliuyx wants to merge 1 commit into
pytorch:mainfrom
wliuyx:export-D104433196
Open

Thread kernel_registry through Module::load_method (#19641)#19641
wliuyx wants to merge 1 commit into
pytorch:mainfrom
wliuyx:export-D104433196

Conversation

@wliuyx
Copy link
Copy Markdown

@wliuyx wliuyx commented May 18, 2026

Summary:

Previous commit added a method-scoped kernel registry to Program::load_method and Method, allowing callers to override specific kernels for a single method without affecting the global registry. However, the Module facade class did not expose this parameter, forcing consumers to bypass Module and manage memory manually.

This adds an optional Span<const Kernel> kernel_registry parameter (defaulting to empty) to Module::load_method and Module::load_forward, and forwards it to Program::load_method. Existing callers are completely unaffected — the default empty span causes the runtime to fall back to the global kernel registry, exactly as before.

Differential Revision: D104433196

@wliuyx wliuyx requested a review from shoumikhin as a code owner May 18, 2026 14:53
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 18, 2026

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 7bdaad3 with merge base 3ceb89c (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 May 18, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 18, 2026

@wliuyx has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104433196.

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

wliuyx added a commit to wliuyx/executorch that referenced this pull request May 18, 2026
Summary:
Pull Request resolved: pytorch#19641

D98080033 added a method-scoped kernel registry to Program::load_method and Method, allowing callers to override specific kernels for a single method without affecting the global registry. However, the Module facade class did not expose this parameter, forcing consumers to bypass Module and manage memory manually.

This adds an optional `Span<const Kernel> kernel_registry` parameter (defaulting to empty) to Module::load_method and Module::load_forward, and forwards it to Program::load_method. Existing callers are completely unaffected — the default empty span causes the runtime to fall back to the global kernel registry, exactly as before.

Differential Revision: D104433196
@meta-codesync meta-codesync Bot changed the title Thread kernel_registry through Module::load_method Thread kernel_registry through Module::load_method (#19641) May 18, 2026
@wliuyx wliuyx force-pushed the export-D104433196 branch from 93074e2 to b6c2a9f Compare May 18, 2026 14:55
Summary:

Previous commit added a method-scoped kernel registry to Program::load_method and Method, allowing callers to override specific kernels for a single method without affecting the global registry. However, the Module facade class did not expose this parameter, forcing consumers to bypass Module and manage memory manually.

This adds an optional `Span<const Kernel> kernel_registry` parameter (defaulting to empty) to Module::load_method and Module::load_forward, and forwards it to Program::load_method. Existing callers are completely unaffected — the default empty span causes the runtime to fall back to the global kernel registry, exactly as before.

Differential Revision: D104433196
@wliuyx wliuyx force-pushed the export-D104433196 branch from b6c2a9f to 7bdaad3 Compare May 18, 2026 15:36
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants