You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are mainly two Ahead-of-Time entry point for backend to implement: `partition` and `preprocess`.
65
65
66
-
`partitioner` is an algorithm implemented by the backend to tag the nodes to be lowered to the backend. `to_backend` API
67
-
will apply the partition algorithm and lowered each subgraph, consists of connected tagged nodes, to the backend. Every subgraph
66
+
`partitioner` is an algorithm implemented by the backend to tag the nodes to be lowered to the backend. `to_backend` API will apply the partition algorithm and lower each subgraph, which consists of connected tagged nodes, to the targeted backend. Every subgraph
68
67
will be sent to the `preprocess` part provided by the backend to compiled as a binary blob.
69
68
70
69
During partition, the `exported_program` is not allowed to mutate the program, and it's supposed to apply tag to each node. The
**Figure 3.** The relationship between standard ExecuTorch Runtime and backend entry point.
141
140
@@ -155,13 +154,22 @@ static auto success_with_compiler = register_backend(backend);
155
154
```
156
155
157
156
158
-
## Debugging model execution within delegate
157
+
## SDK Integration: Debuggability
159
158
160
159
Providing consistent debugging experience, be it for runtime failures or performance profiling, is important. ExecuTorch employs native SDK (Software Development Kit) for this purpose, which enables correlating program instructions to original PyTorch code, via debug handles. You can read more about it [here](./sdk-etrecord).
161
160
162
-
Delegated program or subgraphs are opaque to ExecuTorch runtime and appear as a special `call_delegate` instruction, which asks corresponding delegate to handle the execution of the subgraph or program. Due to the opaque nature of delgates, native SDK does not have visibility into delegated program. Thus the debugging, functional or performance, experiences of delegated execution suffers significantly as compared to it's non-delegated counterpart.
161
+
Delegated program or subgraphs are opaque to ExecuTorch runtime and appear as a special `call_delegate` instruction, which asks corresponding backend to handle the execution of the subgraph or program. Due to the opaque nature of backend delgates, native SDK does not have visibility into delegated program. Thus the debugging, functional or performance, experiences of delegated execution suffers significantly as compared to it's non-delegated counterpart.
163
162
164
-
In order to provide consistent debugging experience to users, regardless of the use of delegation for a model, SDK provides an interface to correlate delegated (sub)graph to original (sub)graph. The SDK does so via debug handles map which allows delegates to generate internal handles that can be associated with the original (sub)graph consumed by the delegate. Then at runtime, delegates can report error or profiling information using the internal handle, which will be mapped to original (sub)graph using the debug handle map. For more information, please refer to [SDK delegate integration](./sdk-delegate-integration).
163
+
In order to provide consistent debugging experience to users, regardless of the use of delegation for a model, SDK provides an interface to correlate delegated (sub)graph to original (sub)graph. The SDK does so via debug handles map which allows delegates to generate internal handles that can be associated with the original (sub)graph consumed by the delegate. Then at runtime, backend developer can report error or profiling information using the internal handle, which will be mapped to original (sub)graph using the debug handle map. For more information, please refer to [SDK delegate integration](./sdk-delegate-integration).
164
+
165
+
By leveraging the debug identifier, backend developer can embed the debug as part of the delegated blob
0 commit comments