Repository navigation
fix(miopen): add naive reference kernel for 3D INT8 forward convolutions #10051
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
Merged
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
546d766
fix(miopen): add naive reference kernel instantiations for 3D INT8 fw…
amd-bartgips 557f1ea
fix(miopen): fix test naming, shapes, and layout coverage for 3D INT8…
amd-bartgips a9c4b55
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-bartgips e91aea0
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-bartgips b4fa626
test(miopen): migrate 3D int8 fwd cases into unit_conv_solver_ConvDir…
amd-bartgips 45ff34b
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-bartgips 7fee98b
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine eb6e596
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine f8b7e6b
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine c793bfc
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine 949cde8
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine b6d261d
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine 88512e7
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine 7db95b1
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine d913b59
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine a435dd6
Merge branch 'develop' into users/bartgips/naive_conv_3d_int8
amd-ahyttine 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
82 changes: 82 additions & 0 deletions
82
projects/miopen/test/gtest/test_naive_conv_3d_int8_fwd.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,82 @@ | ||
| /******************************************************************************* | ||
| * | ||
| * 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. | ||
| * | ||
| *******************************************************************************/ | ||
|
|
||
| // Regression test for SILOTIGER-709 / ALMIOPEN-2275: | ||
| // The naive reference kernel lacked instantiations for 3D INT8 forward convolutions with | ||
| // int8_t output (ncdhw and ndhwc layouts). This caused "named symbol not found" failures | ||
| // during MIOpenDriver verification even though the fast solver ran successfully. | ||
|
|
||
| #include "unit_conv_solver.hpp" | ||
|
|
||
| namespace { | ||
|
|
||
| auto GetConvTestCases() | ||
| { | ||
| using TestCase = miopen::unit_tests::ConvTestCase; | ||
|
|
||
| // Regression for ALMIOPEN-2275: 3D int8 forward, both NCDHW and NDHWC layouts. | ||
| // x: {N, C, D, H, W}, w: {K, C, D, H, W}, type_y=int8 (the previously missing output variant). | ||
| // C is kept small (<=64) so the test data generator (conv_tensor_gen.hpp:num_add < | ||
| // int8_max=127) doesn't overflow during input generation for the int8_t accumulator path. | ||
| using TDP = miopen::unit_tests::TensorDescriptorParams; | ||
| using CDP = miopen::unit_tests::ConvolutionDescriptorParams; | ||
| return std::vector{ | ||
| // clang-format off | ||
| // NCDHW layout (default): exercises naive_conv_..._ncdhw_int8_t_int32_t_int8_t_0 | ||
| TestCase{{1, 16, 5, 14, 14}, {8, 16, 1, 1, 1}, {0, 0, 0}, {1, 1, 1}, {1, 1, 1}, miopenInt8, miopenInt8, miopenInt8}, | ||
| // NDHWC layout: exercises naive_conv_..._ndhwc_int8_t_int32_t_int8_t_0 | ||
| TestCase{TDP{miopenInt8, miopenTensorNDHWC, {1, 16, 5, 14, 14}}, | ||
| TDP{miopenInt8, miopenTensorNDHWC, {8, 16, 1, 1, 1}}, | ||
| miopenInt8, | ||
| CDP{{0, 0, 0}, {1, 1, 1}, {1, 1, 1}}}, | ||
| // clang-format on | ||
| }; | ||
| } | ||
|
|
||
| const auto& GetTestParams() | ||
| { | ||
| static const auto params = [] { | ||
| auto p = miopen::unit_tests::UnitTestConvSolverParams(Gpu::All); | ||
| p.UseCpuRef(); | ||
| return p; | ||
| }(); | ||
| return params; | ||
| } | ||
|
|
||
| } // namespace | ||
|
|
||
| using GPU_UnitTestConvNaiveConv3dFwd_I8 = GPU_UnitTestConvSolverFwd_I8; | ||
|
|
||
| TEST_P(GPU_UnitTestConvNaiveConv3dFwd_I8, ConvDirectNaiveConvFwd3dInt8) | ||
| { | ||
| this->RunTest(miopen::solver::conv::ConvDirectNaiveConvFwd{}); | ||
| }; | ||
|
|
||
| INSTANTIATE_TEST_SUITE_P(Smoke, | ||
| GPU_UnitTestConvNaiveConv3dFwd_I8, | ||
| testing::Combine(testing::Values(GetTestParams()), | ||
| testing::Values(miopenConvolutionAlgoDirect), | ||
| testing::ValuesIn(GetConvTestCases()))); |
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.