fix the crash related to agent id in rocprofv3 (#631)

This commit is contained in:
ywang103-amd
2025-03-25 16:33:12 -04:00
committed by GitHub
orang tua a92bf96e56
melakukan 983f902fa0
+10 -1
Melihat File
@@ -57,7 +57,7 @@ def using_v1():
def using_v3():
return "ROCPROF" in os.environ.keys() and "rocprofv3" in os.environ["ROCPROF"]
return "ROCPROF" in os.environ.keys() and os.environ["ROCPROF"].endswith("rocprofv3")
def demarcate(function):
@@ -491,6 +491,15 @@ def v3_counter_csv_to_v2_csv(counter_file, agent_info_filepath, converted_csv_fi
values="Counter_Value",
).reset_index()
# NB: Agent_Id is int in older rocporfv3, now switched to string with prefix "Agent ". We need to make sure handle both cases.
console_debug(
"The type of Agent ID from counter csv file is {}".format(
result["Agent_Id"].dtype
)
)
if result["Agent_Id"].dtype == "object":
result["Agent_Id"] = result["Agent_Id"].str.extract("(\d+)").astype("int64")
# Grab the Wave_Front_Size column from agent info
result = result.merge(
pd_agent_info[["Node_Id", "Wave_Front_Size"]],