Repository navigation
Conversation
…IZES, QUANT, CACHE_DIR) Every option defaults to today's behaviour; a set-but-unrecognised value stops the server at startup instead of silently changing the serving configuration. The first stdout line after startup echoes the active settings so a deployment shows its own configuration in its logs. STARTUP_MODE=fast trades steady-state throughput for boot time (--optimization-level 1 plus a small default CUDA-graph capture set, batches past the set still run without a graph). STARTUP_MODE=eager skips compilation and graphs entirely. CUDA_GRAPH_SIZES trims the capture set on its own. QUANT=kv_fp8 halves KV-cache memory; QUANT=fp8 also quantizes weights on load. CACHE_DIR (default /cache) persists the vLLM compile cache and Triton kernels across restarts when it is a mounted volume, and degrades to today's ephemeral behaviour when it is not writable, which is permanent on Inference Endpoints. The vLLM flag names are verified against vllm/vllm-openai:v0.30.0's own 'vllm serve --help' output. serve.sh tests extended from 8 to 24 cases. Assisted-by: pi Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
…pters Measured on a DGX Spark (GB10) against the 8b checkpoint: - --quantization fp8 fails at load with "LoRA weight load: 168 parameter(s) absent from the checkpoint would be served UNINITIALIZED", because the aLoRA adapters are not quantized and carry no scale parameters. - --kv-cache-dtype fp8 fails in input_quant_fp8.forward_cuda on "assert input.ndim == 2" in the switch forward path. Neither can serve the only model this image supports, so the option is removed rather than shipped broken. Any QUANT value now stops the server at startup with that reason instead of failing deep in engine init. README gains the measured boot table for the same hardware: eager 232 s, fast 255 s, default 279 s. Weight loading (99-122 s) dominates, and CUDA graph capture costs 97 s for six sizes on GB10, so eager is the fastest startup mode there while fast remains the right choice where capture is cheap. Banner no longer reports a quantization setting. Assisted-by: pi Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
Measured on a DGX Spark (GB10, 121.6 GB unified memory), arm64 image, 8b checkpointRan the test image against the local 8b mount, each arm a fresh container,
Findings, in order of how much they change the picture:
Verified working on this hardware
What this changes in the PRCommit 8d3533f removes Still open
|
End-to-end request check (same GB10, arm64 image,
|
Correction to two claims in my previous commentsBoth were under-verified when I wrote them. Re-derived from the logs and the shipped code. 1. "Graph capture cost 97 s for six sizes" — wrong. That figure came from vLLM's capture progress bar, which does not isolate capture. From the log timestamps, engine init (profile + KV + warmup + compile + capture) was:
So capture plus compilation costs ~16–24 s over eager, not 97 s. 2. "
3. Why the totals are not a usable ranking: weight loading varied 103.6 → 126.6 s across the three runs, unprompted, from page-cache and disk state. That spread (~23 s) is larger than every flag effect measured, so 4. "Likely a vLLM gap" for the fp8 failure — I had this backwards. vLLM 0.30's The most probable reading is therefore that the plugin's vLLM backend hands unflattened activations to a vLLM quantized linear that documents a 2-D precondition — an integration gap on the granite-switch side, or a combination that was never supported, rather than a defect in vLLM core. Same shape of answer for the fp8-weights failure: vLLM's LoRA loader refuses a parameter set it cannot fully initialise, which looks like intended behaviour when online weight quantization meets adapters it does not quantize. Net effect on this PR: unchanged. Neither quantization path can serve these checkpoints, so |
What this gives users
A deployment that boots faster when it needs to: scale-to-zero endpoints, demo boxes, and any restart that pays vLLM's compile and CUDA-graph capture cost again. Today that cost is fixed; after this PR it is tunable with four environment variables, all defaulting to exactly today's behaviour, so existing deployments see no change at all.
STARTUP_MODE=fast— less compilation (--optimization-level 1) and CUDA graphs captured only for batch sizes 1–32. Batches past the largest captured size still run, without a graph: the failure mode of a too-small set is slower decode, never an error.STARTUP_MODE=eager—--enforce-eager, no compilation and no graphs; fastest boot, slowest serving.CUDA_GRAPH_SIZES=1,2,4,8— trims the capture set on its own.QUANT=kv_fp8/QUANT=fp8— KV-cache fp8 (about half the KV memory) and weight quantization on load. Both perturb decision probabilities slightly; the README says to treat published scores as unquantized-only.CACHE_DIR(default/cache) — when writable, vLLM's compile cache and Triton kernels live under it, so a mounted volume persists them across restarts and a restart skips most of the compile cost. Unwritable or unmounted (permanently the case on Inference Endpoints), behaviour is unchanged.Fail-safe by construction: unset or empty values mean today's defaults, and a set-but-unrecognised value stops the server at startup with the offending value in the log, matching the existing
DECISION_SPEECH_INPUTconvention. The first stdout line of every boot is astartup:banner naming the active mode, quantization, capture sizes and cache location, so a deployment's own configuration is visible in its logs.Mechanism
serve.shbuilds aSTARTUP_ARGSarray from validated env values and appends it to the existingvllm serveinvocation. No flags reach vLLM unless an option is explicitly set, and every flag name was verified againstvllm serve --helpin the shippedvllm/vllm-openai:v0.30.0image (notably--optimization-level, not the-O1shorthand the vLLM docs use, and--cudagraph-capture-sizestakes space-separated sizes).Limitations
QUANT=fp8andkv_fp8change decision outputs; they are opt-in and documented as such.Testing
tests/test_serve_sh.pyextended from 8 to 24 cases: defaults add no flags, each mode adds exactly its flags,CUDA_GRAPH_SIZESoverridesfast's default set, empty values fall back, every invalid value (bad mode, malformed size list, unknown quant) exits 2 beforevllmstarts, writableCACHE_DIRexports both cache roots, and an unwritable one falls back to ephemeral with a warning while the server still starts.ruff format --check,ruff checkand the pre-commit hooks (SPDX, gitleaks) pass.ghcr.io/generative-computing/granite-switch-decision:feat-startup-tuning-options(and-asr) for live validation.latestand0.2.0are untouched.