vllm.models.kimi_k3.nvidia.ops.cute_dsl.latent_moe_tail.primitives ¶
Shared CuTe DSL primitives; this module does not define a CUDA kernel.
Classes:
-
CUDAGraphCompatibleWrapper–DLPack view that does not synchronize with the producer stream.
Functions:
-
block_sum_specialized–Upstream-equivalent FP32 block reduction.
-
fragment_is_dirty–Bit-exact upstream sentinel check: one comparison per 32-bit word.
-
load_global_u32x4–Load one 128-bit fragment as four u32 registers.
-
map_shared_to_peer–Map a local shared-memory slot to the same slot in a peer CTA.
-
red_async_release_gpu_add_u32–The exact SM100 arrival primitive used by upstream LamportFlags.
-
sanitize_negative_zero–Turn real BF16 -0 into +0 so it cannot equal the empty sentinel.
-
store_global_u32x4–Store four packed words to an ordinary or NVLS multicast global VA.
-
store_lamport_sentinel_128–Reset one Lamport fragment to four FP32 negative-zero bit patterns.
-
to_cute_dynamic_m–Expose exactly one compact tensor mode as a runtime shape.
-
warp_sum_specialized–Warp sum supporting a compile-time partial final warp.
CUDAGraphCompatibleWrapper ¶
DLPack view that does not synchronize with the producer stream.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
block_sum_specialized(value, warp_sums, tidx, warps, last_warp_lanes, last_warp_mask) ¶
Upstream-equivalent FP32 block reduction.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
fragment_is_dirty(packed) ¶
Bit-exact upstream sentinel check: one comparison per 32-bit word.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
load_global_u32x4(pointer, *, volatile=False, loc=None, ip=None) ¶
Load one 128-bit fragment as four u32 registers.
The volatile form is the Lamport polling load. Marking the asm side-effecting prevents loop-invariant motion and common-subexpression elimination across polling iterations.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
map_shared_to_peer(smem_ptr, peer_rank, *, loc=None, ip=None) ¶
Map a local shared-memory slot to the same slot in a peer CTA.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
red_async_release_gpu_add_u32(pointer, value, *, loc=None, ip=None) ¶
The exact SM100 arrival primitive used by upstream LamportFlags.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
sanitize_negative_zero(packed) ¶
Turn real BF16 -0 into +0 so it cannot equal the empty sentinel.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
store_global_u32x4(address, packed, *, volatile=False, loc=None, ip=None) ¶
Store four packed words to an ordinary or NVLS multicast global VA.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
store_lamport_sentinel_128(pointer, *, loc=None, ip=None) ¶
Reset one Lamport fragment to four FP32 negative-zero bit patterns.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
to_cute_dynamic_m(tensor, *, mode, assumed_align=16) ¶
Expose exactly one compact tensor mode as a runtime shape.
Model dimensions remain part of the compiled tensor type. Only the token mode is symbolic, so changing M within an Op's capacity reuses the same compiled kernel.
Source code in vllm/models/kimi_k3/nvidia/ops/cute_dsl/latent_moe_tail/primitives.py
warp_sum_specialized(value, warp_idx, lane, warps, last_warp_lanes, last_warp_mask) ¶
Warp sum supporting a compile-time partial final warp.