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
[SR] Make sigrid_transforms fusion work on graph outputs
Pull Request resolved: #73091
This is a re-work of D33669034; the change was backed out due to a data race causing crashes.
The `output_types` vector was the culprit. It was previously lazily initialized on the first iteration. This was problematic because of static runtime's hidden assumption that ops are thread-safe.
The re-work now only does the list unpack fusion if the output dtypes can be statically determined, e.g. if the sigrid transforms instance and `use_offsets` are both constant. Note that this is true for all the models we care about. Also, we were already partially making this assumption by dereferencing the `std::optional` sigrid transforms instance in most of the ops. Another advantage of this is that it makes the code simpler compared to D33669034.
Once the output types are determined, they can be moved into the op lambda and shared as read-only data.
ghstack-source-id: 150704445
Differential Revision: [D34290401](https://our.internmc.facebook.com/intern/diff/D34290401/)
**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D34290401/)!
0 commit comments