Repository navigation
[https://nvbugs/6982380][fix] Open the Harmony final channel in JSON mode eval prompts - #21048
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Add and validate Harmony prompt formatting tensorrt_llm/evaluate/json_mode_eval.py, tests/unittest/evaluate/test_json_mode_eval.py, tests/integration/test_lists/test-db/l0_cpu.yml |
JsonModeEval appends the Harmony final-message prefix when the templated prompt ends with the assistant-start prefix. CPU tests cover matching and non-matching prompts. The CPU test list includes the new test. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: bowenfu
Merge Risk: 
Minimal · up to 7791c
-
No actionable merge-blocking risk is established; the new CPU test is correctly selected and the Harmony formatting branch matches the intended prompt contract.
Pre-merge checks: 
5
-
Full details: Description check
-
Explanation
The description explains the root cause, fix, test plan, bug reference, and reproduction results. It does not reproduce the template headings exactly or explicitly complete the PR checklist, but it provides the required core information.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
mzweilz
left a comment
There was a problem hiding this comment.
Approved from infra perspective.
…mode eval JsonModeEval constrains the whole completion with the sample's JSON schema. For gpt-oss, the chat template's generation prompt stops at `<|start|>assistant`, so the first generated tokens are the Harmony message header, where the model writes `<|channel|>...<|message|>`. The grammar forced JSON into the header position instead, which degraded the answers (JSON Mode Eval 44.00 against a 50.37 threshold for TestGPTOSS::test_eagle3_guided_decoding_4gpus). Append `<|channel|>final<|message|>` after a Harmony generation prompt so that the unchanged JSON-schema guide binds the final message body. Other chat templates and the scoring are unchanged. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> Signed-off-by: Dongfeng Yu <dongfengy@nvidia.com>
83ff218 to
7791ca9
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #81197 [ run ] triggered by Bot. Commit: |
|
PR_Github #81197 [ run ] completed with state Resource maintenance in LLM/main/L0_Test-x86_64-Single-GPU #9595: L40S-PyTorch-2 is temporarily paused due to Kubernetes agent provisioning and node issues.
|
|
/bot run --disable-fail-fast |
|
PR_Github #81273 [ run ] triggered by Bot. Commit: |
|
PR_Github #81273 [ run ] completed with state Resource maintenance in LLM/main/L0_Test-x86_64-Single-GPU #4142: L40S-PyTorch-2 is temporarily paused due to Kubernetes agent provisioning and node issues.
|
|
/bot run --disable-fail-fast |
|
PR_Github #81339 [ run ] triggered by Bot. Commit: |
|
PR_Github #81339 [ run ] completed with state Resource maintenance in LLM/main/L0_Test-x86_64-Single-GPU #10115: L40S-PyTorch-2 is temporarily paused due to Kubernetes agent provisioning and node issues.
|
|
/bot run --disable-fail-fast |
|
PR_Github #81393 [ run ] triggered by Bot. Commit: |
|
PR_Github #81393 [ run ] completed with state |
Summary
<|start|>assistant.<|channel|>final<|message|>after a<|start|>assistantgeneration prompt, so the unchanged JSON-schema guide constrains the final message body.bash .repair-bot/reproduce/6982380-f188d625273e-1793045351165755849/tot/driver.sh --reps 1Test plan
b200at83ff2187e7fcRelated regression tests were not run by repair-bot. The added CPU tests and broader regression coverage are pending PR CI.
Links
Reproduction comparison
Only the ToT run produced a result, so the two cannot be compared.
Dev Engineer Review
JsonModeEval.do_apply_chat_templatenow appends<|channel|>final<|message|>when the rendered prompt ends exactly with<|start|>assistant. Other prompts remain unchanged. The change does not alter the JSON schema or scoring logic. The exact-suffix condition is narrow; verify it against the intended Harmony generation prompts. Current review finding counts are unavailable.QA Engineer Review
Added
tests/unittest/evaluate/test_json_mode_eval.pyand listed it intests/integration/test_lists/test-db/l0_cpu.yml. The tests cover final-channel insertion and unchanged behavior for two other generation-prompt formats. They do not cover suffix variations or schema-constrained generation. Test execution results were not supplied. Coverage verdict: needs follow-up.Per-File QA Perspective
tensorrt_llm/evaluate/json_mode_eval.py— Verify that the exact assistant-start suffix occurs for the intended prompts and that JSON guidance applies to the final-channel answer body.tests/unittest/evaluate/test_json_mode_eval.py— Covers Harmony final-channel insertion and unchanged handling of two other prompt formats. Listed in the CPU test database.tests/integration/test_lists/test-db/l0_cpu.yml— Adds the unit test to the CPU test list.