Repository navigation
Add Nemotron Transcribe CPU expert offload and reduce resident memory - #1154
Merged
Merged
Conversation
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.
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.
ad14f0c4), full GPUOffload 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.
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:
model_spec_system_test,nemotron_transcribe_policy_testandnemotron_transcribe_decoder_padding_testpass (3/3).Metal and full-model CPU execution were not tested.