Skip to content

Commit 204b8e0

Browse files
committed
[ExecuTorch][to_backend] Introduce preprocess_all method to backend details
We introduce the new static method preprocess_all. This is not an enforced method because preprocess() is enforced and can be used instead. Ideally, I want the default implementation of preprocess_all, to just loop through the exported programs for each method and use preprocess() to lower them. However since each are static methods, I wasn't able to find a good way to do this. Suggestions would be greatly appreciated for that. Differential Revision: [D69954544](https://our.internmc.facebook.com/intern/diff/D69954544/) [ghstack-poisoned]
1 parent d023a77 commit 204b8e0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

exir/backend/backend_details.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,12 @@ def preprocess(
7373
# Users should return a compiled blob - a binary that can run the desired
7474
# program in the backend.
7575
pass
76+
77+
@staticmethod
78+
# it's a virtual method and inheritant class needs to implement the actual function
79+
@abstractmethod
80+
def preprocess_all(
81+
edge_programs: Dict[str, List[ExportedProgram]],
82+
compile_specs: Dict[str, List[List[CompileSpec]]],
83+
) -> Dict[str, list[PreprocessResult]]:
84+
pass

0 commit comments

Comments
 (0)