Skip to content

Commit 4b3793d

Browse files
authored
update pool sorting order (#1543)
1 parent 09a9c18 commit 4b3793d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

intel_extension_for_pytorch/cpu/launch/cpu_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def gen_pools_ondemand(
247247

248248
# Split the aggregated pool into individual pools
249249
self.pools_ondemand.clear()
250-
pool.sort(key=lambda x: (x.node, 1 - int(x.is_physical_core)))
250+
pool.sort(key=lambda x: (x.core, 1 - int(x.is_physical_core)))
251251
for i in range(ninstances):
252252
# Generate individual raw pool
253253
pool_local = CPUPool()

tests/cpu/test_launcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def test_core_affinity_with_skip_cross_node_cores_and_use_logical_core(self):
500500
'num_nodes_sum': 2,
501501
'num_cores': [14, 14, 14, 14, 14, 14, 14],
502502
'num_nodes': [1, 1, 1, 1, 1, 1, 1],
503-
'pools_cores': ['0-13', '14-27', '56-69', '70-83', '28-41', '42-55', '84-97'],
503+
'pools_cores': ['0-6,56-62', '7-13,63-69', '14-20,70-76', '21-27,77-83', '28-34,84-90', '35-41,91-97', '42-48,98-104'],
504504
'pools_nodes': ['0', '0', '0', '0', '1', '1', '1']}
505505
self.verify_affinity(cpuinfo.pools_ondemand, ground_truth)
506506

@@ -517,7 +517,7 @@ def test_core_affinity_with_skip_cross_node_cores_and_node_id_use_logical_core(s
517517
'num_nodes_sum': 2,
518518
'num_cores': [14, 14, 14],
519519
'num_nodes': [1, 1, 1],
520-
'pools_cores': ['14-27', '70-83', '28-41'],
520+
'pools_cores': ['14-20,70-76', '21-27,77-83', '28-34,84-90'],
521521
'pools_nodes': ['1', '1', '2']}
522522
self.verify_affinity(cpuinfo.pools_ondemand, ground_truth)
523523

0 commit comments

Comments
 (0)