Skip to content

test(miopen): add Pooling numel>INT_MAX scale coverage (ALMIOPEN-2145) - #10257

Open
peymanr wants to merge 3 commits into
ROCm:developfrom
peymanr:users/prazaghi/almiopen-2145-pooling-scale
Open

test(miopen): add Pooling numel>INT_MAX scale coverage (ALMIOPEN-2145)#10257
peymanr wants to merge 3 commits into
ROCm:developfrom
peymanr:users/prazaghi/almiopen-2145-pooling-scale

Conversation

@peymanr

@peymanr peymanr commented Jul 31, 2026

Copy link
Copy Markdown

JIRA ID: ALMIOPEN-2145

What

Adds projects/miopen/test/gtest/pooling2d_large.cpp — a new gtest file with Max and Avg 2D pooling test cases at numel > INT_MAX as regression guards.

Also updates test_categories.yaml to include GPU_Pooling2d_Large* in positive_patterns and register the file in standard and comprehensive tiers.

Why

Existing pooling tests top out at approximately 40 M elements (e.g. {1,19,1024,2048}). A probe on gfx942 (xnack-) confirmed that MaxPool and AvgPool with a 2×2 window produce correct, finite output at numel > INT_MAX. These test cases close the gap at the INT_MAX boundary and guard against any future regression in 64-bit index handling.

Shape

Parameter Value
N 1
C 1
H 46342
W 46342
numel = N×C×H×W 2 147 580 964 > 2^31-1
Window 2×2
Stride 2×2
Pad 0×0
Output dims 1×1×23171×23171 (~537 M elements)

Test design

  • INSTANTIATE_TEST_SUITE_P(Standard, GPU_Pooling2d_Large_FP32, ...) for max-pool and avg-pool modes — runs on every PR.
  • SetUp() queries hipMemGetInfo and calls GTEST_SKIP() when free GPU memory < 16 GiB, so it is safe to run on smaller devices.
  • No CPU reference comparison (8 GiB host allocation is prohibitive). Correctness is checked by asserting that a sample of output elements is finite — NaN or Inf signals INT_MAX index overflow.
  • static_assert confirms numel > INT_MAX at compile time.

MIOpenDriver equivalent (manual verification on gfx942)

# Max pooling
MIOpenDriver pool -n 1 -c 1 -H 46342 -W 46342 -x 2 -y 2 -m 0 --forw 1 -V 0 -t 1

# Avg pooling
MIOpenDriver pool -n 1 -c 1 -H 46342 -W 46342 -x 2 -y 2 -m 1 --forw 1 -V 0 -t 1

Both commands exit 0 with correct results on gfx942 (xnack-).

🤖 Assisted by PR Pundit

JIRA ID: ALMIOPEN-2145

Add max/avg 2D pooling test cases at numel > INT_MAX as regression guards.

Shape 1×1×46342×46342 (numel = 2 147 580 964 > INT_MAX) with a 2×2
window, stride 2, pad 0 exercises the 64-bit index paths in MIOpen's
pooling kernel. Existing tests top out at ~40 M elements; this fills
the gap at the INT_MAX boundary.

A probe confirmed correct, finite output at this scale on gfx942 (xnack-).
The test asserts a sample of output elements is finite: NaN or Inf signals
INT_MAX index overflow.

- pooling2d_large.cpp: new gtest, INSTANTIATE_TEST_SUITE_P(Standard, ...)
  for max-pool and avg-pool modes; GTEST_SKIP() if < 16 GiB free GPU RAM
- test_categories.yaml: add GPU_Pooling2d_Large* to positive_patterns;
  add gtest/pooling2d_large.cpp to standard/comprehensive test_files
@peymanr
peymanr requested a review from a team as a code owner July 31, 2026 23:30
@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

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

peymanr added 2 commits July 31, 2026 17:16
- Add #include <miopen/tensor.hpp> to provide full definition of
  miopen::TensorDescriptor (pooling.hpp only has a forward declaration)
- Wrap hipMemset/hipMemcpy/hipFree return values to silence
  -Werror,-Wunused-value: use (void) for cleanup/helper calls and
  ASSERT_EQ for the output-zero hipMemset inside the test body

Fixes 7 compiler errors seen in MIOpen Build Hip Package CI job.
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