[ROCm/rocprofiler commit: fbc7de50f7]
Этот коммит содержится в:
Evgeny
2018-02-12 15:00:20 -06:00
родитель b9907b49ea
Коммит ef397b7d07
14 изменённых файлов: 253096 добавлений и 179 удалений
+2 -1
Просмотреть файл
@@ -314,11 +314,12 @@ typedef union {
// Profiling info data
typedef struct {
uint32_t agent_idx;
uint32_t agent_index; // GPU HSA agent index
rocprofiler_info_kind_t kind; // info data kind
union {
struct {
const char* name; // metric name
const char* expr; // metric expression, NULL for basic counters
const char* description; // metric description
} metric;
struct {
+4
Просмотреть файл
@@ -207,6 +207,10 @@ class Context {
const Metric* metric = metrics_->Get(name);
if (metric == NULL)
EXC_RAISING(HSA_STATUS_ERROR, "input metric '" << name << "' is not found");
#if 0
std::cout << " " << name << (metric->GetExpr() ? " = " + metric->GetExpr()->String() : " counter") << std::endl;
#endif
auto ret = metrics_map_.insert({name, metric});
if (!ret.second)
EXC_RAISING(HSA_STATUS_ERROR, "input metric '" << name
+13 -7
Просмотреть файл
@@ -146,15 +146,21 @@ class MetricsDict {
const_iterator_t Begin() const { return cache_.begin(); }
const_iterator_t End() const { return cache_.end(); }
xml::Xml::nodes_t GetNodes(const std::string& scope) const {
return xml_->GetNodes("top." + scope + ".metric");
}
private:
MetricsDict(const util::AgentInfo* agent_info) : xml_(NULL), agent_info_(agent_info) {
const char* xml_name = getenv("ROCP_METRICS");
if (xml_name != NULL) {
//std::cout << "ROCProfiler: importing '" << xml_name << "':" << std::endl;
xml_ = xml::Xml::Create(xml_name);
if (xml_ == NULL) EXC_RAISING(HSA_STATUS_ERROR, "metrics .xml open error '" << xml_name << "'");
xml_->AddConst("top.const.metric", "NUM_SIMDS", 64);
xml_->AddConst("top.const.metric", "NUM_SHADER_ENGINES", 4);
std::cout << "ROCProfiler: importing '" << xml_name << "':" << std::endl;
xml_->AddConst("top.const.metric", "MAX_WAVE_SIZE", agent_info->max_wave_size);
xml_->AddConst("top.const.metric", "CU_NUM", agent_info->cu_num);
xml_->AddConst("top.const.metric", "SIMD_NUM", agent_info->simds_per_cu * agent_info->cu_num);
xml_->AddConst("top.const.metric", "SE_NUM", agent_info->se_num);
ImportMetrics(agent_info, "const");
ImportMetrics(agent_info, agent_info->gfxip);
ImportMetrics(agent_info, "global");
@@ -178,11 +184,11 @@ class MetricsDict {
}
void ImportMetrics(const util::AgentInfo* agent_info, const std::string& scope) {
auto scope_list = xml_->GetNodes("top." + scope + ".metric");
if (!scope_list.empty()) {
std::cout << " " << scope_list.size() << " " << scope << " metrics found" << std::endl;
auto metrics_list = xml_->GetNodes("top." + scope + ".metric");
if (!metrics_list.empty()) {
//std::cout << " " << metrics_list.size() << " " << scope << " metrics found" << std::endl;
for (auto node : scope_list) {
for (auto node : metrics_list) {
const std::string name = node->opts["name"];
const std::string expr_str = node->opts["expr"];
std::string descr = node->opts["descr"];
+11 -11
Просмотреть файл
@@ -367,25 +367,25 @@ PUBLIC_API hsa_status_t rocprofiler_iterate_info(
}
while (hsa_rsrc->GetGpuAgentInfo(agent_idx, &agent_info)) {
info.agent_idx = agent_idx;
info.agent_index = agent_idx;
switch (kind) {
case ROCPROFILER_INFO_KIND_METRIC:
{
const rocprofiler::MetricsDict* dict = rocprofiler::GetMetrics(agent_info->dev_id);
rocprofiler::MetricsDict::const_iterator_t it = dict->Begin();
rocprofiler::MetricsDict::const_iterator_t end = dict->End();
while (it != end) {
const rocprofiler::Metric* metric = it->second;
std::string name = metric->GetName();
//std::string descr = metric->GetDescr();
const auto* expr = metric->GetExpr();
std::string description = "Performance metric " + name + " " + ((expr == NULL) ? "basic" : "= " + expr->String());
auto nodes_vec = dict->GetNodes(agent_info->gfxip);
auto global_vec = dict->GetNodes("global");
nodes_vec.insert(nodes_vec.end(), global_vec.begin(), global_vec.end());
for (auto* node : nodes_vec) {
const std::string& name = node->opts["name"];
const std::string& descr = node->opts["descr"];
const std::string& expr = node->opts["expr"];
info.metric.name = strdup(name.c_str());
info.metric.description = strdup(description.c_str());
info.metric.description = strdup(descr.c_str());
info.metric.expr = expr.empty() ? NULL : strdup(expr.c_str());
status = callback(info, data);
if (status != HSA_STATUS_SUCCESS) break;
++it;
}
break;
}
-2
Просмотреть файл
@@ -82,7 +82,6 @@ hsa_status_t HsaRsrcFactory::FindMemRegionsCallback(hsa_region_t region, void* d
// Constructor of the class
HsaRsrcFactory::HsaRsrcFactory() {
// Initialize the Hsa Runtime
printf("HSA init\n");
hsa_status_t status = hsa_init();
CHECK_STATUS("Error in hsa_init", status);
@@ -110,7 +109,6 @@ HsaRsrcFactory::~HsaRsrcFactory() {
for (auto p : cpu_list_) delete p;
for (auto p : gpu_list_) delete p;
printf("HSA shutdown\n");
hsa_status_t status = hsa_shut_down();
CHECK_STATUS("Error in hsa_shut_down", status);
}
+1 -1
Просмотреть файл
@@ -92,7 +92,7 @@ class Logger {
if (messaging) {
message_[GetTid()] = "";
} else if (streaming_) {
Put("\n");
//Put("\n");
}
messaging_ = messaging;
streaming_ = messaging;
+129 -26
Просмотреть файл
@@ -18,30 +18,66 @@ namespace xml {
class Xml {
public:
typedef std::vector<char> token_t;
struct level_t;
typedef std::vector<level_t*> nodes_t;
typedef std::map<std::string, std::string> opts_t;
struct level_t {
std::string tag;
std::vector<level_t*> nodes;
std::map<std::string, std::string> opts;
nodes_t nodes;
opts_t opts;
};
typedef std::vector<level_t*> nodes_vec_t;
typedef std::map<std::string, nodes_vec_t> map_t;
enum { DECL_STATE, BODY_STATE };
static Xml* Create(const char* file_name) {
Xml* xml = new Xml(file_name);
if (xml->fd_ == -1) {
delete xml;
xml = NULL;
static Xml* Create(const std::string& file_name, const Xml* obj = NULL) {
Xml* xml = new Xml(file_name.c_str(), obj);
if (xml != NULL) {
if (xml->Init() == false) {
delete xml;
xml = NULL;
} else {
const std::size_t pos = file_name.rfind('/');
const std::string path = (pos != std::string::npos) ? file_name.substr(0, pos + 1) : "";
xml->PreProcess();
nodes_t incl_nodes;
for (auto* node : xml->GetNodes("top.include")) {
if (node->opts.find("touch") == node->opts.end()) {
node->opts["touch"] = "";
incl_nodes.push_back(node);
}
}
for (auto* incl : incl_nodes) {
const std::string& incl_name = path + incl->opts["file"];
Xml *ixml = Create(incl_name, xml);
if (ixml == NULL) {
delete xml;
xml = NULL;
break;
} else {
delete(ixml);
}
}
if (xml) {
xml->Process();
}
}
}
return xml;
}
static void Destroy(Xml *xml) { delete xml; }
void AddExpr(const std::string& full_tag, const std::string& name, const std::string& expr) {
const std::size_t pos = full_tag.rfind('.');
const std::size_t pos1 = (pos == std::string::npos) ? 0 : pos + 1;
const std::string level_tag = full_tag.substr(pos1);
level_t* level = new level_t;
map_[full_tag].push_back(level);
(*map_)[full_tag].push_back(level);
level->tag = level_tag;
level->opts["name"] = name;
level->opts["expr"] = expr;
@@ -53,13 +89,11 @@ class Xml {
AddExpr(full_tag, name, oss.str());
}
static void Destroy(Xml *xml) { delete xml; }
std::vector<level_t*> GetNodes(std::string global_tag) { return map_[global_tag]; }
nodes_t GetNodes(std::string global_tag) { return (*map_)[global_tag]; }
void Print() const {
std::cout << "XML file '" << file_name_ << "':" << std::endl;
for (auto& elem : map_) {
for (auto& elem : *map_) {
for (auto node : elem.second) {
if (node->opts.size()) {
std::cout << elem.first << ":" << std::endl;
@@ -72,23 +106,91 @@ class Xml {
}
private:
Xml(const char* file_name)
: file_name_(file_name),
Xml(const char* file_name, const Xml* obj)
: file_name_(strdup(file_name)),
file_line_(0),
data_size_(0),
index_(0),
state_(BODY_STATE),
comment_(false),
included_(false),
level_(NULL),
comment_(false) {
AddLevel("top");
map_(NULL)
{
if (obj != NULL) {
map_ = obj->map_;
level_ = obj->level_;
included_ = true;
}
}
fd_ = open(file_name, O_RDONLY);
~Xml() {
if (included_ == false) delete map_;
}
bool Init() {
fd_ = open(file_name_, O_RDONLY);
if (fd_ == -1) {
perror("open XML file");
return;
perror((std::string("open XML file ") + file_name_).c_str());
return false;
}
if (map_ == NULL) {
map_ = new map_t;
if (map_ == NULL) return false;
AddLevel("top");
}
return true;
}
void PreProcess() {
uint32_t ind = 0;
const uint32_t buf_size = 128;
char buf[buf_size];
bool error = false;
while (1) {
const uint32_t pos = lseek(fd_, 0, SEEK_CUR);
uint32_t size = read(fd_, buf, buf_size);
if (size <= 0) break;
buf[size - 1] = '\0';
if (strncmp(buf, "#include \"", 10) == 0) {
for (ind = 0; (ind < size) && (buf[ind] != '\n'); ++ind);
if (ind == size) {
fprintf(stderr, "XML PreProcess failed, line size limit %d\n", (int)buf_size);
error = true;
break;
}
buf[ind] = '\0';
size = ind;
lseek(fd_, pos + ind + 1, SEEK_SET);
for (ind = 10; (ind < size) && (buf[ind] != '"'); ++ind);
if (ind == size) {
error = true;
break;
}
buf[ind] = '\0';
AddLevel("include");
AddOption("file", &buf[10]);
UpLevel();
}
}
if (error) {
fprintf(stderr, "XML PreProcess failed, line '%s'\n", buf);
exit(1);
}
lseek(fd_, 0, SEEK_SET);
}
void Process() {
token_t remainder;
while (1) {
token_t token = (remainder.size()) ? remainder : NextToken();
remainder.clear();
@@ -157,14 +259,12 @@ class Xml {
}
break;
default:
std::cout << "Wrong state: " << state_ << std::endl;
std::cout << "XML parser error: wrong state: " << state_ << std::endl;
exit(1);
}
}
}
~Xml() {}
bool SpaceCheck() const {
bool cond = ((buffer_[index_] == ' ') || (buffer_[index_] == ' '));
return cond;
@@ -261,7 +361,7 @@ class Xml {
global_tag += level->tag + ".";
}
global_tag += tag;
map_[global_tag].push_back(level_);
(*map_)[global_tag].push_back(level_);
}
void UpLevel() {
@@ -276,15 +376,18 @@ class Xml {
const char* file_name_;
unsigned file_line_;
int fd_;
static const unsigned buf_size_ = 256;
char buffer_[buf_size_];
unsigned data_size_;
unsigned index_;
unsigned state_;
level_t* level_;
std::vector<level_t*> stack_;
std::map<std::string, nodes_vec_t> map_;
bool comment_;
std::vector<level_t*> stack_;
bool included_;
level_t* level_;
map_t* map_;
};
} // namespace xml
+19 -6
Просмотреть файл
@@ -323,8 +323,14 @@ hsa_status_t dispatch_callback(const rocprofiler_callback_data_t* callback_data,
}
static hsa_status_t info_callback(const rocprofiler_info_data_t info, void * arg) {
printf(" gpu-agent%d.%s : %s\n", info.agent_idx, info.metric.name, info.metric.description);
return HSA_STATUS_SUCCESS;
const char symb = *reinterpret_cast<const char*>(arg);
if (((symb == 'b') && (info.metric.expr == NULL)) ||
((symb == 'd') && (info.metric.expr != NULL)))
{
printf("\n gpu-agent%d : %s : %s\n", info.agent_index, info.metric.name, info.metric.description);
if (info.metric.expr != NULL) printf(" %s = %s\n", info.metric.name, info.metric.expr);
}
return HSA_STATUS_SUCCESS;
}
// Tool constructor
@@ -342,9 +348,16 @@ CONSTRUCTOR_API void constructor()
parameters_dict["HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_TOKEN_MASK2"] =
HSA_VEN_AMD_AQLPROFILE_PARAMETER_NAME_TOKEN_MASK2;
if (getenv("ROCP_INFO") != NULL) {
rocprofiler_iterate_info(NULL, ROCPROFILER_INFO_KIND_METRIC, info_callback, NULL);
return;
char* info_symb = getenv("ROCP_INFO");
if (info_symb != NULL) {
if (*info_symb != 'b' && *info_symb != 'd') {
fprintf(stderr, "ROCProfiler: bad info symbol '%c', ROCP_INFO env", *info_symb);
} else {
if (*info_symb == 'b') printf("Basic HW counters:\n");
else printf("Derived metrics:\n");
rocprofiler_iterate_info(NULL, ROCPROFILER_INFO_KIND_METRIC, info_callback, info_symb);
}
exit(1);
}
// Set output file
@@ -381,7 +394,6 @@ CONSTRUCTOR_API void constructor()
fprintf(stderr, "Input file not found '%s'\n", xml_name);
exit(1);
}
xml->Print();
// Getting metrics
auto metrics_list = xml->GetNodes("top.metric");
@@ -455,6 +467,7 @@ CONSTRUCTOR_API void constructor()
printf(" )\n");
++index;
}
fflush(stdout);
// Adding dispatch observer
if (feature_count) {
Разница между файлами не показана из-за своего большого размера Загрузить разницу
Разница между файлами не показана из-за своего большого размера Загрузить разницу
Разница между файлами не показана из-за своего большого размера Загрузить разницу
Разница между файлами не показана из-за своего большого размера Загрузить разницу
+48 -125
Просмотреть файл
@@ -1,283 +1,206 @@
#include "gfx8_metrics.xml"
#include "gfx9_metrics.xml"
<gfx8>
<metric name=GRBM_COUNT block=GRBM event=0 ></metric>
<metric name=GRBM_GUI_ACTIVE block=GRBM event=2 ></metric>
<metric name=SQ_CYCLES block=SQ event=2 ></metric>
<metric name=SQ_WAVES block=SQ event=4 ></metric>
<metric name=SQ_ITEMS block=SQ event=14 ></metric>
<metric name=SQ_INSTS_VALU block=SQ event=26 ></metric>
<metric name=SQ_INSTS_VMEM_WR block=SQ event=27 ></metric>
<metric name=SQ_INSTS_VMEM_RD block=SQ event=28 ></metric>
<metric name=SQ_INSTS_SALU block=SQ event=30 ></metric>
<metric name=SQ_INSTS_SMEM block=SQ event=31 ></metric>
<metric name=SQ_INSTS_FLAT block=SQ event=32 ></metric>
<metric name=SQ_INSTS_FLAT_LDS_ONLY block=SQ event=33 ></metric>
<metric name=SQ_INSTS_LDS block=SQ event=34 ></metric>
<metric name=SQ_INSTS_GDS block=SQ event=35 ></metric>
<metric name=SQ_WAVE_READY block=SQ event=47 ></metric>
<metric name=SQ_WAIT_INST_LDS block=SQ event=61 descr="Number of wave-cycles spent waiting for LDS instruction issue. In units of 4 cycles. (per-simd, nondeterministic)"></metric>
<metric name=SQ_ACTIVE_INST_VALU block=SQ event=69 descr="Number of cycles the SQ instruction arbiter is working on a VALU instruction. (per-simd, nondeterministic)"></metric>
<metric name=SQ_INST_CYCLES_SALU block=SQ event=86 descr="Number of cycles needed to execute non-memory read scalar operations. (per-simd, emulated)"></metric>
<metric name=SQ_THREAD_CYCLES_VALU block=SQ event=89 descr="Number of thread-cycles used to execute VALU operations (similar to INST_CYCLES_VALU but multiplied by # of active threads). (per-simd)"></metric>
<metric name=SQ_THREAD_CYCLES_VALU_MAX block=SQ event=90 descr="Maximum number of thread-cycles VALU operations that could have been executed given the instruction mix (similar to INST_CYCLES_VALU but multiplied by # of active threads). (per-simd, emulated)"></metric>
<metric name=SQ_LDS_BANK_CONFLICT block=SQ event=97 descr="Number of cycles LDS is stalled by bank conflicts. (emulated)"></metric>
<metric name=TA_BUSY block=TA event=15 ></metric>
<metric name=TA_FLAT_READ_WAVEFRONTS block=TA event=101 ></metric>
<metric name=TA_FLAT_WRITE_WAVEFRONTS block=TA event=102 ></metric>
<metric name=TCC_CYCLE block=TCC event=1 ></metric>
<metric name=TCC_REQ block=TCC event=3 ></metric>
<metric name=TCC_HIT block=TCC event=18 ></metric>
<metric name=TCC_MISS block=TCC event=19 ></metric>
<metric name=TCC_WRITEBACK block=TCC event=22 ></metric>
<metric name=TCC_EA_WRREQ block=TCC event=26 ></metric>
<metric name=TCC_EA_WRREQ_64B block=TCC event=27 ></metric>
<metric name=TCC_EA_WRREQ_STALL block=TCC event=30 ></metric>
<metric name=TCC_MC_RDREQ block=TCC event=35 ></metric>
<metric name=TCP_TA_DATA_STALL_CYCLES block=TCP event=3 descr="TCP stalls TA data interface. Now Windowed."></metric>
<metric name=CPC_ALWAYS_COUNT block=CPC event=0 ></metric>
<metric name=CPC_ME1_STALL_WAIT_ON_RCIU_READ block=CPC event=8 ></metric>
# average for (16 instances x 4 shader engines)
<metric name="TA_BUSY_avr" expr=avr(TA_BUSY,16)/4 ></metric>
# average for 16 instances
<metric name="TA_BUSY_avr" expr=avr(TA_TA_BUSY,16) ></metric>
<metric name="TA_BUSY_max" expr=max(TA_TA_BUSY,16) ></metric>
<metric name="TA_BUSY_min" expr=min(TA_TA_BUSY,16) ></metric>
# sum for 16 instances
<metric name="TA_FLAT_READ_WAVEFRONTS_sum" expr=sum(TA_FLAT_READ_WAVEFRONTS,16) ></metric>
<metric name="TA_FLAT_WRITE_WAVEFRONTS_sum" expr=sum(TA_FLAT_WRITE_WAVEFRONTS,16) ></metric>
<metric name="TCC_HIT_sum" expr=sum(TCC_HIT,16) ></metric>
<metric name="TCC_MISS_sum" expr=sum(TCC_MISS,16) ></metric>
<metric name="TCC_MC_RDREQ_sum" expr=sum(TCC_MC_RDREQ,16) ></metric>
<metric name="TCC_MC_WRREQ_sum" expr=sum(TCC_MC_WRREQ,16) ></metric>
<metric name="TCC_WRREQ_STALL_max" expr=max(TCC_MC_WRREQ_STALL,16) ></metric>
# FETCH_SIZE, kilobytes
# The total kilobytes fetched from the video memory. This is measured with all extra fetches and any cache or memory effects taken into account.
<metric
name="FETCH_SIZE"
expr=(TCC_MC_RDREQ_sum*32)/1024
descr="The total kilobytes fetched from the video memory. This is measured with all extra fetches and any cache or memory effects taken into account."
></metric>
<metric name="FETCH_SIZE" expr=(TCC_MC_RDREQ_sum*32)/1024 ></metric>
# WRITE_SIZE
# The total kilobytes written to the video memory. This is measured with all extra fetches and any cache or memory effects taken into account.
<metric name="WRITE_SIZE" expr=(TCC_MC_WRREQ_sum*32)/1024 ></metric>
</gfx8>
<gfx9>
<metric name=GRBM_COUNT block=GRBM event=0 ></metric>
<metric name=GRBM_GUI_ACTIVE block=GRBM event=2 ></metric>
<metric name=SQ_CYCLES block=SQ event=2 ></metric>
<metric name=SQ_WAVES block=SQ event=4 ></metric>
<metric name=SQ_ITEMS block=SQ event=14 ></metric>
<metric name=SQ_INSTS_VALU block=SQ event=26 ></metric>
<metric name=SQ_INSTS_VMEM_WR block=SQ event=27 ></metric>
<metric name=SQ_INSTS_VMEM_RD block=SQ event=28 ></metric>
<metric name=SQ_INSTS_SALU block=SQ event=30 ></metric>
<metric name=SQ_INSTS_SMEM block=SQ event=31 ></metric>
<metric name=SQ_INSTS_FLAT block=SQ event=32 ></metric>
<metric name=SQ_INSTS_FLAT_LDS_ONLY block=SQ event=33 ></metric>
<metric name=SQ_INSTS_LDS block=SQ event=34 ></metric>
<metric name=SQ_INSTS_GDS block=SQ event=35 ></metric>
<metric name=SQ_WAVE_READY block=SQ event=47 ></metric>
<metric name=SQ_WAIT_INST_LDS block=SQ event=63 descr="Number of wave-cycles spent waiting for LDS instruction issue. In units of 4 cycles. (per-simd, nondeterministic)"></metric>
<metric name=SQ_ACTIVE_INST_VALU block=SQ event=71 descr="regspec 71? Number of cycles the SQ instruction arbiter is working on a VALU instruction. (per-simd, nondeterministic)"></metric>
<metric name=SQ_INST_CYCLES_SALU block=SQ event=84 descr="Number of cycles needed to execute non-memory read scalar operations. (per-simd, emulated)"></metric>
<metric name=SQ_THREAD_CYCLES_VALU block=SQ event=85 descr="Number of thread-cycles used to execute VALU operations (similar to INST_CYCLES_VALU but multiplied by # of active threads). (per-simd)"></metric>
<metric name=SQ_THREAD_CYCLES_VALU_MAX block=SQ event=86 descr="Maximum number of thread-cycles VALU operations that could have been executed given the instruction mix (similar to INST_CYCLES_VALU but multiplied by # of active threads). (per-simd, emulated)"></metric>
<metric name=SQ_LDS_BANK_CONFLICT block=SQ event=93 descr="Number of cycles LDS is stalled by bank conflicts. (emulated)"></metric>
<metric name=TA_BUSY block=TA event=15 ></metric>
<metric name=TA_FLAT_READ_WAVEFRONTS block=TA event=101 ></metric>
<metric name=TA_FLAT_WRITE_WAVEFRONTS block=TA event=102 ></metric>
<metric name=TCC_CYCLE block=TCC event=1 ></metric>
<metric name=TCC_REQ block=TCC event=3 ></metric>
<metric name=TCC_HIT block=TCC event=20 ></metric>
<metric name=TCC_MISS block=TCC event=22 ></metric>
<metric name=TCC_WRITEBACK block=TCC event=25 ></metric>
<metric name=TCC_EA_WRREQ block=TCC event=29 ></metric>
<metric name=TCC_EA_WRREQ_64B block=TCC event=30 ></metric>
<metric name=TCC_EA_WRREQ_STALL block=TCC event=33 ></metric>
<metric name=TCC_EA_RDREQ block=TCC event=41 ></metric>
<metric name=TCC_EA_RDREQ_32B block=TCC event=42 ></metric>
<metric name=TCP_TA_DATA_STALL_CYCLES block=TCP event=6 descr="TCP stalls TA data interface. Now Windowed."></metric>
<metric name=CPC_ALWAYS_COUNT block=CPC event=0 ></metric>
<metric name=CPC_ME1_STALL_WAIT_ON_RCIU_READ block=CPC event=8 ></metric>
# average for (16 instances x 4 shader engines)
<metric name="TA_BUSY_avr" expr=avr(TA_BUSY,16)/4 ></metric>
# average for 16 instances
<metric name="TA_BUSY_avr" expr=avr(TA_TA_BUSY,16) ></metric>
<metric name="TA_BUSY_max" expr=max(TA_TA_BUSY,16) ></metric>
<metric name="TA_BUSY_min" expr=min(TA_TA_BUSY,16) ></metric>
# sum for 16 instances
<metric name="TA_FLAT_READ_WAVEFRONTS_sum" expr=sum(TA_FLAT_READ_WAVEFRONTS,16) ></metric>
<metric name="TA_FLAT_WRITE_WAVEFRONTS_sum" expr=sum(TA_FLAT_WRITE_WAVEFRONTS,16) ></metric>
<metric name="TCC_HIT_sum" expr=sum(TCC_HIT,16) ></metric>
<metric name="TCC_MISS_sum" expr=sum(TCC_MISS,16) ></metric>
<metric name="TCC_EA_RDREQ_sum" expr=sum(TCC_EA_RDREQ,16) ></metric>
<metric name="TCC_EA_RDREQ_32B_sum" expr=sum(TCC_EA_RDREQ_32B,16) ></metric>
<metric name="TCC_EA_RDREQ_sum" expr=sum(TCC_EA_RDREQ,16) ></metric>
<metric name="TCC_EA_WRREQ_sum" expr=sum(TCC_EA_WRREQ,16) ></metric>
<metric name="TCC_EA_WRREQ_64B_sum" expr=sum(TCC_EA_WRREQ_64B,16) ></metric>
<metric name="TCC_WRREQ_STALL_max" expr=max(TCC_EA_WRREQ_STALL,16) ></metric>
# FETCH_SIZE, kilobytes
# The total kilobytes fetched from the video memory. This is measured with all extra fetches and any cache or memory effects taken into account.
<metric
name="FETCH_SIZE"
expr=((TCC_EA_RDREQ_sum-TCC_EA_RDREQ_32B_sum)*64+TCC_EA_RDREQ_32B_sum*32)/1024
descr="The total kilobytes fetched from the video memory. This is measured with all extra fetches and any cache or memory effects taken into account."
></metric>
<metric name="FETCH_SIZE" expr=(TCC_EA_RDREQ_32B_sum*32+(TCC_EA_RDREQ_sum-TCC_EA_RDREQ_32B_sum)*64)/1024 ></metric>
# WRITE_SIZE
# The total kilobytes written to the video memory. This is measured with all extra fetches and any cache or memory effects taken into account.
<metric name="WRITE_SIZE" expr=((TCC_EA_WRREQ_sum-TCC_EA_WRREQ_64B_sum)*32+TCC_EA_WRREQ_64B_sum*64)/1024 ></metric>
</gfx9>
<global>
# GPU_BUSY, percentage
# GPUBusy, percentage
# The percentage of time GPU was busy.
<metric
name="GPUBusy"
expr=100*GRBM_GUI_ACTIVE/GRBM_COUNT
descr="The percentage of time GPU was busy."
expr=100*GRBM_GUI_ACTIVE/GRBM_COUNT
></metric>
# Wavefronts Total wavefronts.,
<metric
name="Wavefronts"
expr=SQ_WAVES
descr="Total wavefronts."
expr=SQ_WAVES
></metric>
# VALUInsts The average number of vector ALU instructions executed per work-item (affected by flow control).
<metric
name="VALUInsts"
expr=SQ_INSTS_VALU/SQ_WAVES
descr="The average number of vector ALU instructions executed per work-item (affected by flow control)."
expr=SQ_INSTS_VALU/SQ_WAVES
></metric>
# SALUInsts The average number of scalar ALU instructions executed per work-item (affected by flow control).
<metric
name="SALUInsts"
expr=SQ_INSTS_SALU/SQ_WAVES
descr="The average number of scalar ALU instructions executed per work-item (affected by flow control)."
expr=SQ_INSTS_SALU/SQ_WAVES
></metric>
# VFetchInsts The average number of vector fetch instructions from the video memory executed per work-item (affected by flow control). Excludes FLAT instructions that fetch from video memory.
<metric
name="VFetchInsts"
expr=(SQ_INSTS_VMEM_RD-TA_FLAT_READ_WAVEFRONTS_sum)/SQ_WAVES
descr="The average number of vector fetch instructions from the video memory executed per work-item (affected by flow control). Excludes FLAT instructions that fetch from video memory."
expr=(SQ_INSTS_VMEM_RD-TA_FLAT_READ_WAVEFRONTS_sum)/SQ_WAVES
></metric>
# SFetchInsts The average number of scalar fetch instructions from the video memory executed per work-item (affected by flow control).
<metric
name="SFetchInsts"
expr=SQ_INSTS_SMEM/SQ_WAVES
descr="The average number of scalar fetch instructions from the video memory executed per work-item (affected by flow control)."
expr=SQ_INSTS_SMEM/SQ_WAVES
></metric>
# VWriteInsts The average number of vector write instructions to the video memory executed per work-item (affected by flow control). Excludes FLAT instructions that write to video memory.
<metric
name="VWriteInsts"
expr=(SQ_INSTS_VMEM_WR-TA_FLAT_WRITE_WAVEFRONTS_sum)/SQ_WAVES
descr="The average number of vector write instructions to the video memory executed per work-item (affected by flow control). Excludes FLAT instructions that write to video memory."
expr=(SQ_INSTS_VMEM_WR-TA_FLAT_WRITE_WAVEFRONTS_sum)/SQ_WAVES
></metric>
# FlatVMemInsts The average number of FLAT instructions that read from or write to the video memory executed per work item (affected by flow control). Includes FLAT instructions that read from or write to scratch.
<metric
name="FlatVMemInsts"
expr=(SQ_INSTS_FLAT-SQ_INSTS_FLAT_LDS_ONLY)/SQ_WAVES
descr="The average number of FLAT instructions that read from or write to the video memory executed per work item (affected by flow control). Includes FLAT instructions that read from or write to scratch."
expr=(SQ_INSTS_FLAT-SQ_INSTS_FLAT_LDS_ONLY)/SQ_WAVES
></metric>
# LDSInsts The average number of LDS read or LDS write instructions executed per work item (affected by flow control). Excludes FLAT instructions that read from or write to LDS.
<metric
name="LDSInsts"
expr=(SQ_INSTS_LDS-SQ_INSTS_FLAT_LDS_ONLY)/SQ_WAVES
descr="The average number of LDS read or LDS write instructions executed per work item (affected by flow control). Excludes FLAT instructions that read from or write to LDS."
expr=(SQ_INSTS_LDS-SQ_INSTS_FLAT_LDS_ONLY)/SQ_WAVES
></metric>
# FlatLDSInsts The average number of FLAT instructions that read or write to LDS executed per work item (affected by flow control).
<metric
name="FlatLDSInsts"
expr=SQ_INSTS_FLAT_LDS_ONLY/SQ_WAVES
descr="The average number of FLAT instructions that read or write to LDS executed per work item (affected by flow control)."
expr=SQ_INSTS_FLAT_LDS_ONLY/SQ_WAVES
></metric>
# GDSInsts The average number of GDS read or GDS write instructions executed per work item (affected by flow control).
<metric
name="GDSInsts"
expr=SQ_INSTS_GDS/SQ_WAVES
descr="The average number of GDS read or GDS write instructions executed per work item (affected by flow control)."
expr=SQ_INSTS_GDS/SQ_WAVES
></metric>
# VALUUtilization The percentage of active vector ALU threads in a wave. A lower number can mean either more thread divergence in a wave or that the work-group size is not a multiple of 64. Value range: 0% (bad), 100% (ideal - no thread divergence).
<metric
name="VALUUtilization"
expr=100*SQ_THREAD_CYCLES_VALU/(SQ_ACTIVE_INST_VALU*64)
descr="The percentage of active vector ALU threads in a wave. A lower number can mean either more thread divergence in a wave or that the work-group size is not a multiple of 64. Value range: 0% (bad), 100% (ideal - no thread divergence)."
expr=100*SQ_THREAD_CYCLES_VALU/(SQ_ACTIVE_INST_VALU*MAX_WAVE_SIZE)
></metric>
# VALUBusy The percentage of GPUTime vector ALU instructions are processed. Value range: 0% (bad) to 100% (optimal).
<metric
name="VALUBusy"
expr=100*SQ_ACTIVE_INST_VALU*4/NUM_SIMDS/GRBM_GUI_ACTIVE
descr="The percentage of GPUTime vector ALU instructions are processed. Value range: 0% (bad) to 100% (optimal)."
expr=100*SQ_ACTIVE_INST_VALU*4/SIMD_NUM/GRBM_GUI_ACTIVE
></metric>
# SALUBusy The percentage of GPUTime scalar ALU instructions are processed. Value range: 0% (bad) to 100% (optimal).
<metric
name="SALUBusy"
expr=100*SQ_INST_CYCLES_SALU*4/NUM_SIMDS/GRBM_GUI_ACTIVE
descr="The percentage of GPUTime scalar ALU instructions are processed. Value range: 0% (bad) to 100% (optimal)."
expr=100*SQ_INST_CYCLES_SALU*4/SIMD_NUM/GRBM_GUI_ACTIVE
></metric>
# FetchSize The total kilobytes fetched from the video memory. This is measured with all extra fetches and any cache or memory effects taken into account.
<metric
name="FetchSize"
expr=FETCH_SIZE
descr="The total kilobytes fetched from the video memory. This is measured with all extra fetches and any cache or memory effects taken into account."
expr=FETCH_SIZE
></metric>
# WriteSize The total kilobytes written to the video memory. This is measured with all extra fetches and any cache or memory effects taken into account.
<metric
name="WriteSize"
expr=((sum(TCC_EA_WRREQ,16)-sum(TCC_EA_WRREQ_64B,16))*32+sum(TCC_EA_WRREQ_64B,16)*64)/1024
descr="The total kilobytes written to the video memory. This is measured with all extra fetches and any cache or memory effects taken into account."
expr=WRITE_SIZE
></metric>
# L2CacheHit The percentage of fetch, write, atomic, and other instructions that hit the data in L2 cache. Value range: 0% (no hit) to 100% (optimal).
<metric
name="L2CacheHit"
expr=100*sum(TCC_HIT,16)/(sum(TCC_HIT,16)+sum(TCC_MISS,16))
descr="The percentage of fetch, write, atomic, and other instructions that hit the data in L2 cache. Value range: 0% (no hit) to 100% (optimal)."
expr=100*sum(TCC_HIT,16)/(sum(TCC_HIT,16)+sum(TCC_MISS,16))
></metric>
# MemUnitBusy The percentage of GPUTime the memory unit is active. The result includes the stall time (MemUnitStalled). This is measured with all extra fetches and writes and any cache or memory effects taken into account. Value range: 0% to 100% (fetch-bound).
<metric
name="MemUnitBusy"
expr=100*max(TA_BUSY,16)/GRBM_GUI_ACTIVE/NUM_SHADER_ENGINES
descr="The percentage of GPUTime the memory unit is active. The result includes the stall time (MemUnitStalled). This is measured with all extra fetches and writes and any cache or memory effects taken into account. Value range: 0% to 100% (fetch-bound)."
expr=100*max(TA_TA_BUSY,16)/GRBM_GUI_ACTIVE/SE_NUM
></metric>
# MemUnitStalled The percentage of GPUTime the memory unit is stalled. Try reducing the number or size of fetches and writes if possible. Value range: 0% (optimal) to 100% (bad).
<metric
name="MemUnitStalled"
expr=100*max(TCP_TA_DATA_STALL_CYCLES,16)/GRBM_GUI_ACTIVE/NUM_SHADER_ENGINES
descr="The percentage of GPUTime the memory unit is stalled. Try reducing the number or size of fetches and writes if possible. Value range: 0% (optimal) to 100% (bad)."
expr=100*max(TCP_TCP_TA_DATA_STALL_CYCLES,16)/GRBM_GUI_ACTIVE/SE_NUM
></metric>
# WriteUnitStalled The percentage of GPUTime the Write unit is stalled. Value range: 0% to 100% (bad).
<metric
name="WriteUnitStalled"
expr=100*max(TCC_EA_WRREQ_STALL,16)/GRBM_GUI_ACTIVE
descr="The percentage of GPUTime the Write unit is stalled. Value range: 0% to 100% (bad)."
expr=100*TCC_WRREQ_STALL_max/GRBM_GUI_ACTIVE
></metric>
# The percentage of GPUTime ALU units are stalled by the LDS input queue being full or the output queue being not ready. If there are LDS bank conflicts, reduce them. Otherwise, try reducing the number of LDS accesses if possible. Value range: 0% (optimal) to 100% (bad).
<metric
name="ALUStalledByLDS"
expr=100*SQ_WAIT_INST_LDS*4/SQ_WAVES/GRBM_GUI_ACTIVE
descr="The percentage of GPUTime ALU units are stalled by the LDS input queue being full or the output queue being not ready. If there are LDS bank conflicts, reduce them. Otherwise, try reducing the number of LDS accesses if possible. Value range: 0% (optimal) to 100% (bad)."
expr=100*SQ_WAIT_INST_LDS*4/SQ_WAVES/GRBM_GUI_ACTIVE
></metric>
# LDSBankConflict The percentage of GPUTime LDS is stalled by bank conflicts. Value range: 0% (optimal) to 100% (bad).
<metric
name="LDSBankConflict"
expr=100*SQ_LDS_BANK_CONFLICT/GRBM_GUI_ACTIVE/NUM_SIMDS
descr="The percentage of GPUTime LDS is stalled by bank conflicts. Value range: 0% (optimal) to 100% (bad)."
expr=100*SQ_LDS_BANK_CONFLICT/GRBM_GUI_ACTIVE/CU_NUM
></metric>
</global>
+3
Просмотреть файл
@@ -32,5 +32,8 @@ echo "Run $tbin"
export ROCP_KITER=100
export ROCP_DITER=100
eval $tbin
#valgrind --leak-check=full $tbin
#valgrind --tool=massif $tbin
#ms_print massif.out.<N>
exit 0