Skip to content

Unskip tests in test_profiler_xpu.py#3726

Open
PawelSwider2000 wants to merge 2 commits into
mainfrom
dev/pawelswi/test-profiler-xpu-unskip
Open

Unskip tests in test_profiler_xpu.py#3726
PawelSwider2000 wants to merge 2 commits into
mainfrom
dev/pawelswi/test-profiler-xpu-unskip

Conversation

@PawelSwider2000
Copy link
Copy Markdown
Contributor

No description provided.

@PawelSwider2000 PawelSwider2000 requested a review from Copilot May 21, 2026 07:19
@PawelSwider2000 PawelSwider2000 added disable_e2e Disable all e2e test jobs for the PR disable_distributed Disable distributed UT test jobs for the PR disable_accelerate Disable accelerate test job in PR CI testing disable_transformers Disable transformers UT test in PR CI labels May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR aims to unskip / broaden profiler tests so they can run on XPU in addition to CUDA by switching several CUDA-specific assumptions to accelerator-agnostic logic.

Changes:

  • Generalize Kineto multi-GPU and activity-filter tests to use the current accelerator (CUDA/XPU) rather than hard-coded CUDA paths.
  • Relax/adjust kernel metadata expectations in Chrome traces to account for XPU-specific queue metadata.
  • Convert event/trace parity tests to run via instantiate_device_type_tests for CUDA and XPU.

Comment on lines +605 to +623
@unittest.skipIf(
_current_accelerator_device_type() is None,
"An accelerator is required",
)
@unittest.skipIf(
_current_accelerator_device_type() == "cuda" and not TEST_MULTIGPU,
"Multiple GPUs needed",
)
@unittest.skipIf(
_current_accelerator_device_type() == "xpu" and torch.xpu.device_count() < 2,
"Multiple GPUs needed",
)
def test_kineto_multigpu(self):
with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA]) as prof:
device_type = _current_accelerator_device_type()
activity = _current_accelerator_activity()
self.assertIsNotNone(device_type)
self.assertIsNotNone(activity)

with profile(activities=[ProfilerActivity.CPU, activity]) as prof:
# on ROCm, Gemm shader is hipblaslt Shader, so we use UserArgs_MT to match.
gemm_string = "userargs_mt" if is_rocm else "gemm"
device_string = "hip" if is_rocm else "cuda"
device_enum = getattr(DeviceType, device_type.upper())
Comment on lines +605 to +616
@unittest.skipIf(
_current_accelerator_device_type() is None,
"An accelerator is required",
)
@unittest.skipIf(
_current_accelerator_device_type() == "cuda" and not TEST_MULTIGPU,
"Multiple GPUs needed",
)
@unittest.skipIf(
_current_accelerator_device_type() == "xpu" and torch.xpu.device_count() < 2,
"Multiple GPUs needed",
)
Comment on lines +2949 to +2955
@unittest.skipIf(not TEST_CUDA and not TEST_XPU, "CUDA or XPU is required")
def test_kineto_kernel_metadata_in_trace(self):
with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA]) as prof:
self.payload(use_cuda=True)
device_type = _current_accelerator_device_type()
with profile(
activities=[ProfilerActivity.CPU, _current_accelerator_activity()]
) as prof:
self.payload(device_type=device_type)
class TestProfilerEventsParity(TestCase):
"""Tests validating parity between events() and export_chrome_trace() JSON."""

def _device_type(self, device):
@github-actions github-actions Bot added disable_build Disable source code build for CI test, use nightly wheel disable_win Disable Windows CI test jobs for the PR labels May 21, 2026
@chuanqi129 chuanqi129 marked this pull request as draft May 21, 2026 08:10
@chuanqi129 chuanqi129 marked this pull request as ready for review May 21, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disable_accelerate Disable accelerate test job in PR CI testing disable_build Disable source code build for CI test, use nightly wheel disable_distributed Disable distributed UT test jobs for the PR disable_e2e Disable all e2e test jobs for the PR disable_transformers Disable transformers UT test in PR CI disable_win Disable Windows CI test jobs for the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants