Repository navigation
fix(conv): gate ASM-GTC fwd/bwd/wrw NHWC solvers off int32-overflow tensors #9568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yassinsolim
merged 23 commits into
develop
from
users/ysoliman/gate-asm-gtc-fwd-large-tensor
Sep 8, 2026
Merged
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
311d11e
fix(conv): gate ASM-GTC fwd NHWC solver off int32-overflow tensors
yassinsolim 1eba5bc
fix(conv): prune ASM-GTC fwd NHWC from find-db entries over INT_MAX
yassinsolim 6989dbe
fix(conv): gate ASM-GTC bwd NHWC solver off int32-overflow tensors
yassinsolim afcd08a
fix(conv): gate ASM-GTC wrw NHWC solver off int32-overflow tensors
yassinsolim 48fd8c5
test(conv): applicability test for the ASM-GTC bwd NHWC INT_MAX gate
yassinsolim f9b183f
test(conv): applicability test for the ASM-GTC wrw NHWC INT_MAX gate
yassinsolim 33a00f0
docs(changelog): cover bwd and wrw in the ASM-GTC INT_MAX gate entry
yassinsolim 95825d1
test(conv): consolidate ASM-GTC large-tensor tests into one file
yassinsolim 24f7ebb
test(conv): drop test_conv_asm_gtc_fwd_nhwc_large_tensor.cpp, superse…
yassinsolim c270ba5
test(conv): drop test_conv_asm_gtc_bwd_nhwc_large_tensor.cpp, superse…
yassinsolim 77b9e33
test(conv): drop test_conv_asm_gtc_wrw_nhwc_large_tensor.cpp, superse…
yassinsolim 4f198de
fix(conv): DBSync prune gfx90a68 (auto)
yassinsolim 8393599
fix(conv): DBSync prune gfx90a68 (auto)
yassinsolim e1ff811
fix(conv): DBSync prune gfx90a6e (auto)
yassinsolim c376df7
fix(conv): compare bytes, not elements, in ASM-GTC NHWC overflow gates
yassinsolim 03ef09d
fix(db): drop stale ASM-GTC NHWC find-db rows above the byte-based ov…
yassinsolim eb5a76b
Merge branch 'develop' into users/ysoliman/gate-asm-gtc-fwd-large-tensor
yassinsolim 8e1eee3
Merge branch 'develop' into users/ysoliman/gate-asm-gtc-fwd-large-tensor
yassinsolim ce70fff
Merge remote-tracking branch 'refs/remotes/origin/develop-x' into mrg…
yassinsolim 7488e45
refactor(miopen): share the ASM-GTC large-tensor guard across fwd/bwd…
yassinsolim bc3ffa3
Merge branch 'develop' into gate-asm-gtc-fwd-large-tensor
yassinsolim 8d2dd81
Merge branch 'develop' into gate-asm-gtc-fwd-large-tensor
yassinsolim f37181b
docs(miopen): document the ASM-GTC find-db prune under Changed
yassinsolim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
144 changes: 144 additions & 0 deletions
144
projects/miopen/test/gtest/conv_asm_gtc_nhwc_large_tensor.cpp
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| /******************************************************************************* | ||
| * | ||
| * MIT License | ||
| * | ||
| * Copyright (c) 2026 Advanced Micro Devices, Inc. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in all | ||
| * copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| * SOFTWARE. | ||
| * | ||
| *******************************************************************************/ | ||
|
|
||
| #include "unit_conv_solver.hpp" | ||
|
|
||
| // The ASM-GTC NHWC solvers ConvAsmImplicitGemmGTCDynamic{Fwd,Bwd,Wrw}XdlopsNHWC index | ||
| // global tensor memory with 32-bit BYTE offsets and do not implement large-tensor | ||
| // support. Each solver's IsApplicable() therefore gates off any problem whose tensor | ||
| // size in bytes exceeds INT_MAX, so it cannot be selected for a shape it would silently | ||
| // compute incorrectly. Note the bound is on bytes, not elements: for fp16 the effective | ||
| // element ceiling is half of INT_MAX. | ||
| // | ||
| // The two cases below share geometry and differ only in batch size N, so the byte | ||
| // count crosses the INT_MAX boundary and isolates the gate. The gate checks the | ||
| // (direction-independent) in/out/weights descriptors; for this shape both the input and | ||
| // output tensors have C*H*W per sample = 1024*162*92 = 15,261,696 elements, and fp16 | ||
| // doubles that to bytes: | ||
| // N=70 -> 2,136,637,440 bytes <= INT_MAX (2,147,483,647): int32-safe, applicable | ||
| // N=71 -> 2,167,160,832 bytes > INT_MAX : gated off, not applicable | ||
|
|
||
| namespace { | ||
|
|
||
| auto GetInRangeConvCase() | ||
| { | ||
| using miopen::unit_tests::ConvTestCase; | ||
| return ConvTestCase{{miopenHalf, miopenTensorNHWC, {70, 1024, 162, 92}}, | ||
| {miopenHalf, miopenTensorNHWC, {1024, 1024, 3, 3}}, | ||
| miopenHalf, | ||
| {{1, 1}, {1, 1}, {1, 1}}}; | ||
| } | ||
|
|
||
| auto GetOverInt32ConvCase() | ||
| { | ||
| using miopen::unit_tests::ConvTestCase; | ||
| return ConvTestCase{{miopenHalf, miopenTensorNHWC, {71, 1024, 162, 92}}, | ||
| {miopenHalf, miopenTensorNHWC, {1024, 1024, 3, 3}}, | ||
| miopenHalf, | ||
| {{1, 1}, {1, 1}, {1, 1}}}; | ||
| } | ||
|
|
||
| // int32-safe shape: the solver keeps its usual device applicability (regression guard). | ||
| auto GetInRangeParams() | ||
| { | ||
| auto p = miopen::unit_tests::UnitTestConvSolverParams(Gpu::gfx908 | Gpu::gfx90A | Gpu::gfx94X | | ||
| Gpu::gfx950); | ||
| p.CheckXnackDisabled(); | ||
| return p; | ||
| } | ||
|
|
||
| // byte count > INT_MAX: the solver must be applicable on no device (gated off). | ||
| auto GetGatedParams() | ||
| { | ||
| auto p = miopen::unit_tests::UnitTestConvSolverParams(Gpu::None); | ||
| p.CheckXnackDisabled(); | ||
| return p; | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| // --- Forward ------------------------------------------------------------------------- | ||
|
|
||
| using CPU_UnitTestConvSolverAsmGTCFwdNHWCLargeTensorDevApplicability_NONE = | ||
| CPU_UnitTestConvSolverDevApplicabilityFwd_NONE; | ||
|
|
||
| TEST_P(CPU_UnitTestConvSolverAsmGTCFwdNHWCLargeTensorDevApplicability_NONE, | ||
| ConvAsmImplicitGemmGTCDynamicFwdXdlopsNHWC) | ||
| { | ||
| this->RunTest(miopen::solver::conv::ConvAsmImplicitGemmGTCDynamicFwdXdlopsNHWC{}); | ||
| }; | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(SmokeInt32Safe, | ||
| CPU_UnitTestConvSolverAsmGTCFwdNHWCLargeTensorDevApplicability_NONE, | ||
| testing::Combine(testing::Values(GetInRangeParams()), | ||
| testing::Values(GetInRangeConvCase()))); | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(SmokeOverInt32, | ||
| CPU_UnitTestConvSolverAsmGTCFwdNHWCLargeTensorDevApplicability_NONE, | ||
| testing::Combine(testing::Values(GetGatedParams()), | ||
| testing::Values(GetOverInt32ConvCase()))); | ||
|
|
||
| // --- Backward-data ------------------------------------------------------------------- | ||
|
|
||
| using CPU_UnitTestConvSolverAsmGTCBwdNHWCLargeTensorDevApplicability_NONE = | ||
| CPU_UnitTestConvSolverDevApplicabilityBwd_NONE; | ||
|
|
||
| TEST_P(CPU_UnitTestConvSolverAsmGTCBwdNHWCLargeTensorDevApplicability_NONE, | ||
| ConvAsmImplicitGemmGTCDynamicBwdXdlopsNHWC) | ||
| { | ||
| this->RunTest(miopen::solver::conv::ConvAsmImplicitGemmGTCDynamicBwdXdlopsNHWC{}); | ||
| }; | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(SmokeInt32Safe, | ||
| CPU_UnitTestConvSolverAsmGTCBwdNHWCLargeTensorDevApplicability_NONE, | ||
| testing::Combine(testing::Values(GetInRangeParams()), | ||
| testing::Values(GetInRangeConvCase()))); | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(SmokeOverInt32, | ||
| CPU_UnitTestConvSolverAsmGTCBwdNHWCLargeTensorDevApplicability_NONE, | ||
| testing::Combine(testing::Values(GetGatedParams()), | ||
| testing::Values(GetOverInt32ConvCase()))); | ||
|
|
||
| // --- Backward-weights ---------------------------------------------------------------- | ||
|
|
||
| using CPU_UnitTestConvSolverAsmGTCWrwNHWCLargeTensorDevApplicability_NONE = | ||
| CPU_UnitTestConvSolverDevApplicabilityWrw_NONE; | ||
|
|
||
| TEST_P(CPU_UnitTestConvSolverAsmGTCWrwNHWCLargeTensorDevApplicability_NONE, | ||
| ConvAsmImplicitGemmGTCDynamicWrwXdlopsNHWC) | ||
| { | ||
| this->RunTest(miopen::solver::conv::ConvAsmImplicitGemmGTCDynamicWrwXdlopsNHWC{}); | ||
| }; | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(SmokeInt32Safe, | ||
| CPU_UnitTestConvSolverAsmGTCWrwNHWCLargeTensorDevApplicability_NONE, | ||
| testing::Combine(testing::Values(GetInRangeParams()), | ||
| testing::Values(GetInRangeConvCase()))); | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(SmokeOverInt32, | ||
| CPU_UnitTestConvSolverAsmGTCWrwNHWCLargeTensorDevApplicability_NONE, | ||
| testing::Combine(testing::Values(GetGatedParams()), | ||
| testing::Values(GetOverInt32ConvCase()))); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.