Skip to content

Add Nemotron Transcribe CPU expert offload and reduce resident memory - #1154

Merged
0xShug0 merged 1 commit into
mainfrom
feature/nemotron-transcribe-offload
Oct 31, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
feature/nemotron-transcribe-offload

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Summary

Add opt-in CPU expert-weight offload for Nemotron 3.5 Transcribe using the existing shared expert store. Only selected experts occupy a bounded GPU cache; the encoder, dense decoder layers and expert computation remain on the selected backend. Weights retain their packaged precision.

The model owns cached prefill/decode graphs and shared workspaces. Independent requests reset recurrent state and expert-slot placement, preventing prior request lengths and routing history from changing repeated transcripts. Resource reporting accounts for the resident expert cache.

Load the CTC head only when timestamps or diarization are requested, saving approximately 192 MiB during plain transcription. Also fix the existing Vulkan CTC failure on strided normalization inputs using the existing LayerNorm module's contiguous lowering. No framework, GGML or CLI implementation changes.

Controls

  • nemotron_transcribe.disk_experts=false: enable CPU expert-weight offload.
  • nemotron_transcribe.pin_experts=false: optionally retain expert banks in pinned host memory.
  • nemotron_transcribe.expert_cache_size=8: resident expert slots per routed layer.
  • nemotron_transcribe.disk_expert_read_threads=4: host staging workers when pinning is disabled.

These session options are included in the v1 contract and usage documentation. Offload requires native weight storage.

Performance

RTX 5090, Debug build, CUDA 12.9 / Vulkan, eight CPU threads, published Q4_K_S expert decoder and F16 encoder. One short warmup followed by one 397-second request in the same session; runs were sequential. RTF includes the complete request, excluding model loading. Peak VRAM includes loading and both requests.

Mode CUDA RTF CUDA peak VRAM Vulkan RTF Vulkan peak VRAM
Main (ad14f0c4), full GPU 0.01882 22,242 MiB 0.02137 21,649 MiB
PR, full GPU 0.01876 22,050 MiB 0.02125 21,457 MiB
PR, CPU-weight offload 0.05703 6,706 MiB 0.07764 6,023 MiB

Offload measurements use eight slots, pinned experts and prefill batch size 1024; full-GPU measurements use the existing default prefill 64. Pinned expert buffers require approximately 16.55 GiB of host memory. Offload trades throughput and host RAM for lower VRAM; it is disabled by default.

Correctness and lifecycle

Evaluated 1,000 LibriSpeech clips on CUDA: 500 test-clean and 500 test-other, totaling 2.09 hours and 20,126 reference words. All three modes used identical decoding settings, clip order and default prefill 64. CPU-weight offload used eight slots with pinning enabled. WER is summed word edit distance divided by summed reference words using the existing ASR scorer's normalization.

Mode test-clean WER test-other WER Combined WER
Main, full GPU 1.795% 3.191% 2.430%
PR, full GPU 1.795% 3.191% 2.430%
PR, CPU-weight offload 1.804% 3.136% 2.410%

Full-GPU transcripts match main exactly on all 1,000 clips. Offload changes 70 transcripts, with 485 total word errors versus 489 on main; this is not a claim of statistically significant quality improvement. All 3,000 requests stopped naturally at end-of-turn.

The same pre-existing invalid UTF-8 byte occurs in one transcript in all three modes. Inference completes, but the existing path-test harness subsequently fails decoding its log. Raw logs were retained and scored with that byte preserved explicitly; the standard ASCII WER normalizer excludes it. No clips were dropped.

Additional checks:

  • CUDA and Vulkan long → short → long requests produce exact repeated transcripts in offload mode.
  • CUDA CTC word timestamps match main exactly; Vulkan now returns aligned words and repeats them exactly instead of failing on unsupported strided NORM.
  • Native padded Q4_K, Q3_K and Q2_K fixtures compare bounded-cache output against resident logits and exercise request reuse.
  • model_spec_system_test, nemotron_transcribe_policy_test and nemotron_transcribe_decoder_padding_test pass (3/3).

Metal and full-model CPU execution were not tested.

@0xShug0
0xShug0 merged commit bd8fce0 into main Oct 31, 2026
6 of 7 checks passed
@0xShug0
0xShug0 deleted the feature/nemotron-transcribe-offload branch October 31, 2026 22:33
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.

1 participant