vllm.models.kimi_k3.amd.specialized_decode.runtime.peer
¶
Peer memory for in-kernel TP collectives: one uncached buffer a rank, every rank holding every peer's address, and the TP agreements that must precede anything collective.
Classes:
-
PeerBuffer–One uncached buffer per rank, every rank holding every peer's address
Functions:
-
tp_agree–True when every rank of
grouppassedoktrue. Every rank must call
PeerBuffer
¶
One uncached buffer per rank, every rank holding every peer's address
(addresses, int64, indexed by TP rank). What lives where, and why no rank
overwrites a peer's unread data, is the model's layout's to say.
bytes is the whole buffer: the kernels tag every pair with the step's
epoch, so it is never zeroed between steps.
The constructor is collective over group (the handle exchange, then an
agreement that every rank mapped every peer): every rank must reach it, so a
runner reaches it only after tp_agree. A failed mapping on any rank raises
RuntimeError on all of them.
Methods:
-
close–Close the peer mappings and free the local buffer; idempotent. Only once no
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/peer.py
close()
¶
Close the peer mappings and free the local buffer; idempotent. Only once no kernel of any rank can still touch it (the runner is being dropped).
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/peer.py
_DeviceBytes
¶
__cuda_array_interface__ of nbytes bytes at a raw device address, for a
non-owning torch view.
Source code in vllm/models/kimi_k3/amd/specialized_decode/runtime/peer.py
tp_agree(ok, group)
¶
True when every rank of group passed ok true. Every rank must call
it at the same point; group is a CPU (gloo) process group, or None for a
single rank.