"...text-generation-inference.git" did not exist on "0e9ed1a8c2ca5023388999c42dde2976e026fe13"
Commit 1c93dc06 authored by Ramesh Errabolu's avatar Ramesh Errabolu
Browse files

Report Numa distance as N/A when a pool is inaccessible

parent 5f25d0e8
...@@ -201,7 +201,11 @@ void RocmBandwidthTest::PrintLinkMatrix() const { ...@@ -201,7 +201,11 @@ void RocmBandwidthTest::PrintLinkMatrix() const {
for (uint32_t dst_idx = 0; dst_idx < agent_index_; dst_idx++) { for (uint32_t dst_idx = 0; dst_idx < agent_index_; dst_idx++) {
uint32_t link_weight = link_matrix_[(src_idx * agent_index_) + dst_idx]; uint32_t link_weight = link_matrix_[(src_idx * agent_index_) + dst_idx];
std::cout.width(format); std::cout.width(format);
std::cout << link_weight; if (link_weight == 0xFFFFFFFF) {
std::cout << "N/A";
} else {
std::cout << link_weight;
}
} }
std::cout << std::endl; std::cout << std::endl;
std::cout << std::endl; std::cout << std::endl;
......
...@@ -279,21 +279,26 @@ void RocmBandwidthTest::DiscoverLinkWeight() { ...@@ -279,21 +279,26 @@ void RocmBandwidthTest::DiscoverLinkWeight() {
agent_info_t agent_info; agent_info_t agent_info;
hsa_agent_t agent1; hsa_agent_t agent1;
hsa_agent_t agent2;
hsa_amd_memory_pool_link_info_t link_info = {0}; hsa_amd_memory_pool_link_info_t link_info = {0};
for (uint32_t idx1 = 0; idx1 < agent_index_; idx1++) { for (uint32_t idx1 = 0; idx1 < agent_index_; idx1++) {
agent1 = agent_list_[idx1].agent_; agent1 = agent_list_[idx1].agent_;
for (uint32_t idx2 = 0; idx2 < agent_index_; idx2++) { for (uint32_t idx2 = 0; idx2 < agent_index_; idx2++) {
if (idx1 == idx2) { if (idx1 == idx2) {
link_matrix_[(idx1 *agent_index_) + idx2] = 0; link_matrix_[(idx1 *agent_index_) + idx2] = 0;
continue; continue;
} }
uint32_t hops = 0;
if (agent_pool_list_[idx2].pool_list.size() != 0) { if (agent_pool_list_[idx2].pool_list.size() != 0) {
hsa_amd_memory_pool_t& pool = agent_pool_list_[idx2].pool_list[0].pool_; hsa_amd_memory_pool_t& pool = agent_pool_list_[idx2].pool_list[0].pool_;
agent2 = agent_pool_list_[idx2].agent.agent_;
err_ = hsa_amd_agent_memory_pool_get_info(agent1, pool, err_ = hsa_amd_agent_memory_pool_get_info(agent1, pool,
HSA_AMD_AGENT_MEMORY_POOL_INFO_NUM_LINK_HOPS, &hops);
if (hops > 0) {
err_ = hsa_amd_agent_memory_pool_get_info(agent1, pool,
HSA_AMD_AGENT_MEMORY_POOL_INFO_LINK_INFO, &link_info); HSA_AMD_AGENT_MEMORY_POOL_INFO_LINK_INFO, &link_info);
link_matrix_[(idx1 *agent_index_) + idx2] = link_info.numa_distance; link_matrix_[(idx1 *agent_index_) + idx2] = link_info.numa_distance;
} else {
link_matrix_[(idx1 *agent_index_) + idx2] = 0xFFFFFFFF;
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment