[ROCm][CI] skip TestCudaPrimaryCtx.test_set_device_0 (#163693)

Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/163693
Approved by: https://github.com/jeffdaily

Co-authored-by: Jeff Daily <jeff.daily@amd.com>
This commit is contained in:
Jeff Daily
2025-09-23 22:15:10 +00:00
committed by PyTorch MergeBot
parent c63e417c79
commit b879ef7c0d

View File

@ -5,7 +5,7 @@ import unittest
import torch
from torch.testing._internal.common_cuda import TEST_CUDA, TEST_MULTIGPU
from torch.testing._internal.common_utils import NoTest, run_tests, TestCase
from torch.testing._internal.common_utils import NoTest, run_tests, skipIfRocm, TestCase
# NOTE: this needs to be run in a brand new process
@ -31,6 +31,9 @@ class TestCudaPrimaryCtx(TestCase):
TestCudaPrimaryCtx.CTX_ALREADY_CREATED_ERR_MSG,
)
@skipIfRocm(
msg="last checked in ROCm 7, HIP runtime doesn't create context for hipSetDevice()"
)
def test_set_device_0(self):
# In CUDA 12 the behavior of cudaSetDevice has changed. It eagerly creates context on target.
# The behavior of `torch.cuda.set_device(0)` should also create context on the device 0.