From cd2a25e3e23e7e535a6818006b3f6db7ab93046e Mon Sep 17 00:00:00 2001 From: liujuncheng Date: Fri, 8 Apr 2022 21:06:22 +0800 Subject: [PATCH] [PersistentTable] Fix num blocks --- oneflow/core/embedding/persistent_table.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oneflow/core/embedding/persistent_table.cpp b/oneflow/core/embedding/persistent_table.cpp index f50b192c55d..dd5a9ea39a6 100644 --- a/oneflow/core/embedding/persistent_table.cpp +++ b/oneflow/core/embedding/persistent_table.cpp @@ -532,7 +532,7 @@ template void PersistentTableImpl::PutBlocks(uint32_t num_keys, const void* keys, const void* blocks) { std::lock_guard lock(mutex_); - const uint32_t num_blocks = RoundUp(num_keys, num_values_per_block_); + const uint32_t num_blocks = RoundUp(num_keys, num_values_per_block_) / num_values_per_block_; const uint32_t num_padded_keys = num_blocks * num_values_per_block_; const uint64_t start_index = physical_table_size_; physical_table_size_ += num_padded_keys;