@@ -972,36 +972,39 @@ def to_edge_transform_and_lower(
972
972
exported programs in ATen dialect. It differs fundamentally from to_edge in that it
973
973
combines the conversion of the ATen dialect to the edge dialect program, then running
974
974
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
+
976
977
This is fundamentally useful for lowering to backends that have ops registered that they
977
978
do not want to be decomposed and thus rely on matching with these non-decomposed ops. For
978
979
these sorts of backends this is the *only* API that should be used to lower to the edge
979
980
dialect. Using a combination of to_edge(...) and to_backend(...) will result in inconsistent
980
981
or wrong behavior.
981
982
983
+ This API is the primary recommended way to lower to the CPU based XNNPack backend.
984
+
982
985
Args:
983
986
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".
986
989
987
990
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.
992
995
993
996
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.
998
1001
999
1002
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.
1002
1005
1003
1006
compile_config: An optional argument used to provide greater control over the
1004
- transformation to edge dialect process.
1007
+ transformation to edge dialect process.
1005
1008
1006
1009
Returns:
1007
1010
EdgeProgramManager
0 commit comments