vllm.models.deepseek_v41.nvidia.specialized_decode.engram.prefetch
¶
Engram WKV ahead of the decoder layers.
With host-offloaded tables, Engram looks up its rows on a prefetch stream
before the decoder layers. The rest of the WKV chain (head all-gather, MXFP8
quantize, column-parallel GEMM, output all-gather) reads only those rows, so
for small decode steps EngramPrefetch runs it on a side stream right after
each layer's lookup, and the layer only waits for it before the fused post
kernel. The kernels, inputs and collectives are those of Engram.forward.
The chain issues TP collectives on the side stream, so whether a step starts it depends only on the step's rows, which every TP rank shares.
Classes:
-
EngramPrefetch–The WKV chains of a decode step's Engram layers, on one side stream.
Functions:
-
prefetchable–Whether
engram's WKV can run ahead: host-offloaded, TP-only tables
EngramPrefetch
¶
The WKV chains of a decode step's Engram layers, on one side stream.
Methods:
-
forward–engram(hidden_states, hash_ids, token_mask), on the WKV started -
join–Make the current stream wait for every chain no layer waited for.
-
start–Start every layer's WKV chain once its lookup is done.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/engram/prefetch.py
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 | |
forward(engram, hidden_states, hash_ids, token_mask)
¶
engram(hidden_states, hash_ids, token_mask), on the WKV started
ahead when there is one.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/engram/prefetch.py
join()
¶
Make the current stream wait for every chain no layer waited for.
start(num_tokens)
¶
Start every layer's WKV chain once its lookup is done.
Source code in vllm/models/deepseek_v41/nvidia/specialized_decode/engram/prefetch.py
prefetchable(engram)
¶
Whether engram's WKV can run ahead: host-offloaded, TP-only tables
and a CuTe DSL MXFP8 WKV (FlashInfer's CUTLASS MXFP8 GEMM shares one
process-wide workspace with GEMMs on other streams).