Skip to content

cp: fix(speechlm2): find vLLM 0.33's chat parser for the prompt contract - #16760

Merged
chtruong814 merged 1 commit into
NVIDIA-NeMo:r3.1.0from
svcnemo-autobot:chore/cherrypick-16505-to-r3.1.0
Dec 1, 2026
Merged

chtruong814 merged 1 commit into
NVIDIA-NeMo:r3.1.0from
svcnemo-autobot:chore/cherrypick-16505-to-r3.1.0

Conversation

@svcnemo-autobot

Copy link
Copy Markdown
Contributor

Background

Summary

Backport #16505 to r3.1.0.

  • Locate vLLM 0.33's public chat parser while keeping compatibility with older layouts.
  • Include regression coverage for parser discovery, idempotence, and cached-module isolation.

Source

Verified that #16505 is merged. GitHub commit-to-PR associations identify 9320b9f6f91021366adeec02ff3ad33cd8fd8ddd as the complete landed squash commit; its first parent belongs to a different PR.

Cherry-picked with -x onto upstream target 06912b402859e9a900d8e552371acba6cdd27c73. No conflicts occurred.

Validation

  • Both changed files match the landed source exactly.
  • git diff --check passed.
  • Verified the native signature and bot sign-off.
  • Push succeeded; the remote branch SHA matches a125db33267b17aae6e00414e255a638c36d4137.
  • Tests were not run locally under the cherrypick execution policy. CI is unverified.

What changed

No details provided.

Details

No details provided.

Tested

No details provided.

…VIDIA-NeMo#16505)

* 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.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: PhilflowIO <[email protected]>

* 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.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: PhilflowIO <[email protected]>

---------

Signed-off-by: PhilflowIO <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 9320b9f)
Signed-off-by: svcnemo-autobot <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test a125db3

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This backport adds vLLM 0.33 parser discovery while keeping the legacy lookup paths and prompt wrapper. I reviewed both changed files and the registration caller, with separate runtime and test reviews. I found no confirmed runtime defect. The author/sign-off mismatch and the mandatory docstring cleanup below block approval under the repository’s review rules.

The regression tests exercise the real installer and wrapper through synthetic modules, retain legacy coverage, and check public-parser idempotence. By source inspection, the modern-layout test fails against base because base targets the missing private parser. No additional user documentation is needed for this private compatibility fix.

Validation: I reviewed on 766267172432.dkr.ecr.us-east-1.amazonaws.com/nemo-speech:nemo_container-46162233409, the default branch’s CI image, because the PR’s image build was pending. I ran no probes, tests, installs or linters because the selected skill explicitly requires source-only review. CI showed code-linting / Nemo_Linting_Test and release / build-test-publish-wheel / test-wheel green; the container build was still running, and I did not observe SpeechLM2 test results. The image lacked pinned vLLM source, so I could not independently verify its parser signature or live serving-call lookup.

Blocking: author sign-off does not match

Blocking · contribution-compliance issue · introduced by this backport commit.

Commit a125db33267b17aae6e00414e255a638c36d4137 lacks a sign-off matching its author’s full identity. Its author is Philipp Lütje <[email protected]>, but its sign-offs are PhilflowIO <[email protected]> and svcnemo-autobot <[email protected]>. Neither exactly matches the author, as required by the target branch’s DCO rule. The green DCO check does not resolve that explicit name mismatch.

Have the original author provide the matching Signed-off-by: Philipp Lütje <[email protected]> certification, then recreate and sign the backport while preserving its author, release base and code diff. Do not change author attribution to the bot merely to match its trailer. Before republishing, verify that every backport commit has an exact author-name/email match and that the two-file diff is unchanged.

Note: formal approval is not available for this request, so this review is posted as a comment only.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

def _locate_chat_parser() -> tuple[Any, str]:
"""Return the module and attribute through which vLLM's chat path finds the content-part parser.

The parser keeps its signature across releases but has moved twice:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking · usability issue · introduced by this PR.

The new docstring records implementation history instead of keeping the helper’s intent concise. The paragraph beginning “The parser keeps its signature across releases but has moved twice” and the following layout inventory duplicate the import branches. This leaves a second version-by-version description to maintain. The selected rubric explicitly rejects implementation-history narration in docstrings and makes that writing rule blocking.

Replace this whole docstring with a short statement of the invariant, for example:

"""Find the live chat-parser binding so the adapter affects serving calls."""

Keep the version labels beside the compatibility branches and preserve the reason for targeting the live binding rather than a re-export. This is documentation-only: the public-parser selection, both legacy fallbacks and idempotence must stay unchanged. Acceptance is a diff showing only this docstring refinement, with no executable changes.

@github-actions

Copy link
Copy Markdown
Contributor

[🤖]: Hi @svcnemo-autobot 👋,

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.

@chtruong814
chtruong814 merged commit 333860e into NVIDIA-NeMo:r3.1.0 Dec 1, 2026
159 checks passed

This branch was previously deployed

2 inactive deployments
public — a125db33 Deployed Nov 28, 2026 by copy-pr-bot[bot] via release / finalize / publish-docs #2652
test — a125db33 Deployed Nov 28, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #22319
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants