Thread kernel_registry through Module::load_method (#19641)#19641
Thread kernel_registry through Module::load_method (#19641)#19641wliuyx wants to merge 1 commit into
Conversation
🔗 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 SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit 7bdaad3 with merge base 3ceb89c ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@wliuyx has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104433196. |
This PR needs a
|
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
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
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_registryparameter (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