Repository navigation
Description
Summary
Parakeet ASR service using NeMo's parakeet-tdt-0.6b-v3 batch model enters an unrecoverable error state after a CUDA OOM event when running with torch.compile + CUDA graphs enabled. Every subsequent transcription request fails with a CUDA stream capture error, and the service cannot self-recover without a full pod delete (container restart is insufficient).
Environment
- Model:
nvidia/parakeet-tdt-0.6b-v3(TDT — CTC+transducer hybrid, resolved viaEncDecRNNTBPEModel) - Inference mode: NeMo
- GPU: NVIDIA L4 (22 GiB VRAM)
- CUDA: 13.0, Driver 580.126.20
- NeMo: installed via pip (collections.asr)
- PyTorch: with
torch.compileenabled - Config:
PARAKEET_TORCH_COMPILE=true,PARAKEET_CUDA_GRAPHS=true - Container resource limit: 20Gi RAM, 1x GPU
Code Path
The crash is on the batch transcription path, not the streaming model:
- Batch (
/v1/transcribe,/v2/transcribe):main.py→batch_engine.py:103 submit→batch_engine.py:137 _flush_batch→gpu_worker.py:134 _run_loop→gpu_worker.py:208 _batch_transcribe→ NeMornnt_models.py:317 transcribe - The streaming model (
parakeet-rnnt-1.1bloaded bystream_handler.pyfor/v3/streamWebSocket) is not involved.
Note: rnnt_models.py appears in the traceback because TDT extends RNNT architecture in NeMo — the base transducer .transcribe() logic lives there. This does not mean the RNNT streaming model was loaded.
Sequence of Events
-
Under load, a transcription batch triggers CUDA OOM during
move_data_to_device()in NeMo'stranscription.py:torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 366.00 MiB. GPU 0 has a total capacity of 22.03 GiB of which 127.12 MiB is free. Including non-PyTorch memory, this process has 21.89 GiB memory in use. Of the allocated memory 21.10 GiB is allocated by PyTorch, and 479.55 MiB is reserved by PyTorch but unallocated. -
Container is OOMKilled (exit code 137) and Kubernetes restarts it (restart count reached 3).
-
After restart, every transcription request fails with:
torch.AcceleratorError: CUDA error: operation not permitted when stream is capturing Search for `cudaErrorStreamCaptureUnsupported'The error occurs in
pin_memory()during the PyTorch DataLoader iteration:File "torch/utils/data/_utils/pin_memory.py", line 57, in pin_memory return data.pin_memory() -
The health endpoint (
GET /health) continues returning 200, so Kubernetes keeps routing traffic — but it can never serve a request. The health check atgpu_worker.py:71-72checksself._running and self._ready.is_set() and self._load_error is None— it verifies initial model load success only, with no ongoing GPU liveness probe. -
Container restarts do not fix this — the GPU device retains corrupted CUDA graph/stream capture state across process restarts within the same pod. Only a full pod delete (releasing and reattaching the GPU device) recovers the service.
-
nvidia-smiduring the stuck state showed: 5050 MiB used, 0% GPU utilization — model loaded in VRAM but not processing.
Reproduction
- Deploy parakeet with
PARAKEET_TORCH_COMPILE=trueandPARAKEET_CUDA_GRAPHS=trueon an L4 GPU - Send concurrent transcription requests until VRAM is exhausted
- Wait for OOM kill and container restart
- All subsequent requests fail with stream capture error
- Health endpoint returns 200 throughout
Activity
beastoin commentedon Jun 20, 2026
Correction: Model Identity
The original report implied the streaming model (
parakeet-rnnt-1.1b) was involved. After code review, this is incorrect — the crash is on the batch model (parakeet-tdt-0.6b-v3).Why
rnnt_models.pyappears in the tracebackThe
rnnt_models.py:317in the stack trace is misleading.parakeet-tdt-0.6b-v3is a TDT model (CTC+transducer hybrid), but NeMo resolves it throughEncDecRNNTBPEModelbecause TDT extends the RNNT architecture. The.transcribe()method flows throughrnnt_models.pybecause that's where the base transducer transcription logic lives — not because the RNNT streaming model was loaded.Code paths
/v1/transcribe,/v2/transcribe):main.py→batch_engine.py→gpu_worker.py→GPUWorker(model_name=PARAKEET_MODEL)→ loadsnvidia/parakeet-tdt-0.6b-v3viaEncDecRNNTBPEModelclass resolution/v3/streamWebSocket):stream_handler.py→ loadsnvidia/parakeet-rnnt-1.1b— completely separate, not involved in this crashHealth endpoint gap
gpu_worker.py:71-72—is_readychecksself._runningandself._ready.is_set()andself._load_error is None. Once the model loads successfully on startup,is_readystaysTruepermanently — there is no ongoing GPU liveness probe. This is why the health endpoint returned 200 while the GPU was in a broken CUDA state.Updated suggested fix for health check
This would cause the readiness probe to fail after a CUDA error, triggering Kubernetes to restart the pod automatically.
beastoin commentedon Jun 28, 2026
Addressed by PR #12 — OOM recovery with
torch.cuda.empty_cache()added to all GPU dispatch paths (single, pool, prefetch, stream batch). Observable viagpu.oom_recoveredcounter in/metricsendpoint.Prod data showed VRAM ratcheted 16→19→20→22 GiB across 4-5 OOMs because failed batches leaked tensors without cleanup.