Skip to content

[Triton/Gluon] Fix Conv3D CPU tests with a CUDA default device - #5984

Merged
azaidy merged 1 commit into
mainfrom
hexwang/fix-conv3d-cpu-tests
Oct 1, 2026
Merged

azaidy merged 1 commit into
mainfrom
hexwang/fix-conv3d-cpu-tests

Conversation

@whx-sjtu

Copy link
Copy Markdown
Contributor

Summary

The Conv3D CPU tests allocate on the global default device. When another test selects CUDA, the CPU rejection test receives GPU tensors and fails with DID NOT RAISE. Pin the inputs of both CPU-specific tests to CPU.

-torch.empty(shape, dtype=torch.float16)
+torch.empty(shape, dtype=torch.float16, device="cpu")

Evidence

  • Before: MI35X CI fails test_conv3d_execution_rejects_cpu_tensors with DID NOT RAISE <class 'ValueError'>. Setting the global default device to CUDA reproduces the failure locally.
    After: Both CPU-specific tests pass with that same global default.
import torch
import pytest

torch.set_default_device("cuda")
raise SystemExit(pytest.main([
    "-q",
    "op_tests/triton_tests/conv/test_conv3d.py::test_conv3d_dims_supports_cpu_tensors",
    "op_tests/triton_tests/conv/test_conv3d.py::test_conv3d_execution_rejects_cpu_tensors",
]))
# 2 passed

Validated on main 80a3b0b09448bb5b8ade9a5946bec7549601331a plus this patch, on gfx950 with PyTorch 2.10.0+rocm7.2.4.git3d3aa833 and pytest 8.3.4. Black and Ruff pass. The failure was observed while testing #5822 against main.

Merge Danger

Door: two-way

Blast Radius: tests

Only the four input allocations in the two CPU-specific tests change.

Keep both CPU-specific tests independent of the global default device. Reproduce the rejection test failure after torch.set_default_device("cuda") and verify both CPU tests pass with explicit device selection.
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 5984 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@saeid-rostami saeid-rostami left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @whx-sjtu , LGTM!

@brunomazzottiamd brunomazzottiamd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Let's wait for CI to run and then merge.

@azaidy azaidy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused test-only change correctly eliminates dependence on PyTorch’s global default device.

Review effort: Balanced
Findings: None

What changed in this PR

Pins Conv3D CPU-test tensors to CPU, preventing interference from a CUDA global default device.

Changes:

  • Adds explicit device="cpu" to four test tensor allocations.
  • Preserves CPU dimension validation and rejection coverage.
File Description
op_tests/​triton_tests/​conv/​test_conv3d.py Makes CPU-specific tests independent of global device state.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@azaidy
azaidy merged commit 569d981 into main Oct 1, 2026
98 checks passed
@azaidy
azaidy deleted the hexwang/fix-conv3d-cpu-tests branch October 1, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants