-
Notifications
You must be signed in to change notification settings - Fork 226
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
[HOTFIX][tests] Limit applicability of ConvFwdBiasActivAPI/ConvFwdBiasResAddActivTest.ConvFusedAPI #2635
[HOTFIX][tests] Limit applicability of ConvFwdBiasActivAPI/ConvFwdBiasResAddActivTest.ConvFusedAPI #2635
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,14 +25,44 @@ | |
*******************************************************************************/ | ||
#include <gtest/gtest.h> | ||
#include <miopen/miopen.h> | ||
#include <miopen/env.hpp> | ||
#if MIOPEN_USE_COMPOSABLEKERNEL | ||
#include <miopen/solver/ck_utility_common.hpp> | ||
#endif | ||
|
||
#include "tensor_util.hpp" | ||
#include "get_handle.hpp" | ||
|
||
#include "conv3d_test_case.hpp" | ||
|
||
MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_TEST_ALL) | ||
MIOPEN_DECLARE_ENV_VAR_STR(MIOPEN_TEST_FLOAT_ARG) | ||
|
||
#if MIOPEN_USE_COMPOSABLEKERNEL | ||
#define WORAROUND_ISSUE_2533 1 | ||
#endif | ||
|
||
namespace conv_bias_act_res_add_fwd { | ||
|
||
bool TestIsApplicable() | ||
{ | ||
#if MIOPEN_USE_COMPOSABLEKERNEL | ||
const auto float_arg = miopen::GetStringEnv(ENV(MIOPEN_TEST_FLOAT_ARG)); | ||
return | ||
#if WORAROUND_ISSUE_2533 | ||
miopen::solver::ck_utility::is_ck_whitelist(get_handle().GetDeviceName()) // | ||
#else | ||
/// \todo Check against specific ASCIs. | ||
#endif | ||
&& (float_arg == "--half" // So far only test for fp16 is implemented. | ||
|| float_arg.empty()) // Empty when gtest is run without parameters. | ||
&& !miopen::IsDisabled( | ||
ENV(MIOPEN_TEST_ALL)); // Not disabled when gtest is run without parameters. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to remove this dependence on environment variables like CC: @JehandadKhan , @junliume There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @amberhassaan I'm second to this. We will remove this when possible. However, for now we need to handle Ditto |
||
#else | ||
return false; | ||
#endif | ||
} | ||
|
||
std::vector<Conv3DTestCase> ConvTestConfigs() | ||
{ // g, n, c, d, h, w, k, z, y, x, pad_x pad_y pad_z stri_x stri_y stri_z dia_x dia_y | ||
// dia_z | ||
|
@@ -57,6 +87,8 @@ struct ConvFwdBiasResAddFixture | |
protected: | ||
void SetUp() override | ||
{ | ||
if(!TestIsApplicable()) | ||
return; | ||
|
||
std::tie(algo, conv_config, alpha1, alpha2, tensor_layout) = GetParam(); | ||
|
||
|
@@ -94,6 +126,8 @@ struct ConvFwdBiasResAddFixture | |
} | ||
void TearDown() override | ||
{ | ||
if(!TestIsApplicable()) | ||
return; | ||
|
||
miopenDestroyActivationDescriptor(activ_desc); | ||
|
||
|
@@ -163,26 +197,33 @@ using namespace conv_bias_act_res_add_fwd; | |
|
||
TEST_P(ConvFwdBiasResAddActivTest, ConvFusedAPI) | ||
{ | ||
auto status = miopenConvolutionBiasActivationForward(&get_handle(), | ||
&alpha1, | ||
&input.desc, | ||
in_dev.get(), | ||
&weights.desc, | ||
wei_dev.get(), | ||
&conv_desc, | ||
algo, | ||
nullptr, // workspace | ||
0ull, // workspace size | ||
&alpha2, | ||
&z.desc, | ||
z_dev.get(), | ||
&bias.desc, | ||
bias_dev.get(), | ||
activ_desc, | ||
&output.desc, | ||
out_dev.get()); | ||
|
||
EXPECT_EQ(status, miopenStatusSuccess); | ||
if(TestIsApplicable()) | ||
{ | ||
auto status = miopenConvolutionBiasActivationForward(&get_handle(), | ||
&alpha1, | ||
&input.desc, | ||
in_dev.get(), | ||
&weights.desc, | ||
wei_dev.get(), | ||
&conv_desc, | ||
algo, | ||
nullptr, // workspace | ||
0ull, // workspace size | ||
&alpha2, | ||
&z.desc, | ||
z_dev.get(), | ||
&bias.desc, | ||
bias_dev.get(), | ||
activ_desc, | ||
&output.desc, | ||
out_dev.get()); | ||
|
||
EXPECT_EQ(status, miopenStatusSuccess); | ||
} | ||
else | ||
{ | ||
GTEST_SKIP(); | ||
} | ||
} | ||
|
||
INSTANTIATE_TEST_SUITE_P(ConvFwdBiasActivAPI, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This switch does not seem useful given how we rely heavily on CK and that we don't have (to my knowledge) alternatives to CK that intend to replace it. Do we expect to ship/deploy MIOpen in a setting where CK is absent or does not work?
CC: @JehandadKhan , @junliume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amberhassaan This is for CI stage 'Fp32 Hip Debug NOCK AnyGPU Build-Only' to pass.