Repository navigation
fix(speechlm2): default offline vLLM engines to spawn in the SpeechLM plugin - #16667
Conversation
… plugin Importing the plugin initializes the CUDA driver through NeMo's numba-cuda availability check, so the EngineCore process that offline vllm.LLM forks afterwards fails with 'CUDA driver initialization failed'. register() now defaults VLLM_WORKER_MULTIPROC_METHOD to spawn, as vllm serve already does, and keeps an explicit setting. Drop the now-redundant workaround from docs. Signed-off-by: Valentin Mendelev <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
The PR defaults vLLM workers to spawn, keeps explicit user settings, and removes the redundant environment setup from the docs. I completed the review of all seven changed files and found no blocking defects. Approval needs a maintainer decision because the registration hook changes process-start behavior for every engine loading this plugin, including text-only models and unsupported vLLM versions.
The new regression test covers an unset variable and explicit fork, and checks that the default applies before the version gate. Reading the base implementation shows the unset-variable case fails without this change. Environment restoration is sound, and the directly affected offline scripts have __main__ guards. The documentation edits match the new default.
I reviewed source only. I did not run tests, execute GPU inference, or build documentation; the reported validation results are author-provided. Third-party vLLM internals are not mounted, so I could not independently verify their loading order. The supplied commit message includes a DCO trailer, but author metadata was not supplied to verify the identity match.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
/ok to test fb66728 |
|
/review-approve |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
The PR defaults vLLM workers to spawn, keeps explicit user settings, and removes redundant environment setup from the docs. I completed this same-head follow-up with no eligible defect findings. Approval still needs a maintainer decision.
Review 5961138296 reviewed the current commit, so there are no subsequent changes or unresolved findings to assess. I accounted for all seven changed files and checked the earlier source observations without restarting broad defect discovery. The registration hook still sets the default before the version gate. The regression test and environment cleanup cover the changed contract appropriately: an unset variable becomes spawn, explicit fork stays unchanged, and teardown restores the original environment. The edited documentation matches that behavior, and the directly affected offline entrypoints have __main__ guards.
The maintainer guardrail still applies because the general-plugin entry point changes process-start defaults for every engine loading this plugin. A maintainer needs to accept that scope, including text-only models and unsupported vLLM versions.
I reviewed source only. I did not run tests, GPU inference, calibration, or a documentation build; the reported validation is author-provided. Third-party vLLM internals are not mounted, so I could not independently verify loading order. Commit author metadata was not supplied, so I could not check the DCO identity match.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
[🤖]: Hi @vmendelev 👋, We wanted to let you know that a CICD pipeline for this PR just finished successfully. So it might be time to merge this PR or get some approvals. |
What does this PR do ?
Offline
vllm.LLMengines in an environment with NeMo installed no longer needVLLM_WORKER_MULTIPROC_METHOD=spawn: the SpeechLM vLLM plugin now makesspawnthe default.Collection: speechlm2
Changelog
EngineArgs. Importing the SpeechLM plugin importsnemo.collections.speechlm2, which reachesnemo/core/utils/optional_libs.py, whoseNUMBA_CUDA_AVAILABLEcheck callsnumba.cuda.is_available()and initializes the CUDA driver. Torch's CUDA state stays uninitialized, so offlineLLMkeeps vLLM's defaultforkstart method, and the forkedEngineCorefails withRuntimeError: CUDA driver initialization failed. This hits any offline engine in such an environment, text-only models included.vllm serveis unaffected because its CLI already defaults tospawn.register()setsVLLM_WORKER_MULTIPROC_METHODtospawnunless the user chose a method, asvllm servedoes. It runs before the version gate because the import has already initialized CUDA even when registration is skipped. Every Speech script that constructsLLMalready has the__main__guard thatspawnneeds.finetune-speech-llmskill, the quantization guide, the quantization README and the calibration script docstring. The troubleshooting entry now points at an explicitfork.Making NeMo's numba-cuda check lazy would also fix the root cause for forked processes outside vLLM.
NUMBA_CUDA_AVAILABLEis read at import time bynumba_cuda_requiredand ASR'saudio_preprocessing, though, so that is a wider core change. This PR only removes the vLLM failure.Validation
pre-commit run --from-ref origin/main --to-ref HEADandgit diff --checkpass; the commit is signed off by its author.pytest --cpu -m "not pleasefixme" tests/collections/speechlm2/test_vllm_*.py tests/collections/speechlm2/test_finetuning_tools.pyon vLLM 0.32.0: 554 passed, 6 skipped. The newtest_register_defaults_vllm_workers_to_spawn[None-spawn]fails without the fix. The fake-vLLM helper restores the variable, soregister()tests leave the session environment unchanged.LLM(model="Qwen/Qwen3-0.6B")plus onegeneratecall. On 0.33.0 the tree was build(speechlm2): bump the vllm extra to vLLM 0.33.0 #16666 + fix(speechlm2): find vLLM 0.33's chat parser for the prompt contract #16505, with and without this change.CUDA driver initialization failedCUDA driver initialization failedVLLM_PLUGINS=(plugin disabled)vllm_task_eval.py --task asron vLLM 0.32.0,nvidia/NVIDIA-Nemotron-3.5-Transcribe-30B-A4B-FP8with MTP, 300 LibriSpeech test-clean utterances, noVLLM_WORKER_MULTIPROC_METHOD: WER 1.34%, the same as the earlier run that used the workaround.calibrate_activations.py, docs build (only code-block text changed).Before your PR is "Ready for review"
Pre checks:
PR Type:
Additional Information