vllm.distributed.engram_pool.memory
¶
Shard and staging memory: NUMA-local pinned host pages and cuMem HBM.
Classes:
-
CuMem–CUDA VMM backing in HBM or on a Grace host NUMA node.
-
SharedHost–Pinned, GPU-mapped host bytes near the current GPU, in a file that RDMA
Functions:
-
device_view–A uint8 tensor over mapped GPU memory; torch retains
ownerwith it.
CuMem
¶
CUDA VMM backing in HBM or on a Grace host NUMA node.
Methods:
-
map–Map
handle(this allocation by default) for this GPU. -
release–Drop a handle once mapped: the mapping keeps the memory alive.
Source code in vllm/distributed/engram_pool/memory.py
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 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
map(handle=None, *, read_only=False)
¶
Map handle (this allocation by default) for this GPU.
Source code in vllm/distributed/engram_pool/memory.py
SharedHost
¶
Pinned, GPU-mapped host bytes near the current GPU, in a file that RDMA
proxy processes map too: a memfd, or, with thp_dir, an unlinked file on
that tmpfs.
thp_dir must be on a tmpfs mounted with huge=always, so the shard gets
transparent huge pages. A NIC translates every address it reads, and
gathers rows at random: over a large shard on base pages it misses its
translation cache on nearly every row.
Source code in vllm/distributed/engram_pool/memory.py
_check_pages(address, num_bytes, node, huge)
¶
Warn if the pages of [address, address + num_bytes) are mostly off
node, or (huge) mostly not huge pages, as when memory was short or
fragmented. Chunked mbind may have split the range into several VMAs.
Source code in vllm/distributed/engram_pool/memory.py
_claimable_bytes(node)
¶
Free and clean page-cache bytes on NUMA node node.
Source code in vllm/distributed/engram_pool/memory.py
_fault_on_node(owner, node)
¶
Fault in owner's pages on NUMA node node, 1 GB at a time.
MPOL_PREFERRED takes another node's free memory before reclaiming page
cache on node (with the default zone_reclaim_mode=0), so each chunk is
bound to node while it clearly has room, and only preferred after.
Source code in vllm/distributed/engram_pool/memory.py
_huge_page_bytes()
¶
The size of a transparent huge page: 2 MB, or 512 MB on 64 KB pages.
Source code in vllm/distributed/engram_pool/memory.py
device_view(address, num_bytes, owner=None)
¶
A uint8 tensor over mapped GPU memory; torch retains owner with it.