Replace CUDA-specific patterns with device-agnostic ones:
- Replace TEST_MULTIGPU with TEST_MULTIACCELERATOR
- Replace .cuda() with .to(device_type)
- Replace device='cuda' with device=device_type
- Add device_type variable using torch.accelerator.current_accelerator()
This enables the multi-GPU DataParallel tests to run on any accelerator (CUDA, XPU, etc.) instead of just CUDA.
Test Plan:
TEST_CONFIG=cuda python test/test_stateless.py -v
TEST_CONFIG=cpu python test/test_stateless.py -v
Both pass with 50/50 tests (4 multi-GPU tests skipped as expected)
Pull Request resolved: #185127
Approved by: https://github.com/zou3519
SOCIAL SHARE CARD GENERATOR