Release GIL when synchronize or wait (#16182)
Summary:
address the second future work item in #15937
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16182
Differential Revision: D13744972
Pulled By: mrshenli
fbshipit-source-id: e9812e3fd4a5623e99b639d9f334bfc2d1827d92