-
Notifications
You must be signed in to change notification settings - Fork 256
[BN] Serial run large tensors test cases #3553
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
Conversation
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNCKBWDSerialRun2D_FP16, | ||
testing::Combine(testing::ValuesIn(Network2DSerialCase<BN2DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCHW, miopenTensorNHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN2DTestCase>()); | ||
|
||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNOCLBWDSerialRun2D_FP16, | ||
testing::Combine(testing::ValuesIn(Network2DSerialCase<BN2DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCHW, miopenTensorNHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN2DTestCase>()); | ||
|
||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNOCLBWDSerialRun3D_FP16, | ||
testing::Combine(testing::ValuesIn(Network3DSerialCase<BN3DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCDHW, miopenTensorNDHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN3DTestCase>()); | ||
|
||
// bfp16 | ||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNCKBWDSerialRun2D_BFP16, | ||
testing::Combine(testing::ValuesIn(Network2DSerialCase<BN2DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCHW, miopenTensorNHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN2DTestCase>()); | ||
|
||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNOCLBWDSerialRun2D_BFP16, | ||
testing::Combine(testing::ValuesIn(Network2DSerialCase<BN2DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCHW, miopenTensorNHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN2DTestCase>()); | ||
|
||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNOCLBWDSerialRun3D_BFP16, | ||
testing::Combine(testing::ValuesIn(Network3DSerialCase<BN3DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCDHW, miopenTensorNDHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN3DTestCase>()); | ||
|
||
// fp32 | ||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNBWDSerialRun2D_FP32, | ||
testing::Combine(testing::ValuesIn(Network2DSerialCase<BN2DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCHW, miopenTensorNHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV1})), | ||
TestNameGenerator<BN2DTestCase>()); | ||
|
||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNBWDSerialRun3D_FP32, | ||
testing::Combine(testing::ValuesIn(Network3DSerialCase<BN3DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCDHW, miopenTensorNDHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN3DTestCase>()); | ||
// fp64 | ||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNBWDSerialRun2D_FP64, | ||
testing::Combine(testing::ValuesIn(Network2DSerialCase<BN2DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCHW, miopenTensorNHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV1})), | ||
TestNameGenerator<BN2DTestCase>()); | ||
|
||
INSTANTIATE_TEST_SUITE_P(Smoke, | ||
GPU_BNBWDSerialRun3D_FP64, | ||
testing::Combine(testing::ValuesIn(Network3DSerialCase<BN3DTestCase>()), | ||
testing::ValuesIn({miopenTensorNCHW, miopenTensorNHWC}), | ||
testing::ValuesIn({miopenBNSpatial, | ||
miopenBNPerActivation}), | ||
testing::ValuesIn({testBNAPIV2})), | ||
TestNameGenerator<BN3DTestCase>()); |
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.
Can we move these to full if they are going to run serial?
Seems like long running tests shouldn't be in smoke stage.
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.
template <> | ||
inline std::vector<BN3DTestCase> Network3DSerialCase() | ||
{ | ||
return {{2, 2048, 16, 128, 128, miopen::batchnorm::Direction::Backward, 0, 1}}; |
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.
2*2048*16*128*128=1073741824=1*10^9
// edge cases | ||
{69328, 1, 22, 22, miopen::batchnorm::Direction::ForwardTraining, 1, 1}, | ||
{69328, 1, 13, 79, miopen::batchnorm::Direction::ForwardTraining, 1, 1}, | ||
{128, 256, 14, 14, miopen::batchnorm::Direction::Backward, 0, 1}, | ||
{128, 256, 16, 16, miopen::batchnorm::Direction::Backward, 0, 1}, |
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.
69328*1*22*22=33554752=3.3*10^7
128*256*14*14=6422528=6.4*10^6
they are all quite small compared to 10^9.
Recommendation to remove from serial in next PR.
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.
There is also some in the Network large above that are bigger I think.
I think we should decide on a cut-off size, and split it consistently.
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.
When I listed all the shapes size by descending order
- Shape: (2, 2048, 16, 128, 128) --> Size: 1.07e+09
- Shape: (69328, 1, 13, 79) --> Size: 7.12e+07
- Shape: (64, 1024, 1024) --> Size: 6.71e+07
- Shape: (64, 256, 56, 56) --> Size: 5.14e+07
It seem like I can cut off 1e+9 since (2, 2048, 16, 128, 128) was the tensor size that caused the error in CI
* undo code change and fix issue from cmake * seperate large tensor test in batch norm to run serially
* undo code change and fix issue from cmake * seperate large tensor test in batch norm to run serially
* undo code change and fix issue from cmake * seperate large tensor test in batch norm to run serially
Follow up PR for #3545 Since that solution ended up taking huge CI time. In this PR we sperate the large tensor and create a separate file, effectively creating separate binary. Then to this binary that only does large tensor test we serialize the run via CMake's
gtest_discover_tests