예제 #1
0
def main():
    boot.run(bg, vw, vh, vc, display.FPS)
    Level = menu.run(bg, bg_alpha)

    Action = True
    while True:  ### main game loop
        game = action(Level, Action)
        features.updateCraftsUnit(game.craft.units)  ### Update units

        Level = menu.run(bg, bg_alpha, Levels=True)
        Action = True

        ### Event loop block
        for event in pygame.event.get():
            kind = event.type

            if kind == QUIT:
                pygame.quit()
                sys.exit()

            if kind == KEYDOWN:
                key = event.key

        ### Blit updating
        pygame.display.update()
        FPSClock.tick(FPS)
예제 #2
0
파일: test_mean.py 프로젝트: wxyhv/akg
def test_mean():
    boot.run("test_resnet50_mean_000", "mean_run",
             ((32, 128, 7, 7, 16), "float32", (2, 3), True, "cce_mean"),
             "dynamic")
    boot.run("test_resnet50_mean_001", "mean_run",
             ((32, 128, 7, 7, 16), "float16", (2, 3), True, "cce_mean"),
             "dynamic")
예제 #3
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)
예제 #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_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")
예제 #7
0
파일: test_bias_add.py 프로젝트: wxyhv/akg
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")
예제 #8
0
파일: test_reshape.py 프로젝트: wxyhv/akg
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")
예제 #9
0
def collect_network_facts():
    from boot import run

    hostname = platform.node().split('.')[0]
    ipv4 = [
        line for line in run('cat /etc/hosts').out.strip().split('\n')
        if hostname in line
    ].pop()
    ipv4 = ipv4.rstrip('app').strip()

    return {'hostname': hostname, 'ipv4': ipv4}
예제 #10
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")
예제 #11
0
def main():
    boot.run(bg, vw, vh, vc, display.FPS)
    Level = menu.run(bg, bg_alpha)

    Action = TRUE
    while True:  ### main game loop
        action(Level, Action)
        Level = menu.run(bg, bg_alpha, Levels=TRUE)
        Action = TRUE

        ### Event loop block
        for event in pygame.event.get():
            kind = event.type

            if kind == QUIT:
                pygame.quit()
                sys.exit()

            if kind == KEYDOWN:
                key = event.key

        ### Blit updating
        pygame.display.update()
        FPSClock.tick(FPS)
예제 #12
0
import boot

# test case for op5
boot.run("op5_000", "cast_run", ((16, 128, 16, 16), "float32", "float16"))
boot.run("op5_001", "cast_run", ((16, 64, 16, 16), "float32", "float16"))
boot.run("op5_002", "cast_run", ((16, 32, 16, 16), "float32", "float16"))
boot.run("op5_003", "cast_run", ((16, 16, 16, 16), "float32", "float16"))
boot.run("op5_004", "cast_run", ((16, 4, 16, 16), "float32", "float16"))
boot.run("op5_005", "cast_run", ((16, 4, 112, 112, 16), "float16", "float32"))
boot.run("op5_006", "cast_run", ((16, 4, 56, 56, 16), "float32", "float16"))
boot.run("op5_007", "cast_run", ((16, 16, 56, 56, 16), "float16", "float32"))
boot.run("op5_008", "cast_run", ((16, 4, 16, 16), "float32", "float16"))
boot.run("op5_009", "cast_run", ((16, 4, 16, 16), "float32", "float16"))
예제 #13
0
import boot
boot.run("matmul_run_011", "matmul_run",
         ((512, 512), (512, 128), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[4, 2], [8, 4], [16, 16], [16, 16], [16, 4]])
boot.run("matmul_run_012", "matmul_run",
         ((512, 512), (512, 2048), 0, 'zN', 'zN', 'zN', False, False,
          'float16', None, 'float32', "matmul"),
         [[64, 64], [2, 2], [16, 16], [16, 16], [16, 1]])
boot.run("matmul_run_013", "matmul_run",
         ((1008, 2048), (2048, 2048), 0, 'zN', 'zN', 'zN', False, False,
          'float16', None, 'float32', "matmul"),
         [[32, 32], [7, 7], [16, 16], [16, 16], [2, 1]])
boot.run("matmul_run_014", "matmul_run",
         ((256, 256), (256, 1024), 0, 'zN', 'zN', 'zN', False, False,
          'float16', None, 'float32', "matmul"),
         [[16, 16], [8, 8], [16, 16], [16, 16], [1, 1]])
boot.run("matmul_run_015", "matmul_run",
         ((128, 512), (512, 512), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[8, 4], [4, 1], [16, 16], [16, 16], [32, 8]])
boot.run("matmul_run_016", "matmul_run",
         ((2048, 512), (512, 512), 0, 'zN', 'zN', 'zN', False, False,
          'float16', None, 'float32', "matmul"),
         [[4, 4], [4, 2], [16, 16], [16, 16], [32, 32]])
boot.run("matmul_run_017", "matmul_run",
         ((512, 128), (128, 128), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[4, 4], [8, 2], [16, 16], [16, 16], [8, 8]])
boot.run("matmul_run_018", "matmul_run",
         ((1008, 1008), (1008, 2048), 0, 'zN', 'zN', 'zN', False, False,
예제 #14
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")
예제 #15
0
파일: test_add.py 프로젝트: zhuyawen/akg
def test_add():
    boot.run(
        "test_resnet50_add_000", "add_run",
        ([32, 128, 7, 7, 16], [32, 128, 7, 7, 16], "float32", "cce_add_fp32"),
        "dynamic")
    boot.run("test_resnet50_add_001", "add_run",
             ([32, 16, 56, 56, 16], [32, 16, 56, 56, 16
                                     ], "float32", "cce_add_fp32"), "dynamic")
    boot.run("test_resnet50_add_002", "add_run",
             ([32, 32, 28, 28, 16], [32, 32, 28, 28, 16
                                     ], "float32", "cce_add_fp32"), "dynamic")
    boot.run("test_resnet50_add_003", "add_run",
             ([32, 64, 14, 14, 16], [32, 64, 14, 14, 16
                                     ], "float32", "cce_add_fp32"), "dynamic")
    boot.run(
        "test_resnet50_add_004", "add_run",
        ([32, 128, 7, 7, 16], [32, 128, 7, 7, 16], "float16", "cce_add_fp16"),
        "dynamic")
    boot.run("test_resnet50_add_005", "add_run",
             ([32, 16, 56, 56, 16], [32, 16, 56, 56, 16
                                     ], "float16", "cce_add_fp16"), "dynamic")
    boot.run("test_resnet50_add_006", "add_run",
             ([32, 32, 28, 28, 16], [32, 32, 28, 28, 16
                                     ], "float16", "cce_add_fp16"), "dynamic")
    boot.run("test_resnet50_add_007", "add_run",
             ([32, 64, 14, 14, 16], [32, 64, 14, 14, 16
                                     ], "float16", "cce_add_fp16"), "dynamic")
예제 #16
0
import boot

# test case for op4
boot.run("op4_000", "batchmatmul_run", ((), 16, 10, 2048, (10,), "float32", False, True, "output"))
boot.run("op4_001", "batchmatmul_run", ((), 2048, 10, 16, (), "float32", True, False, "output"))
boot.run("op4_002", "batchmatmul_run", ((), 16, 2048, 10, (), "float32", False, False, "output"))
boot.run("op4_003", "batchmatmul_run", ((), 2048, 1001, 16, (), "float32", True, False, "output"))
boot.run("op4_004", "batchmatmul_run", ((), 16, 2048, 1001, (), "float32", False, False, "output"))
boot.run("op4_005", "batchmatmul_run", ((), 16, 1001, 2048, (1001,), "float32", False, True, "output"))
boot.run("op4_006", "batchmatmul_run", ((), 16, 10, 2048, (10,), "float16", False, True, "output"))
boot.run("op4_007", "batchmatmul_run", ((), 16, 2048, 10, (), "float16", False, False, "output"))
boot.run("op4_008", "batchmatmul_run", ((), 2048, 1001, 16, (), "float16", True, False, "output"))
boot.run("op4_009", "batchmatmul_run", ((), 1001, 2048, 16, (), "float32", True, False, "output"))
예제 #17
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")
예제 #18
0
import boot

boot.run("op2_1", "matmul_run",
         ((256, 256), (256, 64), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[4, 4], [8, 8], [16, 16], [16, 16], [4, 1]])
boot.run("op2_2", "matmul_run",
         ((64, 576), (576, 576), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[3, 3], [2, 2], [16, 16], [16, 16], [6, 6]])
boot.run("op2_3", "matmul_run",
         ((128, 128), (128, 512), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[8, 4], [8, 4], [16, 16], [16, 16], [8, 2]])
boot.run("op2_4", "matmul_run",
         ((256, 64), (64, 64), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[2, 2], [8, 2], [16, 16], [16, 16], [4, 1]])
boot.run("op2_5", "matmul_run",
         ((512, 512), (512, 1024), 0, 'zN', 'zN', 'zN', False, False,
          'float16', None, 'float32', "matmul"),
         [[16, 16], [8, 8], [16, 16], [16, 16], [2, 1]])
boot.run("op2_6", "matmul_run",
         ((256, 512), (512, 512), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[8, 1], [8, 4], [16, 16], [16, 16], [32, 8]])
boot.run("op2_7", "matmul_run",
         ((512, 512), (512, 256), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[8, 8], [8, 2], [16, 16], [16, 16], [32, 16]])
boot.run("op2_8", "matmul_run",
예제 #19
0
파일: test_sum.py 프로젝트: zhuyawen/akg
def test_sum():
    boot.run("001_sum", "sum_run", ((1024, ), (0, ), False, "float32"),"dynamic")
    boot.run("001_sum", "sum_run", ((32, 1024 ), (1, ), False, "float32"),"dynamic")
    
예제 #20
0
import boot
# resnet shape
#boot.run("four2five_fp32_nhwc_001", "four2five_run", ([32, 224, 224, 4], "float32", 'NHWC', 'float16')),
boot.run("four2five_fp32_nhwc_001", "four2five_run",
         ([32, 224, 224, 3], "float32", 'NHWC', 'float16')),
boot.run("four2five_fp32_nhwc_001", "four2five_run",
         ([1001, 2048, 1, 1], "float32", 'NCHW', 'float16')),
boot.run("four2five_012_fp32", "four2five_run",
         ([32, 1001, 1, 1], "float32", 'NCHW', 'float16')),
boot.run("four2five_016", "four2five_run",
         ([1, 1024, 14, 14], "float16", 'NCHW', 'float16')),
boot.run("four2five_017", "four2five_run",
         ([1, 256, 14, 14], "float16", 'NCHW', 'float16')),
boot.run("four2five_018", "four2five_run",
         ([1, 512, 14, 14], "float16", 'NCHW', 'float16')),
boot.run("four2five_019", "four2five_run",
         ([1, 2048, 14, 14], "float16", 'NCHW', 'float16')),
boot.run("four2five_020", "four2five_run",
         ([32, 128, 14, 14], "float16", 'NCHW', 'float16'))
예제 #21
0
# This is the the test case of Table 1 and Figure 12.
import boot

boot.run("subgraph_1", "softmax_run",
         ((16, 16, 512, 512), "float16", -1, "softmax_fp16"))
예제 #22
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")
예제 #23
0
import boot
# test case for op7
boot.run("op7_001", "one_hot_run", ((128, ), 2, "int32", 1, 0, -1))
boot.run("op7_002", "one_hot_run", ((160, ), 21128, "int32", 1, 0, -1))
boot.run("op7_003", "one_hot_run", ((16, ), 2, "int32", 1, 0, -1))
boot.run("op7_004", "one_hot_run", ((20, ), 21128, "int32", 1, 0, -1))
boot.run("op7_005", "one_hot_run", ((2, ), 2, "int32", 1, 0, -1))
boot.run("op7_006", "one_hot_run", ((2560, ), 21128, "int32", 1, 0, -1))
boot.run("op7_007", "one_hot_run", ((1, ), 2, "int32", 1, 0, -1))
boot.run("op7_008", "one_hot_run", ((320, ), 21128, "int32", 1, 0, -1))
boot.run("op7_009", "one_hot_run", ((32, ), 2, "int32", 1, 0, -1))
boot.run("op7_010", "one_hot_run", ((40, ), 21128, "int32", 1, 0, -1))
예제 #24
0
import boot

# test case for op1
boot.run("op1_000", "conv_run", ((16, 2048, 7, 7), (512, 2048, 1, 1),
                                 (0, 0, 0, 0), (1, 1), (1, 1), False))
boot.run("op1_001", "conv_run", ((16, 256, 14, 14), (256, 256, 3, 3),
                                 (1, 1, 1, 1), (1, 1), (1, 1), False))
boot.run("op1_002", "conv_run", ((16, 256, 14, 14), (1024, 256, 1, 1),
                                 (0, 0, 0, 0), (1, 1), (1, 1), False))
boot.run("op1_003", "conv_run", ((16, 256, 56, 56), (512, 256, 1, 1),
                                 (0, 0, 0, 0), (2, 2), (1, 1), False))
boot.run("op1_004", "conv_run", ((16, 256, 56, 56), (64, 256, 1, 1),
                                 (0, 0, 0, 0), (1, 1), (1, 1), False))
boot.run("op1_005", "conv_run", ((16, 256, 56, 56), (128, 256, 1, 1),
                                 (0, 0, 0, 0), (2, 2), (1, 1), False))
boot.run("op1_006", "conv_run", ((16, 3, 224, 224), (64, 3, 7, 7),
                                 (2, 3, 2, 3), (2, 2), (1, 1), False))
boot.run("op1_007", "conv_run", ((16, 512, 28, 28), (256, 512, 1, 1),
                                 (0, 0, 0, 0), (2, 2), (1, 1), False))
boot.run("op1_008", "conv_run", ((16, 512, 28, 28), (1024, 512, 1, 1),
                                 (0, 0, 0, 0), (2, 2), (1, 1), False))
boot.run("op1_009", "conv_run", ((16, 512, 28, 28), (128, 512, 1, 1),
                                 (0, 0, 0, 0), (1, 1), (1, 1), False))
예제 #25
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")
예제 #26
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")),
예제 #27
0
import boot
# test case for op8
boot.run("op8_000", "add_run",
         ([16, 128, 7, 7, 16], [16, 128, 7, 7, 16], "float32", "add_fp32"))
boot.run("op8_001", "add_run",
         ([16, 16, 56, 56, 16], [16, 16, 56, 56, 16], "float32", "add_fp32"))
boot.run("op8_002", "add_run",
         ([16, 32, 28, 28, 16], [16, 32, 28, 28, 16], "float32", "add_fp32"))
boot.run("op8_003", "add_run",
         ([16, 64, 14, 14, 16], [16, 64, 14, 14, 16], "float32", "add_fp32"))
boot.run("op8_004", "add_run",
         ([16, 128, 7, 7, 16], [16, 128, 7, 7, 16], "float16", "add_fp16"))
boot.run("op8_005", "add_run",
         ([16, 16, 56, 56, 16], [16, 16, 56, 56, 16], "float16", "add_fp16"))
boot.run("op8_006", "add_run",
         ([16, 32, 28, 28, 16], [16, 32, 28, 28, 16], "float16", "add_fp16"))
boot.run("op8_007", "add_run",
         ([16, 64, 14, 14, 16], [16, 64, 14, 14, 16], "float16", "add_fp16"))
boot.run("op8_008", "add_run",
         ([16, 4, 56, 56, 16], [16, 4, 56, 56, 16], "float16", "add_fp16"))
boot.run("op8_009", "add_run",
         ([16, 4, 56, 56, 16], [16, 4, 56, 56, 16], "float32", "add_fp32"))
예제 #28
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))),
예제 #29
0
import boot

boot.run("matmul_run_031", "matmul_run",
         ((256, 256), (256, 64), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[4, 4], [8, 8], [16, 16], [16, 16], [4, 1]])
boot.run("matmul_run_032", "matmul_run",
         ((64, 576), (576, 576), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[3, 3], [2, 2], [16, 16], [16, 16], [6, 6]])
boot.run("matmul_run_033", "matmul_run",
         ((128, 128), (128, 512), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[8, 4], [8, 4], [16, 16], [16, 16], [8, 2]])
boot.run("matmul_run_034", "matmul_run",
         ((256, 64), (64, 64), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[2, 2], [8, 2], [16, 16], [16, 16], [4, 1]])
boot.run("matmul_run_035", "matmul_run",
         ((512, 512), (512, 1024), 0, 'zN', 'zN', 'zN', False, False,
          'float16', None, 'float32', "matmul"),
         [[16, 16], [8, 8], [16, 16], [16, 16], [2, 1]])
boot.run("matmul_run_036", "matmul_run",
         ((256, 512), (512, 512), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[8, 1], [8, 4], [16, 16], [16, 16], [32, 8]])
boot.run("matmul_run_037", "matmul_run",
         ((512, 512), (512, 256), 0, 'zN', 'zN', 'zN', False, False, 'float16',
          None, 'float32', "matmul"),
         [[8, 8], [8, 2], [16, 16], [16, 16], [32, 16]])
boot.run("matmul_run_038", "matmul_run",
예제 #30
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"))