CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
373 lines
15 KiB
C++
373 lines
15 KiB
C++
/*******************************************************************************
|
|
*
|
|
* MIT License
|
|
*
|
|
* Copyright (c) 2025 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"
|
|
|
|
namespace {
|
|
|
|
auto GetConvTestCasesHalfFwd()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{1, 40, 20, 20}, {20, 40, 3, 3}, {1, 1}, {1, 1}, {1, 1}, miopenHalf},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
auto GetConvTestCasesHalfBwd()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{1, 20, 20, 20}, {40, 20, 3, 3}, {1, 1}, {1, 1}, {1, 1}, miopenHalf},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
auto GetConvTestCasesHalfWrw()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{1, 20, 20, 20}, {20, 20, 3, 3}, {1, 1}, {1, 1}, {1, 1}, miopenHalf},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
auto GetConvTestCasesFloat()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{1, 20, 20, 20}, {20, 20, 3, 3}, {1, 1}, {1, 1}, {1, 1}, miopenFloat},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
template <miopenDataType_t datatype>
|
|
miopen::unit_tests::UnitTestConvSolverParams GetTestParams()
|
|
{
|
|
Gpu supported_gpus = Gpu::gfx906 | Gpu::gfx908 | Gpu::gfx90A | Gpu::gfx94X | Gpu::gfx950 |
|
|
Gpu::gfx103X | Gpu::gfx110X | Gpu::gfx115X | Gpu::gfx120X;
|
|
if constexpr(datatype == miopenFloat)
|
|
{
|
|
supported_gpus = supported_gpus | Gpu::gfx900;
|
|
}
|
|
auto p = miopen::unit_tests::UnitTestConvSolverParams(supported_gpus);
|
|
p.CheckXnackDisabled();
|
|
if constexpr(datatype == miopenHalf)
|
|
{
|
|
// FP16 ALT attribute is disabled to enable the backward solver on MI200 for HALF
|
|
p.SetConvAttrFp16Alt(0);
|
|
}
|
|
return p;
|
|
}
|
|
|
|
miopen::unit_tests::UnitTestConvSolverParams GetTestParamsHalf()
|
|
{
|
|
return GetTestParams<miopenHalf>();
|
|
}
|
|
|
|
miopen::unit_tests::UnitTestConvSolverParams GetTestParamsFloat()
|
|
{
|
|
return GetTestParams<miopenFloat>();
|
|
}
|
|
|
|
} // namespace
|
|
|
|
using GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Fwd_FP16 = GPU_UnitTestConvSolverFwd_FP16;
|
|
using GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Bwd_FP16 = GPU_UnitTestConvSolverBwd_FP16;
|
|
using GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Wrw_FP16 = GPU_UnitTestConvSolverWrw_FP16;
|
|
using GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Fwd_FP32 = GPU_UnitTestConvSolverFwd_FP32;
|
|
using GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Bwd_FP32 = GPU_UnitTestConvSolverBwd_FP32;
|
|
using GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Wrw_FP32 = GPU_UnitTestConvSolverWrw_FP32;
|
|
using CPU_UnitTestConvSolverBinWinogradRxSf2x3g1DevApplicabilityFwd_FP16 =
|
|
CPU_UnitTestConvSolverDevApplicabilityFwd_NONE;
|
|
using CPU_UnitTestConvSolverBinWinogradRxSf2x3g1DevApplicabilityFwd_FP32 =
|
|
CPU_UnitTestConvSolverDevApplicabilityFwd_NONE;
|
|
|
|
TEST_P(GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Fwd_FP16, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Bwd_FP16, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Wrw_FP16, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Fwd_FP32, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Bwd_FP32, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Wrw_FP32, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(CPU_UnitTestConvSolverBinWinogradRxSf2x3g1DevApplicabilityFwd_FP16, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(CPU_UnitTestConvSolverBinWinogradRxSf2x3g1DevApplicabilityFwd_FP32, ConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::ConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
// Smoke tests
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Fwd_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesHalfFwd())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Bwd_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesHalfBwd())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Wrw_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesHalfWrw())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Fwd_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesFloat())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Bwd_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesFloat())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverBinWinogradRxSf2x3g1Wrw_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesFloat())));
|
|
|
|
// Device applicability test
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
CPU_UnitTestConvSolverBinWinogradRxSf2x3g1DevApplicabilityFwd_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(GetConvTestCasesHalfFwd()[0])));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
CPU_UnitTestConvSolverBinWinogradRxSf2x3g1DevApplicabilityFwd_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(GetConvTestCasesFloat()[0])));
|
|
|
|
// =====================================================================
|
|
// TransposedConvBinWinogradRxSf2x3g1 (NHWC layout)
|
|
// =====================================================================
|
|
|
|
namespace {
|
|
|
|
auto GetConvTestCasesNHWCHalfFwd()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{miopenHalf, miopenTensorNHWC, {1, 40, 20, 20}},
|
|
{miopenHalf, miopenTensorNHWC, {20, 40, 3, 3}},
|
|
miopenHalf, {{1, 1}, {1, 1}, {1, 1}}},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
auto GetConvTestCasesNHWCHalfBwd()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{miopenHalf, miopenTensorNHWC, {1, 20, 20, 20}},
|
|
{miopenHalf, miopenTensorNHWC, {40, 20, 3, 3}},
|
|
miopenHalf, {{1, 1}, {1, 1}, {1, 1}}},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
auto GetConvTestCasesNHWCHalfWrw()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{miopenHalf, miopenTensorNHWC, {1, 20, 20, 20}},
|
|
{miopenHalf, miopenTensorNHWC, {20, 20, 3, 3}},
|
|
miopenHalf, {{1, 1}, {1, 1}, {1, 1}}},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
auto GetConvTestCasesNHWCFloat()
|
|
{
|
|
using TestCase = miopen::unit_tests::ConvTestCase;
|
|
|
|
return std::vector{
|
|
// clang-format off
|
|
TestCase{{miopenFloat, miopenTensorNHWC, {1, 20, 20, 20}},
|
|
{miopenFloat, miopenTensorNHWC, {20, 20, 3, 3}},
|
|
miopenFloat, {{1, 1}, {1, 1}, {1, 1}}},
|
|
// clang-format on
|
|
};
|
|
}
|
|
|
|
} // namespace
|
|
|
|
using GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Fwd_FP16 = GPU_UnitTestConvSolverFwd_FP16;
|
|
using GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Bwd_FP16 = GPU_UnitTestConvSolverBwd_FP16;
|
|
using GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Wrw_FP16 = GPU_UnitTestConvSolverWrw_FP16;
|
|
using GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Fwd_FP32 = GPU_UnitTestConvSolverFwd_FP32;
|
|
using GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Bwd_FP32 = GPU_UnitTestConvSolverBwd_FP32;
|
|
using GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Wrw_FP32 = GPU_UnitTestConvSolverWrw_FP32;
|
|
using CPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1DevApplicabilityFwd_FP16 =
|
|
CPU_UnitTestConvSolverDevApplicabilityFwd_NONE;
|
|
using CPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1DevApplicabilityFwd_FP32 =
|
|
CPU_UnitTestConvSolverDevApplicabilityFwd_NONE;
|
|
|
|
TEST_P(GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Fwd_FP16,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Bwd_FP16,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Wrw_FP16,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Fwd_FP32,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Bwd_FP32,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Wrw_FP32,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(CPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1DevApplicabilityFwd_FP16,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
TEST_P(CPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1DevApplicabilityFwd_FP32,
|
|
TransposedConvBinWinogradRxSf2x3g1)
|
|
{
|
|
this->RunTest(miopen::solver::conv::TransposedConvBinWinogradRxSf2x3g1{});
|
|
};
|
|
|
|
// Smoke tests
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Fwd_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesNHWCHalfFwd())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Bwd_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesNHWCHalfBwd())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Wrw_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesNHWCHalfWrw())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Fwd_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesNHWCFloat())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Bwd_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesNHWCFloat())));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(Smoke,
|
|
GPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1Wrw_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(miopenConvolutionAlgoWinograd),
|
|
testing::ValuesIn(GetConvTestCasesNHWCFloat())));
|
|
|
|
// Device applicability test
|
|
INSTANTIATE_TEST_SUITE_P(
|
|
Smoke,
|
|
CPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1DevApplicabilityFwd_FP16,
|
|
testing::Combine(testing::Values(GetTestParamsHalf()),
|
|
testing::Values(GetConvTestCasesNHWCHalfFwd()[0])));
|
|
|
|
INSTANTIATE_TEST_SUITE_P(
|
|
Smoke,
|
|
CPU_UnitTestConvSolverTransposedBinWinogradRxSf2x3g1DevApplicabilityFwd_FP32,
|
|
testing::Combine(testing::Values(GetTestParamsFloat()),
|
|
testing::Values(GetConvTestCasesNHWCFloat()[0])));
|