Skip to content

Commit d0153b2

Browse files
authored
[Proton] Fix proton intra kernel profiling buffer overflow warning (#8109)
Fixed the miscalculated event size that each warp captured for reporting the overflow warning.
1 parent 3d8b0be commit d0153b2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

third_party/proton/common/lib/TraceDataIO/CircularLayoutParser.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ void CircularLayoutParser::parseMetadata() {
5353
int maxCountPerUnit = bt.bufSize / getConfig().uidVec.size() / 8;
5454

5555
for (auto uid : getConfig().uidVec) {
56+
// Each event is 2 words (8 bytes) and countVec captures the number of words
57+
// of each warp captured during profiling
5658
auto count = countVec[uid];
59+
auto numEvent = count / 2;
5760

58-
if (count > maxCountPerUnit) {
61+
if (numEvent > maxCountPerUnit) {
5962
std::cerr << "Warning (cta" << bt.blockId << ", warp" << uid
60-
<< "): first " << count - maxCountPerUnit
63+
<< "): first " << numEvent - maxCountPerUnit
6164
<< " events are dropped due to insufficient buffer size ("
62-
<< maxCountPerUnit << "/" << count << ")" << std::endl;
65+
<< maxCountPerUnit << "/" << numEvent << ")" << std::endl;
6366
}
6467

6568
auto &trace = bt.traces.emplace_back();

0 commit comments

Comments
 (0)