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
Copy file name to clipboardExpand all lines: docs/source/concepts.md
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,11 @@ A specific hardware (like GPU, NPU) or a software stack (like XNNPACK) that cons
36
36
37
37
Backend dialect is the result of exporting Edge dialect to specific backend. It’s target-aware, and may contain operators or submodules that are only meaningful to the target backend. This dialect allows the introduction of target-specific operators that do not conform to the schema defined in the Core ATen Operator Set and are not shown in ATen or Edge Dialect.
38
38
39
-
## [Backend Specific Operator]
39
+
## Backend registry
40
+
41
+
A table mapping backend names to backend interfaces. This allows backends to be called via name during runtime.
42
+
43
+
## Backend Specific Operator
40
44
41
45
These are operators that are not part of ATen dialect or Edge dialect. Backend specific operators are only introduced by passes that happen after Edge dialect (see Backend dialect). These operators are specific to the target backend and will generally execute faster.
42
46
@@ -48,6 +52,10 @@ An open-source, large scale build system. Used to build ExecuTorch.
48
52
49
53
An open-source, cross-platform family of tools designed to build, test and package software. Used to build ExecuTorch.
50
54
55
+
## Codegen
56
+
57
+
In ExecuTorch, code generation is used to generate the [kernel registration library](./kernel-library-selective_build.md).
58
+
51
59
## Core ATen Dialect
52
60
53
61
Core ATen dialect contains the core ATen operators along with higher order operators (control flow) and registered custom operators.
@@ -122,12 +130,16 @@ An ExecuTorch `Program` maps string names like `forward` to specific ExecuTorch
122
130
123
131
## executor_runner
124
132
125
-
The ExecuTorch runtime that executes the exported PyTorch model on-device.
133
+
A sample wrapper around the ExecuTorch runtime which includes all the operators and backends.
126
134
127
135
## [EXIR](./ir-exir.md)
128
136
129
137
The **EX**port **I**ntermediate **R**epresentation (IR) from `torch.export`. Contains the computational graph of the model. All EXIR graphs are valid [FX graphs](https://pytorch.org/docs/stable/fx.html#torch.fx.Graph).
130
138
139
+
## `ExportedProgram`
140
+
141
+
The output of `torch.export` that bundles the computational graph of a PyTorch model (usually an `nn.Module`) with the parameters or weights that the model consumes.
Memory efficient, cross platform serialization library. In the context of ExecuTorch, eager mode Pytorch models are exported to flatbuffer, which is the format consumed by the ExecuTorch runtime.
@@ -136,6 +148,10 @@ Memory efficient, cross platform serialization library. In the context of ExecuT
136
148
137
149
The cost of various loading and initialization tasks (not inference). For example; loading a program, initializing executor, kernel and backend-delegate dispatch, and runtime memory utilization.
138
150
151
+
## Functional ATen operators
152
+
153
+
ATen operators that do not have any side effects.
154
+
139
155
## [Graph](./ir-exir.md)
140
156
141
157
An EXIR Graph is a PyTorch program represented in the form of a DAG (directed acyclic graph). Each node in the graph represents a particular computation or operation, and edges of this graph consist of references between nodes. Note: all EXIR graphs are valid [FX graphs](https://pytorch.org/docs/stable/fx.html#torch.fx.Graph).
@@ -156,6 +172,11 @@ A representation of a program between the source and target languages. Generally
156
172
157
173
An implementation of an operator. There can be multiple implementations of an operator for different backends/inputs/etc.
158
174
175
+
176
+
## Kernel registry / Operator registry
177
+
178
+
A table with mappings between kernel names and their implementations. This allows the ExecuTorch runtime to resolve references to kernels during execution.
179
+
159
180
## Lowering
160
181
161
182
The process of transforming a model to run on various backends. It is called 'lowering' as it is moving code closer to the hardware. In ExecuTorch, lowering is performed as part of backend delegation.
@@ -176,9 +197,11 @@ Function on tensors. This is the abstraction; kernels are the implementation. Th
176
197
177
198
Operator fusion is the process of combining multiple operators into a single compound operator, resulting in faster computation due to fewer kernel launches and fewer memory read/writes. This is a performance advantage of graph mode vs eager mode.
178
199
179
-
## Operator registration
200
+
## Out variant
201
+
202
+
Instead of allocating returned tensors in kernel implementations, an operator's out variant will take in a pre-allocated tensor to its out kwarg, and store the result there.
180
203
181
-
Operators need to be registered with the ExecuTorch runtime. This allows the compiler to resolve references to the operator in code.
204
+
This makes it easier for memory planners to perform tensor lifetime analysis. In ExecuTorch, an out variant pass is performed before memory planning.
0 commit comments