@@ -459,12 +459,9 @@ void CuptiActivityProfiler::processCpuTrace(
459
459
const std::unique_ptr<GenericTraceActivity>>::value,
460
460
" handleActivity is unsafe and relies on the caller to maintain not "
461
461
" only lifetime but also address stability." );
462
- if (act->type () == ActivityType::USER_ANNOTATION &&
463
- act->duration () <= 0 ) {
462
+ if (act->duration () <= 0 ) {
464
463
act->endTime = captureWindowEndTime_;
465
464
act->addMetadata (" finished" , " false" );
466
- } else {
467
- act->addMetadata (" finished" , " true" );
468
465
}
469
466
logger.handleActivity (*act);
470
467
}
@@ -581,8 +578,8 @@ inline static bool isBlockListedRuntimeCbid(CUpti_CallbackId cbid) {
581
578
if (cbid == CUPTI_RUNTIME_TRACE_CBID_cudaGetDevice_v3020 ||
582
579
cbid == CUPTI_RUNTIME_TRACE_CBID_cudaSetDevice_v3020 ||
583
580
cbid == CUPTI_RUNTIME_TRACE_CBID_cudaGetLastError_v3020 ||
584
- // Support cudaEventRecord and cudaEventSynchronize, revisit if others are
585
- // needed
581
+ // Support cudaEventRecord and cudaEventSynchronize, revisit if others
582
+ // are needed
586
583
cbid == CUPTI_RUNTIME_TRACE_CBID_cudaEventCreate_v3020 ||
587
584
cbid == CUPTI_RUNTIME_TRACE_CBID_cudaEventCreateWithFlags_v3020 ||
588
585
cbid == CUPTI_RUNTIME_TRACE_CBID_cudaEventDestroy_v3020) {
@@ -1339,20 +1336,21 @@ const time_point<system_clock> CuptiActivityProfiler::performRunLoopStep(
1339
1336
|| cupti_.stopCollection
1340
1337
#endif // HAS_CUPTI || HAS_ROCTRACER
1341
1338
) {
1342
- // Update runloop state first to prevent further updates to shared state
1339
+ // Update runloop state first to prevent further updates to shared
1340
+ // state
1343
1341
LOG (INFO) << " Tracing complete." ;
1344
1342
VLOG_IF (1 , currentIter >= 0 )
1345
1343
<< " This state change was invoked by application's step() call" ;
1346
1344
1347
1345
// currentIter >= 0 means this is called from the step() api of
1348
- // the profile in pytorch main thread, it should be executed in another
1349
- // thread in case pytorch main thread is blocked
1346
+ // the profile in pytorch main thread, it should be executed in
1347
+ // another thread in case pytorch main thread is blocked
1350
1348
if (currentIter >= 0 ) {
1351
1349
// if collectTraceThread_ is already running, there's no need to
1352
1350
// execute collectTrace twice.
1353
- // Do not call collectTrace when profilerThread_ is collecting Trace.
1354
- // Otherwise, libkineto::api().client()->stop will be called twice,
1355
- // which leads to an unrecoverable ::c10:Error at
1351
+ // Do not call collectTrace when profilerThread_ is collecting
1352
+ // Trace. Otherwise, libkineto::api().client()->stop will be called
1353
+ // twice, which leads to an unrecoverable ::c10:Error at
1356
1354
// disableProfiler
1357
1355
if (!collectTraceThread_ && !getCollectTraceState ()) {
1358
1356
std::lock_guard<std::recursive_mutex> guard (mutex_);
0 commit comments