From ec2688340c60689d2283c75081f084ce8826ae0d Mon Sep 17 00:00:00 2001 From: optima2005 Date: Wed, 8 Jan 2020 21:05:51 +0800 Subject: [PATCH] [CONV] Reduce data size of asymmetric padding testcase --- topi/tests/python/test_topi_conv2d_NCHWc.py | 28 ++++++++--------- topi/tests/python/test_topi_conv2d_int8.py | 22 +++++++------- topi/tests/python/test_topi_conv2d_nchw.py | 30 +++++++++---------- .../tests/python/test_topi_conv2d_winograd.py | 20 ++++++------- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/topi/tests/python/test_topi_conv2d_NCHWc.py b/topi/tests/python/test_topi_conv2d_NCHWc.py index 7c8595d49cc1..4843cbf0442e 100644 --- a/topi/tests/python/test_topi_conv2d_NCHWc.py +++ b/topi/tests/python/test_topi_conv2d_NCHWc.py @@ -220,20 +220,20 @@ def test_conv2d_NCHWc(): verify_conv2d_NCHWc(1, 256, 3, 126, 3, 1, 1) # Asymmetric padding - verify_conv2d_NCHWc(1, 3, 224, 64, 7, 2, (0, 0, 1, 1)) - verify_conv2d_NCHWc(1, 64, 56, 128, 3, 1, (3, 3, 2, 2)) - verify_conv2d_NCHWc(1, 64, 56, 64, 1, 1, (1, 2, 2, 1)) - verify_conv2d_NCHWc(1, 64, 288, 192, 1, 1, (1, 2)) - verify_conv2d_NCHWc(1, 64, 56, 64, 3, 1, (3, 1)) - verify_conv2d_NCHWc(1, 128, 56, 384, 3, 1, (0, 2)) - verify_conv2d_NCHWc(1, 64, 56, 64, 1, 1, "VALID") - verify_conv2d_NCHWc(1, 388, 56, 64, 3, 1, "VALID") - verify_conv2d_NCHWc(1, 512, 19, 64, 1, 1, "SAME") - verify_conv2d_NCHWc(1, 64, 2048, 32, 2, 1, "SAME") - verify_conv2d_NCHWc(1, 64, 56, 64, 3, 1, (1, 2, 2, 1), add_relu=True) - verify_conv2d_NCHWc(1, 64, 56, 64, 5, 2, (1, 3), add_bias=True) - verify_conv2d_NCHWc(1, 64, 56, 64, 3, 1, "VALID", add_bias=True, add_relu=True) - verify_conv2d_NCHWc(1, 64, 56, 64, 24, 1, "SAME", add_bias=True, add_relu=True) + verify_conv2d_NCHWc(1, 32, 17, 64, 7, 2, (0, 0, 1, 1)) + verify_conv2d_NCHWc(1, 32, 35, 128, 3, 1, (3, 3, 2, 2)) + verify_conv2d_NCHWc(1, 32, 35, 32, 1, 1, (1, 2, 2, 1)) + verify_conv2d_NCHWc(1, 32, 17, 192, 1, 1, (1, 2)) + verify_conv2d_NCHWc(1, 32, 8, 32, 3, 1, (3, 1)) + verify_conv2d_NCHWc(1, 128, 8, 384, 3, 1, (0, 2)) + verify_conv2d_NCHWc(1, 32, 8, 32, 1, 1, "VALID") + verify_conv2d_NCHWc(1, 388, 8, 32, 3, 1, "VALID") + verify_conv2d_NCHWc(1, 512, 19, 32, 1, 1, "SAME") + verify_conv2d_NCHWc(1, 32, 10, 32, 2, 1, "SAME") + verify_conv2d_NCHWc(1, 32, 8, 32, 3, 1, (1, 2, 2, 1), add_relu=True) + verify_conv2d_NCHWc(1, 32, 8, 32, 5, 2, (1, 3), add_bias=True) + verify_conv2d_NCHWc(1, 32, 8, 32, 3, 1, "VALID", add_bias=True, add_relu=True) + verify_conv2d_NCHWc(1, 32, 8, 32, 24, 1, "SAME", add_bias=True, add_relu=True) if __name__ == "__main__": diff --git a/topi/tests/python/test_topi_conv2d_int8.py b/topi/tests/python/test_topi_conv2d_int8.py index 5b8a2eb6e1f1..6cb66d013541 100644 --- a/topi/tests/python/test_topi_conv2d_int8.py +++ b/topi/tests/python/test_topi_conv2d_int8.py @@ -188,18 +188,18 @@ def test_conv2d_nchw(): verify_conv2d_NCHWc_int8(32, 32, 149, 32, 3, 1, 0) # Asymmetric padding - verify_conv2d_NCHWc_int8(1, 32, 224, 64, 7, 2, (0, 0, 1, 1)) - verify_conv2d_NCHWc_int8(1, 64, 56, 128, 3, 1, (3, 3, 2, 2)) - verify_conv2d_NCHWc_int8(1, 64, 56, 64, 1, 1, (1, 2, 2, 1)) - verify_conv2d_NCHWc_int8(1, 64, 288, 192, 1, 1, (1, 2)) - verify_conv2d_NCHWc_int8(1, 64, 56, 64, 3, 1, (3, 1)) - verify_conv2d_NCHWc_int8(1, 128, 56, 384, 3, 1, (0, 2)) - verify_conv2d_NCHWc_int8(1, 64, 56, 64, 1, 1, "VALID") - verify_conv2d_NCHWc_int8(1, 388, 56, 64, 3, 1, "VALID") + verify_conv2d_NCHWc_int8(1, 32, 35, 64, 7, 2, (0, 0, 1, 1)) + verify_conv2d_NCHWc_int8(1, 64, 8, 128, 3, 1, (3, 3, 2, 2)) + verify_conv2d_NCHWc_int8(1, 64, 8, 64, 1, 1, (1, 2, 2, 1)) + verify_conv2d_NCHWc_int8(1, 64, 17, 192, 1, 1, (1, 2)) + verify_conv2d_NCHWc_int8(1, 64, 8, 64, 3, 1, (3, 1)) + verify_conv2d_NCHWc_int8(1, 128, 8, 384, 3, 1, (0, 2)) + verify_conv2d_NCHWc_int8(1, 64, 8, 64, 1, 1, "VALID") + verify_conv2d_NCHWc_int8(1, 388, 8, 64, 3, 1, "VALID") verify_conv2d_NCHWc_int8(1, 512, 19, 64, 1, 1, "SAME") - verify_conv2d_NCHWc_int8(1, 64, 2048, 32, 2, 1, "SAME") - verify_conv2d_NCHWc_int8(1, 64, 56, 64, 3, 1, (1, 2, 2, 1), add_relu=True) - verify_conv2d_NCHWc_int8(1, 64, 56, 64, 5, 2, (1, 3), add_bias=True) + verify_conv2d_NCHWc_int8(1, 64, 16, 32, 2, 1, "SAME") + verify_conv2d_NCHWc_int8(1, 64, 8, 64, 3, 1, (1, 2, 2, 1), add_relu=True) + verify_conv2d_NCHWc_int8(1, 64, 8, 64, 5, 2, (1, 3), add_bias=True) verify_conv2d_NCHWc_int8(1, 64, 56, 64, 3, 1, "VALID", add_bias=True, add_relu=True) verify_conv2d_NCHWc_int8(1, 64, 56, 64, 24, 1, "SAME", add_bias=True, add_relu=True) diff --git a/topi/tests/python/test_topi_conv2d_nchw.py b/topi/tests/python/test_topi_conv2d_nchw.py index 7c8041b87d6f..85d733c5d546 100644 --- a/topi/tests/python/test_topi_conv2d_nchw.py +++ b/topi/tests/python/test_topi_conv2d_nchw.py @@ -185,23 +185,23 @@ def test_conv2d_nchw(): verify_conv2d_nchw(1, 256, 3, 126, 3, 1, 1) # Asymmetric padding - verify_conv2d_nchw(1, 3, 224, 64, 7, 2, (0, 0, 1, 1)) - verify_conv2d_nchw(1, 64, 56, 128, 3, 1, (3, 3, 2, 2)) - verify_conv2d_nchw(1, 64, 56, 64, 1, 1, (1, 2, 2, 1)) - verify_conv2d_nchw(1, 64, 288, 192, 1, 1, (1, 2)) - verify_conv2d_nchw(1, 64, 56, 64, 3, 1, (3, 1)) - verify_conv2d_nchw(1, 128, 56, 384, 3, 1, (0, 2)) - verify_conv2d_nchw(1, 64, 384, 64, 3, 1, (1, 2), use_cudnn=True) - verify_conv2d_nchw(1, 64, 56, 64, 1, 1, "VALID") - verify_conv2d_nchw(1, 388, 56, 64, 3, 1, "VALID") - verify_conv2d_nchw(1, 64, 1280, 48, 3, 1, "VALID", use_cudnn=True) + verify_conv2d_nchw(1, 3, 35, 64, 7, 2, (0, 0, 1, 1)) + verify_conv2d_nchw(1, 64, 8, 128, 3, 1, (3, 3, 2, 2)) + verify_conv2d_nchw(1, 64, 8, 64, 1, 1, (1, 2, 2, 1)) + verify_conv2d_nchw(1, 64, 17, 192, 1, 1, (1, 2)) + verify_conv2d_nchw(1, 64, 8, 64, 3, 1, (3, 1)) + verify_conv2d_nchw(1, 128, 8, 384, 3, 1, (0, 2)) + verify_conv2d_nchw(1, 64, 35, 64, 3, 1, (1, 2), use_cudnn=True) + verify_conv2d_nchw(1, 64, 8, 64, 1, 1, "VALID") + verify_conv2d_nchw(1, 388, 8, 64, 3, 1, "VALID") + verify_conv2d_nchw(1, 64, 10, 48, 3, 1, "VALID", use_cudnn=True) verify_conv2d_nchw(1, 512, 19, 64, 1, 1, "SAME") - verify_conv2d_nchw(1, 64, 2048, 32, 2, 1, "SAME") + verify_conv2d_nchw(1, 64, 5, 32, 2, 1, "SAME") verify_conv2d_nchw(1, 64, 8, 64, 3, 1, "SAME", use_cudnn=True) - verify_conv2d_nchw(1, 64, 56, 64, 3, 1, (1, 2, 2, 1), add_relu=True) - verify_conv2d_nchw(1, 64, 56, 64, 5, 2, (1, 3), add_bias=True) - verify_conv2d_nchw(1, 64, 56, 64, 3, 1, "VALID", add_bias=True, add_relu=True) - verify_conv2d_nchw(1, 64, 56, 64, 24, 1, "SAME", add_bias=True, add_relu=True) + verify_conv2d_nchw(1, 64, 8, 64, 3, 1, (1, 2, 2, 1), add_relu=True) + verify_conv2d_nchw(1, 64, 8, 64, 5, 2, (1, 3), add_bias=True) + verify_conv2d_nchw(1, 64, 8, 64, 3, 1, "VALID", add_bias=True, add_relu=True) + verify_conv2d_nchw(1, 64, 8, 64, 24, 1, "SAME", add_bias=True, add_relu=True) if __name__ == "__main__": diff --git a/topi/tests/python/test_topi_conv2d_winograd.py b/topi/tests/python/test_topi_conv2d_winograd.py index 548aea909cae..350e62101689 100644 --- a/topi/tests/python/test_topi_conv2d_winograd.py +++ b/topi/tests/python/test_topi_conv2d_winograd.py @@ -136,18 +136,18 @@ def test_conv2d_nchw(): verify_conv2d_nchw(2, 13, 71, 59, 3, 1, 1) # Asymmetric padding - verify_conv2d_nchw(1, 64, 56, 64, 3, 1, (1, 1, 1, 1)) - verify_conv2d_nchw(1, 128, 28, 128, 3, 1, (1, 1, 1, 1)) - verify_conv2d_nchw(1, 256, 14, 256, 3, 1, (1, 1)) + verify_conv2d_nchw(1, 48, 56, 48, 3, 1, (1, 1, 1, 1)) + verify_conv2d_nchw(1, 64, 28, 64, 3, 1, (1, 1, 1, 1)) + verify_conv2d_nchw(1, 128, 14, 128, 3, 1, (1, 1)) verify_conv2d_nchw(1, 512, 7, 512, 3, 1, "SAME") - verify_conv2d_nchw(2, 13, 71, 59, 3, 1, (1, 1, 1, 1)) - verify_conv2d_nchw(2, 64, 56, 64, 3, 1, (1, 1, 1, 1), add_bias=True) - verify_conv2d_nchw(2, 64, 56, 64, 3, 1, (1, 1), add_relu=True) - verify_conv2d_nchw(2, 64, 56, 64, 3, 1, "SAME", add_relu=True, add_bias=True) - verify_conv2d_nchw(1, 128, 17, 192, 7, 1, (3, 1), devices=['cuda']) - verify_conv2d_nchw(1, 128, 17, 128, 7, 1, (3, 3, 2, 2), devices=['cuda']) + verify_conv2d_nchw(2, 13, 71, 59, 3, 1, (1, 1, 1, 1)) + verify_conv2d_nchw(2, 48, 56, 48, 3, 1, (1, 1, 1, 1), add_bias=True) + verify_conv2d_nchw(2, 48, 56, 48, 3, 1, (1, 1), add_relu=True) + verify_conv2d_nchw(2, 48, 56, 48, 3, 1, "SAME", add_relu=True, add_bias=True) + verify_conv2d_nchw(1, 64, 17, 192, 7, 1, (3, 1), devices=['cuda']) + verify_conv2d_nchw(1, 64, 17, 64, 7, 1, (3, 3, 2, 2), devices=['cuda']) verify_conv2d_nchw(1, 160, 17, 160, 7, 1, "SAME", devices=['cuda']) - verify_conv2d_nchw(1, 48, 35, 64, 5, 1, "VALID", devices=['cuda']) + verify_conv2d_nchw(1, 48, 35, 48, 5, 1, "VALID", devices=['cuda']) if __name__ == "__main__":