示例#1
0
def run_case(*args, **kwargs):
    if len(sys.argv) >= 3:
        case_name = sys.argv[2]
        if len(args) < 2:
            return
        if not (isinstance(args[0], Iterable) and case_name in args[0]):
            if not (isinstance(args[1], Iterable) and case_name in args[1]):
                return
    boot.run(*args, **kwargs)
示例#2
0
def test_softmax():
    boot.run("test_resnet50_softmax_001", "softmax_run",
             ((32, 10), "float16", -1, "softmax_16"), "dynamic")
    boot.run("test_resnet50_softmax_002", "softmax_run",
             ((32, 10), "float32", -1, "softmax_32"), "dynamic")
    boot.run("test_resnet50_softmax_003", "softmax_run",
             ((32, 1001), "float16", -1, "softmax_16"), "dynamic")
    boot.run("test_resnet50_softmax_004", "softmax_run",
             ((32, 1001), "float32", -1, "softmax_32"), "dynamic")
示例#3
0
def test_bias_add():
    boot.run("test_resnet50_bias_add_000", "bias_add_run",
             ([32, 10], "DefaultFormat", "float32"), "dynamic")
    boot.run("test_resnet50_bias_add_001", "bias_add_run",
             ([32, 1001], "DefaultFormat", "float32"), "dynamic")
    boot.run("test_resnet50_bias_add_002", "bias_add_run",
             ([32, 10], "DefaultFormat", "float16"), "dynamic")
    boot.run("test_resnet50_bias_add_003", "bias_add_run",
             ([32, 1001], "DefaultFormat", "float16"), "dynamic")
示例#4
0
def test_four2five():
    boot.run("test_resnet50_four2five_000", "four2five_run",
             ([32, 3, 224, 224], "float32", "NCHW", "float16"), "dynamic")
    boot.run("test_resnet50_four2five_001", "four2five_run",
             ([32, 2048, 7, 7], "float32", "NCHW", "float16"), "dynamic")
    boot.run("test_resnet50_four2five_003", "four2five_run",
             ([32, 3, 224, 224], "float16", "NCHW", "float16"), "dynamic")
    boot.run("test_resnet50_four2five_004", "four2five_run",
             ([32, 2048, 7, 7], "float16", "NCHW", "float16"), "dynamic")
示例#5
0
def test_argmax():
    boot.run("test_resnet50_argmax_001", "argmax_run",
             ((32, 10), "float16", -1), "dynamic")
    boot.run("test_resnet50_argmax_002", "argmax_run",
             ((32, 10), "float32", -1), "dynamic")
    boot.run("test_resnet50_argmax_003", "argmax_run",
             ((32, 1001), "float16", -1), "dynamic")
    boot.run("test_resnet50_argmax_004", "argmax_run",
             ((32, 1001), "float32", -1), "dynamic")
示例#6
0
def test_reshape():
    boot.run("test_resnet50_reshape_000", reshape_run, [(32, 2048, 1, 1),
                                                        (32, 2048), "float32"],
             "dynamic")
    boot.run("test_resnet50_reshape_001", reshape_run,
             [(32, 2048), (32, 2048, 1, 1), "float32"], "dynamic")
    boot.run("test_resnet50_reshape_002", reshape_run, [(32, 2048, 1, 1),
                                                        (32, 2048), "float16"],
             "dynamic")
    boot.run("test_resnet50_reshape_003", reshape_run,
             [(32, 2048), (32, 2048, 1, 1), "float16"], "dynamic")
示例#7
0
def test_matmul():
    boot.run("test_resnet50_matmul_001", batchmatmul_execute,
             ((), 2048, 10, 32,
              (), "float32", True, False, "batchmatmul_output"), "dynamic")
    boot.run("test_resnet50_matmul_002", batchmatmul_execute,
             ((), 32, 2048, 10,
              (), "float32", False, False, "batchmatmul_output"), "dynamic")
    boot.run("test_resnet50_matmul_003", batchmatmul_execute,
             ((), 2048, 1001, 32,
              (), "float32", True, False, "batchmatmul_output"), "dynamic")
    boot.run("test_resnet50_matmul_004", batchmatmul_execute,
             ((), 32, 2048, 1001,
              (), "float32", False, False, "batchmatmul_output"), "dynamic")
示例#8
0
def test_equal_count():
    boot.run("test_resnet50_equal_count_001", "equal_count_run", (((32,), (32,)), "int32", "equal_count"), "dynamic")
示例#9
0
def test_relu():
    boot.run("test_resnet50_relu_000", "relu_run",
             ((32, 128, 7, 7, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_001", "relu_run",
             ((32, 16, 14, 14, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_002", "relu_run",
             ((32, 16, 56, 56, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_003", "relu_run",
             ((32, 32, 28, 28, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_004", "relu_run",
             ((32, 32, 7, 7, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_005", "relu_run",
             ((32, 4, 112, 112, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_006", "relu_run",
             ((32, 4, 56, 56, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_007", "relu_run",
             ((32, 64, 14, 14, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_008", "relu_run",
             ((32, 8, 28, 28, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_009", "relu_run",
             ((32, 8, 56, 56, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_010", "relu_run",
             ((32, 16, 28, 28, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_011", "relu_run",
             ((32, 32, 14, 14, 16), "float32", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_012", "relu_run",
             ((32, 128, 7, 7, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_013", "relu_run",
             ((32, 16, 14, 14, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_014", "relu_run",
             ((32, 16, 56, 56, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_015", "relu_run",
             ((32, 32, 28, 28, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_016", "relu_run",
             ((32, 32, 7, 7, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_017", "relu_run",
             ((32, 4, 112, 112, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_018", "relu_run",
             ((32, 4, 56, 56, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_019", "relu_run",
             ((32, 64, 14, 14, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_020", "relu_run",
             ((32, 8, 28, 28, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_021", "relu_run",
             ((32, 8, 56, 56, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_022", "relu_run",
             ((32, 16, 28, 28, 16), "float16", 1e-5), "dynamic")
    boot.run("test_resnet50_relu_023", "relu_run",
             ((32, 32, 14, 14, 16), "float16", 1e-5), "dynamic")
示例#10
0
def test_compile_too_long():
    boot.run("conv_backprop_filter_run_019", "conv_filter_ad_run",
             ((32, 128, 56, 56), (128, 128, 3, 3), (0, 1, 0, 1), (2, 2),
              (1, 1))),
    boot.run("conv_backprop_filter_run_010", "conv_backprop_filter_run",
             ((1, 3, 224, 224), (64, 3, 7, 7), (3, 3, 3, 3), (2, 2), (1, 1))),
示例#11
0
def test_cast():
    #boot.run("test_resnet50_cast_000", cast_run, ((64, 128, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_001", cast_run, ((32, 64, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_002", cast_run, ((16, 32, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_003", cast_run, ((4, 16, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_004", cast_run, ((49, 4, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_005", cast_run, ((32, 4, 112, 112, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_006", cast_run, ((32, 4, 56, 56, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_007", cast_run, ((32, 16, 56, 56, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_008", cast_run, ((36, 4, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_009", cast_run, ((4, 4, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_010", cast_run, ((32, 4, 56, 56, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_011", cast_run, ((16, 4, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_012", cast_run, ((32, 16, 56, 56, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_013", cast_run, ((32, 32, 28, 28, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_014", cast_run, ((8, 32, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_015", cast_run, ((72, 8, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_016", cast_run, ((16, 8, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_017", cast_run, ((32, 8, 56, 56, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_018", cast_run, ((32, 8, 56, 56, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_019", cast_run, ((32, 8, 28, 28, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_020", cast_run, ((32, 8, 28, 28, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_021", cast_run, ((32, 8, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_022", cast_run, ((32, 32, 28, 28, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_023", cast_run, ((32, 64, 14, 14, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_024", cast_run, ((16, 64, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_025", cast_run, ((144, 16, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_026", cast_run, ((32, 16, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_027", cast_run, ((32, 16, 28, 28, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_028", cast_run, ((32, 16, 28, 28, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_029", cast_run, ((32, 16, 14, 14, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_030", cast_run, ((32, 16, 14, 14, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_031", cast_run, ((64, 16, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_032", cast_run, ((32, 64, 14, 14, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_033", cast_run, ((32, 128, 7, 7, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_034", cast_run, ((32, 128, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_035", cast_run, ((288, 32, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_036", cast_run, ((64, 32, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_037", cast_run, ((32, 32, 14, 14, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_038", cast_run, ((32, 32, 14, 14, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_039", cast_run, ((32, 32, 7, 7, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_040", cast_run, ((32, 32, 7, 7, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_041", cast_run, ((128, 32, 16, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_042", cast_run, ((32, 128, 7, 7, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_043", cast_run, ((32, 4, 112, 112, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_044", cast_run, ((32, 128, 1, 1, 16), "float32", "float16"), "dynamic")
    #boot.run("test_resnet50_cast_045", cast_run, ((32, 2048, 1, 1), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_048", cast_run, ((64, 128, 16, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_049", cast_run, ((32, 64, 16, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_050", cast_run, ((16, 32, 16, 16), "float16", "float32"), "dynamic")
    #boot.run("test_resnet50_cast_051", cast_run, ((4, 16, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_052", cast_run,
             ((49, 4, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_053", cast_run,
             ((36, 4, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_054", cast_run,
             ((4, 4, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_055", cast_run,
             ((16, 4, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_056", cast_run,
             ((8, 32, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_057", cast_run,
             ((72, 8, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_058", cast_run,
             ((16, 8, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_059", cast_run,
             ((32, 8, 56, 56, 16), "float32", "float16"), "dynamic")
    boot.run("test_resnet50_cast_060", cast_run,
             ((32, 8, 56, 56, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_061", cast_run,
             ((32, 8, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_062", cast_run,
             ((16, 64, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_063", cast_run,
             ((144, 16, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_064", cast_run,
             ((32, 16, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_065", cast_run,
             ((32, 16, 28, 28, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_066", cast_run,
             ((32, 16, 28, 28, 16), "float32", "float16"), "dynamic")
    boot.run("test_resnet50_cast_067", cast_run,
             ((64, 16, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_068", cast_run,
             ((32, 128, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_069", cast_run,
             ((288, 32, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_070", cast_run,
             ((64, 32, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_071", cast_run,
             ((32, 32, 14, 14, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_072", cast_run,
             ((32, 32, 14, 14, 16), "float32", "float16"), "dynamic")
    boot.run("test_resnet50_cast_073", cast_run,
             ((128, 32, 16, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_074", cast_run,
             ((32, 2048, 1, 1), "float32", "float16"), "dynamic")
    boot.run("test_resnet50_cast_075", cast_run,
             ((32, 128, 1, 1, 16), "float16", "float32"), "dynamic")
    boot.run("test_resnet50_cast_080", cast_run,
             ((64, 128, 16, 16), "bool", "int32"), "dynamic")
示例#12
0
def test_sum():
    boot.run("001_sum", reduce_sum_run, ((1024, ), (0, ), False, "float32"),
             "dynamic")
    boot.run("001_sum", reduce_sum_run, ((32, 1024), (1, ), False, "float32"),
             "dynamic")
示例#13
0
def test_resnet_benchmark():
    boot.run("resnet50_maxpool_with_argmax_000", "maxpool_with_argmax_run",
             ((32, 4, 112, 112, 16), (3, 3), (2, 2), 'SAME', True, "float16")),
    boot.run(
        "resnet50_bn_split_005", "bn_split_run",
        ((32, 4, 112, 112, 16), "float32", 0.1, 1e-4, "resnet50_bn_split")),
    boot.run("resnet50_conv_bn1_026", "conv_bn1_run",
             ((32, 3, 224, 224), (64, 3, 7, 7), (2, 3, 2, 3), (2, 2),
              (1, 1), False)),
    boot.run("resnet50_four2five_003", "four2five_run",
             ([32, 3, 224, 224], "float16", "NCHW", "float16")),
    boot.run("resnet50_softmax_004", "softmax_run",
             ((32, 1001), "float32", -1, "softmax_32")),
    boot.run("resnet50_apply_momentum_002", "apply_momentum_run",
             ((128, 32, 16, 16), "float32", False)),
    boot.run("resnet50_mean_000", "mean_run",
             ((32, 128, 7, 7, 16), "float32", (2, 3), True, "cce_mean")),
示例#14
0
def test_maxpool():
    boot.run("resnet50_maxpool_fp16_c", "maxpool_with_argmax_run",
             ((32, 4, 112, 112, 16), (3, 3), (2, 2), (0, 1, 0, 1), True, "float16"), "dynamic")
示例#15
0
def test_bn():
    boot.run("test_resnet50_bn_5D_reference000", "fused_batch_norm_run",
             ((32, 128, 7, 7, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference001", "fused_batch_norm_run",
             ((32, 16, 14, 14, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference002", "fused_batch_norm_run",
             ((32, 16, 56, 56, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference003", "fused_batch_norm_run",
             ((32, 32, 28, 28, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference004", "fused_batch_norm_run",
             ((32, 32, 7, 7, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference005", "fused_batch_norm_run",
             ((32, 4, 112, 112, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference006", "fused_batch_norm_run",
             ((32, 4, 56, 56, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference007", "fused_batch_norm_run",
             ((32, 64, 14, 14, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference008", "fused_batch_norm_run",
             ((32, 8, 28, 28, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference01"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference009", "fused_batch_norm_run",
             ((32, 8, 56, 56, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference010"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference010", "fused_batch_norm_run",
             ((32, 16, 28, 28, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference011"),
             "dynamic")
    boot.run("test_resnet50_bn_5D_reference011", "fused_batch_norm_run",
             ((32, 32, 14, 14, 16), "float32", 0.1, 1e-4, False, "NC1HWC0", None, "resnet50_bn_5D_reference012"),
             "dynamic")
示例#16
0
def test_five2four():
    boot.run("test_resnet50_five2four_000", "five2four_run",
             ([32, 2048, 1, 1], "float16", "NCHW", "float16"), "dynamic")
    boot.run("test_resnet50_five2four_001", "five2four_run",
             ([32, 2048, 1, 1], "float32", "NCHW", "float16"), "dynamic")
示例#17
0
def test_bert_benchmark():
    boot.run("bert_batch_matmul_003_242", "batchmatmul_run",
             ((), 4096, 3072, 768,
              (3072, ), "float32", False, True, "batch_matmul_output")),
    boot.run("fused_layernorm_002_1280_1024", "fused_layernorm_run",
             ((1280, 1024), 1, -1, 'float16')),
    boot.run("logsoftmax_grad_002", "logsoftmax_grad_run",
             ((160, 30522), "float32", -1, "cce_logsoftmax_fp16")),
    boot.run("unsortedsegmentsum_002", "unsortedsegmentsum_run",
             ([1280, 1024], [1280], 8192, "float32")),
    boot.run("transpose_002", "transpose_run",
             ((8, 16, 128, 64), (0, 2, 1, 3), "float32")),
    boot.run("fused_layer_norm_grad_01", "fused_layer_norm_grad_run",
             ((8192, 1024), -1, -1, "float16")),
    boot.run("logsoftmax_002_fp32", "logsoftmax_run",
             ((160, 30522), "float32", -1, "cce_logsoftmax_fp32")),
    boot.run(
        "strided_slice_grad_002", "strided_slice_grad_run",
        ((128, 128, 768), [0, 0, 0], [128, 1, 768], [1, 1, 1], 0, 0, 0, 0, 0,
         (128, 1, 768), "int32"))