diff --git a/torch_npu/csrc/core/npu/NPUPeerToPeerAccess.cpp b/torch_npu/csrc/core/npu/NPUPeerToPeerAccess.cpp index 32e340866acf513a2e979c582dd1aa0f2e87c1f2..b938202ddc36adb29234ec407f1110dd9c022868 100644 --- a/torch_npu/csrc/core/npu/NPUPeerToPeerAccess.cpp +++ b/torch_npu/csrc/core/npu/NPUPeerToPeerAccess.cpp @@ -4,6 +4,7 @@ #include #include "torch_npu/csrc/core/npu/NPUPeerToPeerAccess.h" #include "torch_npu/csrc/core/npu/NPUGuard.h" +#include "torch_npu/csrc/core/npu/NpuVariables.h" namespace at_npu { namespace native { @@ -54,7 +55,9 @@ bool NpuP2pCtrl::get_p2p_access(int32_t source_dev, int32_t dest_dev, bool& flag } if (device_enabled_count_[source_dev] >= C10_P2P_ACCESS_MAX_NPUS || - device_enabled_count_[dest_dev] >= C10_P2P_ACCESS_MAX_NPUS) { + device_enabled_count_[dest_dev] >= C10_P2P_ACCESS_MAX_NPUS && + c10_npu::GetSocVersion() >= c10_npu::SocVersion::Ascend910PremiumA && + c10_npu::GetSocVersion() < c10_npu::SocVersion::Ascend910_9391) { // we enable P2P in groups of 8. cache_s2d = P2pStatus::COPY_NOT_ALLOWED; cache_d2s = P2pStatus::COPY_NOT_ALLOWED;