Skip to content
Open
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 @@ -795,15 +795,19 @@ batch_index_select_dim0_codegen_forward_cuda(
// if (!is_experimental)
} else {
// Allocate num warps per table based on max_D

const int num_warps_per_table = B * div_round_up(max_D, kWarpSize * 4);
const uint32_t num_warps_per_threadblock = kForwardMaxThreads / kWarpSize;

#ifdef USE_ROCM
const uint32_t num_warps_per_threadblock = kForwardMaxThreads / (kWarpSize*2);
#else
const uint32_t num_warps_per_threadblock = kForwardMaxThreads / kWarpSize;
#endif

const auto kernel_func =
(use_lxu_cache ? split_embedding_codegen_forward_{{ wdesc }}_v2_kernel<
emb_t, cache_t, output_t, index_t, true>
: split_embedding_codegen_forward_{{ wdesc }}_v2_kernel<
emb_t, cache_t, output_t, index_t, false>);

FBGEMM_LAUNCH_KERNEL(
kernel_func,
div_round_up(T * num_warps_per_table, num_warps_per_threadblock),
Expand Down