Skip to content

Commit 3ca4bc1

Browse files
authored
[NPU] fix allocator min chunk size (#31632)
1 parent 11f7887 commit 3ca4bc1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

paddle/fluid/platform/npu_info.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ size_t NPUInitAllocSize() { return NPUAllocSize(/* realloc = */ false); }
163163
size_t NPUReallocSize() { return NPUAllocSize(/* realloc = */ true); }
164164

165165
size_t NPUMinChunkSize() {
166-
// Allow to allocate the minimum chunk size is 256 bytes.
167-
return 1 << 8;
166+
// NOTE(zhiqiu): It seems the min chunk size should be 512 on NPU,
167+
// though no document specify that explicitly.
168+
// See https://gitee.com/zhiqiuchen/Ascend/tree/master/test_reduce_sum_d for
169+
// details.
170+
return 1 << 9;
168171
}
169172

170173
size_t NPUMaxChunkSize() {

0 commit comments

Comments
 (0)