Skip to content

provider: scope Nemotron stray-think handling and artifact sampling defaults - #963

Merged
Gajesh2007 merged 2 commits into
Layr-Labs:masterfrom
jonathan308:fable/nemotron-stray-think-close-20260912
Oct 1, 2026
Merged

Gajesh2007 merged 2 commits into
Layr-Labs:masterfrom
jonathan308:fable/nemotron-stray-think-close-20260912

Conversation

@jonathan308

@jonathan308 jonathan308 commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Rebase the Nemotron parser/sampling follow-up onto master 36154ac64691e04eaebd0aabbb0057919e937b9e, including merged #962 and its prompt, cache-CI and first-byte fixes. Keep master's SDK 1ee8675a035d0d842d5df663938d66cfedf88a8e; this PR no longer changes the SDK pin or reintroduces the parent diff.

  • For explicitly admitted Nemotron Lightning IDs with nemotron_h, absorb a stray </think> in content while preserving preceding text and opaque tool arguments. Other families retain their existing parser behavior.
  • Read artifact sampling defaults once per slot and apply them only to omitted request fields. Explicit values win; other families and missing/unreadable or do_sample: false configs retain legacy defaults. Preserve checkpoint-demand hints and current MiMo media/deadline behavior.
  • Retain the concrete hybrid8/rollback compatibility IDs without activating catalog aliases or changing weights.
  • Fix a pre-existing cancellation-test race: synchronize with installation of the parent's cancellation handler before asserting synchronous lease closure. Runtime cancellation and cleanup behavior is unchanged.

The stray-close transition matches the current vLLM Qwen3 parser configuration, reused by Nemotron V3. NVIDIA documents nemotron_v3 for Lightning serving. This is a scoped transition match, not a claim of complete parser equivalence.

Before

flowchart TD
  A["Nemotron continuation"] --> B["NativeChannelSplitter emits stray close"]
  C["Request omits sampling fields"] --> D["samplingParams uses legacy greedy defaults"]
  E["Child preparation starts"] --> F["Test cancels parent before handler may exist"]
  F --> G["Lease assertion can race"]
  classDef input fill:#dbeafe,stroke:#1d4ed8,color:#172554
  classDef gap fill:#fee2e2,stroke:#b91c1c,color:#450a0a
  class A,C,E input
  class B,D,F,G gap
Loading

After

flowchart TD
  A["Request and model identity"] --> B{"Admitted Nemotron?"}
  B -->|Yes| C["NativeToolStreamRouter + splitter absorb close"]
  B -->|Yes| D["SlotFactory → SamplingDefaults.resolve"]
  B -->|No| E["Existing parsing and defaults"]
  D --> F["samplingParams: explicit values win"]
  F --> G["CBv2 request retains cache-demand hint"]
  H["Parent handler installed"] --> I["Cancel; assert closure and eventual cleanup"]
  classDef input fill:#dbeafe,stroke:#1d4ed8,color:#172554
  classDef fixed fill:#dcfce7,stroke:#15803d,color:#052e16
  classDef stable fill:#f3f4f6,stroke:#4b5563,color:#111827
  class A,H input
  class B,C,D,F,G,I fixed
  class E stable
Loading

Current validation

  • Focused provider checks pass: 24 XCTest tests and 42 Swift Testing tests, with no skipped gates. Coverage includes parser boundaries, tool-argument markers, exact-model scoping, omitted/explicit sampling, cache-demand preservation and native-consumer ownership.
  • The formerly flaky cancellation case passes in 20 fresh test processes.
  • make provider-test passes: 3,558 Swift Testing tests in the main run; 553 XCTest cases with 123 fixture-gated skips and zero failures; all seven isolated selections pass (13 additional Swift Testing tests, zero skips). Build-for-testing passes. The focused Nemotron/ownership checks above have zero skips.
  • Documentation impact and documentation lint pass. The pre-push coordinator tests, Go formatting, console UI lint and production build also pass.
  • Main CI passes on head c5e5b718464749aa0c2fda0c56483d5617cafb33, including provider unit/native gates, SDK gates, production prompt parity, coordinator and console UI. Production parity covers 154 vectors across seven models; 96 cold-start and 375 load requests complete with zero mismatches. The repaired cancellation test passes in CI.
  • Contribution policy passes; both commits are GitHub-Verified. E2E integration passes all three blocking gates: paged integration/profile tests, exact-cache routing, and default-posture smoke.
  • Old provider CI failed on the cancellation-test race fixed here. Old E2E stopped in Homebrew setup (installer: unbound variable), already fixed on master; fresh E2E passed that setup. Parent prompt-parity fixes are retained.
  • External limitations: fork preview deployments need Vercel team authorization, optional E2E benchmarks await environment approval, and both advisory review services reported unavailable. These are not completed validations.

Commands: swift build --build-tests; scripts/run-nested-suite.sh for the focused suite and 20 isolated cancellation runs; make provider-test with the existing MiMo and Nemotron fixture gates enabled; make docs-impact-check BASE=origin/master; make docs-check.

Release scope and remaining qualification

The model results below were collected on the earlier composed candidate described in the original PR, not rerun on this rebased head. They are retained as historical evidence. The code changes do not turn a refusal into a fabricated tool call, and test success does not establish universal model quality.

Prior model evidence

Same optimized binary and frozen requests for both artifacts; MTP on/off verified through runtime metrics. Counts are automatic scenario-oracle passes, not a BF16-equivalence claim.

Artifact / MTP Greedy reasoning-off corpus As-sent sampled requests Reasoning/tool-choice/stream controls Real returned-ID history
Current Q4 / off 8/18 1/6 16/20 1/1
Current Q4 / on 8/18 2/6 16/20 1/1
Hybrid8 / off 16/18 3/6 20/20 1/1
Hybrid8 / on 16/18 4/6 20/20 1/1

Hybrid8 passes the original Boston reasoning-off greedy request and all 20 controlled mode/stream/tool-choice cases in both MTP modes. It still declines the TSLA automatic-tool request and some as-sent sampled draws. The shared poem case also trips the deliberately retained keyword heuristic despite returning a poem; the table does not silently re-score it. Three draws per sampled mode are a bounded regression observation, not a reliability estimate.

The separate long-prefix cache plans observe ready state and 2,048 cached tokens on repeats, with requests fully retired. However, all three requests in each plan produce no tool call, so each dependent returned-ID cache-history cell remains unrun: these two cache plans are recorded as failed, not passed. Main-plan returned-ID history passes in all four arms. The first Q4 MTP-on attempt stopped before model execution because the previous TCP port was not reusable; a distinct-port retry ran the same frozen requests successfully. No test oracle or production source was weakened.

All six completed model processes exited cleanly, with source, executable, resource and artifact hashes unchanged. This is isolated local API evidence, not a signed/notarized release, hosted coordinator or fresh BF16 qualification.

Interfaces and rollout

No new wire fields or provider version. Omitted sampling changes only for admitted Nemotron IDs. Parent #962's normalization v8 / renderer v4 migration requires matching provider, coordinator/sidecar contracts and exact-artifact allowlists at rollout. No artifact or alias is activated here.

Before release, complete the residual reasoning-off automatic-tool and cached returned-ID history acceptance cases on the intended immutable weights, plus signed-release/fleet qualification. Fresh BF16 equivalence is not established by these checks.

Rollback

Use signed reverts. Sampling defaults and stray-close absorption can be reverted independently. Remove compatibility IDs only when nothing depends on them; retain the current upstream SDK and parent fixes. Coordinate any rollback of #962's cache identities separately.

@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

@jonathan308 is attempting to deploy a commit to the EigenLabs Team on Vercel.

A member of the Team first needs to authorize it.

@jonathan308
jonathan308 force-pushed the fable/nemotron-stray-think-close-20260912 branch from dc3bc68 to a03259e Compare October 1, 2026 02:25
@jonathan308 jonathan308 changed the title provider: absorb a stray </think> in Nemotron content state; honor generation_config sampling defaults provider: scope Nemotron stray-think handling and artifact sampling defaults Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Threat model review — advisory

Reviewed head c5e5b7184647 against base 36154ac64691.

Review not completed for this head. Previous findings are superseded, not confirmed resolved.
Scan incomplete: one or more configured reviewers did not finish; completed reviewers' findings are shown below

Reviewers: anthropic/claude-opus-5.5: incomplete (review unavailable); openai/gpt-6-astra: incomplete (review unavailable)

Models: anthropic/claude-opus-5.5, openai/gpt-6-astra. Findings require human validation; this review never requests changes or blocks merging.

@jonathan308
jonathan308 requested a review from Gajesh2007 October 1, 2026 02:48
jonathan308 and others added 2 commits October 1, 2026 12:46
Absorb stray think closers only for the qualified Nemotron Lightning family while preserving preceding content, opaque tool arguments and other model parsers. Apply artifact defaults only to omitted sampling fields, retain explicit overrides, preserve newer prefix donation and MiMo deadlines, and recognize compatible immutable rollout build IDs. Include scoped regressions and documentation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Gajesh2007
Gajesh2007 force-pushed the fable/nemotron-stray-think-close-20260912 branch from a03259e to c5e5b71 Compare October 1, 2026 20:02
@Gajesh2007
Gajesh2007 merged commit 2a14340 into Layr-Labs:master Oct 1, 2026
19 of 24 checks passed
@jonathan308
jonathan308 deleted the fable/nemotron-stray-think-close-20260912 branch October 12, 2026 21:16

This branch was successfully deployed

No deployments
benchmarks — c5e5b718 Deployed Oct 1, 2026 by Gajesh2007 via E2E Benchmarks #2085
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants