vllm.distributed.weight_transfer.sparse_nccl_engine ¶
Sparse NCCL weight transfer engine.
A standalone engine (not a subclass of NCCLWeightTransferEngine) for applying sparse, flat-index weight patches in place. It shares only NCCL process-group initialization with the dense engine (via nccl_common); the update path applies index/value patches directly to existing model parameters and never runs layerwise reload.
MVP limitations: * TP=1 and PP=1 only * uses runtime/kernel-format parameter names * not composable with checkpoint-format or packed updates
Classes:
-
SparseNCCLWeightTransferEngine–Sparse weight transfer engine using NCCL.
-
SparseNCCLWeightTransferUpdateInfo–Update info for the sparse NCCL weight transfer backend.
-
SparseWeightPatch–A sparse in-place patch for one existing parameter.
SparseNCCLWeightTransferEngine ¶
Bases: WeightTransferEngine[NCCLWeightTransferInitInfo, SparseNCCLWeightTransferUpdateInfo]
Sparse weight transfer engine using NCCL.
Receives flat-index (indices, values) patches broadcast from the trainer (rank 0) and applies them in place to existing model parameters. Weights are applied directly without layerwise reload, so start_weight_update and finish_weight_update are no-ops.
Methods:
-
finish_weight_update–No-op: sparse patches are applied in place, no layerwise reload.
-
init_transfer_engine–Initialize the NCCL process group with the trainer.
-
receive_weights–Receive sparse flat-index patches from the trainer and apply them.
-
start_weight_update–No-op: sparse patches are applied in place, no layerwise reload.
-
trainer_send_weights–Broadcast sparse flat-index patches from trainer to vLLM workers.
Source code in vllm/distributed/weight_transfer/sparse_nccl_engine.py
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 | |
_apply_patch(patch) ¶
Apply a single sparse flat-index patch to an existing model param.
Source code in vllm/distributed/weight_transfer/sparse_nccl_engine.py
finish_weight_update() ¶
init_transfer_engine(init_info) ¶
Initialize the NCCL process group with the trainer.
Source code in vllm/distributed/weight_transfer/sparse_nccl_engine.py
receive_weights(update_info) ¶
Receive sparse flat-index patches from the trainer and apply them.
Source code in vllm/distributed/weight_transfer/sparse_nccl_engine.py
start_weight_update() ¶
No-op: sparse patches are applied in place, no layerwise reload.
Source code in vllm/distributed/weight_transfer/sparse_nccl_engine.py
trainer_send_weights(iterator, trainer_args) staticmethod ¶
Broadcast sparse flat-index patches from trainer to vLLM workers.
Source code in vllm/distributed/weight_transfer/sparse_nccl_engine.py
SparseNCCLWeightTransferUpdateInfo dataclass ¶
Bases: WeightTransferUpdateInfo
Update info for the sparse NCCL weight transfer backend.
Attributes:
-
num_updates_list(list[int]) –Number of sparse entries to receive for each parameter in
names.
Source code in vllm/distributed/weight_transfer/sparse_nccl_engine.py
num_updates_list instance-attribute ¶
Number of sparse entries to receive for each parameter in names.