From 3ca4bc1004bf34d88580de090b129f7bc7067b0e Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Mon, 15 Mar 2021 15:26:50 +0800 Subject: [PATCH] [NPU] fix allocator min chunk size (#31632) --- paddle/fluid/platform/npu_info.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/platform/npu_info.cc b/paddle/fluid/platform/npu_info.cc index 69204363993..f2643970a47 100644 --- a/paddle/fluid/platform/npu_info.cc +++ b/paddle/fluid/platform/npu_info.cc @@ -163,8 +163,11 @@ size_t NPUInitAllocSize() { return NPUAllocSize(/* realloc = */ false); } size_t NPUReallocSize() { return NPUAllocSize(/* realloc = */ true); } size_t NPUMinChunkSize() { - // Allow to allocate the minimum chunk size is 256 bytes. - return 1 << 8; + // NOTE(zhiqiu): It seems the min chunk size should be 512 on NPU, + // though no document specify that explicitly. + // See https://gitee.com/zhiqiuchen/Ascend/tree/master/test_reduce_sum_d for + // details. + return 1 << 9; } size_t NPUMaxChunkSize() { -- GitLab