Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PersistentTable] Fix num blocks #7986

Merged
merged 9 commits into from
Apr 10, 2022
2 changes: 1 addition & 1 deletion oneflow/core/embedding/persistent_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ template<typename Key, typename Engine>
void PersistentTableImpl<Key, Engine>::PutBlocks(uint32_t num_keys, const void* keys,
const void* blocks) {
std::lock_guard<std::recursive_mutex> 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;
Expand Down