SWDEV-440746 - Limit WG for compute P2P
Use only 16 workgroups for compute P2P copies.
That should be enough to utilize XGMI bandwidth.
Change-Id: I60dfe019279bb95f93c8874244c1738aad1896d8
[ROCm/clr commit: 31101c6219]
Этот коммит содержится в:
коммит произвёл
German Andryeyev
родитель
29eba6df09
Коммит
339523c475
@@ -2270,8 +2270,18 @@ bool KernelBlitManager::copyBuffer(device::Memory& srcMemory, device::Memory& ds
|
||||
amd::CopyMetadata copyMetadata) const {
|
||||
amd::ScopedLock k(lockXferOps_);
|
||||
bool result = false;
|
||||
bool p2p = (&gpuMem(srcMemory).dev() != &gpuMem(dstMemory).dev()) &&
|
||||
((sizeIn[0] > ROC_P2P_SDMA_SIZE * Ki) || !gpu().IsPendingDispatch());
|
||||
bool p2p = false;
|
||||
uint32_t blit_wg_ = dev().settings().limit_blit_wg_;
|
||||
|
||||
if (&gpuMem(srcMemory).dev() != &gpuMem(dstMemory).dev()) {
|
||||
if ((sizeIn[0] > dev().settings().sdma_p2p_threshold_) || !gpu().IsPendingDispatch()) {
|
||||
p2p = true;
|
||||
} else {
|
||||
constexpr uint32_t kLimitWgForKernelP2p = 16;
|
||||
blit_wg_ = kLimitWgForKernelP2p;
|
||||
}
|
||||
}
|
||||
|
||||
bool asan = false;
|
||||
bool ipcShared = srcMemory.owner()->ipcShared() || dstMemory.owner()->ipcShared();
|
||||
#if defined(__clang__)
|
||||
@@ -2317,7 +2327,7 @@ bool KernelBlitManager::copyBuffer(device::Memory& srcMemory, device::Memory& ds
|
||||
|
||||
// Program the dispatch dimensions
|
||||
const size_t localWorkSize = (aligned) ? 512 : 1024;
|
||||
size_t globalWorkSize = std::min(dev().settings().limit_blit_wg_ * localWorkSize, size[0]);
|
||||
size_t globalWorkSize = std::min(blit_wg_ * localWorkSize, size[0]);
|
||||
globalWorkSize = amd::alignUp(globalWorkSize, localWorkSize);
|
||||
|
||||
// Program kernels arguments for the blit operation
|
||||
|
||||
@@ -81,6 +81,7 @@ Settings::Settings() {
|
||||
lcWavefrontSize64_ = true;
|
||||
imageBufferWar_ = false;
|
||||
|
||||
sdma_p2p_threshold_ = ROC_P2P_SDMA_SIZE * Ki;
|
||||
hmmFlags_ = (!flagIsDefault(ROC_HMM_FLAGS)) ? ROC_HMM_FLAGS : 0;
|
||||
|
||||
rocr_backend_ = true;
|
||||
|
||||
@@ -74,6 +74,7 @@ class Settings : public device::Settings {
|
||||
size_t pinnedMinXferSize_; //!< Minimal buffer size for pinned transfer
|
||||
|
||||
size_t sdmaCopyThreshold_; //!< Use SDMA to copy above this size
|
||||
size_t sdma_p2p_threshold_; //!< Use SDMA in P2P above this size
|
||||
|
||||
uint32_t hmmFlags_; //!< HMM functionality control flags
|
||||
uint32_t limit_blit_wg_; //!< The number of workgroups for blit execution
|
||||
|
||||
Ссылка в новой задаче
Block a user