AI Practices AI实践 6h ago Updated 3h ago 更新于 3小时前 47

Reduce ASR inference costs by 75% with NVIDIA MPS on Amazon EC2 通过NVIDIA MPS在Amazon EC2上将ASR推理成本降低75%

NVIDIA CUDA Multi-Process Service (MPS) combined with Triton Inference Server on Amazon EC2 GPU instances reduced GPU infrastructure requirements by 75% (from 16 instances to 4) for Heidi Health's clinical ASR workload A single ASR inference request typically uses only 15–20% of an NVIDIA L40S GPU's compute capacity; default CUDA time-slicing leaves ~80% of hardware idle with sequential access and context-switch overhead The hybrid inference pipeline runs the Conformer encoder through ONNX Runti 通过NVIDIA MPS技术将ASR推理的GPU基础设施需求降低75%(从16个实例减少到4个) 单GPU在MPS配置下可实现92.1 RPS吞吐量,同时保持亚秒级延迟(mean < 650ms, p99 < 1000ms) 采用ONNX Runtime + TensorRT EP优化编码器,PyTorch CUDA原生运行解码器的混合推理架构 通过Triton Inference Server实现动态批处理(50ms延迟窗口),提升GPU利用率 解决了单ASR请求仅占用15-20% GPU算力、默认CUDA时间切片导致80%硬件空闲的问题

62
Hot 热度
72
Quality 质量
68
Impact 影响力

Analysis 深度分析

TL;DR

  • NVIDIA CUDA Multi-Process Service (MPS) combined with Triton Inference Server on Amazon EC2 GPU instances reduced GPU infrastructure requirements by 75% (from 16 instances to 4) for Heidi Health's clinical ASR workload
  • A single ASR inference request typically uses only 15–20% of an NVIDIA L40S GPU's compute capacity; default CUDA time-slicing leaves ~80% of hardware idle with sequential access and context-switch overhead
  • The hybrid inference pipeline runs the Conformer encoder through ONNX Runtime with TensorRT EP (FP16 precision, kernel fusion) while the RNN-T decoder runs natively in PyTorch CUDA with CUDA graph caching
  • MPS enables concurrent kernel execution across multiple processes sharing a single GPU context, eliminating context-switching overhead and supporting configurable SM partitioning via CUDA_MPS_ACTIVE_THREAD_PERCENTAGE
  • Transcription instances use 25% SM allocation with 4 concurrent processes (~2.5 GB VRAM each); diarization instances use 12% SM with 8 concurrent processes (~1.8 GB each), achieving 92.1 RPS per GPU with sub-second latency

Why It Matters

This case study demonstrates a practical, production-proven approach to dramatically reducing GPU inference costs for latency-sensitive ASR workloads without requiring model retraining or application code changes. For AI practitioners running small-to-medium models that underutilize GPUs, the combination of MPS, TensorRT optimization, and Triton batching offers a replicable blueprint for achieving significant infrastructure savings while maintaining strict latency SLAs.

Technical Details

  • CUDA MPS (Multi-Process Service): A binary-compatible CUDA API implementation that funnels all processes through a single GPU context managed by an MPS daemon, enabling concurrent kernel execution on different SMs without context-switch overhead. Memory protection is maintained via separate address spaces per client process.
  • Hybrid ONNX/TensorRT + PyTorch pipeline: The compute-heavy 24-layer Conformer encoder (1024 hidden dimensions) is converted to ONNX and executed via TensorRT EP with FP16 precision calibration and operator fusion. The RNN-T Token-and-Duration Transducer decoder remains in native PyTorch CUDA, leveraging CUDA graph caching for variable-length token generation flexibility.
  • Triton Inference Server batching: Dynamic batching with a 50 ms accumulation delay and preferred batch sizes of [4, 8, 16] is used for transcription. This allows the scheduler to form optimally sized batches that maximize GPU throughput while respecting latency constraints.
  • MPS configuration: Two separate MPS deployments on dedicated GPU instances — transcription instances allocate 25% SM per process with 4 concurrent processes (~2.5 GB VRAM each on L40S 48 GB), and diarization instances allocate 12% SM with 8 concurrent processes (~1.8 GB each).
  • Performance results: The optimized setup achieves 92.1 RPS per GPU with mean latency < 650 ms and p99 < 1,000 ms, reducing Heidi Health's fleet from 16 GPU instances to 4 while processing 2.4 million clinical consultations weekly across 190 countries.

Industry Insight

  • For workloads where individual inference requests underutilize GPU compute (common with smaller models like Parakeet TDT 0.6B), MPS should be evaluated before scaling out to additional GPU instances — it can deliver 75%+ cost reductions without model changes or retraining.
  • Hybrid optimization strategies that apply TensorRT to static compute kernels (encoders) while preserving framework flexibility for dynamic components (decoders with variable-length generation) offer a pragmatic middle ground between full compilation and native execution.
  • The three GPU sharing mechanisms (time-slicing, MIG, MPS) serve distinct use cases: MIG for hard isolation in multi-tenant environments, MPS for high-concurrency small-model workloads, and time-slicing only for simple single-model deployments — choosing the right mechanism is critical to cost-performance optimization.

TL;DR

  • 通过NVIDIA MPS技术将ASR推理的GPU基础设施需求降低75%(从16个实例减少到4个)
  • 单GPU在MPS配置下可实现92.1 RPS吞吐量,同时保持亚秒级延迟(mean < 650ms, p99 < 1000ms)
  • 采用ONNX Runtime + TensorRT EP优化编码器,PyTorch CUDA原生运行解码器的混合推理架构
  • 通过Triton Inference Server实现动态批处理(50ms延迟窗口),提升GPU利用率
  • 解决了单ASR请求仅占用15-20% GPU算力、默认CUDA时间切片导致80%硬件空闲的问题

为什么值得看

本文展示了如何通过MPS并发执行机制和模型优化技术,在保持严格延迟SLA的前提下大幅降低GPU推理成本,对需要处理大量小模型推理请求的AI从业者具有重要参考价值。Heidi Health在190个国家处理240万临床咨询的实际案例,为医疗AI部署提供了可复用的成本优化范式。

技术解析

  • GPU共享机制对比:评估了三种NVIDIA GPU多租户共享方案——时间切片(默认,顺序执行)、MIG(硬物理分区)和MPS(软SM限制并发)。MPS通过单一GPU上下文管理所有CUDA工作,消除上下文切换开销,支持不同进程的并发内核执行,且无需修改现有CUDA代码。
  • MPS部署配置:转录实例采用25% SM分配,4个并发进程(每进程约2.5GB VRAM);声纹分离实例采用12% SM分配,8个并发进程(每进程约1.8GB)。通过CUDA_MPS_ACTIVE_THREAD_PERCENTAGE环境变量配置分区大小。
  • 混合推理优化:计算密集的Conformer编码器(24层,1024隐藏维度)通过ONNX Runtime + TensorRT EP运行,利用算子融合和FP16精度校准;RNN-T解码器在PyTorch CUDA中原生运行,利用CUDA图缓存处理变长token生成。
  • Triton动态批处理:转录请求通过50ms延迟窗口累积,按[4, 8, 16]优选批次大小调度,实现请求聚合与延迟控制的平衡。

行业启示

  • GPU利用率优化是降本关键:对于小模型推理场景,默认CUDA时间切片导致80%硬件空闲,采用MPS等并发执行机制可显著提升资源利用率,降低基础设施成本。
  • 混合推理架构的灵活性:将计算密集型组件(编码器)与动态生成组件(解码器)分别优化,结合TensorRT静态优化和PyTorch动态执行,可在性能和灵活性之间取得最佳平衡。
  • 医疗AI部署的成本挑战:处理大规模临床咨询的AI系统需要在严格延迟SLA下控制成本,本文提供的75%成本降低方案为医疗AI规模化部署提供了可行路径。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Speech 语音 Inference 推理 GPU GPU Deployment 部署 Healthcare AI 医疗AI