SWDEV-405575: Added gfx941 and gfx942

Change-Id: I45a49cd64a76d3ae32c209497c70fe27b5be212b


[ROCm/rocprofiler commit: e1285e3fd4]
This commit is contained in:
Giovanni LB
2023-06-13 15:26:06 -03:00
کامیت شده توسط Giovanni Baraldi
والد 62d3c0018c
کامیت a7e8182a21
11فایلهای تغییر یافته به همراه52 افزوده شده و 27 حذف شده
@@ -617,6 +617,9 @@
<metric name="TCC_EA0_WRREQ_DRAM" block="TCC" event="103" descr="Number of TCC/EA write requests (either 32-byte of 64-byte) destined for DRAM (MC)."></metric>
</gfx940>
<gfx941 base="gfx940"></gfx941>
<gfx942 base="gfx940"></gfx942>
<gfx9>
<metric name="GRBM_COUNT" block="GRBM" event="0" descr="Tie High - Count Number of Clocks"></metric>
<metric name="GRBM_GUI_ACTIVE" block="GRBM" event="2" descr="The GUI is Active"></metric>
@@ -386,6 +386,9 @@
<metric name="WRITE_REQ_32B" expr="TCC_EA0_WRREQ_64B_sum*2+(TCC_EA0_WRREQ_sum-TCC_EA0_WRREQ_64B_sum)" descr="The total number of 32-byte effective memory writes."></metric>
</gfx940>
<gfx941 base="gfx940"></gfx941>
<gfx942 base="gfx940"></gfx942>
<gfx10>
<metric name="GPUBusy" expr="100*GRBM_GUI_ACTIVE/GRBM_COUNT" descr="The percentage of time GPU was busy."></metric>
<metric name="Wavefronts" expr="SQ_WAVES" descr="Total wavefronts."></metric>
@@ -630,6 +630,9 @@
<metric name="TCC_EA0_WRREQ_DRAM" block=TCC event=103 descr="Number of TCC/EA write requests (either 32-byte of 64-byte) destined for DRAM (MC)."></metric>
</gfx940>
<gfx941 base="gfx940"></gfx941>
<gfx942 base="gfx940"></gfx942>
<gfx10>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
<metric name="GRBM_GUI_ACTIVE" block=GRBM event=2 descr="The GUI is Active"></metric>
@@ -733,3 +736,4 @@
<gfx1101 base="gfx11">
</gfx1101>
@@ -505,6 +505,8 @@
<gfx90a base="gfx90a_expr"></gfx90a>
#Mi300
<gfx940 base="gfx940_expr"></gfx940>
<gfx941 base="gfx940_expr"></gfx941>
<gfx942 base="gfx940_expr"></gfx942>
#Navi21
<gfx1030 base="gfx1030_expr"></gfx1030>
<gfx1031 base="gfx1031_expr"></gfx1031>
@@ -39,6 +39,7 @@ THE SOFTWARE.
#include "expr.h"
#include "xml.h"
#include <mutex>
#include <unordered_set>
#include "src/core/hardware/hsa_info.h"
namespace rocprofiler {
@@ -203,14 +204,17 @@ class MetricsDict {
xml_->AddConst("top.const.metric", "SE_NUM", agent_info->getShaderEngineCount());
ImportMetrics(agent_info, "const");
agent_name_ = agent_info->getName();
if (agent_name_.substr(0, 6) == "gfx940")
agent_name_ =
"gfx940"; // To correct the agent_name from "gfx940:forcestoresc1+" -> "gfx940"
if (std::string("gfx906") == agent_name_ || std::string("gfx908") == agent_name_ ||
std::string("gfx90a") == agent_name_ || std::string("gfx940") == agent_name_ ||
std::string("gfx1032") == agent_name_ || std::string("gfx1031") == agent_name_ ||
std::string("gfx1030") == agent_name_ || std::string("gfx1100") == agent_name_ ||
std::string("gfx1101") == agent_name_) {
if (agent_name_.find(':') != std::string::npos) // Remove compiler flags from the agent_name
agent_name_ = agent_name_.substr(0, agent_name_.find(':'));
std::unordered_set<std::string> supported_agent_names = {
"gfx906", "gfx908" "gfx90a", // Vega
"gfx940", "gfx941", "gfx942", // Mi300
"gfx1030", "gfx1031", "gfx1032", // Navi2x
"gfx1100", "gfx1101" // Navi3x
};
if (supported_agent_names.find(agent_name_) != supported_agent_names.end()) {
ImportMetrics(agent_info, agent_name_);
} else {
agent_name_ = agent_info->getGfxip();
@@ -85,13 +85,11 @@ AgentInfo::AgentInfo(const hsa_agent_t agent, ::CoreApiTable* table) : handle_(a
rocprofiler::fatal("hsa_agent_get_info for PCI info failed");
}
// TODO: (sauverma) use hsa_agent_get_info_fn(HSA_AMD_AGENT_INFO_NUM_XCC)
// to get xcc_num once hsa headers are updated from rocr/hsa
std::string gpu_name = std::string(name_).substr(0, 6);
if (gpu_name == "gfx940")
xcc_num_ = 6;
else
xcc_num_ = 1;
// TODO(saurabh, giovanni): Remove this in 5.7
if (table->hsa_agent_get_info_fn(agent,
static_cast<hsa_agent_info_t>(HSA_AMD_AGENT_INFO_NUM_XCC), &xcc_num_) != HSA_STATUS_SUCCESS) {
xcc_num_ = 1;
}
}
uint64_t AgentInfo::getIndex() const { return index_; }
@@ -193,7 +193,7 @@ static const kernel_descriptor_t* GetKernelCode(uint64_t kernel_object) {
static uint32_t arch_vgpr_count(Agent::AgentInfo& info, const kernel_descriptor_t& kernel_code) {
const std::string_view& name = info.getName();
std::string info_name(name.data(), name.size());
if (strcmp(name.data(), "gfx90a") == 0 || strcmp(name.data(), "gfx940") == 0)
if (strcmp(name.data(), "gfx90a") == 0 || strncmp(name.data(), "gfx94", 5) == 0)
return (AMD_HSA_BITS_GET(kernel_code.compute_pgm_rsrc3,
AMD_COMPUTE_PGM_RSRC_THREE_ACCUM_OFFSET) +
1) *
@@ -211,7 +211,7 @@ static uint32_t accum_vgpr_count(Agent::AgentInfo& info, const kernel_descriptor
const std::string_view& name = info.getName();
std::string info_name(name.data(), name.size());
if (strcmp(info_name.c_str(), "gfx908") == 0) return arch_vgpr_count(info, kernel_code);
if (strcmp(info_name.c_str(), "gfx90a") == 0 || strcmp(info_name.c_str(), "gfx940") == 0)
if (strcmp(info_name.c_str(), "gfx90a") == 0 || strncmp(info_name.c_str(), "gfx94", 5) == 0)
return (AMD_HSA_BITS_GET(kernel_code.compute_pgm_rsrc1,
AMD_COMPUTE_PGM_RSRC_ONE_GRANULATED_WORKITEM_VGPR_COUNT) +
1) *
@@ -33,6 +33,7 @@ THE SOFTWARE.
#include <list>
#include <map>
#include <vector>
#include <unordered_set>
#include "core/types.h"
#include "util/exception.h"
@@ -201,14 +202,17 @@ class MetricsDict {
xml_->AddConst("top.const.metric", "SE_NUM", agent_info->se_num);
ImportMetrics(agent_info, "const");
agent_name_ = agent_info->name;
if (agent_name_.substr(0, 6) == "gfx940")
agent_name_ =
"gfx940"; // To correct the agent_name from "gfx940:forcestoresc1+" -> "gfx940"
if (std::string("gfx906") == agent_name_ || std::string("gfx908") == agent_name_ ||
std::string("gfx90a") == agent_name_ || std::string("gfx940") == agent_name_ ||
std::string("gfx1032") == agent_name_ || std::string("gfx1031") == agent_name_ ||
std::string("gfx1030") == agent_name_ || std::string("gfx1100") == agent_name_ ||
std::string("gfx1101") == agent_name_) {
if (agent_name_.find(':') != std::string::npos) // Remove compiler flags from the agent_name
agent_name_ = agent_name_.substr(0, agent_name_.find(':'));
std::unordered_set<std::string> supported_agent_names = {
"gfx906", "gfx908" "gfx90a", // Vega
"gfx940", "gfx941", "gfx942", // Mi300
"gfx1030", "gfx1031", "gfx1032", // Navi2x
"gfx1100", "gfx1101" // Navi3x
};
if (supported_agent_names.find(agent_name_) != supported_agent_names.end()) {
ImportMetrics(agent_info, agent_name_);
} else {
agent_name_ = agent_info->gfxip;
@@ -631,6 +631,9 @@
<metric name="TCC_EA0_WRREQ_DRAM" block=TCC event=103 descr="Number of TCC/EA write requests (either 32-byte of 64-byte) destined for DRAM (MC)."></metric>
</gfx940>
<gfx941 base="gfx940"></gfx941>
<gfx942 base="gfx940"></gfx942>
<gfx10>
<metric name="GRBM_COUNT" block=GRBM event=0 descr="Tie High - Count Number of Clocks"></metric>
<metric name="GRBM_GUI_ACTIVE" block=GRBM event=2 descr="The GUI is Active"></metric>
@@ -739,3 +742,4 @@
<gfx1101 base="gfx11">
</gfx1101>
@@ -426,6 +426,8 @@
<gfx90a base="gfx90a_expr"></gfx90a>
#Mi300
<gfx940 base="gfx940_expr"></gfx940>
<gfx941 base="gfx940_expr"></gfx941>
<gfx942 base="gfx940_expr"></gfx942>
#Navi21
<gfx1030 base="gfx1030_expr"></gfx1030>
@@ -670,7 +670,7 @@ static const kernel_descriptor_t* GetKernelCode(uint64_t kernel_object) {
}
static uint32_t arch_vgpr_count(const AgentInfo &info, const kernel_descriptor_t &kernel_code) {
if (strcmp(info.name, "gfx90a") == 0 || strcmp(info.name, "gfx940") == 0)
if (strcmp(info.name, "gfx90a") == 0 || strncmp(info.name, "gfx94", 5) == 0)
return (AMD_HSA_BITS_GET(kernel_code.compute_pgm_rsrc3, AMD_COMPUTE_PGM_RSRC_THREE_ACCUM_OFFSET) + 1) * 4;
return (AMD_HSA_BITS_GET(kernel_code.compute_pgm_rsrc1, AMD_COMPUTE_PGM_RSRC_ONE_GRANULATED_WORKITEM_VGPR_COUNT) + 1)
@@ -680,7 +680,7 @@ static uint32_t arch_vgpr_count(const AgentInfo &info, const kernel_descriptor_t
static uint32_t accum_vgpr_count(const AgentInfo &info, const kernel_descriptor_t &kernel_code) {
if (strcmp(info.name, "gfx908") == 0)
return arch_vgpr_count(info, kernel_code);
if (strcmp(info.name, "gfx90a") == 0 || strcmp(info.name, "gfx940") == 0)
if (strcmp(info.name, "gfx90a") == 0 || strncmp(info.name, "gfx94", 5) == 0)
return (AMD_HSA_BITS_GET(kernel_code.compute_pgm_rsrc1,
AMD_COMPUTE_PGM_RSRC_ONE_GRANULATED_WORKITEM_VGPR_COUNT) + 1) * 8
- arch_vgpr_count(info, kernel_code);
@@ -737,6 +737,7 @@ void set_kernel_properties(const rocprofiler_callback_data_t* callback_data,
// Kernel disoatch callback
hsa_status_t dispatch_callback(const rocprofiler_callback_data_t* callback_data, void* user_data,
rocprofiler_group_t* group) {
// TODO: return success, make atomic flag
// Passed tool data
callbacks_data_t* tool_data = reinterpret_cast<callbacks_data_t*>(user_data);
// HSA status