Commit aec5b5d
Add embedded NVIDIA Dynamo support to vLLM ModelHandler (#38701)
* Add embedded NVIDIA Dynamo support to vLLM ModelHandler
VLLMCompletionsModelHandler and VLLMChatModelHandler gain two
keyword-only parameters, use_dynamo (default False) and
dynamo_frontend_kwargs. When use_dynamo=True, the handler launches a
dynamo.frontend process as the OpenAI-compatible local endpoint plus a
separate dynamo.vllm worker, instead of vllm.entrypoints.openai.api_server.
The existing native-vLLM path is unchanged when the flag is absent.
The example pipeline vllm_text_completion.py gains --use_dynamo and
--max_tokens flags. validate_inference_args is now a no-op on both
handlers so OpenAI-style request kwargs (e.g. max_tokens) can be passed
through RunInference. A new unit-test module covers process-launch
behaviour for both paths.
This supersedes #36966 (now closed) and rebases the embedded-Dynamo
approach onto current master, preserving the recent batching-kwargs
additions to the ModelHandler base.
Co-authored-by: Danny McCormick <damccorm@google.com>
* Harden _VLLMModelServer process lifecycle per code review
Apply five robustness fixes flagged on PR #38701:
- Track the temporary etcd data dir as self._etcd_data_dir and
shutil.rmtree(..., ignore_errors=True) it in _stop_processes so worker
restarts don't leak /tmp directories.
- Wrap process.terminate() / process.wait() / process.kill() in a single
try/except OSError to absorb the ProcessLookupError race when a process
exits between poll() and the signal call.
- Switch the ETCD_ENDPOINTS removal from `del os.environ[...]` to
`os.environ.pop(..., None)` to be idempotent.
- Wrap __del__ in try/except Exception so cleanup never raises during
interpreter shutdown.
- Add the embedded etcd process to the check_connectivity() poll loop so
an etcd death fails fast instead of waiting out the 10-minute timeout.
* Enable Dataflow IT for embedded Dynamo on T4
Bump vllm.dockerfile.old to apache-beam[gcp]==2.71.0 (and the
COPY-from beam_python3.12_sdk image to 2.71.0), install
ai-dynamo[vllm], and add the etcd binary required by embedded
Dynamo's runtime discovery.
Uncomment the Dynamo IT block in common.gradle. Drop the unused
machine_type override so it inherits n1-standard-4 from argMap,
and switch nvidia-l4 -> nvidia-tesla-t4 to match the existing
native vLLM ITs and the local Dataflow validation (per @damccorm
review).
Validated end-to-end on Dataflow with Qwen/Qwen3-0.6B; the
nvext.timing field present on every PredictionResult confirms the
Dynamo frontend served the requests.
* Trigger Python PostCommit for Dynamo IT
Bump the beam_PostCommit_Python trigger file so the postcommit
suite (inferencePostCommitITPy312 -> vllmTests) runs the embedded
Dynamo IT against the rebuilt apache-beam-testing vLLM image.
* fix: run Dynamo vLLM IT separately in py312 PostCommit
Split vllmDynamoTests from vllmTests so py312 validates Dynamo without
blocking on the pre-existing native opt-125m hang in apache-beam-testing.
* Restore full vLLM postcommit suite
* fix: fold Dynamo IT back into vllmTests for py312 PostCommit
Revert the Option A split now that the native opt-125m vLLM hang is
fixed (3.12 PostCommit passed in ~2.5h). vllmTests again runs
completion -> chat -> Dynamo as a single suite; the separate
vllmDynamoTests task is removed. Bump PostCommit trigger to re-run.
---------
Co-authored-by: Danny McCormick <damccorm@google.com>1 parent 1c4b204 commit aec5b5d
6 files changed
Lines changed: 510 additions & 60 deletions
File tree
- .github/trigger_files
- sdks/python
- apache_beam
- examples/inference
- ml/inference
- test_resources
- test-suites/dataflow
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
141 | 155 | | |
142 | 156 | | |
143 | 157 | | |
| |||
178 | 192 | | |
179 | 193 | | |
180 | 194 | | |
181 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
182 | 198 | | |
183 | 199 | | |
184 | 200 | | |
185 | 201 | | |
186 | 202 | | |
187 | 203 | | |
188 | | - | |
| 204 | + | |
| 205 | + | |
189 | 206 | | |
190 | 207 | | |
191 | 208 | | |
192 | 209 | | |
193 | 210 | | |
194 | 211 | | |
195 | 212 | | |
196 | | - | |
| 213 | + | |
| 214 | + | |
197 | 215 | | |
198 | 216 | | |
199 | 217 | | |
| |||
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
43 | 51 | | |
44 | | - | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
0 commit comments