test(miopen): add RNN/GRU scale coverage for training and FP32 (ALMIOPEN-2149) - #10254
Open
peymanr wants to merge 2 commits into
Open
test(miopen): add RNN/GRU scale coverage for training and FP32 (ALMIOPEN-2149)#10254peymanr wants to merge 2 commits into
peymanr wants to merge 2 commits into
Conversation
…32 (ALMIOPEN-2149)
The only existing at-scale RNN test (lstm_large_workspace.cpp) covers
LSTM forward-inference in FP16. This commit adds a new test file that
closes three gaps identified in ALMIOPEN-2149:
1. GRU FP32 — forward training + backward data with workspace > INT_MAX
2. Vanilla RNN (tanh) FP32 — forward training + backward data with workspace > INT_MAX
3. LSTM FP32 — forward training + backward data with workspace > INT_MAX
(existing coverage is FP16 inference only)
Each suite follows the pattern established in lstm_large_workspace.cpp:
* A GetWorkspaceSizeOverflowsInt tripwire that fails if a future change
shrinks the workspace below INT_MAX for the chosen config.
* A ForwardTraining* test that allocates all required buffers and
verifies miopenRNNForwardTraining returns miopenStatusSuccess.
* A BackwardData* test that runs forward first to populate reserve
space, then verifies miopenRNNBackwardData returns miopenStatusSuccess.
Config used for all suites (same spatial shape as the existing LSTM test):
batch=1000, seq=600, input=60, hidden=128, layers=4, bidirectional, FP32
Workspace byte counts at this config (formula: workspaceScale*nLayers*
seqLen*batch*hidden*sizeof(dtype)*(bidir?2:1)):
GRU FP32: workspaceScale=4 → ~9.8 GB > INT_MAX
RNN FP32: workspaceScale=1 → ~2.5 GB > INT_MAX
LSTM FP32: workspaceScale=6 → ~14.7 GB > INT_MAX
All tests skip gracefully (GTEST_SKIP) when the device has insufficient
memory for the full training run. The CMakeLists.txt file(GLOB) picks up
the new file automatically; no build-system changes are required.
JIRA ID: ALMIOPEN-2149
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
Pre-commit check failed⛔ pre-commit failed Please run locally:
This repo uses |
Fix clang-format violations in rnn_large_workspace.cpp flagged by pre-commit CI. Resolves: ALMIOPEN-2149
|
🎉 All checks passed! This PR is ready for review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JIRA ID: ALMIOPEN-2149
The only existing at-scale RNN test (
lstm_large_workspace.cpp) covers LSTM forward-inference in FP16 only. This PR addsrnn_large_workspace.cppwith three new test suites that close the gaps identified in ALMIOPEN-2149:GPU_GRU_LargeWorkspace_FP32GPU_RNNVanilla_LargeWorkspace_FP32GPU_LSTM_LargeWorkspace_FP32All suites use the same spatial config as the existing test (batch=1000, seq=600, input=60, hidden=128, layers=4, bidirectional). Workspace byte counts at this config exceed INT_MAX for every mode:
Each suite includes:
miopenRNNForwardTrainingend-to-end with properly sized workspace + reserve buffers.miopenRNNBackwardDatasucceeds.Tests skip gracefully (
GTEST_SKIP) when the device lacks sufficient memory. The new file is picked up automatically by the existingfile(GLOB TESTS *.cpp)inCMakeLists.txt; no build-system changes are required.Test plan
miopen_gtestwithMIOPEN_TEST_SINGLE_GTEST=ONand confirmrnn_large_workspace.cppis includedStandard/GPU_GRU_LargeWorkspace_FP32.*on gfx942 (MI325X / TW325) — expect pass or SKIP if VRAM < requiredStandard/GPU_RNNVanilla_LargeWorkspace_FP32.*— sameStandard/GPU_LSTM_LargeWorkspace_FP32.*— samecheck_names.py(GPU prefix + FP32 suffix, Standard instantiation)🤖 Assisted by PR Pundit