Repository navigation
fix(speechlm2): find vLLM 0.33's chat parser for the prompt contract - #16505
Conversation
|
/ok to test 821e036 |
|
/ok to test 17220e6 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
This adds discovery of vLLM 0.33's public chat parser while keeping the legacy adapter path. It is not ready to merge: the supplied merge commit has no DCO sign-off. I also found a non-blocking test-isolation regression described inline.
Blocking: sign off the merge commit
The supplied message for commit 17220e64d94d57782c0f88200510b3383df8d8c3 contains only Merge branch 'main' into fix/vllm-0.33-chat-parts-adapter, with no Signed-off-by trailer. Repository guidance requires an author-matching sign-off on every commit, so this blocks merging.
These commands rewrite published history. Coordinate with anyone using the branch before pushing.
- Configure
user.nameanduser.emailto the real identity used to author the commits. - Run
git rebase --signoff origin/main. - Run
git push --force-with-lease.
Acceptance: inspect the published PR commits with git log --format='%h %s%nAuthor: %an <%ae>%n%(trailers:key=Signed-off-by)' origin/main..HEAD. Every remaining commit must have a sign-off matching its author exactly. Keep the reviewed parser and test changes intact during this signing repair. The supplied metadata lacks author identities, so I could not check identity matching for the existing trailer.
Verification scope
I inspected both changed files and traced plugin registration into the prompt adapter. The new tests cover public-parser installation, exact prompt rendering, and idempotence; the inline finding addresses the legacy-layout isolation gap. The unchanged dependency pin agrees with the serving documentation, so this internal compatibility addition does not require a documentation correction. I did not run tests or independently verify startup against a real vLLM 0.33 installation.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
| * Earlier releases have ``vllm.entrypoints.chat_utils._parse_chat_message_content_parts``. | ||
| """ | ||
| try: | ||
| from vllm.renderers.chat_utils import chat_message # vLLM >= 0.33 |
There was a problem hiding this comment.
Should fix: isolate the legacy-layout tests from cached 0.33 modules.
This new import bypasses the mocks in the two existing legacy-layout tests when sys.modules["vllm.renderers.chat_utils"] already contains the 0.33 package. Python can return that cached child even when the tests replace vllm.renderers with a fake or None. Installation then patches the cached public parser instead of the test's legacy fake, so the final marker assertion raises AttributeError. Base selected the mocked renderer or entrypoints module directly.
A minimal proposed reproduction is to preload that cache entry with SimpleNamespace(chat_message=public), where public comes from _fake_vllm_chat_utils("parse_chat_message_content_parts"), then execute either legacy test's setup and installation call. This also represents running those tests after plugin registration has loaded the modern parser.
In both test_install_prompt_contract_patches_vllm_renderers_chat_utils and test_install_prompt_contract_falls_back_to_vllm_entrypoints_chat_utils, add this before installation:
monkeypatch.setitem(sys.modules, "vllm.renderers.chat_utils", None)This deliberately disables modern discovery only for the legacy-layout simulations. Keep the 0.33 tests' explicit child-module mocks; do not change production discovery or block the module globally.
Acceptance, proposed rather than executed: exercise each legacy test with and without a preloaded public-parser module. Each must patch its own legacy fake and leave the preloaded parser unchanged. Retain the 0.33 assertions that the public parser is patched once, renders Transcribe <|audio|>, and keeps the audio payload registered.
There was a problem hiding this comment.
Fixed in 9de5c17. Both legacy-layout tests now set sys.modules["vllm.renderers.chat_utils"] = None before installation. Each one also runs with and without a preloaded 0.33 public parser, and the fixture asserts that the preloaded parser is left unchanged. Without the fix, the two 0.33-parser-cached cases fail as you described. With it, all 23 tests in the file pass. The 0.33 tests and production discovery are unchanged.
vLLM 0.33 turned vllm.renderers.chat_utils into a package and made the content-part parser public as chat_message.parse_chat_message_content_parts. The package has no _parse_chat_message_content_parts any more, so install_prompt_contract raised "Unsupported vLLM chat API" while the plugin registered, and `vllm serve` aborted for every SpeechLM checkpoint on 0.33. The adapter now looks the parser up where vLLM's chat path resolves it: chat_message's module global on 0.33 (parse_chat_message_content calls it there), the 0.32 module, then the pre-0.32 entrypoints module. The signature is unchanged across all three, so the wrapper is the same; it still fails closed when none of them has the parser. The vllm extra stays pinned to 0.32.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: PhilflowIO <[email protected]>
Python returns a cached child module even when its parent is mocked away, so once plugin registration has imported vllm.renderers.chat_utils the two legacy-layout tests patched the real 0.33 parser instead of their own fake. Block modern discovery explicitly in those tests and run each of them with and without a preloaded public parser. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: PhilflowIO <[email protected]>
17220e6 to
9de5c17
Compare
|
Rebased onto main with sign-off, which drops the unsigned merge commit; all commits are now signed off. @pzelasko could you re-trigger |
|
/ok to test 9de5c17 |
|
/review-approve |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
This adds vLLM 0.33 parser discovery while keeping the legacy adapter path. The concrete prior findings are resolved, and I found no remaining in-scope blockers in this follow-up review.
The legacy-layout tests now block modern discovery before installation. Their parametrized fixture covers both cache states and checks that the preloaded public parser stays unchanged. Reading the tests shows that removing the isolation fix would reproduce the earlier failure. The modern-layout tests still check exact prompt rendering, audio registration and idempotence.
The unsigned merge commit 17220e64d94d57782c0f88200510b3383df8d8c3 is absent from the supplied current commit list. Both listed commits contain Signed-off-by trailers, closing the prior missing-trailer finding. Author identities were not supplied, so I could not verify exact author-to-sign-off matching. The serving instructions still agree with the unchanged vLLM 0.32.0 pin; these follow-up edits need no documentation change.
I inspected both changed files and traced plugin registration into the installer. The previously reviewed tree was unavailable, so I could not independently compare the complete inter-review delta. This review covers the earlier findings and identifiable follow-up edits, not a fresh full-PR review. I did not execute tests or verify startup against a real vLLM 0.33 installation.
Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.
|
[🤖]: Hi @PhilflowIO 👋, 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. |
DongjiGao
left a comment
There was a problem hiding this comment.
Thanks, this looks right. I checked the v0.33.0 source: chat_message.py resolves parse_chat_message_content_parts as a module global (L622, L637), so the patch covers both LLM.chat and /v1/chat/completions. The scoring path imports the package re-export and keeps the original parser, which is fine, since SALM does not serve pooling. Two non-blocking notes:
- The description still says 21 tests; the file now has 23 cases (the cache fixture runs two tests twice).
- CI pins vLLM 0.32 and the new tests use fake parser modules, so nothing here starts a real 0.33 server. If you have a log of
vllm servewith a SpeechLM checkpoint on 0.33, please paste it here. Otherwise we will cover real 0.33 in the PR that moves the pin.
|
Thanks for checking the 0.33 source.
The same fork commit also carries a separate fix that lets our W8A16 weights load on vLLM's Marlin MoE path; it does not touch |
|
/cherrypick to=r3.1.0 |
…16505) (#16760) * fix(speechlm2): find vLLM 0.33's chat parser for the prompt contract vLLM 0.33 turned vllm.renderers.chat_utils into a package and made the content-part parser public as chat_message.parse_chat_message_content_parts. The package has no _parse_chat_message_content_parts any more, so install_prompt_contract raised "Unsupported vLLM chat API" while the plugin registered, and `vllm serve` aborted for every SpeechLM checkpoint on 0.33. The adapter now looks the parser up where vLLM's chat path resolves it: chat_message's module global on 0.33 (parse_chat_message_content calls it there), the 0.32 module, then the pre-0.32 entrypoints module. The signature is unchanged across all three, so the wrapper is the same; it still fails closed when none of them has the parser. The vllm extra stays pinned to 0.32.0. * test(speechlm2): isolate legacy-layout tests from a cached 0.33 parser Python returns a cached child module even when its parent is mocked away, so once plugin registration has imported vllm.renderers.chat_utils the two legacy-layout tests patched the real 0.33 parser instead of their own fake. Block modern discovery explicitly in those tests and run each of them with and without a preloaded public parser. --------- (cherry picked from commit 9320b9f) Signed-off-by: PhilflowIO <[email protected]> Signed-off-by: svcnemo-autobot <[email protected]> Co-authored-by: Philipp Lütje <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
What does this PR do ?
Makes the SALM vLLM plugin start on vLLM 0.33.0 — today
vllm serveaborts for every SpeechLM checkpoint (e.g.nvidia/NVIDIA-Nemotron-3.5-Transcribe-30B-A4B) while the plugin registers.Collection: speechlm2
vLLM 0.33.0 turned
vllm.renderers.chat_utilsinto a package and made the parser public asvllm/renderers/chat_utils/chat_message.py::parse_chat_message_content_parts(same signature).parse_chat_message_contentcalls it as a module global ofchat_message, so that is where the adapter has to sit.Changelog
runtime_compat.py:_locate_chat_parser()returns the module + attribute name of the parser, newest layout first:chat_message.parse_chat_message_content_parts(0.33),vllm.renderers.chat_utils._parse_chat_message_content_parts(0.32),vllm.entrypoints.chat_utils._parse_chat_message_content_parts(older)._patch_speechlm_training_prompt_contracttakes the attribute name (default unchanged). The wrapper itself, its idempotence and its fail-closed behaviour are unchanged.test_vllm_runtime_compat.py: three tests for the 0.33 layout (patcheschat_message, renders the exacttext <|audio|>contract through it, idempotent, error names the missing public parser). The three fail onmainand pass here; the existing 18 still pass.vllmextra stays pinned tovllm==0.32.0; whether to move the pin is your call. This change keeps 0.32 working.Usage
No API change —
vllm serve <SpeechLM checkpoint>now starts on vLLM 0.33.0 as it does on 0.32.0.Validation
pytest tests/collections/speechlm2/test_vllm_runtime_compat.py: 23 passed (the cache fixture runs two tests twice)Before your PR is "Ready for review"
Pre checks:
vllmis imported inside the function, each layout behindtry/except ImportError, as before.)PR Type:
Additional Information
We serve the model on a vLLM 0.33.0 environment shared with other models, so a second, 0.32-pinned environment is not an option for us. Until this is merged we pin a fork at this commit.
🤖 Generated with Claude Code