Skip to content

test(miopen): add NHWC conv fallback numel>INT_MAX scale coverage (ALMIOPEN-2141) - #10256

Open
peymanr wants to merge 4 commits into
ROCm:developfrom
peymanr:users/prazaghi/almiopen-2141-conv-fallback-scale
Open

test(miopen): add NHWC conv fallback numel>INT_MAX scale coverage (ALMIOPEN-2141)#10256
peymanr wants to merge 4 commits into
ROCm:developfrom
peymanr:users/prazaghi/almiopen-2141-conv-fallback-scale

Conversation

@peymanr

@peymanr peymanr commented Jul 31, 2026

Copy link
Copy Markdown

What

Adds two FullScale-tier test cases covering NHWC conv paths at tensor element counts greater than INT_MAX (2,147,483,647):

1. Naive / fallback forward conv (unit_conv_solver_ConvDirectNaiveConvFwd.cpp)

  • New GetNhwcScaleTestCase(): shape {N=1, C=1, H=46342, W=46342} × 1×1 kernel, NHWC layout
    • numel = 46342 × 46342 = 2,147,580,964 > INT_MAX
  • New GetScaleTestParams() using UseGpuRef() (CPU reference is impractical at 4.3 GB per tensor)
  • New FullScale instantiation for GPU_UnitTestConvSolverDirectNaiveFwd_FP16

2. Fused conv+bias+activation (cba_infer.cpp)

  • New GetNhwcFusedScaleCase(): same shape, 1×1 kernel, miopenConvolution
  • New FullScale instantiation for GPU_ConvBiasActivInfer_FP16 with miopenTensorNHWC layout

Why

Two NHWC conv surfaces were untested at numel > INT_MAX:

  1. Conv fallback path (ConvDirectNaiveConvFwd — the solver used when no optimised solver applies): index arithmetic that uses int32_t wraps at 2 GB elements, causing silent out-of-bounds writes.
  2. Fused convolution (ConvHipDirectFwdFused / ConvCKIgemmFwdBiasActivFused via fusion plan): same risk in the fused launch path.

The grouped-CK int32-wrap case is already covered by PR #7663's degenerate case. This PR specifically targets the fallback and fused surfaces identified in ALMIOPEN-2141.

How

  • Two test-only file changes in projects/miopen/test/gtest/
  • No kernel, dispatch, or library code modified
  • FullScale tier (large-memory GPU required, e.g. MI300X / MI325X with ≥10 GB free VRAM)
  • FP16 chosen to keep per-tensor VRAM at ~4.3 GB

Testing

Run on gfx942/gfx950 hardware:

./bin/MIOpenTests --gtest_filter="*FullScale*ConvDirectNaiveConvFwd*"
./bin/MIOpenTests --gtest_filter="*FullScale*ConvBiasActivInfer*"

JIRA ID: ALMIOPEN-2141

🤖 Assisted by PR Pundit

peymanr added 2 commits July 31, 2026 16:27
…t test

Adds GetNhwcScaleTestCase() with shape {1,1,46342,46342} and 1x1 kernel in
NHWC layout (numel=2,147,580,964 > INT_MAX) to the ConvDirectNaiveConvFwd
unit test. Registers a FullScale instantiation with GPU-side reference
verification (CPU ref is impractical at 4.3 GB per tensor).

Covers the conv fallback path (ConvDirectNaiveConvFwd, the solver used when
no optimised solver applies) against int32 index-wrap OOB at NHWC tensors
larger than INT_MAX elements.

JIRA ID: ALMIOPEN-2141
…tiv test

Adds GetNhwcFusedScaleCase() with shape N=1,C=1,H=46342,W=46342,K=1,1x1
kernel (numel=2,147,580,964 > INT_MAX) to cba_infer.cpp. Registers a
FullScale instantiation for GPU_ConvBiasActivInfer_FP16 with miopenTensorNHWC
layout, covering the conv+bias+activation fusion path at NHWC tensor sizes
that overflow int32 index arithmetic.

JIRA ID: ALMIOPEN-2141
@peymanr
peymanr requested a review from a team as a code owner July 31, 2026 23:29
@therock-pr-bot

therock-pr-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass
Forbidden Files ✅ Pass
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled
🤖 therock-pr-bot ✅ Pass

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

Pre-commit check failed

pre-commit failed

Please run locally:

  • python -m pip install pre-commit
  • pre-commit install
  • pre-commit run --all-files --show-diff-on-failure

This repo uses .pre-commit-config.yaml.

peymanr added 2 commits July 31, 2026 17:01
Fix clang-format violations in cba_infer.cpp flagged by pre-commit CI.
Resolves: ALMIOPEN-2141
@therock-pr-bot

therock-pr-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

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.

1 participant