Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -963,14 +963,13 @@ void ValidateMinibatchOrSparseCoreSlice(
int ids_count = 0;
absl::flat_hash_set<int> unique_ids;
for (int j = start_index; j < end_index; ++j) {
if (embedding_ids_slice(j) != INT_MAX) {
ValidateCooId(embedding_ids_slice(j), sample_ids_slice(j),
table_shard_size, batch_size_per_sc);
ids_count++;
unique_ids.insert(embedding_ids_slice(j));
// ASSERT_LE(ids_count, max_ids_per_partition);
// ASSERT_LE(unique_ids.size(), max_unique_ids_per_partition);
}
ASSERT_NE(embedding_ids_slice(j), INT_MAX);
ValidateCooId(embedding_ids_slice(j), sample_ids_slice(j),
table_shard_size, batch_size_per_sc);
ids_count++;
unique_ids.insert(embedding_ids_slice(j));
ASSERT_LE(ids_count, max_ids_per_partition);
ASSERT_LE(unique_ids.size(), max_unique_ids_per_partition);
}
start_index = xla::RoundUpTo(end_index, TPU_VECTOR_REGISTER_ALIGNMENT_SIZE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#ifndef JAX_TPU_EMBEDDING_SPARSECORE_LIB_CORE_MINIBATCHING_SPLITS_IMPL_H_
#define JAX_TPU_EMBEDDING_SPARSECORE_LIB_CORE_MINIBATCHING_SPLITS_IMPL_H_

#include <algorithm>
#include <bitset>
#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -72,6 +73,7 @@ std::bitset<N - 1> ComputeMinibatchingSplit(
const int val_right = unique_ids_per_bucket[i + subtree_size / 2];
if (val_left + val_right > max_unique_ids_per_partition) {
split.set(split_index);
unique_ids_per_bucket[i] = std::max(val_left, val_right);
} else {
unique_ids_per_bucket[i] += val_right;
}
Expand Down