Skip to content

Commit

Permalink
Add 1ns buffer to Roctracer Events (#992)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #992

As reported in ROCm/roctracer#105, there is an issue where event starts and ends can "tie". This can cause a visual issue in the traces. Lets add a tiny buffer so the events are separate. At the single nanosecond level, the timings are inaccurate anyways so it doesn't really hurt to add this buffer in the meanwhile. Remove/wrap in ifdef once it is issue is resolved

Reviewed By: aaronenyeshi

Differential Revision: D63296093

fbshipit-source-id: 09e313e55bbee65f5e6a4974dc52b3e0df4d5922
  • Loading branch information
sraikund16 authored and facebook-github-bot committed Sep 25, 2024
1 parent 0a8763e commit 0aacc09
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libkineto/src/RoctracerActivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ struct GpuActivity : public RoctracerActivity<roctracerAsyncRow> {
void log(ActivityLogger& logger) const override;
const std::string metadataJson() const override;

// Add small buffer to fix visual error created by https://github.com/ROCm/roctracer/issues/105
// Once this is resolved we can use ifdef to handle having this buffer or not based on version
int64_t timestamp() const override {
return activity_.begin + 1;
}
int64_t duration() const override {
return activity_.end - (activity_.begin + 1);
}

private:
ActivityType type_;
};
Expand Down

0 comments on commit 0aacc09

Please sign in to comment.