Overlay: build the n-gram table parameter on the meta device when VLLM_PLE_QUANT_DIR is set, and swap the stub Parameter instead of set_data — removes the 102 GB virtual reservation that the kernel's overcommit heuristic refuses on hosts with less RAM+swap than the table (field report, 64 GB host); validated under an emulated 67/99 GiB commit limit, sanity PASS, tool-calling 77.0 (n=3), 81 tok/s c1
Browse files- worker_image_quant.py +10 -3
worker_image_quant.py
CHANGED
|
@@ -436,9 +436,16 @@ def _ple_quant_attach(layer_name: str, layer: torch.nn.Module,
|
|
| 436 |
for p in parts[:-1]:
|
| 437 |
owner = getattr(owner, p)
|
| 438 |
owner._ple_quant = _PleQuantTable(quant_dir, rows, width)
|
| 439 |
-
# Stub before anything writes the parameter
|
| 440 |
-
#
|
| 441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
logger.info("PLE quant: %s.%s stubbed, gathers served from sidecar.",
|
| 443 |
layer_name, pname)
|
| 444 |
return pname
|
|
|
|
| 436 |
for p in parts[:-1]:
|
| 437 |
owner = getattr(owner, p)
|
| 438 |
owner._ple_quant = _PleQuantTable(quant_dir, rows, width)
|
| 439 |
+
# Stub before anything writes the parameter. Replace the Parameter object rather
|
| 440 |
+
# than assigning .data: with a quantized sidecar the table is built on the meta
|
| 441 |
+
# device (no 95 GB virtual reservation for the kernel's overcommit heuristic to
|
| 442 |
+
# refuse), and set_data() rejects a meta -> cpu swap. vLLM's weight attributes
|
| 443 |
+
# (weight_loader, output_dim, ...) are carried over to the stub.
|
| 444 |
+
old = getattr(owner, parts[-1])
|
| 445 |
+
stub = torch.nn.Parameter(torch.empty(0, width, dtype=param.dtype), requires_grad=False)
|
| 446 |
+
for k, v in vars(old).items():
|
| 447 |
+
setattr(stub, k, v)
|
| 448 |
+
setattr(owner, parts[-1], stub)
|
| 449 |
logger.info("PLE quant: %s.%s stubbed, gathers served from sidecar.",
|
| 450 |
layer_name, pname)
|
| 451 |
return pname
|