Skip to content

Commit

Permalink
Populate in/out split size info for all_to_all from CPU to CUDA kernel (
Browse files Browse the repository at this point in the history
#822)

Summary:
X-link: pytorch/pytorch#112308

Pull Request resolved: #822

This diff populates all_to_all input and out split size from CPU op to GPU kernel when valid.

bypass-github-pytorch-ci-checks

Reviewed By: aaronenyeshi, idning

Differential Revision: D50762093

fbshipit-source-id: a118b9e2623ca0ac6b5f9e30cd554666a4c01a12
  • Loading branch information
yoyoyocmu authored and facebook-github-bot committed Nov 7, 2023
1 parent 46ede25 commit 59506b7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions libkineto/src/output_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ static constexpr const char* kDtype = "dtype";
static constexpr const char* kInMsgSize = "In msg size";
static constexpr const char* kOutMsgSize = "Out msg size";
static constexpr const char* kGroupSize = "Group size";
static constexpr const char* kInSplit = "In split size";
static constexpr const char* kOutSplit = "Out split size";

#ifdef __linux__
static constexpr char kDefaultLogFileFmt[] =
Expand Down Expand Up @@ -329,6 +331,20 @@ void ChromeTraceLogger::handleActivity(
kDtype,
dtype));
}
// In/out split size are valid for all_to_all
const auto& inSplitSize = collectiveRecord->getMetadataValue(kInSplit);
const auto& outSplitSize = collectiveRecord->getMetadataValue(kOutSplit);
if (!inSplitSize.empty() && !outSplitSize.empty()) {
if (!arg_values.empty()) {
arg_values.append(",");
}
arg_values.append(fmt::format(
"\"{}\": {}, \"{}\": {}",
kInSplit,
inSplitSize,
kOutSplit,
outSplitSize));
}
}

std::string args = "";
Expand Down

0 comments on commit 59506b7

Please sign in to comment.