Skip to content

Commit 6caa1ac

Browse files
authored
Fix benchmark accuracy mode (#1297)
1 parent 93094bd commit 6caa1ac

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

neural_compressor/experimental/benchmark.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ def __init__(self, conf_fname_or_obj=None):
100100
def __call__(self, mode='performance'):
101101
cfg = self.conf.usr_cfg
102102
assert cfg.evaluation is not None, 'benchmark evaluation filed should not be None...'
103-
# use first eval config in yaml if mode from __call__not same with yaml config
104-
if not mode in cfg.evaluation:
105-
mode = list(cfg.evaluation.keys())[0]
106103
assert sys.platform in ['linux', 'win32'], 'only support platform windows and linux...'
107104
set_all_env_var(deep_get(cfg, 'evaluation.{}.configs'.format(mode)))
108105
# disable multi-instance for accuracy mode

test/benchmark/test_benchmark.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_benchmark_without_yaml(self):
255255
os.system("python fake2.py --input_model={} 2>&1 | tee benchmark.log".format(self.graph_path))
256256
with open('benchmark.log', "r") as f:
257257
for line in f:
258-
accuracy = re.search(r"Accuracy is\s+(\d+(\.\d+)?)", line)
258+
accuracy = re.search(r"Throughput: (\d+(\.\d+)?)", line)
259259
self.assertIsNotNone(accuracy)
260260
os.system("rm *.log")
261261

0 commit comments

Comments
 (0)