Skip to content

Commit 620d7ea

Browse files
pytorchbottarun292
andauthored
Point to to_edge_transform_and_lower in ExecuTorch API docs (#6283)
Point to to_edge_transform_and_lower in ExecuTorch API docs (#6236) Summary: Pull Request resolved: #6236 Add a pointer to `to_edge_transform_and_lower` in the ExecuTorch export API docs. Reviewed By: lucylq Differential Revision: D64407042 fbshipit-source-id: 5eeedbb10af4d2e9fa1b6b8d979374b2eaa6da9d (cherry picked from commit 8673567) Co-authored-by: Tarun Karuturi <[email protected]>
1 parent e0e19ed commit 620d7ea

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

docs/source/export-to-executorch-api-reference.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ For detailed information on how APIs evolve and the deprecation process, please
66
.. automodule:: executorch.exir
77
.. autofunction:: to_edge
88

9+
.. automodule:: executorch.exir
10+
.. autofunction:: to_edge_transform_and_lower
11+
912
.. autoclass:: EdgeProgramManager
1013
:members: methods, config_methods, exported_program, transform, to_backend, to_executorch
1114

exir/program/_program.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -972,36 +972,39 @@ def to_edge_transform_and_lower(
972972
exported programs in ATen dialect. It differs fundamentally from to_edge in that it
973973
combines the conversion of the ATen dialect to the edge dialect program, then running
974974
the transformation passes and then subsequently lowering the programs to their
975-
corresponding backends all in a single pass.
975+
corresponding backends all into a single API.
976+
976977
This is fundamentally useful for lowering to backends that have ops registered that they
977978
do not want to be decomposed and thus rely on matching with these non-decomposed ops. For
978979
these sorts of backends this is the *only* API that should be used to lower to the edge
979980
dialect. Using a combination of to_edge(...) and to_backend(...) will result in inconsistent
980981
or wrong behavior.
981982
983+
This API is the primary recommended way to lower to the CPU based XNNPack backend.
984+
982985
Args:
983986
programs: Can be a single ExportedProgram or a dictionary mapping function names
984-
to their corresponding ExportedPrograms. If only a single ExportedProgram is
985-
provided it will be assigned the name "forward".
987+
to their corresponding ExportedPrograms. If only a single ExportedProgram is
988+
provided it will be assigned the name "forward".
986989
987990
transform_passes: The passes can either be a list of passes, or a dictionary
988-
mapping method names to lists of passes. If it is just a list of passes, all methods
989-
in the given EdgeProgramManager will be transformed with the provided passes. If it
990-
is a dictionary, only method names specified in the dictionary will be transformed
991-
with their corresponding passes.
991+
mapping method names to lists of passes. If it is just a list of passes, all methods
992+
in the given EdgeProgramManager will be transformed with the provided passes. If it
993+
is a dictionary, only method names specified in the dictionary will be transformed
994+
with their corresponding passes.
992995
993996
partitioner: The partitioner can either be a Partitioner subclass instance, or a
994-
dictionary mapping method names to Partitioner subclass instance. If it is a
995-
Partitioner subclass, all programs in the given EdgeProgramManager will be lowered
996-
using the given partitioner. If it is a dictionary, only method names specified in
997-
the dictionary will be lowered with the given partitioner.
997+
dictionary mapping method names to Partitioner subclass instance. If it is a
998+
Partitioner subclass, all programs in the given EdgeProgramManager will be lowered
999+
using the given partitioner. If it is a dictionary, only method names specified in
1000+
the dictionary will be lowered with the given partitioner.
9981001
9991002
constant_methods: An optional dictionary of method name to the constant value
1000-
returned by that method in eager mode. Often used to store config information on
1001-
Edge models.
1003+
returned by that method in eager mode. Often used to store config information on
1004+
Edge models.
10021005
10031006
compile_config: An optional argument used to provide greater control over the
1004-
transformation to edge dialect process.
1007+
transformation to edge dialect process.
10051008
10061009
Returns:
10071010
EdgeProgramManager

0 commit comments

Comments
 (0)