Skip to content

Commit ac67efc

Browse files
pytorchbotlucylq
authored andcommitted
Add preserve_ops to EdgeCompileConfig (#12546)
1. Add `preserve_ops` to `EdgeCompileConfig` 2. Remove preserved ops from the decomposition table in `to_edge`. 3. Add checks to the verifier ensuring that preserved ops do not have mutations or views. 4. Update 'core_aten_exception_list' to be 'preserved_ops' in `to_edge_transform_and_lower`. Context/Usage **core_aten_ops_exception_list** - Contains operators that are missing a decomposition to core aten. - Exclude these so that verification can still be run on the rest of the graph. - Ideally, this list should be empty. **preserve_ops** - Contains operators that the user specifically does not want decomposed. - Must be aten; custom ops are ignored by verifier. Edge case: - If an aten operator does not have a decomp, and the user specifically wants it to be preserved, put it in preserve_ops rather than core_aten_ops_exception_list. Differential Revision: [D78298749](https://our.internmc.facebook.com/intern/diff/D78298749/)
1 parent f5405a6 commit ac67efc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

exir/program/test/test_program.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,11 @@ def _test_to_edge_with_preserved_ops(
784784
self, program, preserved_ops, expected_preserved_ops
785785
):
786786
edge = to_edge(
787+
<<<<<<< HEAD
787788
program, compile_config=EdgeCompileConfig(preserve_ops=preserved_ops)
789+
=======
790+
program, compile_config=EdgeCompileConfig(_preserve_ops=preserved_ops)
791+
>>>>>>> 0012ffaf9f (Add preserve_ops to EdgeCompileConfig (#12546))
788792
)
789793

790794
def count_nodes(graph_module, target):

0 commit comments

Comments
 (0)