ITADN

[Triton TRT-LLM] TRT engine max sequence length (3000 frames) too small for sentences >~40 words

#1274Closedamr-hussain 创建于 2026-03-11
bug
A
amr-hussaincommented
### Checks - [x] This template is only for bug reports, usage problems go with 'Help Wanted'. - [x] I have thoroughly reviewed the project documentation but couldn't find information to solve my problem. - [x] I have searched for existing issues, including closed ones, and couldn't find a solution. - [x] I am using English to submit this issue to facilitate community communication. ### Environment Details ## Environment - GPU: NVIDIA RTX 4090 (24GB) - Docker image: `soar97/triton-f5-tts:24.12` - TensorRT-LLM version: 0.16.0 - Model: `F5TTS_v1_Base` - Deployment: Triton Inference Server via `docker compose up` ## Root Cause In `run.sh`, the `trtllm-build` command uses: ```bash --maxShapes=mel:8x100x3000 ``` This limits the engine to 3000 mel frames total, which includes both the reference audio frames and the generated output frames. With a ~5 second reference audio (~120 frames), only ~2880 frames remain for generation — roughly **40 words** before hitting the limit. ### Steps to Reproduce ## Steps to Reproduce 1. Launch the server following the README: `MODEL=F5TTS_v1_Base MODEL_ID=F5TTS_v1_Base docker compose up` 2. Send a request with a target text of ~50 words: ```python python3 client_grpc.py \ --reference-audio basic_ref_en.wav \ --reference-text "Some call me nature, others call me mother nature." \ --target-text "Artificial intelligence is rapidly transforming every industry on the planet. From healthcare to finance, from transportation to entertainment, machine learning models are being deployed at an unprecedented scale, generating insights and automating tasks that were once thought to require human intelligence." \ --log-dir ./tests/long_sentence_test ``` ## Error ``` tritonclient.utils.InferenceServerException: [StatusCode.INTERNAL] Failed to process the request(s) for model 'f5_tts_0_0', message: ValueError: Couldn't assign noise with shape torch.Size([2, 3580, 100]), engine supports [min, opt, max] = [(2, 100, 100), (2, 1500, 100), (8, 3000, 100)] At: /usr/local/lib/python3.12/dist-packages/tensorrt_llm/runtime/session.py(168): set_shapes /workspace/F5-TTS/src/f5_tts/runtime/triton_trtllm/model_repo/f5_tts/1/f5_tts_trtllm.py(350): forward ``` ### ✔️ Expected Behavior ## Expected Behavior The engine should either: 1. Support a configurable `--maxShapes` via an environment variable or argument to `run.sh` 2. Default to a larger value (e.g. `8000`) that supports real-world use cases of 200-500 word generation 3. Document the limitation and provide instructions for rebuilding with custom max shapes ### ❌ Actual Behavior ## Bug Description When sending a target text longer than ~40 words to the Triton server, inference fails with a shape mismatch error because the TRT engine was built with a hardcoded max sequence length of 3000 mel frames.
关闭于 2026-03-11 3 条评论