From ea566b49556a630c8dd5a922c9273b0624140332 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Mon, 3 Apr 2023 10:21:13 +0800 Subject: [PATCH 01/13] testcase --- python/conformance/diopi_configs.py | 87 ++++++++++++++++++++++++++--- 1 file changed, 79 insertions(+), 8 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index e733c2a..8d34e29 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -997,7 +997,7 @@ ), tensor_para=dict( gen_fn=Genfunc.randn, - dtype=[Dtype.float32, Dtype.float64], + dtype=[Dtype.float16,Dtype.float32, Dtype.float64], args=[ { "ins": ['input'], @@ -1026,7 +1026,7 @@ ), tensor_para=dict( gen_fn=Genfunc.randn, - dtype=[Dtype.float32, Dtype.float64], + dtype=[Dtype.float16,Dtype.float32, Dtype.float64], args=[ { "ins": ['input'], @@ -1054,7 +1054,7 @@ ), tensor_para=dict( gen_fn=Genfunc.randn, - dtype=[Dtype.float32, Dtype.float64], + dtype=[Dtype.float16,Dtype.float32, Dtype.float64], args=[ { "ins": ['input'], @@ -1624,7 +1624,8 @@ { "ins": ['mask'], "shape": ((16,), (12, 13), (12, 13, 14), (12, 13, 14, 1), (1, 4)), - "dtype": [Dtype.bool], + "dtype": [Dtype.uint8, Dtype.bool, Dtype.uint8, Dtype.bool, + Dtype.uint8, Dtype.bool, Dtype.uint8, Dtype.bool, Dtype.bool], "gen_fn": Genfunc.mask }, { @@ -2398,6 +2399,31 @@ ], ), ), + + 'masked_fill_int': dict( + name=["masked_fill"], + interface=["torch"], + is_inplace=True, + para=dict( + value=[-100, 0.0, -4, 0.432, 23.4, 5], + ), + tensor_para=dict( + args=[ + { + "ins": ['input'], + "shape": ((1,), (64,), (4, 49), (1276, 49, 49), (2, 8, 726, 726), (2, 31, 6, 40, 1)), + "dtype": [Dtype.int16,Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + "gen_fn": Genfunc.randint, + }, + { + "ins": ['mask'], + "shape": ((1,), (64,), (4, 49), (1276, 49, 49), (2, 1, 1, 726), (2, 31, 6, 40, 1)), + "dtype": [Dtype.bool], # uint8 is deprecated + "gen_fn": Genfunc.mask + }, + ], + ), + ), 'masked_fill_scalar': dict( name=["masked_fill"], @@ -2408,7 +2434,8 @@ { "ins": ['input'], "shape": ((1,), (64,), (4, 49), (1276, 49, 49), (2, 8, 726, 726), (2, 31, 6, 40, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, Dtype.int16, + Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], "gen_fn": Genfunc.randn, }, { @@ -2421,7 +2448,8 @@ "ins": ['value'], # masked_fill_ only supports a 0-dimensional value tensor "shape": ((), (), (), (), (), ()), - "dtype": [Dtype.float32, Dtype.float64], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, Dtype.int16, + Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], "gen_fn": Genfunc.ones }, ], @@ -2642,6 +2670,23 @@ ], ), ), + + 'bitwise_not_int': dict( + name=['bitwise_not'], + interface=['torch'], + is_inplace=True, + tensor_para=dict( + args=[ + { + "ins": ['input'], + "shape": ((10,), (100, 4), (2, 256, 256)), + "dtype": [Dtype.bool, Dtype.int16,Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8], + "gen_fn": dict(fn=Genfunc.randint, low=0, high=2), + }, + ], + ), + ), 'argmax': dict( name=['argmax'], @@ -2998,7 +3043,7 @@ interface=['torch'], is_inplace=True, para=dict( - dim=[0, 1, 2, 3], + dim=[0, 1, -2, 3], value=[1, -1, 2.0, 5] ), tensor_para=dict( @@ -3024,7 +3069,7 @@ interface=['torch'], is_inplace=True, para=dict( - dim=[0, 1, 2, 3], + dim=[0, -1, 2, 3], ), tensor_para=dict( args=[ @@ -3377,6 +3422,32 @@ ], ), ), + + 'remainder_other_zero': dict( + name=['remainder'], + interface=['torch'], + atol=1e-4, + rtol=1e-5, + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((6, ), (4, 5)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.float32], + "gen_fn": Genfunc.randn, + }, + { + "ins": ['other'], + "shape": ((6, ), (4, 1)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + "gen_fn": Genfunc.zeros, + }, + ], + ), + ), 'remainder_scalar': dict( name=['remainder'], From 9798a6fa38485ecd8f58814812b642a718f6ba19 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Mon, 3 Apr 2023 14:56:45 +0800 Subject: [PATCH 02/13] testcase --- python/conformance/diopi_configs.py | 142 ++++++++++++++++++++++++++-- 1 file changed, 135 insertions(+), 7 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index e733c2a..de861f8 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -801,6 +801,32 @@ ], ), ), + + 'div_rounding_mode': dict( + name=['div'], + interface=['torch'], + is_inplace=True, + para=dict( + rounding_mode=[None, 'floor', 'trunc', 'floor'], + ), + dtype=[Dtype.float32, Dtype.float16, Dtype.float64], + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((1024, ), (384, 128), + (128, 64, 3, 3), + (2, 32, 130, 130)), + }, + { + "ins": ['other'], + "shape": ((1024, ), (384, 128), + (1, ), (2, 32, 1, 1)), + }, + ], + ), + ), 'div_dtype_int_and_bool': dict( name=['div'], @@ -997,7 +1023,7 @@ ), tensor_para=dict( gen_fn=Genfunc.randn, - dtype=[Dtype.float32, Dtype.float64], + dtype=[Dtype.float16,Dtype.float32, Dtype.float64], args=[ { "ins": ['input'], @@ -1026,7 +1052,7 @@ ), tensor_para=dict( gen_fn=Genfunc.randn, - dtype=[Dtype.float32, Dtype.float64], + dtype=[Dtype.float16,Dtype.float32, Dtype.float64], args=[ { "ins": ['input'], @@ -1054,7 +1080,7 @@ ), tensor_para=dict( gen_fn=Genfunc.randn, - dtype=[Dtype.float32, Dtype.float64], + dtype=[Dtype.float16,Dtype.float32, Dtype.float64], args=[ { "ins": ['input'], @@ -2398,6 +2424,31 @@ ], ), ), + + 'masked_fill_int': dict( + name=["masked_fill"], + interface=["torch"], + is_inplace=True, + para=dict( + value=[-100, 0.0, -4, 0.432, 23.4, 5], + ), + tensor_para=dict( + args=[ + { + "ins": ['input'], + "shape": ((1,), (64,), (4, 49), (1276, 49, 49), (2, 8, 726, 726), (2, 31, 6, 40, 1)), + "dtype": [Dtype.int16,Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + "gen_fn": Genfunc.randint, + }, + { + "ins": ['mask'], + "shape": ((1,), (64,), (4, 49), (1276, 49, 49), (2, 1, 1, 726), (2, 31, 6, 40, 1)), + "dtype": [Dtype.bool], # uint8 is deprecated + "gen_fn": Genfunc.mask + }, + ], + ), + ), 'masked_fill_scalar': dict( name=["masked_fill"], @@ -2408,7 +2459,8 @@ { "ins": ['input'], "shape": ((1,), (64,), (4, 49), (1276, 49, 49), (2, 8, 726, 726), (2, 31, 6, 40, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, Dtype.int16, + Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], "gen_fn": Genfunc.randn, }, { @@ -2421,7 +2473,8 @@ "ins": ['value'], # masked_fill_ only supports a 0-dimensional value tensor "shape": ((), (), (), (), (), ()), - "dtype": [Dtype.float32, Dtype.float64], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, Dtype.int16, + Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], "gen_fn": Genfunc.ones }, ], @@ -2642,6 +2695,23 @@ ], ), ), + + 'bitwise_not_int': dict( + name=['bitwise_not'], + interface=['torch'], + is_inplace=True, + tensor_para=dict( + args=[ + { + "ins": ['input'], + "shape": ((10,), (100, 4), (2, 256, 256)), + "dtype": [Dtype.bool, Dtype.int16,Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8], + "gen_fn": dict(fn=Genfunc.randint, low=0, high=2), + }, + ], + ), + ), 'argmax': dict( name=['argmax'], @@ -2998,7 +3068,7 @@ interface=['torch'], is_inplace=True, para=dict( - dim=[0, 1, 2, 3], + dim=[0, 1, -2, 3], value=[1, -1, 2.0, 5] ), tensor_para=dict( @@ -3024,7 +3094,7 @@ interface=['torch'], is_inplace=True, para=dict( - dim=[0, 1, 2, 3], + dim=[0, -1, 2, 3], ), tensor_para=dict( args=[ @@ -3377,6 +3447,32 @@ ], ), ), + + 'remainder_other_zero': dict( + name=['remainder'], + interface=['torch'], + atol=1e-4, + rtol=1e-5, + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((6, ), (4, 5)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.float32], + "gen_fn": Genfunc.randn, + }, + { + "ins": ['other'], + "shape": ((6, ), (4, 1)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + "gen_fn": Genfunc.zeros, + }, + ], + ), + ), 'remainder_scalar': dict( name=['remainder'], @@ -3661,6 +3757,38 @@ ] ), ), + + 'index_put_acc_bool_indices': dict( + name=['index_put'], + interface=['CustomizedTest'], + is_inplace=True, + para=dict( + accumulate=[True, False, False] + ), + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((16, 4, 4), (64, 4, 14, 14), (4, 4)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + }, + { + "ins": ['indices1'], + "shape": ((16, 4), (64, 4), (4,4)), + "dtype": [Dtype.bool], + "gen_fn": Genfunc.ones, + }, + { + "ins": ['values'], + "shape": ((64,4), (256, 14, 14), (16,)), + "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool] + }, + ] + ), + ), 'index_put_one_indices': dict( name=['index_put'], From 9b262e51fcaae91baa3a5b29592dc5dd0ef9e7ab Mon Sep 17 00:00:00 2001 From: liangshinan Date: Mon, 3 Apr 2023 15:50:07 +0800 Subject: [PATCH 03/13] cdist --- python/conformance/diopi_configs.py | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index de861f8..a99d60f 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -2679,6 +2679,39 @@ ], ), ), + + 'cdist_compute_mode': dict( + name=['cdist'], + interface=['torch'], + saved_args=dict(output=0), + para=dict( + p=[2,2,2,2,2,2,2,2,2], + compute_mode=['use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', + 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', + 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist'] + ), + tensor_para=dict( + args=[ + { + "ins": ['x1'], + "requires_grad": [True], + "shape": ((5, 4), (2, 256, 256), (5, 4, 256, 256), + (3, 5, 4), (2, 256, 256), (5, 4, 256, 256), + (5, 4), (2, 256, 256), (5, 4, 256, 256),), + "dtype": [Dtype.float32, Dtype.float64], + "gen_fn": Genfunc.randn, + }, + { + "ins": ['x2'], + "shape": ((3, 4), (2, 16, 256), (2,5,4, 256, 256), + (3, 4), (2, 16, 256), (2,5,4, 256, 256), + (4, 3, 4), (2, 16, 256), (2,5,4, 256, 256),), + "dtype": [Dtype.float32, Dtype.float64], + "gen_fn": Genfunc.randn, + }, + ], + ), + ), 'bitwise_not': dict( name=['bitwise_not'], From c726f4eb592e62454c7b0b8f7b7123372dc52c34 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Tue, 4 Apr 2023 11:12:23 +0800 Subject: [PATCH 04/13] normal --- python/conformance/diopi_configs.py | 69 +++++++++++++++++++---------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index a99d60f..0cd28fc 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -359,6 +359,23 @@ ], ), ), + + 'pointwise_op_mask': dict( + name=['logical_not', 'bitwise_not'], + interface=['torch'], + dtype=[Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + tensor_para=dict( + gen_fn=dict(fn=Genfunc.randint, low=0, high=2), + args=[ + { + "ins": ['input'], + "shape": ((1, ), (1024,), (364800, 4), (2, 128, 3072), + (256, 128, 3, 3), + (2, 31, 512, 6, 40)), + }, + ], + ), + ), 'pointwise_op_bool': dict( name=['cos', 'erf', 'exp', 'sin', 'sqrt'], @@ -718,21 +735,23 @@ 'bitwise_op': dict( name=['bitwise_and', 'bitwise_or'], interface=['torch'], - is_inplace=True, - dtype=[Dtype.bool, Dtype.int8, Dtype.int32], tensor_para=dict( - gen_fn=Genfunc.randint, + gen_fn=dict(fn=Genfunc.randint, high=4), args=[ { "ins": ['input'], "shape": ((1024, ), (384, 128), (128, 64, 3, 3), (2, 32, 130, 130)), + "dtype": [Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.bool], }, { "ins": ['other'], "shape": ((1024, ), (384, 128), (1, ), (2, 32, 1, 1)), + "dtype": [Dtype.uint8, Dtype.bool, Dtype.int16, + Dtype.int64, Dtype.int8, Dtype.int32], }, ], ), @@ -2829,7 +2848,7 @@ centered=[False, True], ), tensor_para=dict( - dtype=[Dtype.float32, Dtype.float16], + dtype=[Dtype.float32, Dtype.float16, Dtype.float64], args=[ { "ins": ['param', 'param_grad'], @@ -4099,13 +4118,15 @@ name=['flip'], interface=['torch'], para=dict( - dims=[(1,), (-2, -1), (0, 1)], + dims=[(1,), (-2, -1), (0, 1), (0, -1, 2)], ), tensor_para=dict( args=[ { - "shape": ((49, 49), (12, 13, 14), (12, 13, 14, 16)), - "dtype": [Dtype.float32], + "shape": ((49, 49), (12, 13, 14), (12, 13, 14, 16), (2, 3, 4, 10, 12)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.bool], "gen_fn": Genfunc.randn, }, ], @@ -4125,7 +4146,7 @@ "ins": ['input'], "requires_grad": [True], "shape": ((2, 3, 3), (2, 3, 3)), - "dtype": [Dtype.float32], + "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.sym_mat, }, ], @@ -4151,13 +4172,13 @@ "ins": ['input'], "requires_grad": [True], "shape": ((2, 2, 2), (3, 3), (7, 6, 5), (7, 2, 1)), - "dtype": [Dtype.float32], + "dtype": [Dtype.float32, Dtype.float64], }, { "ins": ['A'], "requires_grad": [True], "shape": ((2, 2, 2), (5, 3, 3), (7, 6, 6), (2, 2)), - "dtype": [Dtype.float32], + "dtype": [Dtype.float32, Dtype.float64], }, ], ), @@ -4190,9 +4211,9 @@ name=["normal"], no_output_ref=True, para=dict( - mean=[0, 0.1], - std=[1, 2], - size=[(32, 8), (32, 2, 3, 3)], + mean=[-1, -0.5, 0, 0.1, 2], + std=[0, 0.5, 1, 2.3, 3], + size=[(), (2,), (32, 8), (2, 2, 2, 16), (32, 2, 3, 3)], ), ), @@ -4200,15 +4221,15 @@ name=["normal"], no_output_ref=True, para=dict( - mean=[0, 0.5], + mean=[-1, -0.5, 0, 0.1, 2], ), tensor_para=dict( gen_fn=Genfunc.positive, args=[ { "ins": ['std'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "shape": ((), (16,), (8, 4), (256, 256, 3, 3), (256, 128, 1, 1)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] ), @@ -4218,15 +4239,15 @@ name=["normal"], no_output_ref=True, para=dict( - std=[0.1, 0.024056261216234408], + std=[0, 0.1, 0.054056261216234408, 2, 5], ), tensor_para=dict( gen_fn=Genfunc.randn, args=[ { "ins": ['mean'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "shape": ((), (16,), (8, 4), (256, 256, 3, 3), (256, 128, 1, 1)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] ), @@ -4240,13 +4261,15 @@ args=[ { "ins": ['mean'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "shape": ((8, 8, 16), (256, 256, 3, 3), (256, 128, 3, 1)), # (3, 4), (4,16,),will be removed in version 1.6 release + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, { "ins": ['std'], - "shape": ((256, 256, 3, 3), (256, 128, 1, 1)), - "dtype": [Dtype.float32, Dtype.float64], + "shape": ((8, 16), (256, 256, 3, 3), (256, 128, 1, 1)), # (12,), (2,4,4,2), will be removed in version 1.6 release + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.bool], "gen_fn": Genfunc.positive, }, ] From da6e0e587b6e410820bdd3edda74f7ba469fb2c3 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Thu, 6 Apr 2023 15:40:50 +0800 Subject: [PATCH 05/13] logical_and diff dtype --- python/conformance/diopi_configs.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index 0cd28fc..faea04b 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -707,6 +707,33 @@ ], ), ), + + 'pointwise_binary_diff_dtype': dict( + name=['logical_and', 'logical_or'], + interface=['torch'], + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((1024, ), (384, 128), + (128, 64, 3, 3), + (2, 32, 130, 130)), + "dtype":[Dtype.float64, Dtype.float32, Dtype.float16, + Dtype.int64, Dtype.int32, Dtype.int16, + Dtype.int8, Dtype.uint8, Dtype.bool], + }, + { + "ins": ['other'], + "shape": ((1024, ), (384, 128), + (1, ), (2, 32, 1, 1)), + "dtype":[Dtype.int32, Dtype.uint8, Dtype.bool, + Dtype.int64, Dtype.float64, Dtype.float32, + Dtype.int16, Dtype.float16, Dtype.int8], + }, + ], + ), + ), 'pointwise_binary_dtype_bool': dict( name=['add', 'mul', 'eq', 'ne', 'le', 'lt', 'gt', 'ge', From b9220f5b07fdee0b60aa8b8aace4c82d589c52c6 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Fri, 14 Apr 2023 10:12:07 +0800 Subject: [PATCH 06/13] log_zero --- python/conformance/diopi_configs.py | 56 ++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index 31bc904..2238b73 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -446,6 +446,25 @@ ], ), ), + + 'log_zero_input': dict( + name=['log', 'log2', 'log10'], + interface=['torch'], + dtype=[Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.uint8, Dtype.int8], + tensor_para=dict( + gen_fn=Genfunc.zeros, + args=[ + { + "ins": ['input'], + "shape": ((1, ), (1024,), (364800, 4), (2, 128, 3072), + (256, 128, 3, 3), + (2, 31, 512, 6, 40)), + }, + ], + ), + ), 'tanh': dict( name=['tanh'], @@ -707,6 +726,33 @@ ], ), ), + + 'pointwise_binary_diff_dtype': dict( + name=['logical_and', 'logical_or'], + interface=['torch'], + tensor_para=dict( + gen_fn=Genfunc.randn, + args=[ + { + "ins": ['input'], + "shape": ((1024, ), (384, 128), + (128, 64, 3, 3), + (2, 32, 130, 130)), + "dtype":[Dtype.float64, Dtype.float32, Dtype.float16, + Dtype.int64, Dtype.int32, Dtype.int16, + Dtype.int8, Dtype.uint8, Dtype.bool], + }, + { + "ins": ['other'], + "shape": ((1024, ), (384, 128), + (1, ), (2, 32, 1, 1)), + "dtype":[Dtype.int32, Dtype.uint8, Dtype.bool, + Dtype.int64, Dtype.float64, Dtype.float32, + Dtype.int16, Dtype.float16, Dtype.int8], + }, + ], + ), + ), 'pointwise_binary_dtype_bool': dict( name=['add', 'mul', 'eq', 'ne', 'le', 'lt', 'gt', 'ge', @@ -1195,7 +1241,6 @@ atol=1e-4, rtol=1e-5, tensor_para=dict( - dtype=[Dtype.float32, Dtype.float64], gen_fn=Genfunc.randn, args=[ { @@ -1203,15 +1248,24 @@ "shape": ((182, ), (384, 128), (1, 242991, 2), (2, 4, 100, 152)), + "dtype":[Dtype.float32, Dtype.float64, Dtype.float16, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.float32], }, { "ins": ['min'], "shape": ((182, ), (384, 1), None, (2, 4, 100, 152)), + "dtype":[Dtype.bool, Dtype.float32, Dtype.float16, + Dtype.int16, Dtype.int64, Dtype.int32, + Dtype.int8, Dtype.int64, Dtype.uint8], }, { "ins": ['max'], "shape": (None, (384, 128), (1, 1, 2), None), + "dtype":[Dtype.float32, Dtype.bool, Dtype.float16, + Dtype.uint8, Dtype.int32, Dtype.int64, + Dtype.int32, Dtype.int8, Dtype.int16], }, ], ), From 61be4887673b5325d4d27a55052acaef12d948fb Mon Sep 17 00:00:00 2001 From: liangshinan Date: Fri, 14 Apr 2023 10:13:49 +0800 Subject: [PATCH 07/13] log zero --- python/conformance/diopi_configs.py | 32 +++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index faea04b..2238b73 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -446,6 +446,25 @@ ], ), ), + + 'log_zero_input': dict( + name=['log', 'log2', 'log10'], + interface=['torch'], + dtype=[Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.uint8, Dtype.int8], + tensor_para=dict( + gen_fn=Genfunc.zeros, + args=[ + { + "ins": ['input'], + "shape": ((1, ), (1024,), (364800, 4), (2, 128, 3072), + (256, 128, 3, 3), + (2, 31, 512, 6, 40)), + }, + ], + ), + ), 'tanh': dict( name=['tanh'], @@ -1222,7 +1241,6 @@ atol=1e-4, rtol=1e-5, tensor_para=dict( - dtype=[Dtype.float32, Dtype.float64], gen_fn=Genfunc.randn, args=[ { @@ -1230,15 +1248,24 @@ "shape": ((182, ), (384, 128), (1, 242991, 2), (2, 4, 100, 152)), + "dtype":[Dtype.float32, Dtype.float64, Dtype.float16, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.float32], }, { "ins": ['min'], "shape": ((182, ), (384, 1), None, (2, 4, 100, 152)), + "dtype":[Dtype.bool, Dtype.float32, Dtype.float16, + Dtype.int16, Dtype.int64, Dtype.int32, + Dtype.int8, Dtype.int64, Dtype.uint8], }, { "ins": ['max'], "shape": (None, (384, 128), (1, 1, 2), None), + "dtype":[Dtype.float32, Dtype.bool, Dtype.float16, + Dtype.uint8, Dtype.int32, Dtype.int64, + Dtype.int32, Dtype.int8, Dtype.int16], }, ], ), @@ -1696,7 +1723,8 @@ { "ins": ['mask'], "shape": ((16,), (12, 13), (12, 13, 14), (12, 13, 14, 1), (1, 4)), - "dtype": [Dtype.bool], + "dtype": [Dtype.uint8, Dtype.bool, Dtype.uint8, Dtype.bool, + Dtype.uint8, Dtype.bool, Dtype.uint8, Dtype.bool, Dtype.bool], "gen_fn": Genfunc.mask }, { From a86862352c1dbf5a3aade97e9cc7cbef0bc5dc47 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Fri, 21 Apr 2023 10:17:07 +0800 Subject: [PATCH 08/13] cdist norm --- python/conformance/diopi_configs.py | 54 ++++++++++++++++++----------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index 4f09283..4d3c6d2 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -2822,27 +2822,27 @@ interface=['torch'], saved_args=dict(output=0), para=dict( - p=[2,2,2,2,2,2,2,2,2], - compute_mode=['use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', - 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', - 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist'] + p=[2,2,2,2,2,2,2,2,2,2,2,2], + compute_mode=['use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', + 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', + 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist'] ), tensor_para=dict( args=[ { "ins": ['x1'], "requires_grad": [True], - "shape": ((5, 4), (2, 256, 256), (5, 4, 256, 256), - (3, 5, 4), (2, 256, 256), (5, 4, 256, 256), - (5, 4), (2, 256, 256), (5, 4, 256, 256),), + "shape": ((5, 4), (2, 256, 256), (2, 16, 256), (5, 4, 256, 256), + (3, 5, 4), (2, 256, 256), (3,2, 16, 256), (5, 4, 26, 256), + (5, 4), (2, 256, 256), (2, 16, 256), (5, 4, 256, 256),), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, { "ins": ['x2'], - "shape": ((3, 4), (2, 16, 256), (2,5,4, 256, 256), - (3, 4), (2, 16, 256), (2,5,4, 256, 256), - (4, 3, 4), (2, 16, 256), (2,5,4, 256, 256),), + "shape": ((3, 4), (2, 16, 256), (2, 26, 256), (2,5,4, 256, 256), + (3, 4), (2, 16, 256), (2, 26, 256), (2,5,4, 256, 256), + (4, 3, 4), (2, 16, 256),(4,2, 26, 256), (2,5,4, 256, 256),), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, @@ -3454,6 +3454,30 @@ ], ), ), + + 'norm_p': dict( + name=['norm'], + interface=['torch'], + para=dict( + p=['fro', 0., 2, -1, None, + 0.231, -1.234, 'fro', 'fro', 'fro', + 'nuc', 'nuc', 'nuc', float('inf'), float('-inf'),], + dim=[None, None, None, [1, -1, 0], None, + 0, None, None, 0, [0, 1], + None, [0, 1], [-1, 1], None, [0,1,2,3]], + ), + tensor_para=dict( + args=[ + { + "shape": ((), (3,), (3,4), (3,4,5), (6,3,4,5), + (3,4,5,6), (3,4,5), (), (3,), (6,3,), + (6,3,), (3,4), (3,4,5), (), (6,3,4,5)), + "dtype": [Dtype.float32, Dtype.float64], + "gen_fn": Genfunc.randn, + }, + ], + ), + ), 'group_norm': dict( name=['group_norm'], @@ -4392,16 +4416,6 @@ std=[0, 0.5, 1, 2.3, 3], size=[(), (2,), (32, 8), (2, 2, 2, 16), (32, 2, 3, 3)], ), - tensor_para=dict( - gen_fn=Genfunc.randn, - args=[ - { - "ins": ['input'], - "shape": [(32, 8), (16, 64, 32)], - "dtype": [Dtype.float32, Dtype.float64], - }, - ] - ), ), 'normal_': dict( From 73b68f6d5592adc1b1e5562c7043d78cf7e61822 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Fri, 21 Apr 2023 14:46:15 +0800 Subject: [PATCH 09/13] sym_mat --- python/conformance/gen_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/conformance/gen_data.py b/python/conformance/gen_data.py index d224cb2..9e61ec1 100644 --- a/python/conformance/gen_data.py +++ b/python/conformance/gen_data.py @@ -281,7 +281,7 @@ def gen_tensor(arg: dict, cfg_dict: dict) -> np.ndarray: elif gen_fn == Genfunc.positive: value = np.abs(np.array(np.random.randn(*shape)).astype(dtype)) elif gen_fn == Genfunc.sym_mat: - axis = (0, 2, 1) if len(shape) == 3 else (0, 1) + axis = [i for i in range(len(shape)-2)] + [-1, -2] mat = np.random.randn(*shape).astype(dtype) value = mat @ mat.transpose(axis) else: From 1eddd2a8ac4ef6c7985bbe7660a6b88c949d8057 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Fri, 21 Apr 2023 14:46:25 +0800 Subject: [PATCH 10/13] cholesky_ex --- python/conformance/diopi_configs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index 4d3c6d2..752581f 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -425,7 +425,7 @@ ), 'pointwise_op_bool': dict( - name=['cos', 'erf', 'exp', 'sin', 'sqrt'], + name=['abs', 'cos', 'erf', 'exp', 'sin', 'sqrt'], interface=['torch'], dtype=[Dtype.bool], tensor_para=dict( @@ -1244,7 +1244,7 @@ { "ins": ['other'], "shape": ((128, 384), (5,), (128, 4, 32, 49), - (2, 1, 3136, 64), (2, 64, 784), (512, 1)), + (2, 3, 3136, 64), (2, 64, 784), (512, 1)), }, ], ), @@ -4338,15 +4338,15 @@ name=['cholesky_ex'], interface=['torch.linalg'], para=dict( - upper=[True, False], - check_errors=[True, False], + upper=[True, False, True, False], + check_errors=[True, False, True, False], ), tensor_para=dict( args=[ { "ins": ['input'], "requires_grad": [True], - "shape": ((2, 3, 3), (2, 3, 3)), + "shape": ((3,4), (2, 3, 3), (2, 3, 4), (6,3,4,5)), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.sym_mat, }, From cfb213aab1aace81edf40af9f0c5121f857b321d Mon Sep 17 00:00:00 2001 From: liangshinan Date: Mon, 24 Apr 2023 09:53:05 +0800 Subject: [PATCH 11/13] baddbmm sliu --- python/conformance/diopi_configs.py | 51 ++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index 752581f..afec777 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -72,6 +72,45 @@ ] ), ), + + 'baddbmm_without_inplace': dict( + name=["baddbmm"], + interface=["torch"], + dtype=[Dtype.float32, Dtype.float16, Dtype.float64], + para=dict( + beta=[1, -0.34 ,0, + 2, 0, -1.33, + 1, 0.5, 0.1], + alpha=[1, 1.33, 2, + 0, -2, 3.2, + 0.1, 0.2, -0.5], + ), + tensor_para=dict( + args=[ + { + "ins": ["input"], + "shape": ((32, 64, 16), (32, 64, 32), (168, 52, 64), + (16,), (64, 32), (1, 52, 64), + (32, 1, 16), (32, 64, 1), (64,)), + "gen_fn": Genfunc.randn, + }, + { + "ins": ["batch1"], + "shape": ((32, 64, 32), (32, 64, 8), (168, 52, 38), + (32, 64, 32), (32, 64, 8), (168, 52, 38), + (32, 64, 32), (32, 64, 8), (168, 52, 38),), + "gen_fn": Genfunc.randn, + }, + { + "ins": ["batch2"], + "shape": ((32, 32, 16), (32, 8, 32), (168, 38, 64), + (32, 32, 16), (32, 8, 32), (168, 38, 64), + (32, 32, 16), (32, 8, 32), (168, 38, 64)), + "gen_fn": Genfunc.randn, + }, + ] + ), + ), 'conv_2d': dict( name=["conv2d"], @@ -613,8 +652,8 @@ "ins": ['input'], "requires_grad": [True], "shape": ((182400,), (20267, 80), (8, 200, 304), - (32, 16, 1, 1), (16, 32, 130, 130)), - "dtype": [Dtype.float32, Dtype.float64], + (32, 16, 1, 1), (16, 32, 130, 130), ()), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, ], @@ -4502,9 +4541,11 @@ tensor_para=dict( args=[ { - "ins": ['tensor'], - "shape": ((8,), (16,), (32,)), - "dtype": [Dtype.float32, Dtype.float64, Dtype.int64], + "ins": ['tensors'], + "shape": (((8,),(8,),(8,)), ((16,),(8,),()), ((32,),(16,)), ((8,),)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, + Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.int8, Dtype.uint8, Dtype.bool], "gen_fn": Genfunc.randn, "gen_num_range": [1, 5], }, From 21636022a5dc5a1b2a2d3d756ebde94fd4666457 Mon Sep 17 00:00:00 2001 From: liangshinan Date: Mon, 24 Apr 2023 15:10:26 +0800 Subject: [PATCH 12/13] normal --- python/conformance/diopi_configs.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index cbcbb32..729ea06 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -4452,8 +4452,8 @@ no_output_ref=True, para=dict( mean=[-1, -0.5, 0, 0.1, 2], - std=[0, 0.5, 1, 2.3, 3], - size=[(), (2,), (32, 8), (2, 2, 2, 16), (32, 2, 3, 3)], + std=[0.1, 0.5, 1, 2.3, 3], + size=[(), (128,), (32, 8), (2, 2, 2, 16), (32, 2, 3, 3)], ), ), @@ -4461,16 +4461,16 @@ name=["normal_"], no_output_ref=True, para=dict( - mean=[0, 0.1], - std=[1, 2], + mean=[0, 2, 0.1, 0.5], + std=[0.5, 1, 2, 3.14], ), tensor_para=dict( gen_fn=Genfunc.randn, args=[ { "ins": ['input'], - "shape": [(32, 8), (16, 64, 32)], - "dtype": [Dtype.float32, Dtype.float64], + "shape": [(), (128,), (32, 8), (16, 64, 32)], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] ), @@ -4498,7 +4498,7 @@ name=["normal"], no_output_ref=True, para=dict( - std=[0, 0.1, 0.054056261216234408, 2, 5], + std=[0.5, 0.1, 0.054056261216234408, 2, 5], ), tensor_para=dict( gen_fn=Genfunc.randn, From 73dfce4368c541c28d4bed5de4dd27621091447e Mon Sep 17 00:00:00 2001 From: liangshinan Date: Tue, 25 Apr 2023 15:13:08 +0800 Subject: [PATCH 13/13] multinomial meshgrid normal --- python/conformance/conformance_test.py | 1 + python/conformance/diopi_configs.py | 171 ++++++++++++++++--------- 2 files changed, 110 insertions(+), 62 deletions(-) diff --git a/python/conformance/conformance_test.py b/python/conformance/conformance_test.py index 8a0d0b5..1b91db5 100644 --- a/python/conformance/conformance_test.py +++ b/python/conformance/conformance_test.py @@ -223,6 +223,7 @@ def test_multinomial(input, num_samples, replacement): assert has_duplicates is False, "failed to execute multinomial" out_numpy = out_numpy.flatten() assert len(out_numpy) % num_samples == 0, "failed to execute multinomial" + assert np.all(out_numpy < input.shape[-1]), "failed to execute multinomial" def config_to_format_string(data, indent=0): diff --git a/python/conformance/diopi_configs.py b/python/conformance/diopi_configs.py index 729ea06..ac24a04 100644 --- a/python/conformance/diopi_configs.py +++ b/python/conformance/diopi_configs.py @@ -72,13 +72,13 @@ ] ), ), - + 'baddbmm_without_inplace': dict( name=["baddbmm"], interface=["torch"], dtype=[Dtype.float32, Dtype.float16, Dtype.float64], para=dict( - beta=[1, -0.34 ,0, + beta=[1, -0.34, 0, 2, 0, -1.33, 1, 0.5, 0.1], alpha=[1, 1.33, 2, @@ -128,12 +128,14 @@ { "ins": ["input"], "requires_grad": [True], - "shape": ((2, 256, 200, 304), (2, 2048, 64, 64), (2, 2048, 1, 1), (2, 256, 200, 304)), + "shape": ((2, 256, 200, 304), (2, 2048, 64, 64), + (2, 2048, 1, 1), (2, 256, 200, 304)), }, { "ins": ["weight"], "requires_grad": [True], - "shape": ((12, 256, 1, 1), (2048, 1, 3, 3), (512, 2048, 1, 1), (12, 256, 1, 1)), + "shape": ((12, 256, 1, 1), (2048, 1, 3, 3), + (512, 2048, 1, 1), (12, 256, 1, 1)), }, { "ins": ["bias"], @@ -188,16 +190,34 @@ args=[ { "ins": ['input'], - "shape": ((2, 4096), (64, 28, 28), + "shape": ((), (1024,), (2, 4096), (64, 28, 28), (32, 64, 112, 112), (64, 3, 7, 28, 28)), "requires_grad": [True], - "dtype": [Dtype.float32, Dtype.float64], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, ], ), ), + # 生成小于-3和大于3的测例 + 'hardswish_domain': dict( + name=["hardswish"], + is_inplace=True, + tensor_para=dict( + args=[ + { + "ins": ['input'], + "shape": ((), (1024,), (2, 4096), (64, 28, 28), + (32, 64, 112, 112), (64, 3, 7, 28, 28)), + "requires_grad": [True], + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], + "gen_fn": dict(fn=Genfunc.randint, low=-6, high=6), + }, + ], + ), + ), + 'threshold': dict( name=["threshold"], is_inplace=True, @@ -449,7 +469,8 @@ 'pointwise_op_mask': dict( name=['logical_not', 'bitwise_not'], interface=['torch'], - dtype=[Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + dtype=[Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.uint8, Dtype.int8, Dtype.bool], tensor_para=dict( gen_fn=dict(fn=Genfunc.randint, low=0, high=2), args=[ @@ -532,11 +553,11 @@ ], ), ), - + 'log_zero_input': dict( name=['log', 'log2', 'log10'], interface=['torch'], - dtype=[Dtype.float16, Dtype.float32, Dtype.float64, + dtype=[Dtype.float16, Dtype.float32, Dtype.float64, Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8], tensor_para=dict( @@ -575,7 +596,8 @@ 'tanh_not_float': dict( name=['tanh'], interface=['torch'], - dtype=[Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool], + dtype=[Dtype.int16, Dtype.int32, Dtype.int64, + Dtype.uint8, Dtype.int8, Dtype.bool], tensor_para=dict( gen_fn=Genfunc.randn, args=[ @@ -811,7 +833,8 @@ 'lt', 'gt', 'ge', 'logical_and', 'logical_or'], interface=['torch'], is_inplace=True, - dtype=[Dtype.float64, Dtype.float32, Dtype.float16, Dtype.int64, Dtype.int32, Dtype.int16, Dtype.int8, Dtype.uint8], + dtype=[Dtype.float64, Dtype.float32, Dtype.float16, Dtype.int64, + Dtype.int32, Dtype.int16, Dtype.int8, Dtype.uint8], tensor_para=dict( gen_fn=Genfunc.randn, args=[ @@ -829,7 +852,7 @@ ], ), ), - + 'pointwise_binary_diff_dtype': dict( name=['logical_and', 'logical_or'], interface=['torch'], @@ -841,16 +864,16 @@ "shape": ((1024, ), (384, 128), (128, 64, 3, 3), (2, 32, 130, 130)), - "dtype":[Dtype.float64, Dtype.float32, Dtype.float16, - Dtype.int64, Dtype.int32, Dtype.int16, + "dtype":[Dtype.float64, Dtype.float32, Dtype.float16, + Dtype.int64, Dtype.int32, Dtype.int16, Dtype.int8, Dtype.uint8, Dtype.bool], }, { "ins": ['other'], "shape": ((1024, ), (384, 128), (1, ), (2, 32, 1, 1)), - "dtype":[Dtype.int32, Dtype.uint8, Dtype.bool, - Dtype.int64, Dtype.float64, Dtype.float32, + "dtype":[Dtype.int32, Dtype.uint8, Dtype.bool, + Dtype.int64, Dtype.float64, Dtype.float32, Dtype.int16, Dtype.float16, Dtype.int8], }, ], @@ -999,7 +1022,8 @@ 'div_dtype_int_and_bool': dict( name=['div'], interface=['torch'], - dtype=[Dtype.int8, Dtype.int16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.bool], + dtype=[Dtype.int8, Dtype.int16, Dtype.int32, + Dtype.int64, Dtype.uint8, Dtype.bool], tensor_para=dict( gen_fn=Genfunc.randn, args=[ @@ -1983,7 +2007,8 @@ para=dict( max_norm=[1.0, 5, 2.0, 10, 8], norm_type=[2.0, 3.0, 2.0, 2.0, float("inf")], - error_if_nonfinite=[True, False, False, True, True], # 1.7 not support + error_if_nonfinite=[True, False, False, + True, True], # 1.7 not support ), tensor_para=dict( args=[ @@ -2068,7 +2093,8 @@ atol=1e-4, rtol=1e-5, para=dict( - split_size_or_sections=[[1, 1, 1, 1], [15200, 3800, 950, 247, 70], 3], + split_size_or_sections=[[1, 1, 1, 1], + [15200, 3800, 950, 247, 70], 3], dim=[-1, 0, 1] ), tensor_para=dict( @@ -2092,7 +2118,8 @@ atol=1e-4, rtol=1e-5, para=dict( - split_size_or_sections=[[1, 1, 1, 1], [15200, 3800, 950, 247, 70], 3], + split_size_or_sections=[[1, 1, 1, 1], + [15200, 3800, 950, 247, 70], 3], dim=[-1, 0, 1] ), tensor_para=dict( @@ -2473,7 +2500,8 @@ interface=["CustomizedTest"], dtype=[Dtype.float32, Dtype.float64], para=dict( - index=(slice(0, 3, 1), slice(0, 3, 1), slice(0, 4, 2), slice(-3, -2, 1)), + index=(slice(0, 3, 1), slice(0, 3, 1), + slice(0, 4, 2), slice(-3, -2, 1)), dim=[0, 1, 2, 0], ), tensor_para=dict( @@ -2581,7 +2609,8 @@ interface=["torch"], is_inplace=True, para=dict( - value=[-100, 0.0, float("-inf"), -100, 0.0, float("-inf"), 23.4, 5, float("nan")], + value=[-100, 0.0, float("-inf"), -100, 0.0, + float("-inf"), 23.4, 5, float("nan")], ), tensor_para=dict( args=[ @@ -2855,13 +2884,13 @@ ], ), ), - + 'cdist_compute_mode': dict( name=['cdist'], interface=['torch'], saved_args=dict(output=0), para=dict( - p=[2,2,2,2,2,2,2,2,2,2,2,2], + p=[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], compute_mode=['use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'use_mm_for_euclid_dist_if_necessary', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist', 'donot_use_mm_for_euclid_dist'] @@ -2871,17 +2900,19 @@ { "ins": ['x1'], "requires_grad": [True], - "shape": ((5, 4), (2, 256, 256), (2, 16, 256), (5, 4, 256, 256), - (3, 5, 4), (2, 256, 256), (3,2, 16, 256), (5, 4, 26, 256), + "shape": ((5, 4), (2, 256, 256), (2, 16, 256), (5, 4, 256, 256), + (3, 5, 4), (2, 256, 256), (3, + 2, 16, 256), (5, 4, 26, 256), (5, 4), (2, 256, 256), (2, 16, 256), (5, 4, 256, 256),), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, { "ins": ['x2'], - "shape": ((3, 4), (2, 16, 256), (2, 26, 256), (2,5,4, 256, 256), - (3, 4), (2, 16, 256), (2, 26, 256), (2,5,4, 256, 256), - (4, 3, 4), (2, 16, 256),(4,2, 26, 256), (2,5,4, 256, 256),), + "shape": ((3, 4), (2, 16, 256), (2, 26, 256), (2, 5, 4, 256, 256), + (3, 4), (2, 16, 256), (2, 26, + 256), (2, 5, 4, 256, 256), + (4, 3, 4), (2, 16, 256), (4, 2, 26, 256), (2, 5, 4, 256, 256),), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, @@ -3367,7 +3398,8 @@ name=['permute'], interface=['torch'], para=dict( - dims=[(0, 1, 3, 2, 4, 5), (2, 0, 1), (0, 2, 3, 1), (1, 0), (0, -2, -1), (0,), (0,)], + dims=[(0, 1, 3, 2, 4, 5), (2, 0, 1), (0, 2, 3, 1), + (1, 0), (0, -2, -1), (0,), (0,)], ), tensor_para=dict( args=[ @@ -3493,24 +3525,24 @@ ], ), ), - + 'norm_p': dict( name=['norm'], interface=['torch'], para=dict( p=['fro', 0., 2, -1, None, 0.231, -1.234, 'fro', 'fro', 'fro', - 'nuc', 'nuc', 'nuc', float('inf'), float('-inf'),], + 'nuc', 'nuc', 'nuc', float('inf'), float('-inf'), ], dim=[None, None, None, [1, -1, 0], None, - 0, None, None, 0, [0, 1], - None, [0, 1], [-1, 1], None, [0,1,2,3]], + 0, None, None, 0, [0, 1], + None, [0, 1], [-1, 1], None, [0, 1, 2, 3]], ), tensor_para=dict( args=[ { - "shape": ((), (3,), (3,4), (3,4,5), (6,3,4,5), - (3,4,5,6), (3,4,5), (), (3,), (6,3,), - (6,3,), (3,4), (3,4,5), (), (6,3,4,5)), + "shape": ((), (3,), (3, 4), (3, 4, 5), (6, 3, 4, 5), + (3, 4, 5, 6), (3, 4, 5), (), (3,), (6, 3,), + (6, 3,), (3, 4), (3, 4, 5), (), (6, 3, 4, 5)), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.randn, }, @@ -3681,7 +3713,7 @@ ], ), ), - + 'remainder_other_zero': dict( name=['remainder'], interface=['torch'], @@ -4017,7 +4049,7 @@ ] ), ), - + 'index_put_acc_bool_indices': dict( name=['index_put'], interface=['CustomizedTest'], @@ -4036,13 +4068,13 @@ }, { "ins": ['indices1'], - "shape": ((16, 4), (64, 4), (4,4)), + "shape": ((16, 4), (64, 4), (4, 4)), "dtype": [Dtype.bool], "gen_fn": Genfunc.ones, }, { "ins": ['values'], - "shape": ((64,4), (256, 14, 14), (16,)), + "shape": ((64, 4), (256, 14, 14), (16,)), "dtype": [Dtype.float32, Dtype.float64, Dtype.float16, Dtype.int32, Dtype.int64, Dtype.uint8, Dtype.int8, Dtype.bool] }, @@ -4285,9 +4317,12 @@ name=["interpolate"], dtype=[Dtype.float32, Dtype.float64, Dtype.float16], para=dict( - mode=['nearest', 'bilinear', 'nearest', 'bicubic', 'trilinear', 'linear', 'nearest', 'nearest'], - size=[(50, 76), (25, 38), (4, 224, 224), (64, 64), (4, 224, 112), (64, ), None, 32], - scale_factor=[None, None, None, None, None, None, (3.0, 3.0), None], + mode=['nearest', 'bilinear', 'nearest', 'bicubic', + 'trilinear', 'linear', 'nearest', 'nearest'], + size=[(50, 76), (25, 38), (4, 224, 224), + (64, 64), (4, 224, 112), (64, ), None, 32], + scale_factor=[None, None, None, None, + None, None, (3.0, 3.0), None], align_corners=[None, False, None, True, True, False, None, None], # recompute_scale_factor=[False, False, False, False, False, False, True, False] @@ -4385,7 +4420,7 @@ { "ins": ['input'], "requires_grad": [True], - "shape": ((3,4), (2, 3, 3), (2, 3, 4), (6,3,4,5)), + "shape": ((3, 4), (2, 3, 3), (2, 3, 4), (6, 3, 4, 5)), "dtype": [Dtype.float32, Dtype.float64], "gen_fn": Genfunc.sym_mat, }, @@ -4451,9 +4486,10 @@ name=["normal"], no_output_ref=True, para=dict( - mean=[-1, -0.5, 0, 0.1, 2], - std=[0.1, 0.5, 1, 2.3, 3], - size=[(), (128,), (32, 8), (2, 2, 2, 16), (32, 2, 3, 3)], + mean=[-1, -0.5, 0, 0.1, 2, True, False], + std=[0.1, 0.5, 1, 2.3, 3, True, True], + size=[(), (128,), (32, 16), (32, 8), + (32, 8), (2, 2, 2, 16), (32, 2, 3, 3)], ), ), @@ -4461,15 +4497,16 @@ name=["normal_"], no_output_ref=True, para=dict( - mean=[0, 2, 0.1, 0.5], - std=[0.5, 1, 2, 3.14], + mean=[0, 2, 0.1, 0.5, True, False], + std=[0.5, 1, 2, 3.14, True, True], ), tensor_para=dict( gen_fn=Genfunc.randn, args=[ { "ins": ['input'], - "shape": [(), (128,), (32, 8), (16, 64, 32)], + "shape": [(), (128,), (32, 8), (32, 8), + (32, 8), (16, 64, 32)], "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] @@ -4487,7 +4524,8 @@ args=[ { "ins": ['std'], - "shape": ((), (16,), (8, 4), (256, 256, 3, 3), (256, 128, 1, 1)), + "shape": ((), (16,), (8, 4), + (256, 256, 3, 3), (256, 128, 1, 1)), "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ] @@ -4520,12 +4558,14 @@ args=[ { "ins": ['mean'], - "shape": ((8, 8, 16), (256, 256, 3, 3), (256, 128, 3, 1)), # (3, 4), (4,16,),will be removed in version 1.6 release + # (3, 4), (4,16,),will be removed in version 1.6 release + "shape": ((8, 8, 16), (256, 256, 3, 3), (256, 128, 3, 1)), "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, { "ins": ['std'], - "shape": ((8, 16), (256, 256, 3, 3), (256, 128, 1, 1)), # (12,), (2,4,4,2), will be removed in version 1.6 release + # (12,), (2,4,4,2), will be removed in version 1.6 release + "shape": ((8, 16), (256, 256, 3, 3), (256, 128, 1, 1)), "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, Dtype.int16, Dtype.int32, Dtype.int64, Dtype.int8, Dtype.uint8, Dtype.bool], @@ -4542,8 +4582,10 @@ args=[ { "ins": ['tensors'], - "shape": (((8,),(8,),(8,)), ((16,),(8,),()), ((32,),(16,)), ((8,),)), - "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, + "shape": (((8,), (8,), (8,)), + ((16,), (8,), ()), + ((32,), (16,)), ((8,),)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64, Dtype.int16, Dtype.int32, Dtype.int64, Dtype.int8, Dtype.uint8, Dtype.bool], "gen_fn": Genfunc.randn, @@ -4559,16 +4601,19 @@ interface=['torch'], no_output_ref=True, para=dict( - num_samples=[6, 60, 200, 128], - replacement=[True, True, False, False], + num_samples=[7, 8, 9, + 63, 257, 128], + replacement=[False, False, True, + True, True, True], ), tensor_para=dict( gen_fn=Genfunc.positive, args=[ { "ins": ['input'], - "shape": ((8, ), (16, 64,), (128, 256,), (256, 128,)), - "dtype": [Dtype.float32, Dtype.float64, Dtype.float64, Dtype.float64], + "shape": ((8, ), (8, ), (8, ), + (16, 64,), (128, 256,), (256, 128,)), + "dtype": [Dtype.float16, Dtype.float32, Dtype.float64], }, ], ), @@ -4583,12 +4628,14 @@ { "ins": ['input'], "shape": [(32, 64,), (128, 24, 32), (16, 8,), (24, 12,)], - "dtype": [Dtype.float32, Dtype.int64, Dtype.int8, Dtype.uint8], + "dtype": [Dtype.float32, Dtype.int64, + Dtype.int8, Dtype.uint8], }, { "ins": ['out'], "shape": [(32, 64,), (128, 24, 32), (16, 8,), (24, 12,)], - "dtype": [Dtype.int64, Dtype.float64, Dtype.bool, Dtype.float16], + "dtype": [Dtype.int64, Dtype.float64, + Dtype.bool, Dtype.float16], }, ] ),