Skip to content

Commit 583545b

Browse files
Spycshchensuyue
andauthored
Fix Windows multi-instance bug (#216)
Signed-off-by: spycsh <[email protected]> Co-authored-by: chensuyue <[email protected]>
1 parent 2483a84 commit 583545b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

examples/.config/model_params_onnxrt_win.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
"yaml": "resnet50_v1_5.yaml",
88
"strategy": "basic",
99
"batch_size": 100,
10-
"new_benchmark": false
10+
"new_benchmark": true
1111
},
1212
"bert_base_MRPC_static": {
13-
"model_src_dir": "language_translation/bert/quantization/ptq",
13+
"model_src_dir": "nlp/bert/quantization/ptq",
1414
"dataset_location": "glue_data/MRPC",
1515
"input_model": "models/onnx/bert.onnx",
1616
"yaml": "bert_static.yaml",
1717
"strategy": "basic",
1818
"batch_size": 8,
19-
"new_benchmark": false
19+
"new_benchmark": true
2020
},
2121
"mobilenet_v2": {
2222
"model_src_dir": "image_recognition/mobilenet_v2/quantization/ptq",
@@ -25,7 +25,7 @@
2525
"yaml": "mobilenet_v2.yaml",
2626
"strategy": "basic",
2727
"batch_size": 100,
28-
"new_benchmark": false
28+
"new_benchmark": true
2929
}
3030
}
3131
}

neural_compressor/experimental/benchmark.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ def config_instance(self):
225225
num_of_instance = int(os.environ.get('NUM_OF_INSTANCE'))
226226
cores_per_instance = int(os.environ.get('CORES_PER_INSTANCE'))
227227

228-
if(get_architecture() == 'aarch64' and int(get_threads_per_core()) > 1):
228+
if(sys.platform in ['linux'] and get_architecture() == 'aarch64' and int(get_threads_per_core()) > 1):
229229
raise OSError('Currently no support on AMD with hyperthreads')
230-
else:
230+
elif sys.platform in ['linux']:
231231
bounded_threads = get_bounded_threads(get_core_ids(), get_threads(), get_physical_ids())
232232

233233
for i in range(0, num_of_instance):
234-
if get_architecture() == 'x86_64':
234+
if sys.platform in ['linux'] and get_architecture() == 'x86_64':
235235
core_list_idx = np.arange(0, cores_per_instance) + i * cores_per_instance
236236
core_list = np.array(bounded_threads)[core_list_idx]
237237
else:

0 commit comments

Comments
 (0)