Repository navigation
feat(serving): Nemotron 3.5 ASR Streaming 0.6B serving example + multilingual RNNT fixes - #4
Conversation
L4 achieves 343x realtime (43 RPS × 8s audio). Omi production deployment benchmarked at 286x realtime (35.92 RPS, 0 failures, 5134 requests tested at up to c=128). Co-Authored-By: Claude Opus 4.6 <[email protected]>
…TML report Both README and benchmark-report.html now show dual metrics: 343x realtime (RTF 0.003) on L4, 55x realtime (RTF 0.018) on T4. HTML report includes Omi production case study: 286x realtime, 35.92 RPS, 0 failures over 5134 requests. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Production-ready streaming ASR server using Nemotron Speech Streaming 0.6B via WebSocket. Benchmarked on L4: 119ms chunk latency (single stream), 4 concurrent streams at p99<1.2s, zero failures across 192 streams. Changes: - gpu_worker: support streaming-only mode (skip batch model loading) - gpu_worker: guard batch dispatch when no batch model loaded - Add serving-stream.yaml config (streaming only, no batch model) - Add Dockerfile.stream (NeMo NGC 26.02 base) - Add K8s deployment-stream.yaml for parakeet-pool - Add stream_benchmark.py (WebSocket concurrency sweep + sustained load) - Fix cache_aware_rnnt.yaml: add missing enable_pnc key - Fix serving.yaml: correct model name to nvidia/nemotron-speech-streaming-en-0.6b Co-Authored-By: Claude Opus 4.6 <[email protected]>
📊 L4 Benchmark Results — Nemotron Speech Streaming 0.6BGPU: NVIDIA L4 (22GB VRAM) on g2-standard-8, GKE us-central1 Concurrency Sweep (realtime pace)
Sweet spot: 4 concurrent streams — chunk p50=369ms (within 480ms latency mode budget), p99=1.2s, zero failures. Sustained Load (c=4, 3 minutes)
Quality Check (espeak-ng TTS)
Key Findings
vs Batch Parakeet TDT (same L4)
Streaming trades ~250x throughput for real-time partial transcripts. |
- Reject batch REST requests early (HTTP 404) in streaming-only mode - Raise FileNotFoundError when streaming config missing instead of warning - Validate at least one model loads at startup - Add websocket timeouts to stream_benchmark.py to prevent hangs - Fix model name in benchmark report metadata - Use Recreate strategy in K8s to avoid RWO PVC deadlock - Pin image tag to v0.1.0 instead of :latest Co-Authored-By: Claude Opus 4.6 <[email protected]>
Code Review Fixes (Codex Review Round 1)All 5 findings from the automated code review have been addressed in commit
Additional fix in |
- Include stream_benchmark.py and espeak-ng in Dockerfile for in-container benchmarking - Add aiohttp + numpy deps for benchmark - Fix model name in serving-stream.yaml comment - Correct VRAM estimate in config comment (5.7GB not 1.7GB) Co-Authored-By: Claude Opus 4.6 <[email protected]>
Industrial Performance Report — Nemotron Speech Streaming 0.6B on NVIDIA L4Test date: 2026-06-16 1. Transcription Quality (real speech)
Note: espeak-ng TTS produces robotic audio that this streaming model handles partially. 2 of 5 samples got empty output (likely below model's audio quality threshold). For production WER, LibriSpeech test-clean evaluation is pending. 2. Concurrency Scaling (20 sessions per level, real-time pace)
Peak throughput: 1.3x RTFx (RTF 0.745) at concurrency≥4 3. Sustained Load (5 minutes, concurrency=4)
Steady-state performance with zero degradation over 5 minutes of continuous streaming. p95-p99 spread is tight (1,253-1,303ms), indicating stable GPU scheduling. 4. Sustained Load (3 minutes, concurrency=8)
Higher concurrency trades chunk latency for throughput — sessions/min increases from 19.0 to 19.7 but p50 doubles (374→752ms). 5. Capacity Planning (per L4 GPU, streaming-only)
Streaming vs Batch Comparison (same L4 GPU)
Key insight: These are complementary workloads, not alternatives. Batch processes entire files 343x faster than real-time. Streaming gives live partial transcripts at 1.3x real-time. The streaming-only Dockerfile uses 60% less VRAM, allowing deployment on smaller GPUs. Industrial benchmark by AI for @beastoin — 329 sessions, 0 failures, 8 concurrency levels × 20 sessions each + 8 minutes sustained load |
Long-Running Stream Benchmark — Nemotron 3.5 ASR (FINAL)Model: Complete Results Matrix
Format: RTFx / p50 chunk latency Detailed Results
Analysis1. Concurrency × Duration limits (on single L4) The GPU can sustain
2. No latency drift — across all passing tests, drift stays within ±2.3%. The model does NOT degrade over time. Cache memory is stable. No thermal throttling observed. 3. RTFx is consistent — 1.47-1.50x at c≥2 regardless of duration. The model processes audio ~50% faster than real-time when batching across streams. 4. p50 scales linearly with concurrency — ~138ms × concurrency. This is the sequential GPU processing cost: each stream's chunk waits behind the others. 5. Failure mode is clean — timeouts produce WebSocket close (1000 OK), not crashes or OOM. The server stays healthy after failures. Production Recommendations
Capacity per L4 GPU
12 tests, ~3.5 hours total runtime, 71,250+ audio chunks processed on passing tests |
…lingual model Stream chunks from concurrent WebSocket sessions are now drained from the queue and processed in a single `transcribe_step()` call instead of one at a time. This eliminates the sequential bottleneck where each chunk took ~137ms, limiting throughput to ~1.17 concurrent streams. Benchmarked on L4 GPU (Nemotron 3.5 ASR 0.6B): - c=4: 1.38x → 3.0x RTFx (+117%) - c=8: failing → 3.9x RTFx, 0 failures - c=16: N/A → 6.1x RTFx, 0 failures - p50 latency flat at ~145ms regardless of concurrency Also switches default model to nvidia/nemotron-3.5-asr-streaming-0.6b (multilingual, 35+ languages, 4.8GB VRAM). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Batched Streaming Benchmark Results (Short Duration)Root Cause & FixRoot cause: GPU worker processed stream chunks sequentially via Fix: Concurrency Sweep (short clips, L4 GPU)
Key metrics at c=16: p50=147.5ms, p90=491ms, p99=1784ms, 0 failures Sustained Load (1 min, c=4)
Long-running benchmark (5/10/15 min at c=1-16) is in progress — results will follow. Commit: 474eeae |
Long-Running Stream Benchmark — Batched Inference Results14/14 configs PASSED (vs 8/12 before batching fix) Before vs After Comparison
Key Metrics (Batched)
Root Cause & Fix Summary
Hardware: NVIDIA L4 (24GB) on GKE | Model: nvidia/nemotron-3.5-asr-streaming-0.6b (0.6B params, 35+ languages) |
…ng model transcribe_step() is void — read transcripts from pipeline.get_state() instead of the return value. Track committed text across EOU events and return accumulated transcript on stream close. Switch to nvidia/nemotron-speech-streaming-en-0.6b which works correctly for streaming (multilingual model produces blank tokens in NeMo 3.1.0 streaming pipeline). Verified: 6.7% WER on LibriSpeech test-clean, 64 concurrent streams sustained for 5 min with 0 failures on L4. Co-Authored-By: Claude Opus 4.6 <[email protected]>
WER Evaluation & High-Concurrency Benchmark ResultsModel
WER — LibriSpeech test-clean (20 samples, batch inference)
Errors are edge cases: proper names ("Emil"→"Emile"), archaic spellings ("O"→"oh"), French phrases ("vive le roi"→"viva roy"). Core English recognition is near-perfect. High-Concurrency Benchmarks — L4 GPU (24GB VRAM)Quick test (1 min streams):
Sustained test (5 min streams):
Code Fix (73231a1)
|
CacheAwareRNNTInferenceWrapper.execute_step() accepted prompt_vectors but never used them — the decoder received unconditioned encoder output, causing all-blank tokens for prompt-based multilingual models. Apply prompt_kernel projection between encoder and decoder (matching what model._apply_prompt_to_encoded does). Also auto-detect left attention context size from the model instead of hardcoding [70, x] which is wrong for the multilingual model ([56, x]). Co-Authored-By: Claude Opus 4.6 <[email protected]>
…tilingual model The multilingual model (nemotron-3.5-asr-streaming-0.6b) produces garbled output when fed small WebSocket chunks (40ms/640 samples) directly because the mel spectrogram computation is fragmented. This accumulates raw audio to the pipeline's native chunk size (320ms/5120 samples) before creating frames, matching the chunk size used by pipeline.run(). Tested on L4 GPU with LibriSpeech: 40ms direct produces "sauce" while accumulated 320ms produces identical output to 320ms direct baseline. Buffer is flushed on stream close so no audio is lost. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Multilingual Streaming Fix — Chunk AccumulationTwo root causes identified and fixed for the multilingual model blank token issue in streaming mode: Root Cause 1: Prompt vectors silently dropped (commit 4d9c78e)
Root Cause 2: Fragmented mel features from small chunks (commit af1bf3d)The multilingual model produces garbled output when fed small WebSocket chunks (40ms/640 samples) directly. Fix: accumulate raw audio to the pipeline native chunk size (320ms/5120 samples, read from Test Results (L4 GPU, LibriSpeech sample)
Accumulated output matches 320ms direct baseline character-for-character. Buffer is flushed on stream close. |
Max Concurrency Benchmark — L4 GPUBinary search for max concurrent streams with quality gate (WER < 20%, p99 < 3s, 0 failures). Tested with LibriSpeech test-clean for WER, 90s sustained per level, realtime-paced 160ms chunks. Results
Max Concurrency: c=56 (single L4 GPU)
|
Rewrite README to cover both Parakeet TDT batch and Nemotron Streaming modes with architecture diagram, quick start guides (Docker/K8s/bare metal), full API reference (REST + WebSocket), streaming client examples (Python + JS), configuration/tuning guide, deployment patterns, and Omi case study. Update docker-compose.yaml to support both services. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace hard 30-min max_stream_duration with idle-based zombie detection. Streams now run indefinitely as long as audio keeps flowing. Idle streams (no chunks for 5 min) are reaped automatically. - max_stream_duration defaults to 0 (unlimited) - idle_timeout defaults to 300s (5 min) - Background reaper task checks every 30s - Tracks last_chunk_at per session and reaped count in metrics Co-Authored-By: Claude Opus 4.6 <[email protected]>
…, WS error handling Fixes from CP7 review cycle: HIGH: Stream audio buffer now drains in a loop (processes all buffered 320ms chunks per message, not just one). Uses bytearray instead of Python list for memory efficiency. Caps buffer at 10x chunk size to prevent unbounded growth from oversized WebSocket frames. MEDIUM: WebSocket handler catches ValueError when idle reaper closes a stream mid-receive, sends error to client and exits cleanly instead of leaking the connection. MEDIUM: stream_ws() now catches GPU errors during stream open (queue full, pipeline unavailable) and closes with proper WebSocket codes. Co-Authored-By: Claude Opus 4.6 <[email protected]>
CP7 Review Cycle (2026-06-22)Reviewer: Codex (gpt-5.5) — full codebase review Findings: 7 total (1 HIGH, 4 MEDIUM, 2 LOW)Fixed (commit a41101c)
Deferred (acceptable risk)
|
…del class The nvcr.io/nvidia/nemo:26.02 base image predates the nemotron-3.5-asr-streaming model which requires nemo.collections.asr.models.rnnt_bpe_models_prompt. Install our fork on top to provide the missing module plus thread-safety patches. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…verlay The 26.02 base image has NeMo editable-installed at /opt/NeMo/ which takes sys.path precedence over pip site-packages. Replace the entire source tree with our fork to get prompt model class and thread-safety patches. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…close The RNNT streaming pipeline puts all text in partial_transcript — final_transcript (committed segments) stays empty for short utterances. This caused final_text to be empty on stream close despite correct partial transcripts during streaming. Track last_partial in the session and use it as fallback when committed_text is empty. Co-Authored-By: Claude Opus 4.6 <[email protected]>
P1: Dockerfile.batch missing stream_engine.py (server.py imports it
unconditionally) — image crashed on start with ModuleNotFoundError.
P2: batch_engine timestamp serialization — when _extract_results returns
dicts (timestamps mode), _serialize_result now preserves them instead
of stringifying the whole dict into the text field.
P2: T4 config missing cuda_graphs: false — T4/Turing crashes with RNNT
CUDA graph conditional nodes.
P2: K8s service-stream.yaml added — service.yaml only selected
parakeet-batch pods, streaming pods had no Service endpoint.
P2: Dockerfile.stream now copies nemo/ from build context instead of
cloning an external branch — ensures image matches the checked-out
source.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Benchmark Results — Nemotron 3.5 ASR Streaming 0.6B (CP8)GPU: NVIDIA L4 (24GB) | VRAM: ~4.8GB | Container: NeMo NGC 26.02 + fork patches Tier 1: WER (LibriSpeech test-clean, 200 samples, streaming)
WER DistributionTier 2: Concurrency Sweep (realtime-paced)
Tier 3: Sustained Load (3 min, c=4)
Summary
|
CP10: Merge Gate — All Checkpoints Passed ✅
Quality gates:
Ready for merge approval. |
Summary
Production-ready streaming ASR serving example for Nemotron 3.5 ASR Streaming 0.6B (
nvidia/nemotron-3.5-asr-streaming-0.6b) — a 638M-param multilingual model supporting 35+ languages.Includes two NeMo framework-level bug fixes that enable multilingual streaming inference, plus seven serving-layer fixes from two rounds of code review.
NeMo Framework Fixes
Prompt vectors silently dropped in streaming pipeline (commit
4d9c78e)CacheAwareRNNTInferenceWrapper.execute_step()acceptedprompt_vectorsbut never applied the prompt projection — multilingual model produced blank tokens in streaming modeprompt_kernelMLP projection between encoder and decoder, matching the batch inference pathMel spectrogram fragmentation from small WebSocket chunks (commit
af1bf3d)Serving-Layer Fixes
a41101c) — process ALL buffered 320ms chunks per WS message, not just one. Prevents unbounded memory growth.a41101c) — replace Python list with bytearray for memory-efficient buffering. Buffer cap at 51200 samples.a41101c) — idle reaper closes GPU state; WS handler now catches ValueError and breaks cleanly.a41101c) — catches GPU errors with WS code 1011.773a3bc) — removed hard 30-min stream limit. Background reaper closes streams idle for 5 minutes (configurable).914724d) — RNNT streaming pipeline puts all text inpartial_transcript; track last partial and return it on stream close.59e3d5b) — 5 fixes: Dockerfile.batch missing stream_engine (P1), timestamp serialization, T4 cuda_graphs config, K8s service-stream.yaml, Dockerfile.stream uses build context.Serving Example
batch_modelconfigured, saving ~8GB VRAMtranscribe_step()callsL4 GPU Benchmark Results
GPU: NVIDIA L4 (24GB) · Container: NeMo NGC 26.02 + fork patches · VRAM: ~4.8GB · Model: nemotron-3.5-asr-streaming-0.6b
WER (LibriSpeech test-clean, 200 samples, streaming 480ms latency mode)
Concurrency Sweep (realtime-paced, 480ms latency mode)
Summary
Code Review
Two rounds of Codex (gpt-5.5) review:
59e3d5bFiles Changed
NeMo Framework Fix
nemo/collections/asr/inference/model_wrappers/cache_aware_rnnt_inference_wrapper.py— prompt projection in streamingexecute_step()Serving Example
examples/asr/serving/gpu_worker.py— streaming-only mode, batched inference, chunk accumulation, buffer drain, final text fixexamples/asr/serving/server.py— batch rejection, WS error handling, idle timeoutexamples/asr/serving/stream_engine.py— idle timeout reaper, unlimited stream durationexamples/asr/serving/batch_engine.py— batch transcription engine, timestamp fixexamples/asr/serving/stream_benchmark.py— WebSocket benchmark (NEW)examples/asr/serving/Dockerfile.stream— NeMo NGC base + source overlay (NEW)examples/asr/serving/Dockerfile.batch— PyTorch NGC batch-only (NEW)examples/asr/serving/docker-compose.yaml— batch + streaming services (UPDATED)examples/asr/serving/README.md— comprehensive batch + streaming guide (REWRITTEN)examples/asr/serving/conf/serving-stream.yaml— streaming-only config (NEW)examples/asr/serving/conf/serving-batch-t4.yaml— T4 config with cuda_graphs fixexamples/asr/serving/conf/serving.yaml— idle timeout, model name fixexamples/asr/serving/k8s/service-stream.yaml— streaming K8s Service (NEW)Test Plan
🤖 Generated with Claude Code