Skip to content

Commit 68a08dd

Browse files
authored
[AMD] Fix unhandled profile event in RoctracerProfiler (#5252)
Fixes proton unit tests when upgrading to ROCm 6.2 by adding missing event handlers. Magic number is replaced with the corresponding enum value which was added by upgrading the HIP headers triton-lang/triton#5077.
1 parent 317e483 commit 68a08dd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

third_party/proton/csrc/lib/Profiler/RocTracer/RoctracerProfiler.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ std::shared_ptr<Metric>
7474
convertActivityToMetric(const roctracer_record_t *activity) {
7575
std::shared_ptr<Metric> metric;
7676
switch (activity->kind) {
77+
case kHipVdiCommandTask:
7778
case kHipVdiCommandKernel: {
7879
if (activity->begin_ns < activity->end_ns) {
7980
metric = std::make_shared<KernelMetric>(
@@ -135,7 +136,7 @@ void processActivity(RoctracerProfiler::CorrIdToExternIdMap &corrIdToExternId,
135136
const roctracer_record_t *record, bool isAPI,
136137
bool isGraph) {
137138
switch (record->kind) {
138-
case 0x11F1: // Task - kernel enqueued by graph launch
139+
case kHipVdiCommandTask:
139140
case kHipVdiCommandKernel: {
140141
processActivityKernel(corrIdToExternId, externId, dataSet, record, isAPI,
141142
isGraph);
@@ -169,6 +170,7 @@ std::pair<bool, bool> matchKernelCbId(uint32_t cbId) {
169170
case HIP_API_ID_hipModuleLaunchCooperativeKernel:
170171
case HIP_API_ID_hipModuleLaunchCooperativeKernelMultiDevice:
171172
case HIP_API_ID_hipGraphExecDestroy:
173+
case HIP_API_ID_hipGraphInstantiateWithFlags:
172174
case HIP_API_ID_hipGraphInstantiate: {
173175
isRuntimeApi = true;
174176
break;
@@ -300,6 +302,13 @@ void RoctracerProfiler::RoctracerProfilerPimpl::apiCallback(
300302
pImpl->StreamToCaptureCount[Stream]++;
301303
break;
302304
}
305+
case HIP_API_ID_hipGraphInstantiateWithFlags: {
306+
hipGraph_t Graph = data->args.hipGraphInstantiateWithFlags.graph;
307+
hipGraphExec_t GraphExec =
308+
*(data->args.hipGraphInstantiateWithFlags.pGraphExec);
309+
pImpl->GraphExecToGraph[GraphExec] = Graph;
310+
break;
311+
}
303312
case HIP_API_ID_hipGraphInstantiate: {
304313
hipGraph_t Graph = data->args.hipGraphInstantiate.graph;
305314
hipGraphExec_t GraphExec = *(data->args.hipGraphInstantiate.pGraphExec);

0 commit comments

Comments
 (0)