Skip to content

Commit

Permalink
WIp
Browse files Browse the repository at this point in the history
  • Loading branch information
Binyang2014 committed Dec 7, 2024
1 parent dcda43b commit 8cb4269
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/executor/execution_plan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ std::vector<BufferType> ExecutionPlan::Impl::getConnectedBufferTypes(int rank) c
return std::vector<BufferType>(bufferTypes.begin(), bufferTypes.end());
}

size_t ExecutionPlan::Impl::getScratchBufferSize(int rank, size_t inputSize, size_t outputSize) const {
size_t ExecutionPlan::Impl::getScratchBufferSize(int rank, size_t inputSize) const {
size_t sizePerChunk = 0;
if (this->inputChunks.at(rank) != 0)
sizePerChunk = inputSize / this->inputChunks.at(rank);
Expand All @@ -187,7 +187,7 @@ size_t ExecutionPlan::Impl::getMaxScratchBufferSize(int rank) const {
else
throw mscclpp::Error("Input chunks must be greater than 0", mscclpp::ErrorCode::ExecutorError);

return this->getScratchBufferSize(rank, this->maxMessageSize, sizePerChunk * this->outputChunks.at(rank));
return this->getScratchBufferSize(rank, sizePerChunk * this->inputChunks.at(rank));
}

std::vector<Operation> ExecutionPlan::Impl::getOperations(int rank, int threadblock) const {
Expand Down
2 changes: 1 addition & 1 deletion src/executor/executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ struct Executor::Impl {
ExecutionContext context;
size_t maxScratchBufferSize = plan.impl_->getMaxScratchBufferSize(rank);
size_t scratchBufferSize =
std::min(plan.impl_->getScratchBufferSize(rank, sendMemRange, recvMemRange), maxScratchBufferSize);
std::min(plan.impl_->getScratchBufferSize(rank, sendMemRange), maxScratchBufferSize);
std::shared_ptr<char> scratchBuffer;
if (isNvlsSupported()) {
scratchBuffer = allocSharedPhysicalCuda<char>(scratchBufferSize);
Expand Down

0 comments on commit 8cb4269

Please sign in to comment.