SIGN IN SIGN UP

Allow core aten op exception list (#5237)

Summary:
Currently when a non-core ATen operator shows up in the exported graph, `to_edge()` will fail and the only option is to disable IR validity check by setting `_check_ir_validity=False`. However this is unsafe to do, instead we should still run the rest of the checks.

This PR adds support to allow users to bypass core ATen ops check, by passing a list of non-core ATen ops into `to_edge()`.

Note that:

* This is different than `ops_set_to_not_decompose` in `to_edge_transform_and_lower`, as the ops in `_core_aten_ops_exception_list` are not intended to be kept but more likely showing up because of missing decompositions or missing core ATen tag in `native_functions.yaml`. For this reason, we are combining two lists (`ops_set_to_not_decompose` and `_core_aten_ops_exception_list`) and pass to verifier.
* I updated the error log to encourage people to use `_core_aten_ops_exception_list` instead of using `_check_ir_validity=False`.

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

Test Plan: Added unit test

Reviewed By: tarun292

Differential Revision: D62469015

Pulled By: larryliu0820

fbshipit-source-id: 1abb1b4fbbfdf3eb5e64e82e2035c7f93cf5b153
M
Mengwei Liu committed
7942d2cf3e8fd3422896df6f5b53abff5772365c
Parent: d423131
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 9/11/2024, 1:14:52 AM