vllm.models.deepseek_v4.cpu.cpu_utils ¶
Shared helpers for DeepSeek-V4's CPU-ported kernels.
Functions:
-
map_local_to_global_slots_cpu–Map per-request-local (token or compressed-token) indices to global
map_local_to_global_slots_cpu(local_indices, req_idx, block_table, block_size) ¶
Map per-request-local (token or compressed-token) indices to global paged-cache slot ids via a block table, mirroring compute_global_topk_indices_and_lens.
Parameters:
-
(local_indices¶Tensor) –[N, K], -1 sentinel for invalid entries.
-
(req_idx¶Tensor) –[N], row into
block_tablefor each of the N rows. -
(block_table¶Tensor) –[num_reqs, max_blocks_per_seq].
-
(block_size¶int) –tokens (or compressed tokens) per physical block.
Returns:
-
Tensor–[N, K] int64 global slot ids, -1 where
local_indiceswas invalid.