MCPcopy Create free account
hub / github.com/MegEngine/MegCC / set_config_and_run

Function set_config_and_run

benchmark/python/example.py:74–107  ·  view source on GitHub ↗
(arch_str)

Source from the content-addressed store, hash-verified

72
73# set test config and run
74def set_config_and_run(arch_str):
75 for arch_desc in arch_str:
76 kernel_build_dir = kernel_build_dirs[arch_desc]
77 for model in all_models.models:
78 for framework in framework_str:
79 for log_level in [False, True]:
80 if framework == "megcc":
81 extension = "tiny"
82 model_path = "{}/{}.tiny".format(
83 kernel_build_dir, model.name)
84 model_ = ValidModel(model_path, model.name, extension)
85 output_dir_ = ValidOutputDir(
86 "{}/benchmark/output".format(megcc_path), "output")
87 benchmarker_list[arch_desc].set_config(
88 profile_kernel=log_level,
89 benchmark_framework=framework,
90 model=model_,
91 output_dir=output_dir_,
92 )
93 if arch_desc == "x86":
94 benchmarker_list[arch_desc].run_local()
95 elif (arch_desc == "riscv" or arch_desc == "armv7"
96 or arch_desc == "arm64"):
97 # run for different device may avoid the effection of device heat radiation
98 for ssh_device in ssh_device_info:
99 ssh_name = ssh_device["name"]
100 ssh_host = ssh_device["host"]
101 ssh_workdir = ssh_device["workdir"]
102 benchmarker_list[arch_desc].run_ssh_device(
103 ssh_name, ssh_host, ssh_workdir)
104 else:
105 print("unsupported arch type: {} in megcc".format(
106 arch_desc))
107 return
108
109
110def main():

Callers 1

mainFunction · 0.85

Calls 5

ValidModelClass · 0.90
ValidOutputDirClass · 0.90
set_configMethod · 0.80
run_localMethod · 0.80
run_ssh_deviceMethod · 0.80

Tested by

no test coverage detected