Repository navigation
fix(nemotron3): render later system messages instead of raising - #200
Open
mottopanikeiku wants to merge 1 commit into
Open
mottopanikeiku wants to merge 1 commit into
mottopanikeiku wants to merge 1 commit into
Conversation
The Nemotron 3 chat templates render a system message that is not first as its own system turn, and bridge_to_next_turn already does the same, but render() raised ValueError. I render it through the user branch like the template does and run the later-system parity scenario for the Nemotron renderers. Assisted-by: Claude Assisted-by: GPT-6 Astra Signed-off-by: mottopanikeiku <176798723+mottopanikeiku@users.noreply.github.com>
This branch has not been deployed
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.
Nemotron3Renderer.render()raisesValueError: System message must be at the beginning.for any system message that is not the first message. The Nemotron 3 chat templates (Nano, Super, Ultra, 3.5 Lightning) accept that message and render it as its own turn through the user branch:bridge_to_next_turnin the same renderer already renders an appended system message this way, so such a conversation can be extended through the bridge but not rendered in full. In verifiers' train client a tail that contains a system message is not bridged, so the fullrender()is the path that runs. verifiers' Responses dialect also turnsinstructionsplus adeveloperinput item into two system messages.This change renders a non-leading system message through the user branch under its own role header, as the template does. The reasoning-effort hint still goes only on the last user message. The
later-systemparity scenario now also runs fornemotron-3,nemotron-3-ultraandnemotron-3.5.Reproducer:
ValueErrorResponsesDialect.parse_requestof aninstructions+developerrequest, rendered with thenemotron-3config fromconfigs/advanced/nemotron-3-super/swe.tomlValueErrorpytest tests/test_parity.py -k "Nemotron and later-system"After the change,
pytest tests -k "nemotron or Nemotron"gives 1423 passed, 17 skipped (PIL/torch-dependent and capability skips). ruff 0.15.12 check and format pass on the changed files.I found this by reading and testing the code.
I made this PR and directed its development, with AI assistance from Claude and GPT-6 Astra.
Note
Render later system messages in Nemotron3 renderer instead of raising
Macroscope summarized 83e2027.