Workaround the nightly package hash issue. (#705)
Summary:
During the GHA migration, the `git_version` result of pytorch nightly package could be either the hash on the `nightly` branch, or the hash on the `master` branch. We need to consider both cases to find the correct commit hash.
Pull Request resolved: https://github.com/pytorch/benchmark/pull/705
Reviewed By: malfet
Differential Revision: D33699224
Pulled By: xuzhao9
fbshipit-source-id: e27a434b53eb5595d4fe27a1b3261adbf20a2452