SIGN IN SIGN UP

Use lowered_module graph instead of self.node.graph in emitter (#4079)

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

We found for some simple models where Helios was delegating a function
to Turing, that there were duplicate functions with the same debug handle.
In our case, both `aten.permute_copy.default` run on CPU and a call_delegate
contained the same debug handle.

This was found to be that `self.node.graph` in the emitter is pointing to the
wrong graph, who has both permutes and the `call_delegate` instruction
itself. Using `lowered_module.original_module` instead has the correct
list of nodes that are being lowered.

I'm not sure why `self.node.graph` is wrong, but there's no other users in
the emitter other than this function.

Reviewed By: tarun292

Differential Revision: D59132213

fbshipit-source-id: 089d89a0a55265ee91694bb25d79c1147de958c9
R
Riley Dulin committed
929fc806bd2b986d7ea1e9946a3335891b694fdf
Parent: 4fcd903
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 6/28/2024, 1:00:46 AM