Fix RocM resource class allocation (#41553)
Summary:
Add Conf.is_test_stage() method to avoid duplicating state in ['test', 'test1', 'test2'] throughout the code
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41553
Test Plan: Make sure that in modified config.yml ROCM tests jobs are assigned `pytorch/amd-gpu` resource class
Reviewed By: yns88
Differential Revision: D22580471
Pulled By: malfet
fbshipit-source-id: 514555f0c0ac94c807bf837ba209560055335587