[TRTLLM-11950][perf] Audio feature extractor optimizations#14031
Conversation
|
/bot run |
📝 WalkthroughWalkthroughParakeetExtractor was refactored from a HuggingFace feature extractor wrapper to a Torch-native STFT-based log-mel feature extractor with cached signal processing components, device-aware tensor operations, and explicit argument validation. The extractor now returns a structured dict with audio features, attention masks, and clip counts. Nemotron Nano integration was simplified to use the new API directly, and comprehensive tests validate output structure, input flexibility, error handling, and configuration propagation. ChangesParakeetExtractor Torch Refactor and Nemotron Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tensorrt_llm/_torch/models/modeling_parakeet.py (1)
44-49: 💤 Low valueUnnecessary
int()wrapping onround()result.In Python 3,
round()already returns anintwhen called with a single argument (no decimal places specified). Theint()call is redundant.♻️ Suggested simplification
- self._clip_target_samples = int( - round(self.config.clip_duration_s * self.config.sampling_rate) - ) - self._tail_min_samples = int( - round(self.config.clip_min_duration_s * self.config.sampling_rate) - ) + self._clip_target_samples = round( + self.config.clip_duration_s * self.config.sampling_rate + ) + self._tail_min_samples = round( + self.config.clip_min_duration_s * self.config.sampling_rate + )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tensorrt_llm/_torch/models/modeling_parakeet.py` around lines 44 - 49, The expressions assigning self._clip_target_samples and self._tail_min_samples wrap round(...) with int(), which is redundant in Python 3; remove the outer int() calls in the assignments to _clip_target_samples and _tail_min_samples (leave round(self.config.clip_duration_s * self.config.sampling_rate) and round(self.config.clip_min_duration_s * self.config.sampling_rate)) so the result remains an int without the unnecessary cast.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tensorrt_llm/_torch/models/modeling_parakeet.py`:
- Around line 44-49: The expressions assigning self._clip_target_samples and
self._tail_min_samples wrap round(...) with int(), which is redundant in Python
3; remove the outer int() calls in the assignments to _clip_target_samples and
_tail_min_samples (leave round(self.config.clip_duration_s *
self.config.sampling_rate) and round(self.config.clip_min_duration_s *
self.config.sampling_rate)) so the result remains an int without the unnecessary
cast.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8f0c41e7-11ef-4ea8-8fde-19b204141865
📒 Files selected for processing (3)
tensorrt_llm/_torch/models/modeling_nemotron_nano.pytensorrt_llm/_torch/models/modeling_parakeet.pytests/unittest/_torch/modeling/test_modeling_parakeet.py
|
PR_Github #47885 [ run ] triggered by Bot. Commit: |
Signed-off-by: William Zhang <133824995+2ez4bz@users.noreply.github.com>
|
/bot run |
|
PR_Github #47900 [ run ] triggered by Bot. Commit: |
|
PR_Github #47900 [ run ] completed with state
|
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Description
This mirrors audio optimizations done in vLLM.
Perf impact
H200 FP8
B200 NVFP4
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.