Skip to content

Commit

Permalink
[AMD] Fix unhandled profile event in RoctracerProfiler (triton-lang#5252
Browse files Browse the repository at this point in the history
)

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#5077.
  • Loading branch information
AlexAUT authored Nov 26, 2024
1 parent 317e483 commit 68a08dd
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ std::shared_ptr<Metric>
convertActivityToMetric(const roctracer_record_t *activity) {
std::shared_ptr<Metric> metric;
switch (activity->kind) {
case kHipVdiCommandTask:
case kHipVdiCommandKernel: {
if (activity->begin_ns < activity->end_ns) {
metric = std::make_shared<KernelMetric>(
Expand Down Expand Up @@ -135,7 +136,7 @@ void processActivity(RoctracerProfiler::CorrIdToExternIdMap &corrIdToExternId,
const roctracer_record_t *record, bool isAPI,
bool isGraph) {
switch (record->kind) {
case 0x11F1: // Task - kernel enqueued by graph launch
case kHipVdiCommandTask:
case kHipVdiCommandKernel: {
processActivityKernel(corrIdToExternId, externId, dataSet, record, isAPI,
isGraph);
Expand Down Expand Up @@ -169,6 +170,7 @@ std::pair<bool, bool> matchKernelCbId(uint32_t cbId) {
case HIP_API_ID_hipModuleLaunchCooperativeKernel:
case HIP_API_ID_hipModuleLaunchCooperativeKernelMultiDevice:
case HIP_API_ID_hipGraphExecDestroy:
case HIP_API_ID_hipGraphInstantiateWithFlags:
case HIP_API_ID_hipGraphInstantiate: {
isRuntimeApi = true;
break;
Expand Down Expand Up @@ -300,6 +302,13 @@ void RoctracerProfiler::RoctracerProfilerPimpl::apiCallback(
pImpl->StreamToCaptureCount[Stream]++;
break;
}
case HIP_API_ID_hipGraphInstantiateWithFlags: {
hipGraph_t Graph = data->args.hipGraphInstantiateWithFlags.graph;
hipGraphExec_t GraphExec =
*(data->args.hipGraphInstantiateWithFlags.pGraphExec);
pImpl->GraphExecToGraph[GraphExec] = Graph;
break;
}
case HIP_API_ID_hipGraphInstantiate: {
hipGraph_t Graph = data->args.hipGraphInstantiate.graph;
hipGraphExec_t GraphExec = *(data->args.hipGraphInstantiate.pGraphExec);
Expand Down

0 comments on commit 68a08dd

Please sign in to comment.