Add pass registration mechanism (#18587)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18587
ghimport-source-id: 80d753f7046a2a719e0c076684f44fa2059a0921
Differential Revision: D14901227
Pulled By: bwasti
fbshipit-source-id: 56511d0313419b63945a36b80e9ea51abdef2bd4