Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion hatchet/readers/caliper_native_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ def read_metrics(self, ctx="path"):
elif record["cupti.activity.kind"] == "memcpy":
node_label = record["cupti.activity.kind"]
node_callpath = tuple(record[ctx] + [node_label])
# rocm records
elif "rocm.activity" in record:
if record["rocm.activity"] == "KernelExecution":
node_label = record["rocm.kernel.name"]
node_callpath = tuple(record[ctx] + [node_label])
else:
node_label = record["rocm.activity"]
node_callpath = tuple(record[ctx] + [node_label])
# Sampling
elif "module#cali.sampler.pc" in record:
node_label = record["source.function#cali.sampler.pc"]
Expand Down Expand Up @@ -306,6 +314,22 @@ def _create_parent(child_node, parent_callpath):
node_type = "memcpy"
else:
Exception("Haven't seen this activity kind yet")
# rocm records
elif "rocm.activity" in record:
if record["rocm.activity"] == "KernelExecution":
node_label = record["rocm.kernel.name"]
node_callpath = tuple(record[ctx] + [node_label])
parent_callpath = node_callpath[:-1]
node_type = "kernel"
elif "hipMemcpy" in record["rocm.api"]:
node_label = record["rocm.activity"]
# Theres going to be an extra record at the end that we must remove
record[ctx].pop()
node_callpath = tuple(record[ctx] + [node_label])
parent_callpath = node_callpath[:-1]
node_type = "memcpy"
else:
Exception("Haven't seen this activity kind yet")
# Sampling
elif "module#cali.sampler.pc" in record:
node_label = record["source.function#cali.sampler.pc"]
Expand Down Expand Up @@ -453,7 +477,7 @@ def read(self):
# add missing intermediate nodes to the df_fixed_data dataframe
if "mpi.rank" in df_fixed_data.columns:
num_ranks = metrics["mpi.rank"].max() + 1
rank_list = range(0, num_ranks)
rank_list = range(0, int(num_ranks))

# create a standard dict to be used for filling all missing rows
default_metric_dict = {}
Expand Down