Downloads · 30 days
8
20% of all-time downloads
DEXX23/whisper-small-fp16-cuda-graphs
whisper-small-fp16-cuda-graphs is a machine learning model from DEXX23. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This is an optimized version of openai/whisper-small designed for NVIDIA GPUs. It achieves up to 4x speedup compared to the baseline by leveraging: 1. FP16 Precision: Reduced memory footprint and tensor core accelerat…
Downloads · 30 days
8
20% of all-time downloads
All-time downloads
40
Public
Parameters
242M
484 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors484 MB · 99%
From the Hugging Face model README
This is an optimized version of openai/whisper-small designed for NVIDIA GPUs. It achieves up to 4x speedup compared to the baseline by leveraging:
static cache.fp32 eager mode.https://github.com/ItzDEXX/WhisperOptimization
To achieve the speedup, you must enable CUDA Graphs (compilation) at runtime. The model weights are standard FP16, but the speed comes from torch.compile.
import torch
from transformers import WhisperForConditionalGeneration, WhisperProcessor
model_id = "YOUR_USERNAME/YOUR_REPO_NAME" # <--- REPLACE THIS
# 1. Load Model
model = WhisperForConditionalGeneration.from_pretrained(
model_id,
torch_dtype=torch.float16,
attn_implementation="sdpa", # Flash Attention
device_map="cuda"
)
# 2. Enable CUDA Graphs (The Magic Step)
model.generation_config.cache_implementation = "static"
model = torch.compile(model, mode="reduce-overhead", fullgraph=True)
# 3. Run Inference
processor = WhisperProcessor.from_pretrained(model_id)
# ... standard generation code ...