Skip to content

Commit 36a827f

Browse files
committed
Fix windows multi-instance subprocess bug
Signed-off-by: spycsh <[email protected]>
1 parent 7fb76c4 commit 36a827f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

neural_compressor/experimental/benchmark.py

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

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

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

0 commit comments

Comments
 (0)