vllm.config.engram
¶
Classes:
-
EngramConfig–Configuration for Engram embedding storage and sharding.
Functions:
-
model_has_engram_layers–Whether the model carries n-gram embedding layers.
EngramConfig
¶
Configuration for Engram embedding storage and sharding.
Methods:
-
compile_factors–Hash settings that affect embedding execution and graph structure.
-
get_parallel_size–Derive the embedding group size from the parallel configuration.
-
resolve_dp_shared_memory–Share host tables by default wherever the model supports them.
-
verify_model_config–Reject Engram configuration for models without n-gram embeddings.
-
verify_parallel_config–Reject unsupported embedding parallel topologies.
Attributes:
-
cpu_offload(bool) –Store embedding weights in host memory. NVLink peer groups use local
-
disk_offload(bool) –Keep Qwen4Exp PLE tables in the checkpoint files and read each step's
-
dp_shared_memory(bool | None) –Share CPU-offloaded embedding weights between co-located
-
embedding_across_dp(bool) –Shard embeddings across TP and all DP ranks when enabled.
-
peer_group_fetch(Literal['sync', 'async']) –Where a peer group's fetch kernels run.
sync: on the compute stream, -
peer_group_rdma_inflight(int) –With
rdma, the most prefill-sized gathers (64 WRs each) a GPU's NIC -
peer_group_size(int) –Split each table's rows over this many GPUs of several engines (the sum
-
peer_group_store(str | None) –File through which a peer group's engines meet once at startup. Required
-
peer_group_thp_dir(str | None) –With
rdmaand cpu_offload: a directory on a tmpfs mounted with -
peer_group_transport(Literal['nvlink', 'rdma']) –How a peer group reads rows:
nvlinkloads them from peer device or host memory -
use_thp(bool) –Back private CPU-offloaded tables with transparent huge pages (best
Source code in vllm/config/engram.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 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 | |
cpu_offload = True
class-attribute
instance-attribute
¶
Store embedding weights in host memory. NVLink peer groups use local Grace host memory when enabled and HBM when disabled.
disk_offload = False
class-attribute
instance-attribute
¶
Keep Qwen4Exp PLE tables in the checkpoint files and read each step's rows on the host instead of allocating the table. Takes precedence over cpu_offload.
dp_shared_memory = None
class-attribute
instance-attribute
¶
Share CPU-offloaded embedding weights between co-located DP replicas. Each node stores one copy of every TP shard, reducing host memory without per-step Engram DP collectives. Uses host-NUMA cuMem shared by FABRIC handle where supported (on ROCm, HIP VMM host memory with VLLM_ROCM_ENGRAM_HIP_VMM=1), else /dev/shm (which then needs capacity and a shared IPC namespace). Defaults to enabled when the model and other settings allow it; Flash uses private replicas. Falls back to per-replica tables when DP replicas are not co-located on one node or the host cannot hold them.
embedding_across_dp = False
class-attribute
instance-attribute
¶
Shard embeddings across TP and all DP ranks when enabled. Otherwise, each DP rank has a separate TP-sharded embedding replica.
peer_group_fetch = 'sync'
class-attribute
instance-attribute
¶
Where a peer group's fetch kernels run. sync: on the compute stream,
started before the decoder layers, each Engram layer waiting for its own
rows; over RDMA the rows move without SMs in between. async: on a side
stream beside the layers, so their SM work (all of NVLink's gather)
overlaps compute. Full CUDA graphs capture both; piecewise ones break at
the start and at each Engram layer's wait.
peer_group_rdma_inflight = Field(default=8, ge=0)
class-attribute
instance-attribute
¶
With rdma, the most prefill-sized gathers (64 WRs each) a GPU's NIC
has in flight for its peers; 0 means no limit. Decode-sized fetches bypass
it, so one engine's prefill delays another engine's decode by at most this
backlog. The default (~2 MB) keeps prefill fetches at full rate.
peer_group_size = 0
class-attribute
instance-attribute
¶
Split each table's rows over this many GPUs of several engines (the sum
of their GPU counts); lookups read rows from the owning GPU. Every engine
passes the same value, peer_group_store and peer_group_transport.
Requires a model with Engram pool support (DeepSeek V4.1 or Qwen4Exp),
CUDA, TP=1 and PP=1.
peer_group_store = None
class-attribute
instance-attribute
¶
File through which a peer group's engines meet once at startup. Required
with peer_group_size: the same path for every engine, reachable by all of
them and fresh per launch (e.g. under a per-job directory).
peer_group_thp_dir = None
class-attribute
instance-attribute
¶
With rdma and cpu_offload: a directory on a tmpfs mounted with
huge=always, where host shards are placed on transparent huge pages.
NICs gather rows at random, so a large shard on base pages misses the
NIC's address-translation cache on nearly every row, which can make large
fetches several times slower.
peer_group_transport = 'nvlink'
class-attribute
instance-attribute
¶
How a peer group reads rows: nvlink loads them from peer device or host memory
through CUDA FABRIC handles and an IMEX channel.
With rdma, the owners' NICs gather them from HBM, or from host memory
with cpu_offload.
use_thp = False
class-attribute
instance-attribute
¶
Back private CPU-offloaded tables with transparent huge pages (best effort, falls back to ordinary pinned pages). Prefaulting the tables at startup takes longer. Requires cpu_offload without dp_shared_memory. Always on for private tables on ROCm.
compile_factors()
¶
Hash settings that affect embedding execution and graph structure.
Source code in vllm/config/engram.py
get_parallel_size(parallel_config)
¶
Derive the embedding group size from the parallel configuration.
Source code in vllm/config/engram.py
resolve_dp_shared_memory(parallel_config, model_config=None)
¶
Share host tables by default wherever the model supports them.
Source code in vllm/config/engram.py
verify_model_config(model_config)
¶
Reject Engram configuration for models without n-gram embeddings.
Source code in vllm/config/engram.py
verify_parallel_config(parallel_config)
¶
Reject unsupported embedding parallel topologies.
Source code in vllm/config/engram.py
model_has_engram_layers(model_config)
¶
Whether the model carries n-gram embedding layers.