From 09ac1cedc7099fc379b57b9c63c4a344a2f9fc7d Mon Sep 17 00:00:00 2001 From: rbrugaro Date: Mon, 19 Aug 2024 22:42:08 -0700 Subject: [PATCH] fix node_id value to account for rank_id starts at zero --- optimum/intel/utils/modeling_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optimum/intel/utils/modeling_utils.py b/optimum/intel/utils/modeling_utils.py index 487323b2a8..89d435a5a1 100644 --- a/optimum/intel/utils/modeling_utils.py +++ b/optimum/intel/utils/modeling_utils.py @@ -162,7 +162,7 @@ def bind_cores_for_best_perf(): nodes = numa.get_max_node() + 1 rank_per_node = math.ceil(world_size / nodes) num_cpus_per_nodes = int(psutil.cpu_count(logical=False) / nodes) - node_id = int(rank_id / rank_per_node) + node_id = int((rank_id+1) / rank_per_node) rank_offset_per_node = rank_id % rank_per_node if os.getenv("OMP_NUM_THREADS") is None: # set OMP_NUM_THREADS to num of physical cores per socket