Repository navigation
Give backends the method's metadata at init (#24220) - #24220
sivapatibandla wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24220
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ce078f5 with merge base 0549e1e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@sivapatibandla has exported this pull request. If you are a Meta employee, you can view the originating Diff in D127716377. |
This PR needs a
|
Summary: `BackendInitContext::method_meta()` gives a delegate's `init` the `MethodMeta` of the method being loaded, or null when the context is built without one. `Method::init` passes its own; the view is borrowed and valid only during `init`. With it, a delegate can check the method around it, such as its delegates, its instruction count and whether its inputs and outputs are memory planned, before it accepts options that depend on them. The Core ML delegate uses this later in the stack to accept IOSurface load options only for a method that is just its own call on unplanned inputs and outputs. The context carries the metadata instead of a `has_verified_single_delegate_io()` flag computed by the runtime, so each delegate applies its own rule. Differential Revision: D127716377
96eed8e to
ce078f5
Compare
Summary:
BackendInitContext::method_meta()gives a delegate'sinittheMethodMetaof the method being loaded, or null when the context is built without one.Method::initpasses its own; the view is borrowed and valid only duringinit. With it, a delegate can check the method around it, such as its delegates, its instruction count and whether its inputs and outputs are memory planned, before it accepts options that depend on them.The Core ML delegate uses this later in the stack to accept IOSurface load options only for a method that is just its own call on unplanned inputs and outputs.
The context carries the metadata instead of a
has_verified_single_delegate_io()flag computed by the runtime, so each delegate applies its own rule.Differential Revision: D127716377