Skip to content

Refactor Nemotron models with shared RoPE encoder and host CTC decoding - #1213

Merged
0xShug0 merged 1 commit into
mainfrom
refactor/rope-transformer-encoder
Nov 5, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
refactor/rope-transformer-encoder

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Extract reusable RoPE Transformer encoder construction and cached execution from Nemotron Transcribe and Nemotron 3 Diarization. Both models use the shared encoder, and Transcribe’s CTC adapter reuses its Transformer builder.

  • RopeTransformerEncoderModule owns numerical graph construction and resolved weight types. RopeTransformerEncoderRuntime owns cached graphs, positional inputs, attention masks, allocation and execution.
  • Encoder math settings and graph-composition settings have separate configuration types. Model-owned heads remain in the encoder graph.
  • CtcHostDecoder owns host token collapse, frame spans and full/anchored-band alignment with reusable workspace.
  • Checkpoint binding, feature preparation, speaker history, neural CTC-head orchestration and timestamp formatting remain model-local. Existing CLI options, package contracts and backend kernels are unchanged.

Validation

All compared transcripts, word timestamps, speaker turns, non-timing result fields and saved speaker-probability tensors matched main exactly. CUDA and Vulkan checks cover default/eager attention, Diar BF16/Q8, Transcribe full residency and host-staged experts, CTC timestamps, speaker tagging, streaming, mixed-length native batches, repeated requests after shape changes, and unload/reload. Small CPU checks also matched. Debug builds and relevant encoder, CTC, alignment and scheduling tests passed.

Offline performance

RTX 5090, CUDA 12.9 and native Vulkan, Debug builds, eight CPU threads. Matched request sequences use approximately 6–328 seconds of audio. RTF excludes the first warmup request. Parentheses show observed process peak VRAM in MiB, sampled every 100 ms over the session.

Backend Profile Main RTF (peak MiB) PR RTF (peak MiB)
CUDA Diar BF16, default 0.001378 (839) 0.001354 (833)
CUDA Transcribe, default 0.019407 (22051) 0.019183 (22063)
CUDA Diar Q8, default 0.001298 (739) 0.001285 (747)
CUDA Diar BF16, eager 0.001350 (883) 0.001298 (883)
CUDA Transcribe, CTC timestamps 0.019319 (22309) 0.019316 (22303)
CUDA Transcribe, eager + CTC 0.019504 (22285) 0.019615 (22285)
CUDA Transcribe, host-staged experts + CTC 0.245976 (6497) 0.245520 (6517)
Vulkan Diar BF16, default 0.001481 (275) 0.001532 (275)
Vulkan Transcribe, default 0.024592 (21456) 0.022431 (21470)
Vulkan Diar Q8, default 0.001453 (157) 0.001416 (157)
Vulkan Diar BF16, eager 0.001556 (273) 0.001487 (257)
Vulkan Transcribe, CTC timestamps 0.022847 (21722) 0.022868 (21694)
Vulkan Transcribe, eager + CTC 0.023389 (21665) 0.023357 (21691)
Vulkan Transcribe, host-staged experts + CTC 0.296868 (5835) 0.297409 (5830)

disk_experts=true stages expert weights from host storage; expert computation stays on the GPU. Post-unload GPU residency matched main or was slightly lower.

Streaming performance

Matched warmed HTTP streaming requests use 28-, 167- and 28-second recordings. RTF includes upload, transport and complete SSE delivery; warmup and reload are excluded.

Backend Diar latency profile Main RTF PR RTF
CUDA low 0.030761 0.030613
Vulkan low 0.035920 0.035386
CUDA very_high 0.001215 0.001205
Vulkan very_high 0.001349 0.001337

The earlier apparent very_high slowdown was timing noise: it did not reproduce across 16 counterbalanced server runs. The table reports the final steady-state results, within 1% of main. Individual paired differences varied in both directions, and all outputs matched exactly.

CPU performance

Ryzen 9 7900X, eight threads. Small matched runs after warmup:

Model Main RTF PR RTF
Nemotron 3 Diarization, BF16 0.008990 0.009466
Nemotron Transcribe, CTC timestamps 0.344569 0.349110

@0xShug0
0xShug0 merged commit ae1cbcb into main Nov 5, 2026
7 checks passed
@0xShug0
0xShug0 deleted the refactor/rope-transformer-encoder branch November 5, 2026 22:10
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