This commit is contained in:
Binyang Li
2026-03-18 22:35:07 +00:00
parent a8edfb7cf9
commit 0ceef09eda
3 changed files with 4 additions and 4 deletions

View File

@@ -102,7 +102,6 @@ void NativeAlgorithm::reset(int32_t contextKey) {
} else {
contexts_.clear();
customKeyMap_.clear();
initialized_ = false;
}
}

View File

@@ -78,6 +78,8 @@ struct AllreduceNvlsPacketAdapter {
void AllreduceNvlsPacket::initialize(std::shared_ptr<Communicator> comm) {
int nSwitchChannels = 1;
this->nvlsConnections_ = setupNvlsConnections(comm, nvlsBufferSize_, nSwitchChannels);
this->switchChannels_ =
setupNvlsChannels(this->nvlsConnections_, this->scratchBuffer_, this->scratchBufferSize_, nSwitchChannels);
}
AlgorithmCtxKey AllreduceNvlsPacket::generateAllreduceContextKey(const void*, void*, size_t, DataType, bool) {
@@ -92,9 +94,7 @@ std::shared_ptr<void> AllreduceNvlsPacket::initAllreduceContext(std::shared_ptr<
ctx->nRanksPerNode = comm->bootstrap()->getNranksPerNode();
// setup channels
int nSwitchChannels = 1;
ctx->switchChannels =
setupNvlsChannels(this->nvlsConnections_, this->scratchBuffer_, this->scratchBufferSize_, nSwitchChannels);
ctx->switchChannels = this->switchChannels_;
ctx->switchChannelDeviceHandles = setupNvlsChannelDeviceHandles(ctx->switchChannels);
return ctx;
}

View File

@@ -34,6 +34,7 @@ class AllreduceNvlsPacket : public mscclpp::AlgorithmBuilder {
uintptr_t flagBuffer_;
size_t flagBufferSize_;
std::vector<std::shared_ptr<NvlsConnection>> nvlsConnections_;
std::vector<SwitchChannel> switchChannels_;
};
} // namespace collective
} // namespace mscclpp