Skip to content

Commit

Permalink
Merge b154647 into 1af13ae
Browse files Browse the repository at this point in the history
  • Loading branch information
min-jean-cho committed Apr 17, 2023
2 parents 1af13ae + b154647 commit 0debd09
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions benchmarks/auto_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ def report_cmd(self, cmd):

self.bm_config["report_cmd"] = " ".join(cmd_options)

def enable_launcher_with_logical_core(self):
if self.bm_config["hardware"] == "cpu":
with open("./benchmarks/config.properties", "a") as f:
f.write("cpu_launcher_enable=true\n")
f.write("cpu_launcher_args=--use_logical_core\n")

def load_config(self):
report_cmd = None
for k, v in self.yaml_dict.items():
Expand All @@ -106,8 +100,6 @@ def load_config(self):
else "{}/cpu".format(MODEL_JSON_CONFIG_PATH)
)

self.enable_launcher_with_logical_core()

if self.skip_ts_install:
self.bm_config["version"] = get_torchserve_version()

Expand All @@ -133,6 +125,7 @@ def benchmark_env_setup(bm_config, skip_ts_install):
install_torchserve(skip_ts_install, bm_config["hardware"], bm_config["version"])
setup_benchmark_path(bm_config["model_config_path"])
build_model_json_config(bm_config["models"])
enable_launcher_with_logical_core(bm_config["hardware"])


def install_torchserve(skip_ts_install, hw, ts_version):
Expand Down Expand Up @@ -186,6 +179,13 @@ def build_model_json_config(models):
gen_model_config_json.convert_yaml_to_json(input_file, MODEL_JSON_CONFIG_PATH)


def enable_launcher_with_logical_core(hw):
if hw == "cpu":
with open("./benchmarks/config.properties", "a") as f:
f.write("cpu_launcher_enable=true\n")
f.write("cpu_launcher_args=--use_logical_core\n")


def run_benchmark(bm_config):
files = os.listdir(bm_config["model_config_path"])
files.sort()
Expand Down

0 comments on commit 0debd09

Please sign in to comment.