Skip to content

fix: bound Nemotron-H SSD prefill memory - #2290

Merged
inureyes merged 3 commits into
mainfrom
fix/issue-2281-bound-nemotron-prefill
Oct 13, 2026
Merged

inureyes merged 3 commits into
mainfrom
fix/issue-2281-bound-nemotron-prefill

Conversation

@inureyes

@inureyes inureyes commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Bound Nemotron-H SSD prefill's quadratic surrogate-attention transient to the checkpoint-configured chunk size, carrying recurrent state and evaluating each chunk before constructing the next graph.
  • Preserve the existing float32 precision boundary and add configuration validation plus focused full-step, prior-state, partial-tail, multi-batch, multi-group, f16, and bf16 coverage.
  • Add load-time and production-forward attribution markers and archive the reproducible real-checkpoint memory/output harnesses and raw results.

Real-checkpoint evidence

On an M1 Ultra 128 GB host with nvidia-nemotron-3-nano-30b-a3b-4bit, three fresh-process repetitions per cell reduced median process peak memory from 20.9/31.4/48.5/72.2 GiB to 17.6/18.0/18.4/18.7 GiB at 1,519/3,019/4,519/6,019 prompt tokens. All rounded ranges were 0.0 GiB at vmmap's 0.1 GiB resolution. The candidate also completed three 8,019-token runs at 19.3 GiB. Both attribution markers were absent from every baseline run and present in every candidate run. Three substantive greedy prompts, including a 2,810-token prompt, produced byte-identical choices between baseline and candidate. No latency claim is made because the host carried background load.

Validation

  • RUSTC_WRAPPER= cargo build --release --features metal,accelerate --bin mlxcel-server
  • RUSTC_WRAPPER= cargo test --profile test-fast --features metal,accelerate --lib models::nemotron_h::tests:: -- --test-threads=1 (22 passed, 3 ignored)
  • RUSTC_WRAPPER= cargo test --profile test-fast --features metal,accelerate --lib models::nemotron_h::tests::chunked_ssd -- --ignored --test-threads=1 (2 passed)
  • cargo fmt --check
  • git diff --check
  • python3 scripts/ci/check_cross_repo_refs.py
  • Archived benchmark artifact consistency checks and Python harness byte-compilation

Approved follow-up

The bounded SSD-prefill fix is complete. Request-level activation/transient-memory admission will be implemented in a separate follow-up, as approved by the maintainer. This PR does not provide recovery from arbitrary Metal command-buffer OOM. Issue #2281 remains open until the follow-up is linked.

Implementation and security reviews found no code defects within this scope; bilingual technical reports are included.

Refs #2281

Process Nemotron-H SSD prefill in configured chunks and materialize each chunk before building the next graph. Preserve recurrent state, float32 numerical boundaries, and partial-tail behavior.

Add focused configuration and numerical regression coverage plus reproducible real-checkpoint memory and output evidence. The benchmark record documents that request-level transient-memory admission remains outside this change.

Refs #2281
@inureyes inureyes added the status:review Under review label Oct 13, 2026
@inureyes

Copy link
Copy Markdown
Member Author

Implementation Review Summary

Intent

Bound Nemotron-H's quadratic SSD-prefill transient with chunked recurrent carry while preserving numerical behavior; request-level transient-memory admission remains outside this PR.

Findings Addressed

  • Verified the production model path passes the validated checkpoint chunk size into every Nemotron-H Mamba mixer and evaluates each quadratic chunk before constructing the next graph.
  • Verified cross-chunk recurrent carry, partial tails, multi-batch/multi-group behavior, float32 safety boundaries, and f16/bf16 output/state parity through focused tests and the scalar recurrence oracle.
  • Verified the benchmark uses fresh processes, three repetitions per memory cell, arm-specific execution markers, process high-water memory, real-checkpoint output comparisons, and explicit unmeasured cells.

Remaining Items

Verification

  • All issue requirements implemented
  • No placeholder/mock code remaining
  • Integrated into project code flow
  • Project conventions followed
  • Existing modules reused where applicable
  • No unintended structural changes
  • Tests pass

No code-level correctness finding remains within the declared partial scope. Formatting, diff hygiene, benchmark artifact consistency, Python harness compilation, the 22-test Nemotron-H module suite, two serial Metal numerical tests, release server build, and current CI checks were reviewed as passing; the supplementary external reviewer could not initialize in this sandbox, so this conclusion is based on direct review and executed validation.

Record the chunked SSD prefill design, numerical and real-checkpoint evidence, and the unresolved request-admission requirement. Flag the current closing relationship so issue #2281 is not silently completed by this partial change.
Mark the bounded SSD-prefill scope complete after review while retaining the unresolved request-level transient-memory risk. Record the approved separate follow-up and the cleared GitHub closing relationship without inventing a follow-up issue number.

Validation:
- cargo fmt --check
- git diff --check
- Nemotron-H module tests: 22 passed, 3 ignored
- Serial Metal numerical tests: 2 passed

Refs #2281
@inureyes inureyes added status:done Completed and removed status:review Under review labels Oct 13, 2026
@inureyes
inureyes merged commit c9e062a into main Oct 13, 2026
27 checks passed
@inureyes
inureyes deleted the fix/issue-2281-bound-nemotron-prefill branch October 13, 2026 14:17
@inureyes inureyes added type:bug Bug fixes, error corrections, or issue resolutions priority:high High priority labels Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high High priority status:done Completed type:bug Bug fixes, error corrections, or issue resolutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant