Skip to content

Commit

Permalink
[CONV] Reduce data size of asymmetric padding testcase (apache#4658)
Browse files Browse the repository at this point in the history
Co-authored-by: Tianqi Chen <[email protected]>
  • Loading branch information
2 people authored and alexwong committed Feb 26, 2020
1 parent 2bf46c3 commit a5d23b6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 49 deletions.
29 changes: 15 additions & 14 deletions topi/tests/python/test_topi_conv2d_NCHWc.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,21 @@ 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, 16, 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__":
Expand Down
20 changes: 10 additions & 10 deletions topi/tests/python/test_topi_conv2d_int8.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, 16, 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, 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)

Expand Down
30 changes: 15 additions & 15 deletions topi/tests/python/test_topi_conv2d_nchw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, 20, 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, 16, 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__":
Expand Down
20 changes: 10 additions & 10 deletions topi/tests/python/test_topi_conv2d_winograd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down

0 comments on commit a5d23b6

Please sign in to comment.