vllm.distributed.engram_pool.proxy
¶
RDMA owner proxy: per GPU, a process whose NIC gathers rows of the shards it serves into other GPUs' landing buffers.
It has its own GIL and one thread that moves rows (its command thread sleeps
in recv once set up), so it never waits on a CPU-busy model thread. The GPU
process sends commands over a socket (fds by SCM_RIGHTS). For a GPU fetching
rows (requester) from GPUs holding them (owners):
- The requester's GPU writes, per owner and table, chained RDMA WRITEs whose
SGEs gather that owner's rows, a packet's worth each, into the requester's
landing buffer, with the owner proxy's pointers. Each QP's last chain links
a READ of the requester's memory, which returns only once the rows before
it have landed, then a fenced inline WRITE of
seqinto that QP's flag for the table. The GPU then posts a WRITE_WITH_IMM that copies them into this owner's mailbox (rdma.py). - The owner process, asleep on its receive CQ's completion channel, posts the WRs as they are: its NIC gathers the rows, then writes the flags. Rows in host memory of the requester's node are gathered the same way by the requester's own owner process over loopback QPs, so no GPU reads host memory.
It wakes once per request and never spins.
Run as a script: only the standard library and verbs.py are imported.
Classes:
-
Owner–Posts requesters' WRs, so its NIC gathers rows of this GPU's shard and
Functions:
-
chain_length–WRs per chain when an owner posts
num_wrsWRs overqpsQPs. -
mailbox_bytes–A requester's WRs, then their SGEs.
Owner
¶
Posts requesters' WRs, so its NIC gathers rows of this GPU's shard and of its node's host shards; rows and flags of this GPU land through it.
Methods:
-
connect–Connect peers' gathering QPs and requesters' request QPs; returns
-
fits–Whether the next chain fits its send queue; a large one also needs no
-
map_peer–Register another process's host shard (a memfd) for this GPU's
-
register–Register host memory or HBM; returns its address, lkey and rkey.
-
retire–Reap completed chains, returning their send queue room.
-
run–Post requests' WRs a whole chain at a time: small requests (decode)
Source code in vllm/distributed/engram_pool/proxy.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
connect(peers, requesters, box_sizes, max_tables)
¶
Connect peers' gathering QPs and requesters' request QPs; returns this GPU's mailboxes (per requester and table) and their rkey and lkey.
Source code in vllm/distributed/engram_pool/proxy.py
fits(request)
¶
Whether the next chain fits its send queue; a large one also needs no
other large chain on its QP and fewer than max_large in flight.
Source code in vllm/distributed/engram_pool/proxy.py
map_peer(pid, fd, size)
¶
Register another process's host shard (a memfd) for this GPU's loopback gathers; returns its address here and lkey.
Source code in vllm/distributed/engram_pool/proxy.py
register(kind, size, iova, access, fds)
¶
Register host memory or HBM; returns its address, lkey and rkey.
Source code in vllm/distributed/engram_pool/proxy.py
retire()
¶
Reap completed chains, returning their send queue room.
Source code in vllm/distributed/engram_pool/proxy.py
run()
¶
Post requests' WRs a whole chain at a time: small requests (decode)
first, large ones (prefill) in turn and bounded by fits.
Source code in vllm/distributed/engram_pool/proxy.py
_Request
¶
A request's WRs in a mailbox, posted a chain at a time over its QPs, as the requester's GPU chained them.
Attributes:
Source code in vllm/distributed/engram_pool/proxy.py
next_wrs
property
¶
The next chain's WRs: each QP's last also links a READ and a flag.
_check(wc, count, what)
¶
Raise on the first failed completion in wc.