Repository navigation
Conversation
AMOOOMA
force-pushed
the
pr-vllm-integration
branch
from
October 30, 2026 17:21
ff5bb1b to
24ee97a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #40908 +/- ##
==========================================
+ Coverage 79.83% 79.88% +0.04%
==========================================
Files 494 496 +2
Lines 83575 84013 +438
==========================================
+ Hits 66722 67113 +391
- Misses 16853 16900 +47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AMOOOMA
force-pushed
the
pr-vllm-integration
branch
13 times, most recently
from
November 6, 2026 00:36
2eb9415 to
5687806
Compare
…ling Wire the RunInference prefix batching (apache#40905) and the capacity-based autoscaling signal (apache#40907) into the vLLM handlers: - VLLMCompletionsModelHandler / VLLMChatModelHandler accept a prefix_batching_config. When set, requests sharing a prompt prefix (the leading characters of the prompt, or the role and leading content of the first chat message, unless a custom key_fn is given) are routed to the same worker and batched together so vLLM's prefix cache is reused. - The handlers publish num_loaded_models_<model_identifier> (on by default; enable_autoscaling_metric / autoscaling_config to tune or disable) so Dataflow's GPU autoscaling sizes the pool by each worker's capacity. The server passes vLLM's vllm:request_success_total counter and vllm:num_requests_running gauge to an autoscaling_metrics.PrometheusNumLoadedModelsPublisher, which does the scraping and estimation. The metric tag is the identifier RunInference reports through ModelHandler.set_model_identifier. - The publisher starts once the vLLM server is reachable and stops with it. Its thread reaches the server only through a weak reference, so a dropped server is still garbage-collected, which stops the publisher and the vLLM processes. The only vLLM-specific parts are the two metric names, the default prefix extractors and the server lifecycle.
AMOOOMA
force-pushed
the
pr-vllm-integration
branch
from
November 6, 2026 19:47
5687806 to
d26d5e5
Compare
… signal In Dynamo mode the handler scraped the dynamo.frontend HTTP port, which only serves dynamo_frontend_* metrics, so the vllm:* counter and gauge the capacity estimate needs were never found and nothing was published. Start the dynamo.vllm worker with DYN_SYSTEM_PORT set, which turns on its system server; it also serves vLLM's engine metrics, and the publisher now scrapes that port in Dynamo mode. Dynamo parses DYN_SYSTEM_PORT as a signed 16-bit integer, so the port is picked from 20000-32767 rather than the ephemeral range. start_process gains an optional env argument. Verified on Dataflow staging (L4, ai-dynamo 1.6.2 / vLLM 0.31): each worker scraped its dynamo.vllm system port, found the vllm:* metrics and published num_loaded_models continuously, and the autoscaler's per-worker target matched the published capacity.
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.
Split out of #40760. This is the vLLM-specific part, built on the generic pieces that have all merged:
BatchElements(key_fn, num_shards),PrefixBatchingConfig)ModelHandler.set_model_identifier()autoscaling_metrics.PrometheusNumLoadedModelsPublisher)What
VLLMCompletionsModelHandler/VLLMChatModelHandler:prefix_batching_config: when set, requests that share a prompt prefix are batched together on the same worker, so vLLM's prefix cache is reused. By default the key is the leading characters of the prompt (completions), or the role and leading content of the first message (chat);key_fnoverrides it.num_loaded_models_<model_identifier>so Dataflow's GPU autoscaling sizes the pool by each worker's capacity.enable_autoscaling_metricturns it off andautoscaling_configtunes it.vllm:request_success_totalcounter andvllm:num_requests_runninggauge to anautoscaling_metrics.PrometheusNumLoadedModelsPublisher, which does the rest.set_model_identifier.use_dynamo=True) the frontend doesn't serve vLLM's metrics, so thedynamo.vllmworker is started withDYN_SYSTEM_PORTand the publisher reads that port instead.The only vLLM-specific parts are the two metric names, the default prefix extractors and the server lifecycle; everything else lives in the generic modules.
Testing
vllm_inference_test.py:DYN_SYSTEM_PORTbelow 32768 (Dynamo parses it as a signed 16-bit integer) and scrapes it; native vLLM still reads the API server port.BatchElements(8 shards by default).with_preprocess_fn.use_dynamo=True): each worker scraped itsdynamo.vllmsystem port, found thevllm:*metrics and publishednum_loaded_modelscontinuously; the autoscaler's per-worker target matched the published capacity and the job scaled to 2 workers.Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123orfixes #456).CHANGES.mdwith noteworthy changes.