vllm.models.deepseek_v41.amd.mono.common.peer_memory
¶
Symmetric peer memory for the in-kernel TP all-reduces, and the agreement every rank must reach before anything collective (a rank that turned the mono layer off alone would leave the others spinning on the GPU).
Classes:
-
MonoUnsupported–The loaded model or runtime configuration is outside what mono serves.
-
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
MonoUnsupported
¶
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.
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
MonoUnsupported on all of them.
Methods:
-
close–Close the peer mappings and free the local buffer; idempotent. Only once no
Source code in vllm/models/deepseek_v41/amd/mono/common/peer_memory.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/deepseek_v41/amd/mono/common/peer_memory.py
_DeviceBytes
¶
__cuda_array_interface__ of nbytes bytes at a raw device address, for a
non-owning torch view.
Source code in vllm/models/deepseek_v41/amd/mono/common/peer_memory.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.