Skip to content

Commit

Permalink
missed kernel_compute_tensor_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwendt committed Nov 25, 2024
1 parent 338cdf7 commit 05ca44e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions cpp/src/text/subword/subword_tokenize.cu
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,10 @@ CUDF_KERNEL void kernel_compute_tensor_metadata(
uint32_t* attn_mask,
uint32_t* metadata)
{
cudf::thread_index_type const output_idx =
threadIdx.x + static_cast<cudf::thread_index_type>(blockIdx.x) *
static_cast<cudf::thread_index_type>(blockDim.x);
if (output_idx >= (static_cast<cudf::thread_index_type>(nrows_tensor_token_ids) *
static_cast<cudf::thread_index_type>(max_sequence_length))) {
return;
}
auto const output_idx = cudf::detail::grid_1d::global_thread_id();

uint32_t const absolute_row_id = output_idx / max_sequence_length;
uint32_t const absolute_row_id = output_idx / max_sequence_length;
if (absolute_row_id >= nrows_tensor_token_ids) { return; }
uint32_t const tensor_id = row2tensor[absolute_row_id];
uint32_t const row_within_tensor = row2row_within_tensor[absolute_row_id];
uint32_t const offset_token_ids_tensor = offsets[tensor_id];
Expand Down

0 comments on commit 05ca44e

Please sign in to comment.