Skip to content

vllm.v1.attention.ops.dcp_direct_a2a_cutedsl

CuTe DSL torch.ops._C.direct_dcp_a2a_lse_reduce for SM100 (BF16, 512 dims).

Same symmetric buffers, epoch and signal protocol, and bit-identical output as the CUDA op, in two launches instead of four:

push: one CTA per (token, destination) copies the token's head slice and LSE to the destination's receive slot (tokens with an empty KV shard send LSE -inf). The last CTA per destination publishes the signal. combine: one warp per (token, local head) waits for every source and combines in FP32 in the CUDA op's source order. The last CTA advances the epoch.

Classes:

Functions:

DirectDCPA2ACombineKernel

Bases: VllmCuTeDSLJitKernel[_CompileKey]

Wait for every source, then LSE-combine this rank's heads in FP32.

DirectDCPA2APushKernel

Bases: VllmCuTeDSLJitKernel[_CompileKey]

Send each destination's head slice and LSE into its receive slot.

direct_dcp_a2a_lse_reduce_cutedsl(partial_output, partial_lse, seq_lens, query_start_loc, peer_output_ptrs, peer_lse_ptrs, peer_signal_ptrs, received_output, received_lse, received_signal, epoch, combined_output, world_size, rank, max_num_tokens, is_lse_base_on_e, *, counters)

torch.ops._C.direct_dcp_a2a_lse_reduce with the same arguments.

counters is a zero-initialized int32 [world_size + 1] tensor (push tickets per destination, then the combine's CTA count) that the kernels leave at zero. The workspace owns every other buffer; the caller's inputs are checked (metadata only), as a bad shape would write into peer memory.

register_warmup(world_size, heads_per_rank)

Compile both kernels during JIT warmup (their only compile keys).