SIGN IN SIGN UP

Rewrite backend passes w/o ExportPass (#1372)

Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/1372

The core problem can be reproduced in D51686224. The issue is that the executorch sym operation is unable to handle unbacked symints, and we run the graph with fake inputs + symints whenever we do an Interpreter-based pass. So, the solution we have here is to rewrite the passes to not use the Interpreter-based passes.

This is ok because we (Executorch) is in control of all the passes after EdgeToBackendOpPass, so we just need to make sure that those passes do not use Interpreter-based passes.

Context for this pass:
> At a high level heres whats going on:
> Export produces a graph with nodes like "operator.ge". These are not aten operators and they operate on SymInts/Bools/Floats. Executorch would really like these to be operators so we can target them easier in the backend. To do that we have a pass that replaces all of these with executorch operators that attempt to mimic the behavior of whatever operator.ge etc do. This has historically caused problems where the executorch python definition does not match the operator.ge behavior preventing us from performing future passes or running the model before final lowering. In cpp theres no issues because the concept of sym is gone and everything is concrete.

Reviewed By: larryliu0820

Differential Revision: D51924408

fbshipit-source-id: f93119a799bdaad912b820e712e9651b4cccf1b5
A
Angela Yi committed
cb76c5183c6dd0c32542c37077cd1e1f751d5647
Parent: 5ab43ca
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 12/8/2023, 12:59:34 AM