diff --git a/torch_npu/csrc/core/npu/NPUCachingAllocator.cpp b/torch_npu/csrc/core/npu/NPUCachingAllocator.cpp index 98ef4e3ed114e1c60c07a1165ef4cb0d8ccd02ed..06c06febc691c0710304f367dc31275afa17d2c7 100644 --- a/torch_npu/csrc/core/npu/NPUCachingAllocator.cpp +++ b/torch_npu/csrc/core/npu/NPUCachingAllocator.cpp @@ -183,36 +183,18 @@ bool IsMallocPage1GMem(bool is_small_pool) if (!c10_npu::NPUCachingAllocator::isConfig1GPageSizeEnable()) { return false; } - + // check AclsysGetCANNVersion supported aclCANNPackageVersion cann_version; aclError cann_version_ret = at_npu::native::AclsysGetCANNVersion(ACL_PKG_NAME_CANN, &cann_version); if (cann_version_ret != ACL_SUCCESS) { return false; } - if (!IsCannVersionSufficient(cann_version.version, kCannMajor, kCannMinor)) { - TORCH_NPU_WARN_ONCE("The application for 1G large-page physical memory failed. " - "Using the HUGE_MEM memory page allocation method may result in performance degradation. " - "This warning occurs because the PYTORCH_NPU_ALLOC_CONF = page_size:1g configuration is enabled, " - "but the current driver version does not support this feature. " - "Please upgrade the CANN package version."); - return false; - } - aclCANNPackageVersion driver_version; aclError driver_version_ret = at_npu::native::AclsysGetCANNVersion(ACL_PKG_NAME_DRIVER, &driver_version); if (driver_version_ret != ACL_SUCCESS) { return false; } - - if (!IsCannVersionSufficient(driver_version.version, kDriverMajor, kDriverMinor)) { - TORCH_NPU_WARN_ONCE("The application for 1G large-page physical memory failed. " - "Using the HUGE_MEM memory page allocation method may result in performance degradation. " - "This warning occurs because the PYTORCH_NPU_ALLOC_CONF = page_size:1g configuration is enabled, " - "but the current driver version does not support this feature. " - "Please upgrade the CANN package version 1-2."); - return false; - } return true; }();