mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-15 10:37:44 +00:00
Merge commit 'b60af5bde965a2bb007bb582f7836b43ca647b81' into develop
This commit is contained in:
@@ -8,6 +8,9 @@ using F16 = ck::half_t;
|
||||
using F32 = float;
|
||||
using ck::index_t;
|
||||
|
||||
static ck::index_t length_mask = 0xffff;
|
||||
static ck::index_t instance_index = -1;
|
||||
|
||||
template <typename Tuple>
|
||||
class TestgroupnormBwdData : public ::testing::Test
|
||||
{
|
||||
@@ -29,15 +32,20 @@ class TestgroupnormBwdData : public ::testing::Test
|
||||
{1, 32, 32, 32, 20},
|
||||
{1, 16, 16, 32, 40}};
|
||||
|
||||
for(auto length : lengths)
|
||||
for(size_t i = 0; i < lengths.size(); i++)
|
||||
{
|
||||
if((length_mask & (1 << i)) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
auto length = lengths[i];
|
||||
bool success = ck::profiler::profile_groupnorm_bwd_data_impl<DYDataType,
|
||||
XDataType,
|
||||
GammaDataType,
|
||||
MeanInvStdDataType,
|
||||
ComputeDataType,
|
||||
DXDataType>(
|
||||
true, 2, false, false, length);
|
||||
true, 2, false, false, length, instance_index);
|
||||
EXPECT_TRUE(success);
|
||||
}
|
||||
}
|
||||
@@ -49,3 +57,19 @@ using KernelTypes = ::testing::Types<
|
||||
|
||||
TYPED_TEST_SUITE(TestgroupnormBwdData, KernelTypes);
|
||||
TYPED_TEST(TestgroupnormBwdData, Test_FP32) { this->Run(); }
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
if(argc == 1) {}
|
||||
else if(argc == 3)
|
||||
{
|
||||
length_mask = strtol(argv[1], nullptr, 0);
|
||||
instance_index = atoi(argv[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Usage of " << argv[0] << std::endl;
|
||||
std::cout << "Arg1,2: length_mask instance_index(-1 means all)" << std::endl;
|
||||
}
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ using F16 = ck::half_t;
|
||||
using F32 = float;
|
||||
using ck::index_t;
|
||||
|
||||
static ck::index_t length_mask = 0xffff;
|
||||
static ck::index_t instance_index = -1;
|
||||
|
||||
template <typename Tuple>
|
||||
class TestLayernorm2dBwdData : public ::testing::Test
|
||||
{
|
||||
@@ -25,16 +28,21 @@ class TestLayernorm2dBwdData : public ::testing::Test
|
||||
std::vector<std::vector<ck::index_t>> lengths = {
|
||||
{4, 256}, {8, 511}, {9, 1032}, {4, 2048}, {1, 8192}, {4000, 2000}};
|
||||
|
||||
for(auto length : lengths)
|
||||
for(size_t i = 0; i < lengths.size(); i++)
|
||||
{
|
||||
bool success =
|
||||
ck::profiler::profile_layernorm_bwd_data_impl<DYDataType,
|
||||
XDataType,
|
||||
GammaDataType,
|
||||
MeanInvStdDataType,
|
||||
ComputeDataType,
|
||||
DXDataType,
|
||||
2>(true, 2, false, false, length);
|
||||
if((length_mask & (1 << i)) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
auto length = lengths[i];
|
||||
bool success = ck::profiler::profile_layernorm_bwd_data_impl<DYDataType,
|
||||
XDataType,
|
||||
GammaDataType,
|
||||
MeanInvStdDataType,
|
||||
ComputeDataType,
|
||||
DXDataType,
|
||||
2>(
|
||||
true, 2, false, false, length, instance_index);
|
||||
EXPECT_TRUE(success);
|
||||
}
|
||||
}
|
||||
@@ -46,3 +54,20 @@ using KernelTypes = ::testing::Types<
|
||||
|
||||
TYPED_TEST_SUITE(TestLayernorm2dBwdData, KernelTypes);
|
||||
TYPED_TEST(TestLayernorm2dBwdData, Test_FP32) { this->Run(); }
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
if(argc == 1) {}
|
||||
else if(argc == 3)
|
||||
{
|
||||
length_mask = strtol(argv[1], nullptr, 0);
|
||||
instance_index = atoi(argv[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Usage of " << argv[0] << std::endl;
|
||||
std::cout << "Arg1,2: length_mask instance_index(-1 means all)" << std::endl;
|
||||
}
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user