Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing balanced-tree to tree #1351

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/device/all_reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ namespace {
#endif

{ // Reduce : max number of recv is 3, max number of send is 1 (binary tree + local)
Primitives<T, RedOp, FanAsymmetric<NCCL_MAX_DEV_ARITY, 1>, /*Direct=*/0, Proto, 0> prims
Primitives<T, RedOp, FanAsymmetric<NCCL_MAX_TREE_ARITY, 1>, /*Direct=*/0, Proto, 0> prims
(tid, nthreads, tree->down, &tree->up, args->sendbuff, args->recvbuff, args->redOpArg);

#if defined(ENABLE_NPKIT)
Expand Down Expand Up @@ -298,7 +298,7 @@ namespace {
}

{ // Broadcast : max number of recv is 1, max number of send is 3 (binary tree + local)
Primitives<T, RedOp, FanAsymmetric<1, NCCL_MAX_DEV_ARITY>, /*Direct=*/0, Proto, 0> prims
Primitives<T, RedOp, FanAsymmetric<1, NCCL_MAX_TREE_ARITY>, /*Direct=*/0, Proto, 0> prims
(tid, nthreads, &tree->up, tree->down, args->sendbuff, args->recvbuff, args->redOpArg);

#if defined(ENABLE_NPKIT)
Expand Down Expand Up @@ -417,7 +417,7 @@ namespace {

if (tree->up == -1) {
// Reduce and broadcast. Max number of recv is 2, max number of send is 2
Primitives<T, RedOp, FanSymmetric<NCCL_MAX_DEV_ARITY>, /*Direct=*/0, Proto, 0>
Primitives<T, RedOp, FanSymmetric<NCCL_MAX_TREE_ARITY>, /*Direct=*/0, Proto, 0>
prims(tid, nthreads, tree->down, tree->down, args->sendbuff, args->recvbuff, args->redOpArg);

#if defined(ENABLE_NPKIT)
Expand Down Expand Up @@ -457,7 +457,7 @@ namespace {
* into DirectRecv and DirectSend capabilities, this ctor would have both=0,
* but the ctor above for tree roots would be DirectRecv=0 DirectSend=1.
*/
Primitives<T, RedOp, FanAsymmetric<NCCL_MAX_DEV_ARITY, 1>, /*Direct=*/0, Proto, 0>
Primitives<T, RedOp, FanAsymmetric<NCCL_MAX_TREE_ARITY, 1>, /*Direct=*/0, Proto, 0>
prims(tid, nthreadsSplit, tree->down, &tree->up, args->sendbuff, args->recvbuff, args->redOpArg, 0*Proto::MaxGroupWidth);

#if defined(ENABLE_NPKIT)
Expand Down Expand Up @@ -499,7 +499,7 @@ namespace {
}
else {
// Broadcast down. Max number of recv is 1, max number of send is 3 (binary tree + local)
Primitives<T, RedOp, FanAsymmetric<1, NCCL_MAX_DEV_ARITY>, /*Direct=*/0, Proto, 0>
Primitives<T, RedOp, FanAsymmetric<1, NCCL_MAX_TREE_ARITY>, /*Direct=*/0, Proto, 0>
prims(tid-nthreadsSplit, nthreads-nthreadsSplit, &tree->up, tree->down, args->sendbuff, args->recvbuff,
args->redOpArg, 1*Proto::MaxGroupWidth);

Expand Down
5 changes: 3 additions & 2 deletions src/graph/rome_models.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,8 @@ ncclResult_t parseRome4P2H(struct ncclTopoSystem* system, struct ncclTopoGraph*

// Only support ring and tree graphs
if (graph->pattern != NCCL_TOPO_PATTERN_RING &&
graph->pattern != NCCL_TOPO_PATTERN_BALANCED_TREE)
graph->pattern != NCCL_TOPO_PATTERN_BALANCED_TREE &&
graph->pattern != NCCL_TOPO_PATTERN_TREE)
return ncclSuccess;

if (ngpus > 8) return ncclSuccess;
Expand Down Expand Up @@ -1657,7 +1658,7 @@ ncclResult_t parseRome4P2H(struct ncclTopoSystem* system, struct ncclTopoGraph*
}
}
break;
case NCCL_TOPO_PATTERN_BALANCED_TREE:
case NCCL_TOPO_PATTERN_BALANCED_TREE: case NCCL_TOPO_PATTERN_TREE:
if (romeTopoModels[i].treeBase != nullptr) {
NCCLCHECK(parseGraphLight(romeTopoModels[i].treeBase, system, graph, g));
if (graph->nChannels) return ncclSuccess;
Expand Down
2 changes: 1 addition & 1 deletion src/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ static ncclResult_t initTransportsRank(struct ncclComm* comm, struct ncclComm* p

memset(&treeGraph, 0, sizeof(struct ncclTopoGraph));
treeGraph.id = 1;
treeGraph.pattern = NCCL_TOPO_PATTERN_BALANCED_TREE;
treeGraph.pattern = NCCL_TOPO_PATTERN_TREE;
treeGraph.collNet = 0;
treeGraph.minChannels = comm->topo->nodes[NET].count != 0 ? 1 : ringGraph.nChannels;
treeGraph.maxChannels = ringGraph.nChannels;
Expand Down
Loading