Skip to content

Commit 405d100

Browse files
authored
Merge branch 'main' into fix_windows
2 parents c162fa0 + 464bccf commit 405d100

File tree

6 files changed

+13
-64
lines changed

6 files changed

+13
-64
lines changed

.github/workflows/libkineto_ci.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

libkineto/src/CuptiActivityProfiler.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ void CuptiActivityProfiler::configure(
10011001
// presumably because structures are allocated and initialized, callbacks
10021002
// are activated etc. After a while the overhead decreases and stabilizes.
10031003
// It's therefore useful to perform some warmup before starting recording.
1004-
LOG(INFO) << "Enabling GPU tracing";
1004+
LOG(INFO) << "Enabling GPU tracing with max CUPTI buffer size " << config_->activitiesMaxGpuBufferSize() / 1024 / 1024 << "MB)";
10051005
cupti_.setMaxBufferSize(config_->activitiesMaxGpuBufferSize());
10061006
time_point<system_clock> timestamp;
10071007
if (VLOG_IS_ON(1)) {
@@ -1174,6 +1174,8 @@ const time_point<system_clock> CuptiActivityProfiler::performRunLoopStep(
11741174
std::lock_guard<std::mutex> guard(mutex_);
11751175
stopTraceInternal(now);
11761176
resetInternal();
1177+
LOG(ERROR) << "State: Warmup stopped by CUPTI. (Buffer size configured is " << config_->activitiesMaxGpuBufferSize() / 1024 / 1024 << "MB)";
1178+
UST_LOGGER_MARK_COMPLETED(kWarmUpStage);
11771179
VLOG(0) << "Warmup -> WaitForRequest";
11781180
break;
11791181
}
@@ -1222,7 +1224,10 @@ const time_point<system_clock> CuptiActivityProfiler::performRunLoopStep(
12221224
}
12231225

12241226
#if defined(HAS_CUPTI) || defined(HAS_ROCTRACER)
1225-
ecs_.cupti_stopped_early = cupti_.stopCollection;
1227+
if (cupti_.stopCollection) {
1228+
ecs_.cupti_stopped_early = cupti_.stopCollection;
1229+
LOG(ERROR) << "State: CollectTrace stopped by CUPTI. (Buffer size configured is " << config_->activitiesMaxGpuBufferSize() / 1024 / 1024 << "MB)";
1230+
}
12261231
#endif // HAS_CUPTI || HAS_ROCTRACER
12271232

12281233
std::lock_guard<std::mutex> guard(mutex_);

libkineto/src/RoctracerLogger.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "ThreadUtil.h"
1919
#include "Demangle.h"
2020

21+
using namespace libkineto;
2122
using namespace std::chrono;
2223

2324
class Flush

libkineto/src/RoctracerLogger.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ static timestamp_t timespec_to_ns(const timespec& time) {
6363
return ((timestamp_t)time.tv_sec * 1000000000) + time.tv_nsec;
6464
}
6565

66-
using namespace libkineto;
67-
6866
class ApiIdList {
6967
public:
7068
ApiIdList();

libkineto/src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void libkineto_init(bool cpuOnly, bool logOnError) {
225225
}
226226

227227
// The cuda driver calls this function if the CUDA_INJECTION64_PATH environment
228-
// variable is set
228+
// variable is set. Should be skipped if unset or CUDA_INJECTION64_PATH=none.
229229
int InitializeInjection(void) {
230230
LOG(INFO) << "Injection mode: Initializing libkineto";
231231
libkineto_init(false /*cpuOnly*/, true /*logOnError*/);

libkineto/src/output_json.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,10 @@ void ChromeTraceLogger::handleActivity(
335335
}
336336

337337
std::string arg_values = "";
338-
if (op.correlationId() != 0) {
339-
arg_values.append(fmt::format("\"External id\": {}",
340-
op.linkedActivity() ? op.linkedActivity()->correlationId() : op.correlationId()));
338+
if (op.linkedActivity() && op.linkedActivity()->correlationId() != 0) {
339+
arg_values.append(fmt::format("\"External id\": {}", op.linkedActivity()->correlationId()));
340+
} else if (op.correlationId() != 0) {
341+
arg_values.append(fmt::format("\"External id\": {}", op.correlationId()));
341342
}
342343
std::string op_metadata = op.metadataJson();
343344
sanitizeStrForJSON(op_metadata);

0 commit comments

Comments
 (0)