Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix core pinning enabling in cpu nightly benchmark #2237

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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