Skip to content

test(miopen): add Softmax numel>INT_MAX and beta=0 regression coverage (ALMIOPEN-2147) - #10258

Open
peymanr wants to merge 1 commit into
ROCm:developfrom
peymanr:users/prazaghi/almiopen-2147-softmax-scale
Open

test(miopen): add Softmax numel>INT_MAX and beta=0 regression coverage (ALMIOPEN-2147)#10258
peymanr wants to merge 1 commit into
ROCm:developfrom
peymanr:users/prazaghi/almiopen-2147-softmax-scale

Conversation

@peymanr

@peymanr peymanr commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Add two Softmax test groups to projects/miopen/test/gtest/soft_max.cpp to
address the two concerns raised in ALMIOPEN-2147:

1. numel > INT_MAX — GPU_Softmax_LargeNumel_FP32 (Standard tier, DISABLED)

  • Shape: {2, 1024, 1024, 1024} = 2,147,483,648 elements (exactly 2^31, exceeds INT_MAX)
  • Disabled: DISABLED_ForwardLargeNumel — a prior probe on gfx942 produced an HSA
    illegal-access fault (tracked in ALMIOPEN-2151), indicating the kernel uses 32-bit
    index arithmetic. The test is disabled until ALMIOPEN-2151 is resolved; at that point
    remove the DISABLED_ prefix.
  • Suite: Standard so it appears in Standard/* CI runs once re-enabled.
  • Guards: device-memory check skips on hardware with < 16 GiB VRAM; spot-checks
    first 1 KiB of output for finite values in (0, 1].
  • Algos: parameterised over FAST, ACCURATE, LOG in CHANNEL mode.

2. beta=0 NaN regression — GPU_Softmax_BetaZeroNaN_FP32 (Smoke tier)

Already present in soft_max.cpp on develop — no new code added for this concern.
The existing Smoke/{Forward,Backward}Test cases pre-poison the output buffer with NaN
and assert that beta=0 fully suppresses the read, preventing NaN * 0.0 == NaN
from propagating into the result.

Test plan

  • CI runs Smoke/GPU_Softmax_BetaZeroNaN_FP32.* (existing, should pass)
  • CI skips Standard/GPU_Softmax_LargeNumel_FP32/DISABLED_ForwardLargeNumel/*
    (disabled by design; see ALMIOPEN-2151)
  • When ALMIOPEN-2151 is fixed: remove DISABLED_ prefix and verify the test
    passes on gfx942 hardware with >= 16 GiB VRAM

JIRA ID: ALMIOPEN-2147

🤖 Assisted by PR Pundit

…e (ALMIOPEN-2147)

Add two new test groups to projects/miopen/test/gtest/soft_max.cpp:

1. GPU_Softmax_LargeNumel_FP32 (Standard/DISABLED_ForwardLargeNumel)
   Shape {2, 1024, 1024, 1024} = 2^31 elements, exceeding INT_MAX.
   A prior probe on gfx942 triggered an HSA illegal-access fault
   (ALMIOPEN-2151), so the test is disabled until 64-bit index arithmetic
   is fixed in the kernel.  The test includes a device-memory guard
   (GTEST_SKIP when < 16 GiB VRAM) and a spot-check of the first 1 KiB
   of output.

2. GPU_Softmax_BetaZeroNaN_FP32 (Smoke/ForwardTest, Smoke/BackwardTest)
   Already present in the file — no new code needed for concern (2).
   These tests pre-poison the output/dinput buffer with NaN and assert
   that beta=0 suppresses the read, preventing NaN propagation.

JIRA ID: ALMIOPEN-2147
@peymanr
peymanr requested a review from a team as a code owner July 31, 2026 23:31
@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.

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