Skip to content

Commit

Permalink
Fix block_bucketize_features with variable bucket size when using tor…
Browse files Browse the repository at this point in the history
…ch.int64 for block_bucketize_pos (#2188)

Summary:
Pull Request resolved: #2188

When block_bucketize_pos using torch.int64, it would fail TorchRec uneven sharing test. This is fix resolving this issue

Reviewed By: sryap

Differential Revision: D51713675

fbshipit-source-id: 240e836587d89ed118a9d24e9bf4b267031333b8
  • Loading branch information
gnahzg authored and facebook-github-bot committed Dec 1, 2023
1 parent d5cdefd commit 88fc6e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fbgemm_gpu/src/sparse_ops/sparse_ops_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void _block_bucketize_sparse_features_cpu(
if (variable_bucket_sizes) {
int64_t lb = std::upper_bound(
bucketize_offset,
bucketize_offset + bucket_size,
bucketize_offset + static_cast<index_t>(bucket_size),
indices_data[i]) -
bucketize_offset - 1;
lower_bounds[i] = lb;
Expand Down

0 comments on commit 88fc6e7

Please sign in to comment.