Repository navigation
nemotron hip: add within-path invariance checks for prompt cuts, decode grouping and resume - #3580
Merged
Merged
Conversation
gilby
added a commit
to gilby/TensorFold
that referenced
this pull request
Nov 16, 2026
Owner
|
Thanks @gilby. The invariance checks for prompt cuts, decode grouping and prompt-cache resume, the stream synchronize before null-stream downloads, and the planted 1-ULP failure on gfx1151 make this solid. HIP is hardware we don't have, so your gfx1151 runs are the device evidence, and they cover it. The only thing left is a changelog offset, which is ours. Nothing more is needed from you. It's in our landing queue.
|
ashhart
force-pushed
the
strix/nemotron-hip-path-invariance
branch
from
November 17, 2026 01:40
1ee2994 to
2fa4776
Compare
ashhart
pushed a commit
that referenced
this pull request
Nov 17, 2026
Owner
|
Thank you @gilby. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
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.
What this changes
Adds the within-path HIP invariance checks discussed in #3409 as
tf-nemotron-hip-test invariance <model dir> [ids.bin] [--no-mtp](zig/tests/nemotron_hip/invariance.zig), keeping all checks inside Nemotron-H's existing HIP paths without comparing prompt rows against decoded rows or adding cross-engine code:checkPromptCuts): runs a 193-token prompt in one chunk and in cuts leaving trailing chunks of{ 1, 8, 15, 16, 17, 65 }rows, checking Mamba state, every trailing chunk's hidden rows, KV cache pages (replay.kvDiffers), and the single-rowe.logits(..., 1)output head (0differing bits even below 16 trailing rows, matchingprompt.zig:44).checkDecodeGrouping): compares 8 decode steps run as 1-row steps against 2-row and 4-row windows (logits, final Mamba state, KV pages), plus a grouped 2-stream round running 4 rows alongside 3 rows at a different position.checkResumePrefix): seedsHip.prefixat mark128of193, frees the seeding lane, resumes on a fresh lane, finishes the tail, steps 4 decode tokens throughHip.windows+keepRows, and checks Mamba state, last hidden row, KV pages, prompt head logits, 4-step decode logits, and post-decode KV pages against an uncached lane.Also adds a host unit test in
zig/src/families/nemotron/hip/prompt_test.zig("chunk cuts leaving 1, 8, 15, 16, 17 or 65 trailing rows partition every token in order"), exposesKvWhere/kvDiffersfromzig/tests/nemotron_hip/replay.zig(synchronizinge.streambefore synchronous null-stream page downloads), and wiresinvarianceinzig/tests/nemotron_hip/main.zig.Issue: Refs Nemotron HIP: prompt-pass rows and decoded rows of the same position are not bit-equal (question) #3409.
Stacked on: main (
6bc82acac).atc overlap --json: incomplete (complete: false, API/time/PR limits) across 5 changed files, reporting 56 overlapping open PRs (4 conflicting, 5 clean, 47 unknown).Checks on this head
1ee29948e(c1dd75b5cplus changelog stamp for nemotron hip: add within-path invariance checks for prompt cuts, decode grouping and resume #3580) on main6bc82acac.python3 tools/zig/lean_check.py): 221 on6bc82acacand 221 on1ee29948e, 0 new findings.python3 tools/pr_check.py --base origin/main --pr 3580: 0 errors, 0 warnings.git diff --check origin/main..HEADclean,zig fmt --check zig/clean.zig build hip-host-test -Dhip=true --summary all): 8 of 8 steps succeeded, 80 of 80 passed.zig build test -Dhip=true ... --summary allon gfx1151 host withumask 022): 769 of 771 steps succeeded; 6,627 of 6,676 passed, 48 skipped, 1 failed (stage_hip_test, pre-existing on single-GPU APU).TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit):./zig-out/bin/tf-nemotron-hip-test invariance ...:invariance: prompt cuts (6 cuts) + 1-row head: 0 bits differinvariance: decode windows (1 vs 2 vs 4) and 2-stream grouping: 0 bits differinvariance: served prompt-cache resume at 128/193 (+4 decode steps): 0 bits differinvariance: PASSinvariance (prompt cut 1-row head): logits bits differ (max diff 2.3841858e-7)/FAIL LogitsMismatch).invariance (decode window): logits bits differ (max diff 2.3841858e-7)/FAIL LogitsMismatch).invariance (resume decode): logits bits differ (max diff 2.3841858e-7)/FAIL LogitsMismatch).e.streamuseshipStreamNonBlocking; addinge.stream.synchronize()before synchronous null-streamDeviceBuffer.downloadcalls ininvariance.zigandreplay.kvDifferseliminates a host/device download race caught on the initial run.--tp > 1.Receipt
mainare untouched.TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit.tf-nemotron-hip-test invariancereports0differing bits across all three within-path suites (invariance: PASS), and each planted 1-ULP mismatch exits non-zero (FAIL LogitsMismatch).Checklist