From ad613e1644b0a96e442cc93ad0dc076dc9733034 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Tue, 22 Aug 2023 05:45:32 -0400 Subject: [PATCH] Clean up SDMA ganging We don't need to keep track of specific blit engines in gang for submission anymore as ganging early exits on pending bytes. So tidy up the fluff. Change-Id: I77e80bf1ad8f561a03fff77bce33aa09d02760c6 [ROCm/ROCR-Runtime commit: 132815bcfb62274560f08707aad415c0f8d44bc5] --- .../runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp | 5 ----- .../runtime/hsa-runtime/core/runtime/amd_topology.cpp | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 7ddf19ca69..33cbca3f7a 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -902,7 +902,6 @@ hsa_status_t GpuAgent::DmaCopy(void* dst, core::Agent& dst_agent, } int gang_factor = 0; - uint32_t gang_mask = 0; // Use non-D2D (auxillary) SDMA engines in the event of xGMI D2D support // when xGMI SDMA context is not available. bool has_aux_gang = tmp_gang_factor >= properties_.NumSdmaEngines && !!!properties_.NumSdmaXgmiEngines; @@ -925,7 +924,6 @@ hsa_status_t GpuAgent::DmaCopy(void* dst, core::Agent& dst_agent, } } - gang_mask |= 1 << i; gang_factor++; } @@ -961,9 +959,6 @@ hsa_status_t GpuAgent::DmaCopy(void* dst, core::Agent& dst_agent, bool gang_leader_set = false; int gang_sig_count = 0; for (int i = 0; i < gang_factor; i++) { - if (gang_factor > 1 && !!!(gang_mask & (1 << i))) - continue; - // Set leader and gang status to blit SetCopyRequestRefCount(true); lazy_ptr& blit = has_aux_gang ? blits_[i + 1] : diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_topology.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_topology.cpp index 1f5aa53109..d8cf5e2130 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_topology.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_topology.cpp @@ -376,7 +376,6 @@ void BuildTopology() { continue; auto linfo = core::Runtime::runtime_singleton_->GetLinkInfo(src_id, dst_id); - GpuAgent *gpu = (AMD::GpuAgent*)src_gpu; // xGMI link type cannot determine bandwidth keep it fixed for ganging bool has_fixed_gang = linfo.info.link_type == HSA_AMD_LINK_INFO_TYPE_XGMI && linfo.info.numa_distance != 15; @@ -392,7 +391,7 @@ void BuildTopology() { uint32_t gang_factor = has_fixed_gang ? 2 : (linfo.info.min_bandwidth ? linfo.info.max_bandwidth/linfo.info.min_bandwidth : 0); - gpu->RegisterGangPeer(*dst_gpu, gang_factor); + ((AMD::GpuAgent*)src_gpu)->RegisterGangPeer(*dst_gpu, gang_factor); } } }