Sign inSign up

andspace/whisper-trt

By andspace

โ€ขUpdated about 1 year ago

๐Ÿš€ Whisper TensorRT-LLM compiler with CUDA 12.8 & Ubuntu 22.04 for optimized speech-to-text models

Image
Machine learning & AI
1

986

andspace/whisper-trt repository overview

โ Whisper TensorRT-LLM - Ultra-Fast Speech-to-Text Docker Images

โ ๐ŸŽฏ Overview

GPU-accelerated speech recognition ecosystem for OpenAI Whisper models using TensorRT-LLM. Delivers industry-leading performance for real-time speech-to-text applications with NVIDIA GPU acceleration.

Architecture: Built on top of andspace/trt-llm:base-12.8 which provides the foundational TensorRT-LLM environment with CUDA 12.8 support.


โ ๐Ÿ“ฆ Available Images
โ ๐Ÿ”ง Compiler Image - compiler

Model Compilation & Development Environment

Foundation:

  • ๐Ÿ—๏ธ Built on: TensorRT-LLM dev environment
  • ๐Ÿ”ง Compilation: Full toolchain for model optimization
  • ๐Ÿค– Automated: Built-in compilation script with smart caching

Whisper-Specific Assets:

  • ๐ŸŽฏ Tokenizers: multilingual.tiktoken, gpt2.tiktoken
  • ๐ŸŽต Audio Assets: mel_filters.npz, sample audio files
  • ๐Ÿ“Š Model Files: Pre-downloaded Whisper assets
  • ๐Ÿ”„ Smart Caching: Persistent model cache across compilations

ML & Audio Libraries:

  • ๐Ÿค– Whisper: OpenAI Whisper, KaldiAlign
  • ๐Ÿ“Š Analysis: Datasets 3.1.0, evaluation metrics, ROUGE scoring
  • ๐ŸŽต Audio: Advanced AV codec support
  • ๐Ÿ“ˆ Visualization: Pandas, Matplotlib
  • โšก Async: Janus framework for concurrent processing

Best for: Model compilation, TensorRT engine building, performance optimization


โ ๐Ÿท๏ธ Advanced Tagging Strategy
โ ๐ŸŽฏ Latest Tag
latest โ†’ compiler  # Points to production-ready image
โ ๐Ÿ“‹ All Available Tags

Compiler Image:

andspace/whisper-trt:1.2-compiler-12.8        # Full version
andspace/whisper-trt:compiler-12.8            # Dependency version
andspace/whisper-trt:compiler                  # Type tag
andspace/whisper-trt:latest                    # Latest (โ†’ compiler)
โ ๐Ÿ”„ Version Format
Full version: {release}-{type}-{cuda}
Dependency version: {type}-{cuda}
    โ”‚       โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ CUDA version (12.8)
    โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Image type (compiler)
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Release version (1.2)

โ ๐Ÿ› ๏ธ Model Compilation Workflow
โ ๐Ÿš€ Automated Compilation Script

The compiler image includes an automated compilation script (compile-whisper-model.sh) that handles the complete model compilation pipeline:

Compilation Steps:

  1. ๐Ÿ“ฅ Model Download: Automatic download with smart caching
  2. ๐Ÿ”„ Checkpoint Conversion: Convert to TensorRT-LLM format
  3. ๐Ÿ—๏ธ Engine Building: Build optimized TensorRT engines (encoder + decoder)
  4. ๐Ÿงช Testing: Validate compiled engines with test audio
  5. ๐Ÿ“Š Reporting: Generate detailed compilation report
โ ๐Ÿ“‹ Compilation Options
OptionDefaultDescription
--modellarge-v3Whisper model to compile
--precisionfloat16Inference precision
--batch_size8Maximum batch size
--beam_width4Maximum beam width
โ ๐Ÿ’พ Smart Caching System
  • ๐Ÿ”„ Shared Cache: Models cached in /models/downloaded/
  • โšก Fast Rebuilds: Skip downloads for cached models
  • ๐ŸŽฏ Precision Variants: Multiple precisions share same base model
  • ๐Ÿ“‚ Persistent Storage: Cache survives container restarts
โ ๐Ÿ“Š Output Structure
/models/
โ”œโ”€โ”€ downloaded/                    ๐Ÿ”„ Shared model cache
โ”‚   โ””โ”€โ”€ {model_name}.pt
โ””โ”€โ”€ {model_name}_{precision}/      ๐ŸŽฏ Compiled model
    โ”œโ”€โ”€ encoder/
    โ”‚   โ”œโ”€โ”€ config.json
    โ”‚   โ”œโ”€โ”€ rank0.safetensors
    โ”‚   โ””โ”€โ”€ rank0.engine           โœ… TensorRT engine
    โ”œโ”€โ”€ decoder/
    โ”‚   โ”œโ”€โ”€ config.json
    โ”‚   โ”œโ”€โ”€ rank0.safetensors
    โ”‚   โ””โ”€โ”€ rank0.engine           โœ… TensorRT engine
    โ””โ”€โ”€ model_info.json            ๐Ÿ“‹ Compilation metadata

โ ๐ŸŽต Supported Models & Features
โ ๐Ÿ“ข Whisper Models
ModelSizeUse Case
large-v3~3GBLatest & most accurate
large-v2~3GBHigh accuracy
medium~1.5GBBalanced performance
small~500MBFast processing
base~150MBQuick transcription
tiny~40MBUltra-fast, basic accuracy
โ โšก Precision Support
PrecisionSpeedAccuracyMemoryCompilation
float16โญโญโญโญโญโญโญโญRecommendedโœ… Stable
float32โญโญโญโญโญโญโญโญHighest accuracyโœ… Stable
int8โญโญโญโญโญโญโญโญBalancedโœ… Stable
int4โญโญโญโญโญโญโญMaximum speedโš ๏ธ Experimental
โ ๐ŸŽฏ Core Capabilities
  • ๐Ÿ”„ Automated Compilation: One-command model compilation
  • ๐ŸŒ Multi-language: Support via multilingual tokenizer
  • ๐Ÿ“Š Batch Processing: Configurable batch sizes for throughput
  • ๐ŸŽš๏ธ Audio Preprocessing: Advanced mel-scale filtering
  • ๐Ÿ›ก๏ธ Error Handling: Comprehensive logging and recovery
  • ๐Ÿš€ Development: Complete toolchain for optimization
  • ๐Ÿงช Testing: Built-in engine validation and benchmarking

โ ๐Ÿš€ Quick Start
โ ๐Ÿณ Pull Image
# Model compilation & development (recommended)
docker pull andspace/whisper-trt:latest

# Version pinning with dependencies only
docker pull andspace/whisper-trt:compiler-12.8

# Full version pinning
docker pull andspace/whisper-trt:1.2-compiler-12.8
โ โšก Compile Models
# Basic compilation (large-v3, float16)
docker run --gpus all -v $(pwd)/models:/models \
  andspace/whisper-trt:latest \
  compile-whisper-model.sh

# Custom model and precision
docker run --gpus all -v $(pwd)/models:/models \
  andspace/whisper-trt:latest \
  compile-whisper-model.sh \
  --model small --precision float16 --batch_size 4

# High-throughput configuration
docker run --gpus all -v $(pwd)/models:/models \
  andspace/whisper-trt:latest \
  compile-whisper-model.sh \
  --model medium --precision float16 \
  --batch_size 16 --beam_width 8
โ ๐Ÿ“‹ Compilation Examples

Development Setup:

# Compile tiny model for quick testing
docker run --gpus all -v $(pwd)/models:/models \
  andspace/whisper-trt:latest \
  compile-whisper-model.sh \
  --model tiny --precision float16

Production Setup:

# Compile large-v3 for production use
docker run --gpus all -v $(pwd)/models:/models \
  andspace/whisper-trt:latest \
  compile-whisper-model.sh \
  --model large-v3 --precision float16 \
  --batch_size 8 --beam_width 4

โ ๐Ÿ’ป System Requirements
ComponentRequirement
GPUNVIDIA GPU with CUDA Compute Capability 8.0+
DockerDocker with NVIDIA Container Toolkit
Memory4GB+ GPU memory (varies by model)
Storage10GB+ free space for model compilation
Python3.9+ compatible
LicenseMIT License
โ ๐Ÿ”ง GPU Memory Requirements
Model SizeCompilationInference
tiny2GB1GB
small4GB2GB
medium6GB3GB
large-v2/v38GB+4GB+

โ ๐Ÿ“Š Performance Optimizations
FeatureBenefitImplementation
TensorRT EnginesMaximum GPU utilizationAutomated engine building
Mixed PrecisionOptimal speed/accuracy balanceConfigurable precision modes
Batched InferenceThroughput optimizationConfigurable batch sizes
Model CachingFast recompilationPersistent model cache
Smart TestingValidation & benchmarkingBuilt-in test suite
Async ProcessingConcurrent request handlingJanus framework integration

โ ๐ŸŽฏ Use Cases
  • ๐ŸŽ™๏ธ Real-time transcription services
  • ๐ŸŽง Podcast processing and indexing
  • ๐Ÿ’ผ Meeting transcription and minutes
  • ๐Ÿค– Voice assistants and chatbots
  • โ™ฟ Content accessibility solutions
  • ๐ŸŒ Multilingual speech processing
  • ๐Ÿญ High-throughput ASR pipelines
  • ๐Ÿ”ฌ Research & development environments

Tag summary

Content type

Image

Digest

sha256:f0a2f0617โ€ฆ

Size

16.3 GB

Last updated

about 1 year ago

docker pull andspace/whisper-trt