Skip to content

Commit

Permalink
fix node_id value to account for rank_id starts at zero
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrugaro committed Aug 20, 2024
1 parent fa5526a commit 09ac1ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/intel/utils/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 09ac1ce

Please sign in to comment.