Replace @requires_gpu decorator with @unittest.skipIf(not HAS_GPU) to properly check for both GPU and Triton availability, following the same pattern as test_modes.py.
Changes
- Import HAS_GPU from inductor_utils instead of requires_gpu from triton_utils
- Replace @requires_gpu with @unittest.skipIf(not HAS_GPU, "requires GPU and Triton")
- Keeps HAS_CUDA_AND_TRITON for CUDA-specific cudagraph recording check
Test Plan:
- TEST_CONFIG=cpu python test/dynamo/test_callback.py CallbackTests -v
- TEST_CONFIG=cuda python test/dynamo/test_callback.py CallbackTests -v
All tests pass.
Pull Request resolved: #185110
Approved by: https://github.com/Skylion007, https://github.com/jansel