You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[reland] Fix coreml to edge transform and lower (#12629)
Re-land of: #12564
Previous attempt had conflict with
#12306 that caused CI
failure.
------
The current design of using EDGE_DO_NOT_DECOMP to prevent decomposition
has long standing issues, and often fails lowering when certain ops are
requested for preservation. This shows up most notably in the CoreML
backend, where most ops are requested for preservation.
As a band-aid, we introduced _remove_invalid_ops_for_not_decompose to
cover certain kinds of ops. But when an op is encountered that we do not
have an exception for, lowering still fails.
We also recently found another bug that shows up for SDPA related to
contiguous views
(https://fb.workplace.com/groups/pytorch.edge.users/permalink/1796069037930048/)
that we still do not fully understand the root cause of.
EDGE_DO_NOT_DECOMP is actually only used to support the
"check_op_support" argument in the partitioner; ops_to_not_decompose
only modifies the default composition table.
In CoreML's case, "check_op_support" is not used, and the issues with
EDGE_DO_NOT_DECOMP's design causes lots of lowering issues that are hard
to keep up with. This PR enables a new path that bypasses
EDGE_DO_NOT_DECOMP's when possible (_can_skip_using_EDGE_DO_NOT_DECOMP).
Long term, we need to address the buggy design of EDGE_DO_NOT_DECOMP.
There are some ideas here:
https://fb.workplace.com/groups/pytorch.edge2.team/permalink/1241898747065975/
cc @kimishpatel@YifanShenSZ@cymbalrush
0 commit comments