[Feature]: PyTorch backend: let a Whisper request carry a precomputed log-mel spectrogram
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 12/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- ai-infra-agents
Hướng nghiên cứu
The request path for audio items lives in WhisperInputProcessor, which pads audio to the 30-second window before the encoder computes the log-mel spectrogram; WhisperEncoder.forward already accepts a precomputed spectrogram. Read how the processor handles the audio item, then check the shape validation against num_mel_bins. Done means a request with an input_features item reaches the encoder without recomputing mel and is rejected cleanly on wrong shapes, but this issue already has a linked open pull request (#21045) implementing it.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🚀 The feature, motivation and pitch
On the PyTorch backend, a Whisper request can only carry audio: a file path or URL, an (array, sample_rate) tuple, or an {"array", "sampling_rate"} mapping. WhisperInputProcessor pads it to the 30-second window and the engine computes the log-mel spectrogram itself.
Some clients already have the spectrogram, because feature extraction runs elsewhere in their pipeline or is shared between models. They have no way to send it, so the audio has to be kept around and the log-mel computed a second time. WhisperEncoder.forward already accepts a spectrogram and skips the log-mel step for it; only the request path is missing.
The request: let the audio item be {"input_features": ...}, the array the checkpoint's WhisperFeatureExtractor returns for one window, as numpy or torch.
- Each request picks its form by its item, so one
LLMserves audio and spectrogram requests, also in the same batch. Nothing is configured on theLLM. - The shape is checked against the checkpoint (
num_mel_binsby the extractor's frame count), and other shapes are rejected with a clear message. - A spectrogram that is already on the GPU stays there.
- Encoder CUDA graphs, the decoder prompt and the
max_tokenscap work the same way for both forms.
mel = extractor(wave, sampling_rate=sample_rate, truncation=False, return_tensors="np")["input_features"]
llm.generate([
{"prompt": "", "multi_modal_data": {"audio": [(wave, sample_rate)]}},
{"prompt": "", "multi_modal_data": {"audio": {"input_features": mel}}},
])
Alternatives
- Choosing the form once per
LLM. That forces a deployment to pick one form and to run two instances to serve both. - Sending the audio and letting the engine recompute the spectrogram, as today. That works, but repeats work the client has done and requires keeping the audio.
Additional context
#21045 implements this.
Before submitting a new issue...
- Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
- Ngôn ngữ chính
- Python
- Star
- 15.2k
- Fork
- 3k
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 477
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xCó thể đã có người làm @NimaVaziri đã nhận hôm nay. Đang mởPytorch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/TensorRT-LLM#23406 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Inference runtime Windows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NVIDIA/TensorRT-LLM#23394 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: MMLU subsampling changes when evaluators are interleavedCó thể đã có người làm @LeNeLeNeWo đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NVIDIA/TensorRT-LLM#23273 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderCó thể đã có người làm @sbeierle đã nhận 3 ngày trước. Đang mởTesting
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NVIDIA/TensorRT-LLM#23077 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LongBench V2 blog command breaks on inline comments after continuationsCó thể đã có người làm @ddlw đã nhận 25 ngày trước. Đang mởDoc
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
NVIDIA/TensorRT-LLM#21879 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/TensorRT-LLM
Issue tương tự
-
[Resource]: SpaicelyĐang mởresource-submission validation-passed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
hesreallyhim/awesome-claude-code#3875 · 1 bình luận ·
-
[Bug]: Ajax Pro login issueĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
bvis/aegis-hass#725 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
Maintainer thường phản hồi trong vòng 1 ngày