Skip to content

Move CUDAGuard/CUDAStreamGuard static_assert tests out of CUDA fixtures#19314

Merged
psiddh merged 1 commit intopytorch:mainfrom
psiddh:export-D103937761
May 6, 2026
Merged

Move CUDAGuard/CUDAStreamGuard static_assert tests out of CUDA fixtures#19314
psiddh merged 1 commit intopytorch:mainfrom
psiddh:export-D103937761

Conversation

@psiddh
Copy link
Copy Markdown
Contributor

@psiddh psiddh commented May 5, 2026

Summary:
The 6 type-trait checks below were defined as TEST_F(CUDAGuardTest, ...)
and TEST_F(CUDAStreamGuardTest, ...). Both fixtures' SetUp() calls
GTEST_SKIP() when no CUDA device is available, so on every test host
without an attached GPU these tests skip instead of running:

CUDAGuardTest.CopyConstructorDeleted
CUDAGuardTest.CopyAssignmentDeleted
CUDAGuardTest.MoveAssignmentDeleted
CUDAStreamGuardTest.CopyConstructorDeleted
CUDAStreamGuardTest.CopyAssignmentDeleted
CUDAStreamGuardTest.MoveAssignmentDeleted

Because they never produced a successful run (Passes: 0 across 173 / 23
runs, all skips), TestX auto-disabled them and they show up as DISABLED
on the executorch dashboard.

These are pure compile-time static_assert checks. They do not need a
CUDA device or any runtime state — if the file compiles, they pass.
Move them into a separate non-fixture test suite (CUDAGuardCompileTimeTest /
CUDAStreamGuardCompileTimeTest) so they run unconditionally.

The remaining 15 fixture-based tests still need a real CUDA device and
will be addressed separately (fixing the gpu-remote-execution platform
deps so cudaGetDeviceCount returns a non-zero value).

Reviewed By: Gasoonjia

Differential Revision: D103937761

Summary:
The 6 type-trait checks below were defined as TEST_F(CUDAGuardTest, ...)
and TEST_F(CUDAStreamGuardTest, ...). Both fixtures' SetUp() calls
GTEST_SKIP() when no CUDA device is available, so on every test host
without an attached GPU these tests skip instead of running:

  CUDAGuardTest.CopyConstructorDeleted
  CUDAGuardTest.CopyAssignmentDeleted
  CUDAGuardTest.MoveAssignmentDeleted
  CUDAStreamGuardTest.CopyConstructorDeleted
  CUDAStreamGuardTest.CopyAssignmentDeleted
  CUDAStreamGuardTest.MoveAssignmentDeleted

Because they never produced a successful run (Passes: 0 across 173 / 23
runs, all skips), TestX auto-disabled them and they show up as DISABLED
on the executorch dashboard.

These are pure compile-time static_assert checks. They do not need a
CUDA device or any runtime state — if the file compiles, they pass.
Move them into a separate non-fixture test suite (CUDAGuardCompileTimeTest /
CUDAStreamGuardCompileTimeTest) so they run unconditionally.

The remaining 15 fixture-based tests still need a real CUDA device and
will be addressed separately (fixing the gpu-remote-execution platform
deps so cudaGetDeviceCount returns a non-zero value).

Reviewed By: Gasoonjia

Differential Revision: D103937761
Copilot AI review requested due to automatic review settings May 5, 2026 23:16
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 5, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19314

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Cancelled Job, 31 Pending, 2 Unrelated Failures

As of commit e3776aa with merge base 5d07ce0 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 5, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 5, 2026

@psiddh has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103937761.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

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

This PR fixes CUDA unit-test reporting by moving pure compile-time trait checks out of GPU-dependent fixtures, so they run on hosts without an attached CUDA device. In the ExecuTorch AOTI slim CUDA tests, this prevents static-assert-only tests from being skipped and auto-disabled simply because fixture setup requires runtime CUDA availability.

Changes:

  • Moved CUDAGuard copy/move-deletion trait checks from TEST_F to a standalone TEST suite.
  • Moved CUDAStreamGuard copy/move-deletion trait checks from TEST_F to a standalone TEST suite.
  • Added clarifying comments explaining why these tests must live outside the CUDA fixtures.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
backends/aoti/slim/cuda/test/test_cuda_guard.cpp Converts CUDAGuard static-assert trait checks into non-fixture tests so they run without GPU-dependent SetUp().
backends/aoti/slim/cuda/test/test_cuda_stream_guard.cpp Converts CUDAStreamGuard static-assert trait checks into non-fixture tests so they run without GPU-dependent SetUp().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@psiddh psiddh merged commit 0f9de6a into pytorch:main May 6, 2026
187 of 205 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants