Skip to content

test(cuda.core): use valid im2col-wide parameters so the tests run on Blackwell - #3660

Merged
mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue3587
Nov 30, 2026
Merged

mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue3587

Conversation

@mdboom

@mdboom mdboom commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Closes #3587. Part of #2077.

Summary

The four TestTensorMapIm2colWide tests skipped on every Blackwell runner with "Im2col-wide unsupported on this driver/GPU combination". The cause is the tests' parameters, not the hardware or driver.

The probe and all four tests asked for channels_per_pixel=64 with FLOAT32 elements, which is 256 bytes per pixel. With interleave=NONE, cuda.h requires channelsPerPixel × element size to be at most the swizzle span: 128 bytes for SWIZZLE_128B, cuda.core's default. So encoding failed with CUDA_ERROR_INVALID_VALUE on every GPU, and the fixture turned that into a skip.

+# With no interleave, channels_per_pixel * element size must fit the swizzle span:
+# 32 FLOAT32 channels fill the 128 bytes of the default SWIZZLE_128B.
+_IM2COL_WIDE_CHANNELS = 32

 skip_if_no_im2col_wide:
     skip if compute capability < 10.0
-    probe _from_im2col_wide(channels_per_pixel=64, FLOAT32)
-    skip on "requires a CUDA 13+ build" or CUDA_ERROR_INVALID_VALUE
+    skip if BUILD_CUDA_MAJOR < 13

 test_from_im2col_wide_{3d,4d,5d,rank_validation}:
-    channels_per_pixel=64
+    channels_per_pixel=_IM2COL_WIDE_CHANNELS

CUDA_ERROR_INVALID_VALUE on capable hardware now fails the test. The "not currently run in any CI job" comments are removed.

Evidence

Direct encode checks on an RTX 5070 (sm_120, same family as the RTX PRO 6000 runners):

Shape channels_per_pixel (bytes) Swizzle Result
(1, 32, 64) 64 (256) 128B CUDA_ERROR_INVALID_VALUE (old parameters)
(1, 32, 64) 32 (128) 128B OK
(1, 8, 8, 64) 32 (128) 128B OK
(1, 4, 8, 8, 64) 32 (128) 128B OK
(1, 32, 64) 16 (64) 64B OK
(1, 32, 64) 32 (128) 64B CUDA_ERROR_INVALID_VALUE (over the 64-byte span, as documented)

So sm_12x supports im2col-wide. An RTX A400 (sm_86) returns CUDA_ERROR_NOT_SUPPORTED and is skipped by the existing compute-capability check.

CI coverage: on main, the tests skip in all 65 configurations: 60 pre-Blackwell (compute capability), 1 CUDA 12 build, and 5 Blackwell rows with the probe's INVALID_VALUE. After this change they should pass on those 5 Blackwell rows:

  • linux-64 RTX PRO 6000, CTK 13.0.2 (latest driver) and CTK 13.5.0 (driver 610.43.02);
  • win-64 RTX PRO 6000, CTK 13.0.2 and 13.5.0;
  • linux-aarch64 GB300, CTK 13.5.0 (nightly).

Locally: the four tests pass on the RTX 5070 and skip on the A400; test_tensor_map.py passes (81 passed, 3 skipped).

Confirming in CI: in this PR's CI run, the RTX PRO 6000 cuda.core jobs should report the four tests PASSED. For example:

gh run view <CI run id> --repo NVIDIA/cuda-python --log | grep -E "TestTensorMapIm2colWide::test_from_im2col_wide_(3d|4d|5d|rank_validation)"

The GB300 row is nightly-only (needs write access to NVIDIA/cuda-python): after this PR's CI run succeeds, run gh workflow run ci-nightly.yml --repo NVIDIA/cuda-python --ref pull-request/<PR number> -f run-id=<run-id> and check the "Nightly standard (linux-aarch64)" GB300 job.

Merge Danger

Door: two-way. Test-only change.

Blast Radius: four tests in cuda_core/tests/test_tensor_map.py, now running on Blackwell rows where they used to skip.

Reviewers: please feel free to push commits directly to this PR to improve it.

🤖 Generated with Claude Code

… Blackwell

The TestTensorMapIm2colWide tests and their probe asked for 64 FLOAT32
channels per pixel (256 bytes). With no interleave, cuTensorMapEncodeIm2colWide
requires channelsPerPixel * element size to fit the swizzle span, 128 bytes
for the default SWIZZLE_128B, so encoding failed with
CUDA_ERROR_INVALID_VALUE on every GPU and the fixture skipped it as
"unsupported on this driver/GPU combination".

Use 32 channels (128 bytes). Replace the probe with a direct CUDA 13 build
check, so INVALID_VALUE on capable hardware fails the test. Remove the
"not currently run in any CI job" comments.

Closes NVIDIA#3587.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mdboom mdboom added this to the cuda.core 1.4.0 milestone Nov 30, 2026
@mdboom mdboom added test Improvements or additions to tests cuda.core Everything related to the cuda.core module labels Nov 30, 2026
@mdboom mdboom self-assigned this Nov 30, 2026
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated im2col-wide test coverage to use a 32-channel FLOAT32 configuration matching the default swizzle span.
    • Tests now skip when the GPU compute capability or CUDA build version is below the required level, rather than relying on runtime descriptor-creation errors to determine support. These changes affect test execution only; no end-user functionality is changed.

The im2col-wide tensor map tests now use 32 FLOAT32 channels. Their fixture checks the CUDA build version and device compute capability instead of probing descriptor creation and skipping on probe errors.

Changes: Im2col-wide tensor map tests

Layer / File(s) Summary
Configure im2col-wide tests
cuda_core/tests/test_tensor_map.py
The fixture replaces the descriptor probe and exception-based skips with a CUDA build-version check. The 3D, 4D, and 5D tests and the rank-validation test use 32 channels. Comments that the 4D and 5D tests do not run in CI were removed.

Assessment against linked issues

Objective Addressed Explanation
Stop treating CUDA_ERROR_INVALID_VALUE from the probe as an unsupported driver/GPU combination. [3587] ✅
Use valid channel parameters so the four im2col-wide tests can run on supported hardware. [3587] ❓ The tests now use 32 channels, but no CI results are provided to confirm they pass on GB300 or RTX PRO 6000.

Possibly related issues

  • NVIDIA/cuda-python issue 3409: The issue describes the 64-channel probe and test parameters returning CUDA_ERROR_INVALID_VALUE; this PR changes them to 32 channels and removes the error-based skip.

Suggested labels: test, cuda.core

Suggested reviewers: rparolin, jpascucci-nv, andy-jost

Change: Other · Severity of issue fixed: Low

Merge Risk: Minimal · up to f6f38

This is a test-only change that lets the im2col-wide tensor map tests run on Blackwell GPUs instead of being skipped. It does not affect production behavior. Confirm the CI and GB300 nightly runs pass before merging.

Security architecture risk: Minimal · up to f6f38

The change makes eligible GPU tests exercise descriptor creation instead of skipping on an invalid-value error. It does not change the production API, its callers, or deployment behavior.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between daeda6d and f6f3891.

Files selected for processing: 1

  • cuda_core/tests/test_tensor_map.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

@mdboom
mdboom requested review from jpascucci-nv and rluo8 November 30, 2026 20:21

@jpascucci-nv jpascucci-nv 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.

Sol 6.1 high finds no actionable findings, and it lgtm.

@mdboom
mdboom enabled auto-merge (squash) November 30, 2026 20:30
@mdboom
mdboom merged commit 44743b5 into NVIDIA:main Nov 30, 2026
122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(cuda.core): im2col-wide tensor map tests skip on every Blackwell runner with CUDA_ERROR_INVALID_VALUE

2 participants