Skip to content

Commit cd83e12

Browse files
chaekitfacebook-github-bot
authored andcommitted
[kineto] Deprecate ClientTraceActivity and merge it with GenericTraceActivity (pytorch#56743)
Summary: Pull Request resolved: pytorch#56743 Pull Request resolved: pytorch/kineto#184 as part of the migration to ClientTraceActivity -> GenericTraceActivity, now that all CTA mirrors GTA's data structure, we can safely swap out the symbol name. Test Plan: - `buck build kineto` - sandcastle to catch any other breakage in depdendees Took before and after of `fastrnns` bench `buck run mode/opt //caffe2/benchmarks/fastrnns:bench -- --cnns resnet50 --group cnns --nloops 1000` Before https://fburl.com/perfdoctor/9n0izgji {F611729029} After https://fburl.com/perfdoctor/h9d9tlmp {F611725475} Sample ParamComms traces https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2F0%2F1619503816%2F127.0.0.1%2Flibkineto_activities_4003656.json.gz&bucket=gpu_traces https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2F0%2F1619503816%2F127.0.0.1%2Flibkineto_activities_4003657.json.gz&bucket=gpu_traces https://www.internalfb.com/intern/perfdoctor/trace_view?filepath=tree%2Ftraces%2Fdynocli%2F0%2F1619503816%2F127.0.0.1%2Flibkineto_activities_4003658.json.gz&bucket=gpu_traces Reviewed By: gdankel Differential Revision: D27353973 fbshipit-source-id: ad9eee27e840d41c4b2d78e12b10510e11232e97
1 parent 95f393f commit cd83e12

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

torch/csrc/autograd/profiler_kineto.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,16 @@ struct TORCH_API KinetoThreadLocalState : public ProfilerThreadLocalState {
5858
if (!ctx) {
5959
return;
6060
}
61+
#ifdef USE_KINETO_UPDATED
62+
libkineto::GenericTraceActivity op;
63+
op.activityType = libkineto::ActivityType::CPU_OP;
64+
op.activityName = std::string(fn.name().str());
65+
#else
6166
libkineto::ClientTraceActivity op;
67+
op.opType = std::string(fn.name().str());
68+
#endif
6269
op.startTime = ctx->startUs;
6370
op.endTime = getTimeUs();
64-
op.opType = std::string(fn.name().str());
6571
op.device = 0;
6672
op.correlation = ctx->correlationId;
6773
// optimization - postpone shapesToStr till finalizeCPUTrace
@@ -126,7 +132,7 @@ struct TORCH_API KinetoThreadLocalState : public ProfilerThreadLocalState {
126132
void addTraceEvents(libkineto::ActivityTraceInterface& trace) {
127133
const auto& events = *(trace.activities());
128134
for (const auto& ev_ptr : events) {
129-
// ClientTraceActivity events are already processed
135+
// CPU_OP events are already processed
130136
if (ev_ptr->type() != libkineto::ActivityType::CPU_OP) {
131137
kineto_events_.emplace_back();
132138
kineto_events_.back()

0 commit comments

Comments
 (0)