[kernel] Fused embedding kernel (#53677)

Signed-off-by: Jee Jee Li <jeejeelee@inferact.ai>
This commit is contained in:
Jee Jee Li
2026-08-31 11:34:14 +00:00
committed by GitHub
parent bed3280f50
commit e2c8eeac40
8 changed files with 580 additions and 10 deletions
+8
View File
@@ -697,6 +697,14 @@ void cp_gather_indexer_k_quant_cache(
const torch::stable::Tensor& block_table, // [batch_size, num_blocks]
const torch::stable::Tensor& cu_seq_lens); // [batch_size + 1]
// Fused vocab-parallel embedding lookup (see
// vocab_parallel_embedding_kernels.cu).
void vocab_parallel_embedding(
torch::stable::Tensor& out, const torch::stable::Tensor& input_ids,
const torch::stable::Tensor& weight, int64_t org_vocab_start_index,
int64_t org_vocab_end_index, int64_t num_org_vocab_padding,
int64_t added_vocab_start_index, int64_t added_vocab_end_index);
// LongCat n-gram embedding index kernel (see ngram_embedding_kernels.cu).
void ngram_compute_n_gram_ids(
int64_t ne_n, int64_t ne_k, torch::stable::Tensor& ne_weights,