[CPU] fix all_reduce and all_gather (#6770)

Co-authored-by: blzheng <beilei.zheng@intel.com>
This commit is contained in:
Chunyuan WU
2025-07-03 13:39:45 +08:00
committed by GitHub
parent 36cc3ffdc7
commit 8f844db699
3 changed files with 33 additions and 4 deletions

View File

@@ -2612,3 +2612,12 @@ def get_cpu_ids_by_node():
# ['0,1,2,3', '4,5,6,7', '8,9,10,11', '12,13,14,15', '16,17,18,19', '20,21,22,23']
return cpu_ids
def is_shm_available(dtype, world_size, local_size):
return (
cpu_has_amx_support()
and dtype in [torch.bfloat16, torch.float]
and world_size >= 1
and world_size == local_size
)