From 0b53f791965d38b6ef505b841a331d922427190f Mon Sep 17 00:00:00 2001 From: pradeep-ramanna <91496361+pradeep-ramanna@users.noreply.github.com> Date: Fri, 1 Dec 2023 10:00:17 -0600 Subject: [PATCH] Fix GPU to NIC mapping for peertopeer (#994) --- src/graph/paths.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graph/paths.cc b/src/graph/paths.cc index acff580177..1011652c53 100644 --- a/src/graph/paths.cc +++ b/src/graph/paths.cc @@ -548,7 +548,7 @@ static bool rcclPathOverride(struct ncclTopoSystem* system, uint64_t distance) { for (i = 0; i < system->nodes[GPU].count; i++) { for (j = 0; j < system->nodes[NET].count; j++) { - if (system->nodes[NET].nodes[j].net.busId - system->nodes[GPU].nodes[i].id == distance) + if ((system->nodes[NET].nodes[j].net.busId - system->nodes[GPU].nodes[i].id == distance) || (system->nodes[GPU].nodes[i].id - system->nodes[NET].nodes[j].net.busId == distance)) break; } if (j >= system->nodes[NET].count) @@ -557,7 +557,7 @@ static bool rcclPathOverride(struct ncclTopoSystem* system, uint64_t distance) { if (i >= system->nodes[GPU].count) { for (i = 0; i < system->nodes[GPU].count; i++) { for (j = 0; j < system->nodes[NET].count; j++) { - if (system->nodes[NET].nodes[j].net.busId - system->nodes[GPU].nodes[i].id == distance) + if ((system->nodes[NET].nodes[j].net.busId - system->nodes[GPU].nodes[i].id == distance) || (system->nodes[GPU].nodes[i].id - system->nodes[NET].nodes[j].net.busId == distance)) system->nodes[GPU].nodes[i].paths[NET][j].type = PATH_PXB; } }