Repository navigation
Conversation
- Lock vllm 0.32.0 (torch 2.13.0 cu130, transformers 5.19.0, flashinfer 0.7.0.post1). vllm 0.32 needs Python 3.11+, so the vllm extra is skipped on 3.10, and torchcodec 0.14+. - Move the vllm image to the CUDA 13.0.3 base to match torch's CUDA. - Fix vec-inf metrics for vllm V1 metric names (kv_cache_usage_perc, num_preemptions, prefix cache counters), aggregate across engines and finish reasons, and read SGLang metrics; launch SGLang with --enable-metrics so /metrics exists. - Map -O to --optimization-level, add missing vllm short aliases, and map SGLang --ep-size to --expert-parallel-size. - Do not treat warning-level log lines (e.g. Ray's pubsub warning) as a failed server.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #330 +/- ##
==========================================
+ Coverage 89.98% 90.64% +0.66%
==========================================
Files 14 14
Lines 1468 1593 +125
==========================================
+ Hits 1321 1444 +123
- Misses 147 149 +2
🚀 New features to boost your workflow:
|
The vllm extra now carries a python_full_version marker, so the unanchored grep also matched dependency entries and wrote several lines to GITHUB_OUTPUT, failing the step.
… pin, docs - Add a /metrics capture from vllm 0.32.0 serving Llama-3.2-1B-Instruct on two A40 nodes (pipeline parallel 2) as a test fixture, plus tests for data parallel aggregation, finish reasons, label escaping and SGLang metric names. - Test that generated scripts select the Ray executor only for multi-node vllm, that SGLang always gets --enable-metrics, and that the generated scripts are valid bash. - Drop sgl_kernel from the sglang extra. sglang pins its own sglang-kernel package, and the older sgl-kernel distribution installs the same sgl_kernel module built for a different torch, so importing it failed with an undefined c10 symbol. - Update the metrics section, engine argument aliases and the vllm docs link in the user guide.
for more information, see https://pre-commit.ci
…upgrade notes - Multi-node vllm runs Ray and vllm serve in separate apptainer instances. Ray 2.56 finds the local raylet by scanning the process table, so with --containall (private PID namespace) vllm serve failed with "No node info found matching attributes". Use --contain --cleanenv for the multi-node vllm containers; single node and SGLang keep --containall. Verified on Bon Echo with two A40 nodes. - Phi-3-vision-128k-instruct, Phi-3.5-vision-instruct and Molmo-7B-D-0924 ship custom code; vllm rejects their configs without --trust-remote-code (same on 0.22), so add it to models.yaml. - Add a live SGLang 0.5.12.post1 /metrics capture as a test fixture. - Add vllm 0.32 upgrade notes to the user guide.
- Split --vllm-args/--sglang-args only on commas outside {}, [] and
quotes, accept '-tp 2' as well as '-tp=2', and add the -dc
(--diffusion-config) alias.
- Quote engine argument values in generated scripts with shlex.quote so
JSON reaches the engine intact. Values with $ are double-quoted and a
leading ~/ is left unquoted, so shell expansion still works there.
- SGLang: count scheduler gauges only from tensor/pipeline/expert rank
0 (they repeat per rank), and report num_requests_total as
finished_requests_total (it includes aborted requests).
- Multi-node vllm containers now get $NCCL_ENV_ARG, and the NCCL_IB_GID_INDEX
default is a real parameter expansion (the template dropped the $, so
the value was the literal text {NCCL_IB_GID_INDEX:-3}).
- vllm extra is now >=0.32,<0.33 (still Python 3.11+); lock unchanged
apart from the specifier.
- sglang image canary also imports datasets, pyarrow, transformers and
protobuf.
- Docs: Python API metric key changes, SGLang metric semantics, supported
GPUs and drivers on Bon Echo, quoting of engine args, and the Python
3.10 note for the vllm extra in the README.
find_available_port could pick a GCS port in Ray's default worker port range (10002-19999); ray start on the workers then failed with "worker_ports is trying to use a port number ... used by other components". Seen once on Bon Echo during a 2-node launch.
SGLang 0.5.12 also binds a gRPC port at the server port + 10000 and exits with "SGLANG_GRPC_PORT (...) must be between 1 and 65535" when vec-inf picks a server port above 55535. Seen on Bon Echo.
… ports
- Values that do not start with { or [ are split into words and each word
is quoted on its own, so flags that take several values
(--cudagraph-capture-sizes 1 2 4 8, --served-model-name a b, ...)
work again in both the space and = forms. JSON stays one word.
- Only words with a real variable reference ($NAME, ${...}) or an
escaped \$ are double-quoted; anything else is single-quoted, so
price$5 and JSON containing $ stay literal.
- The comma splitter only tracks quotes inside {} or [] and raises a
ValueError for unbalanced braces, brackets or quotes instead of
silently swallowing the following arguments.
- SGLang: per metric and dp_rank keep the lowest (pp, tp, moe_ep) rank
that reports, then sum over dp_rank. With --enable-dp-attention a DP
group's reporting scheduler can have tp_rank != 0.
- Without ibv_devices on the host, leave the transport to NCCL instead
of forcing NCCL_IB_DISABLE=1 into the containers.
- Server port range starts at 20000, above Ray's worker ports.
- Docs: engine argument quoting rules, NCCL and port changes.
- Put $NCCL_ENV_ARG before the user's --env values in the multi-node container command; apptainer keeps the last value for a repeated key, so --env NCCL_IB_GID_INDEX=2 now overrides the script default. - Inside double quotes, escape every backslash except one directly before $, so a value like $X\"q no longer leaves an open quote. - $$ (and $$NAME) no longer counts as a variable reference. - Split values into words on whitespace with quotes only grouping words when they start a word; apostrophes inside a word (it's, a'b'c) stay literal instead of being stripped as a quote pair. - Docs: override note for NCCL_IB_GID_INDEX and the quoting rules.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades vllm from 0.22.0 to 0.32.0 and fixes what the new version needs, including the
vec-inf metricscommand, which was reading metric names vllm no longer exports. Tested end to end on Bon Echo A40 nodes (single GPU, tensor parallel 2, and two nodes with pipeline parallel 2), both from a container built the same way asvllm.Dockerfileand from a venv built from the lock.Supersedes #328 (0.24).
Dependencies
uv.lockrelocked from main's lock withuv lock --upgrade-package vllm==0.32.0(uv 0.13.5, lock revision 5). vllm 0.32.0 brings torch 2.13.0 (CUDA 13.0 wheels), torchvision 0.28.0, transformers 5.19.0, tokenizers 0.23.3, flashinfer-python 0.7.0.post1, xgrammar 0.2.8, triton 3.7.1, nccl 2.29.7, compressed-tensors 0.17.0.vllmextra is nowvllm[audio,bench]==0.32.0; python_version >= '3.11', so the vec-inf client keeps supporting Python 3.10 and the extra simply skips vllm there.torchcodecmoves from>=0.9,<0.10to>=0.14(vllm 0.32 requires it). The lock picks 0.17.0.sgl_kernel>=0.3.0from the sglang extra. sglang pins its ownsglang-kernel, and the oldsgl-kernel0.3.21 installs the samesgl_kernelmodule built for a different torch, so importing it failed withundefined symbol: _ZN3c104cuda29c10_cuda_check_implementation.... This was already broken on main.vllm[audio,bench]>=0.32,<0.33; python_version >= '3.11'(lock still resolves 0.32.0; only the specifier line changed in the lock).sglang.Dockerfilekeeps its CUDA 12.8.1 base. Its build-time import check now also imports datasets, pyarrow, transformers and protobuf, like the vllm image.vllm.Dockerfilebase moves fromnvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04tonvidia/cuda:13.0.3-cudnn-devel-ubuntu24.04. torch is built for CUDA 13.0, and vllm 0.32 has FlashInfer compile its top-p/top-k sampler at startup with the systemnvcc. With a mismatched toolkit the compile fails ("CUDA compiler and CUDA toolkit headers are incompatible" with nvcc 13.3 and 13.0 headers; "Could not find nvcc" with no toolkit). This matches vllm's own image (CUDA 13.0.3). CUDA 13 needs driver 580+; Bon Echo A40 and A100 nodes run 580.178.04.TORCH_CUDA_ARCH_LIST(7.5 to 9.0) is still valid for CUDA 13.sglang.Dockerfileis unchanged.docker.yml: the backend version lookup now anchors on^name = "vllm"$. The new python marker made the old grep match dependency lines too and write several lines toGITHUB_OUTPUT, failing the job.Code
_client_vars.py,client/_helper.py,cli/_helper.py):KEY_METRICSnow uses the names vllm 0.32 exports (checked againstvllm/v1/metrics/loggers.pyand live output):vllm:kv_cache_usage_perc,vllm:num_preemptions_total,vllm:prefix_cache_queries_total/vllm:prefix_cache_hits_total(hit rate is computed from them), plus queue time count.vllm:gpu_cache_usage_perc,vllm:cpu_cache_usage_perc,vllm:num_requests_swappedand the*_prefix_cache_hit_rategauges no longer exist (the V0 engine metrics were already gone in 0.22).vllm:request_success_total, which has one series perfinished_reason: before, "Successful Requests" showed the last series (repetition, usually 0). It now sums stop, length and repetition, and leaves out abort and error. Data parallel engines are summed; KV cache usage is averaged./metricswith--enable-metrics. The SGLang launch templates now pass--enable-metrics, andKEY_METRICSmaps the SGLang names (sglang:num_running_reqs,sglang:num_queue_reqs,sglang:token_usage,sglang:cache_hit_rate,sglang:num_retracted_requests_total, token and latency counters).enable_prefix_cachingkey from the job JSON (engine args live underengine_args, so it was always false). Prefix caching is on by default in both engines; the row shows whenever the server reports it.metricstable rows are now: throughput, running, waiting, KV Cache Usage, Preemptions, Prefix Cache Hit Rate, Avg Request Latency, Avg Queue Time, token totals, Successful Requests. The parser also handles quoted label values with spaces and escaped quotes, and exposition timestamps.--ep-sizemapped to a non-existent--expert-parallel-expert-size; it now maps to--expert-parallel-size(SGLang accepts--expert-parallel-size,--ep-sizeand--ep).-Omapped to--compilation-config(-O3became--compilation-config 3, which vllm rejects). vllm itself expands-O3to--optimization-level 3, so vec-inf now does the same and accepts-O3,-O=3and-O 3.-ep,-sc,-cc,-ac,-dpm,-asc. Boolean short flags like-epare now expanded too, and only the first=splits flag and value.--vllm-args/--sglang-argssplit only on commas outside{}and[](quotes are tracked only inside them), so-sc={"method":"ngram","num_speculative_tokens":3}stays one argument. Behaviour change: unbalanced{,[,}or](or an unclosed quote inside them) in engine args now raise aValueErrorat launch instead of silently swallowing the following arguments. Quotes outside braces are ordinary characters, so--x=it's,-tp=2gives two arguments. Flag and value can be separated by=or a space. Added-dc(--diffusion-config).{or[is one single-quoted word, so JSON reaches the engine intact (before, bash stripped the inner quotes). Other values are split into words on whitespace (a leading quote groups words, quotes inside a word such asit'sstay literal) and each word is quoted on its own, so flags that take several values (--cudagraph-capture-sizes 1 2 4 8,--served-model-name a b,--device-ids,--ignore-patterns, ...) keep working in both the space and=forms. One word with spaces must be quoted (--chat-template='/p q/t.jinja').models.yaml, Bon Echo's cached configs or the templates relies on shell expansion inside a value. A word with a real variable reference ($NAME,${...}, not$$) or an escaped\$is double-quoted with every other backslash escaped, so--download-dir=$SLURM_TMPDIR/xstill expands,a\$bgivesa$band$X\"qstays one word; a leading~/stays unquoted; any other$(price$5,$$, JSON) stays literal.--enable-metrics-for-all-schedulers). For each metric anddp_rankonly the lowest reporting rank is counted, then DP groups are summed; with--enable-dp-attentiona group's reporting rank can havetp_rank != 0, which this handles.sglang:num_requests_totalis reported asfinished_requests_total("Finished Requests" in the CLI) because it includes aborted requests._slurm_templates.py,_slurm_script_generator.py): multi-node vllm runs Ray andvllm servein separate apptainer instances. Ray 2.56 (same version as on main) finds the local raylet by scanning the process table, so with--containall(private PID namespace)vllm servefailed with "No node info found matching attributes". Multi-node vllm containers now use--contain --cleanenv; single node and SGLang keep--containall.$NCCL_ENV_ARG(set by the RDMA check) is now passed to these containers, soNCCL_IB_*reaches NCCL under--cleanenv. This is a behaviour change: on RoCE links NCCL now actually getsNCCL_IB_GID_INDEX=3(InfiniBand0).$NCCL_ENV_ARGcomes before the user's--envvalues, sovec-inf launch ... --env NCCL_IB_GID_INDEX=2overrides the default (apptainer keeps the last value for a repeated key). When the host has noibv_devices, the script no longer forcesNCCL_IB_DISABLE=1; NCCL picks the transport itself. (I could not run the per-partitionibv_devicescheck, see Not verified, so I took the option that is safe either way.) The template also dropped the$inexport NCCL_IB_GID_INDEX={NCCL_IB_GID_INDEX:-3}, so the value was literal text; it is now a real parameter expansion. Verified on Bon Echo: NCCL logsNCCL_IB_GID_INDEX set by environment to 3and uses RoCE between nodes.ray starton the workers fail ("worker_ports is trying to use a port number ..."), which happened once in testing.client/_utils.py): warning and info log lines are no longer treated as a failed server. Ray logs[... W ...] rpc_client.h: Failed to connect to the observability pubsubduring multi-node startup, which madevec-inf statusreport FAILED for a server that came up fine. Accepted trade-off from review: a genuinely fatal message logged at WARNING level is no longer caught by the status check (it still shows once the process exits).Config
models.yaml: added--trust-remote-codefor Phi-3-vision-128k-instruct, Phi-3.5-vision-instruct and Molmo-7B-D-0924. vllm rejects their configs without it ("contains custom code which must be executed"); this is the same on 0.22.models.yaml, and none of the 113 models in Bon Echo's cached configs, uses an architecture removed between 0.22 and 0.32.Docs
reasoninginstead ofreasoning_content), and a "Notes on the vLLM 0.32 upgrade" section.Python API: metric key changes
VecInfClient.get_metrics()returns different keys:gpu_cache_usagekv_cache_usagecpu_cache_usagerequests_swappedpreemptions_total)gpu_prefix_cache_hit_rateprefix_cache_hit_rate(plusprefix_cache_hits,prefix_cache_queries)cpu_prefix_cache_hit_ratesuccessful_requests_totalfor SGLangfinished_requests_total(vLLM keepssuccessful_requests_total)New keys:
preemptions_total,queue_time_count,avg_queue_time. Theenabled_prefix_cachingattribute ofPerformanceMetricsCollectorandMetricsResponseFormatteris gone.Supported GPUs
CUDA 13 needs driver 580+ and compute capability 7.5+. On Bon Echo (
sinfo): A100 (a100_b1-b5), A40 (a40_b1-b5,interac) and Quadro RTX 6000 (rtx6000_b1-b5,interac) all run driver 580.178.04. vllm 0.32 served models on A40 and RTX 6000 (Turing falls back from bfloat16 to float16 and uses Triton attention). A few drainedgpu:nvidianodes in the a40 partitions could not be checked.Behaviour changes in vllm 0.22 to 0.32 that cluster users may notice
g_idx) is ignored (0.30).max_num_batched_tokensdefault 16384, was 8192 (0.28). Shared memory tensor arena on by default (0.32), and vllm fails fast if /dev/shm is too small (0.27).--allowed-origins(0.32).max_tokensis no longer reserved from the context window (0.32).reasoning, notreasoning_content(0.22/0.28); an emptytool_callslist is omitted (0.24).CUDA_VISIBLE_DEVICESand adds--device-ids(0.24). Slurm's allocation is still respected (verified with TP=2 and two nodes).--max-num-partial-prefills,--max-long-partial-prefills(0.27),--calculate-kv-scales,--override-attention-dtype(0.28).--disable-cascade-attnstill parses but only warns (0.32).--mamba-cache-mode allis rejected (0.32).python -m vllm.entrypoints.openai.api_serveris deprecated in favour ofvllm serve(0.29); vec-inf already usesvllm serve.vllm:request_num_preemptions,vllm:prompt_tokens_cached_by_source_total,vllm:admission_rejections_total.vllm serveflag that vec-inf generates or documents was removed; the full option diff (parser dump of both versions) shows only the four removals above.Testing
uv sync --dev --prerelease=allow, thenuv sync --no-devand the import test) and against the locked set (uv sync --frozen --devwith uv 0.13.5). New tests cover JSON-valued, multi-value (--cudagraph-capture-sizes,--served-model-name, space and=forms) and space-separated engine args (generated script checked withbash -nand the words echoed back through bash), the quoting rules for$,\$,~/andprice$5, unbalanced splitter input, SGLang DP-attention rank labels, shell expansion for$and~/values, NCCL env and GID expansion in multi-node scripts, port ranges, SGLang per-rank aggregation, metric parsing (a real/metricscapture from vllm 0.32.0 serving Llama-3.2-1B-Instruct on two A40 nodes, a real SGLang 0.5.12.post1 capture, data parallel aggregation, finish reasons, label escaping), the alias fixes, the Ray executor and container flags for multi-node,--enable-metricsfor SGLang, andbash -non generated scripts.models.yaml, as configured and as a forced two-node variant (192 command lines), thevllm servecommand fromSlurmScriptGeneratorwas parsed by vllm 0.32.0's ownvllm serveparser and turned intoAsyncEngineArgs.from_cli_args. All 192 pass (Linux arm64 container, locked deps, no GPU, CUDA platform stubbed). On a Bon Echo A40 node,create_engine_config()was also run against each model's realconfig.json, for both vllm 0.32.0 and 0.22.0: the results are identical between versions (154 pass). The remaining cases are only the expected world-size check on a 1-GPU validation node, PP on embedding models in the synthetic two-node variant, the three remote-code VLMs (fixed in this PR, rechecked: pass), and Phi-3-medium-128k-instruct, whose config fails the same way on 0.22 (rope_parametersmissingoriginal_max_position_embeddingsunder transformers 5).vec-inf launch,status,metricsandshutdownfrom this branch:vllm.Dockerfile(thepr-330image is in a private registry I cannot read). Qwen2.5-0.5B-Instruct on 1 GPU, Qwen3-0.6B with--tensor-parallel-size=2, and Llama-3.2-1B-Instruct on 2 nodes with-pp=2all reached READY, answered/v1/chat/completionsand/v1/completions, andvec-inf metricsshowed correct values (for example 48 running requests and a 95% prefix cache hit rate under a 48-request burst, and successful requests matching the number sent).VLLM_USE_FLASHINFER_SAMPLER=0or a CUDA 13.0 toolkit, see the upgrade notes).sglang.Dockerfileequivalent (CUDA 12.8.1 base, locked sglang set, new canary passes: sglang 0.5.12.post1, torch 2.11.0+cu130).vec-inf launch Qwen2.5-0.5B-Instruct --engine sglangon an A40 reached READY with--enable-metrics, chat and completions worked, andvec-inf metricsshowed the new rows (Finished Requests, recent prefix cache hit rate). The first launch hit the gRPC port bug above (fixed). In one run the first chat request after a cold start returned an error response while the server stayed up; after a restart with warm kernel caches every request succeeded. I could not reproduce it.--vllm-args '-sc={"method":"ngram","num_speculative_tokens":3,"prompt_lookup_max":4},-cc={"cudagraph_capture_sizes":[1,2,4,8]},-tp 1'on an RTX 6000. vllm logged the parsed speculative and compilation configs and reported ngram drafts in/metrics.NCCL_IB_GID_INDEX=3.Not verified
The last round of changes (multi-value quoting, SGLang DP-attention ranks, the
ibv_devicesfallback, the 20000 port floor) is covered by unit tests only. Non-interactive SSH to Bon Echo stopped working (it now asks for keyboard-interactive auth), so I could not rerun GPU jobs or checkibv_deviceson the a40, a100 and rtx6000 nodes. Earlier in this PR, the 2-node run on rtx6000 nodes foundmlx5_0RoCE via NCCL, and the login node hasibv_devices.The actual
pr-330image on a GPU (private registry). The tested image uses the same base, locked requirements and install steps, except Python 3.12 comes from Ubuntu's package instead of a source build.A100 serving (only the driver version was checked), and the drained
gpu:nvidianodes.Large models, quantized models and VLM serving; those were checked through vllm's config validation only.
The actual
pr-330SGLang image (private registry); the tested one is the equivalent apptainer build. SGLang multi-node was not run.To test with the PR image