From 983f902fa0f11ff021cf57c784661358e7805f4f Mon Sep 17 00:00:00 2001 From: ywang103-amd Date: Tue, 25 Mar 2025 16:33:12 -0400 Subject: [PATCH] fix the crash related to agent id in rocprofv3 (#631) --- src/utils/utils.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/utils.py b/src/utils/utils.py index 7ccbf55e39..d89926a944 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -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"]],