pytorch
87510022 - equality assertions (#102256)

Commit
1 year ago
equality assertions (#102256) Previously we had runtime asserts for range constraints. This diff adds runtime asserts for equality constraints. This requires a bit of refactoring that is worth calling out. 1. [Minor] Some of the data structures produced by export and consumed by the runtime assertion pass need to be broadened. This is a WIP. There are some associated code improvements that are included in this diff, but by and large the structures are similar to what exists now. Meanwhile @angelayi and I are chatting about how to make it qualitatively better: briefly, we want to index everything by symbols, which are 1-1 with (name, dim) pairs. 2. [Major] The order in which runtime asserts are emitted is changed. Previously we used to do the work in `placeholder`, now this diff adds a hook for "post-processing" after processing of all placeholders is done. This is needed because equality constraints can mention different placeholders. This change also opens the way to optimizing codegen: e.g., each (name, dim) pair should correspond to a single intermediate variable that is reused across runtime asserts. This is future work. Differential Revision: [D46177642](https://our.internmc.facebook.com/intern/diff/D46177642/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/102256 Approved by: https://github.com/tugsbayasgalan, https://github.com/angelayi
Author
Committer
Parents
Loading