Skip to content

Refactor Drama3 and Nemotron Transcribe with shared MoE execution - #1234

Merged
0xShug0 merged 3 commits into
mainfrom
refactor/moe
Nov 8, 2026
Merged

0xShug0 merged 3 commits into
mainfrom
refactor/moe

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Share the duplicated MoE graph construction and staged expert execution used by Drama3 and Nemotron Transcribe.

  • MoeModule builds routing, expert projections and weighted reductions with explicit mathematical policies. Resident execution uses it directly.
  • StagedMoeRuntime reuses cached expert graphs and the existing expert-weight store for offload, preserving logical expert assignments and reduction order.
  • GraphWorkspace shares activation scratch across serial backbone and expert phases.
  • Reuse FeedForwardModule for Nemotron's shared ReLU-squared experts.

Existing options, defaults and native quantization are retained, including Drama3's offload routing-materialization boundary.

CUDA performance

RTX 5090, Debug build, eight CPU threads. Q4_K_S expert packages, with Q8_0 tower projections for Drama3 and an F16 encoder for Nemotron Transcribe. Compared with main at d2b2076e, using identical inputs and settings in sequential matched sessions, including counterbalanced A–B–B–A and B–A–A–B comparisons. RTF excludes the short unrelated warmup; peak VRAM includes loading and request execution. Offload uses pinned experts and eight GPU slots; Nemotron offload uses prefill batch size 1024. The Nemotron offload row measures plain ASR; the full-GPU peak also covers timestamp/diarization requests.

Configuration Main RTF Refactor RTF Main peak VRAM Refactor peak VRAM
Drama3, full GPU, default 0.17530 0.17529 23,385 MiB 23,385 MiB
Drama3, full GPU, cuda_perf 0.14887 0.14903 23,513 MiB 23,513 MiB
Drama3, offload, default 0.42562 0.42576 6,659 MiB 6,653 MiB
Drama3, offload, cuda_perf 0.40763 0.40732 6,715 MiB 6,719 MiB
Nemotron Transcribe, full GPU 0.01659 0.01642 22,255 MiB 22,255 MiB
Nemotron Transcribe, offload, plain ASR 0.06143 0.06140 6,513 MiB 6,517 MiB

Small timing differences are within observed run variation.

Current tip: CUDA offload

Warmed measurements after removing redundant staged-execution work. Drama3 RTF is the mean of two warmed requests; Nemotron measures the long plain-ASR request. These measurements were collected separately from the comparison above and should not be treated as a counterbalanced speedup comparison. Peak VRAM here covers the complete session, including Nemotron timestamp/diarization checks.

Configuration RTF Peak VRAM
Drama3, offload, default 0.42600 6,599 MiB
Drama3, offload, cuda_perf 0.40619 6,597 MiB
Nemotron Transcribe, offload, plain ASR 0.06243 6,537 MiB

Constant physical slot IDs are uploaded once during setup. A controlled Drama3 prefill trace removes 1,248 host-to-device copies and stream synchronizations, with unchanged graph-launch count and identical output.

Validation

  • CUDA Drama3 resident/offload checks preserve exact WAVs, streamed PCM and non-timing results with default settings and cuda_perf.
  • CUDA Nemotron resident/offload checks preserve exact transcripts, timestamps, speaker labels and speaker turns.
  • Reused sessions cover distinct inputs, changed seeds, long-to-short requests and exact repeated outputs.
  • Vulkan resident/offload execution succeeds for both models, including both Drama3 presets. Repeated outputs match exactly; an ASR check recovers the requested text from all four checked Vulkan Drama3 outputs.
  • Short CPU resident/offload smoke checks complete for both models without aborts.
  • CUDA MoE routing/expert tests pass. Staged expert-cache tests use an independent host mathematical reference with analytically checkable native expert weights and an unchanged absolute tolerance of 1e-4. All 80 staged cases pass on each of CPU, CUDA and Vulkan, covering F32/Q4_K weights, fixed and variable row buckets, cache eviction and repeated execution. Existing dense-weight storage/projection tests are retained.
  • Corrected offload execution preserves exact CUDA results against main and exact Vulkan/CPU results against the saved baseline outputs.

@0xShug0
0xShug0 merged commit 408935b into main Nov 8, 2026
7 checks passed
@0xShug0
0xShug0 deleted the refactor/moe branch November 8, 2026 06:12
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