Feature: fp16 builds for timesfm (3x to 12x faster than fp32) need an overflow guard for large normalized inputs
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 46/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python, pytorch, tensorflow
- Lĩnh vực
- machine-learning, performance
Hướng nghiên cứu
Start with the TimesFM family build and network builder paths, then read families/timesfm/README.md and the FP8 study referenced in the issue. Trace where normalized inputs enter the input residual block and how precision is selected; the issue does not name specific source files or tests. Done means fp16 builds pass an overflow guard, all 200 sampled M4 daily series produce finite forecasts, and an fp16 end-to-end case covers the behavior while fp32 remains the default.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Request type: Improvement to existing behavior
Problem and use case
families/timesfm builds fp32 only (the family build rejects fp16, although the network builder has an fp16 path). fp32 with TF32 off is slow: on google/timesfm-2.0-500m-pytorch an fp16 engine is 3.2x to 3.5x faster at batch 1 and 11.5x to 12.4x faster at batch 32 (B200 / B300, TensorRT 11.4), with M4 hourly MASE 0.5859 against 0.5866 for fp32.
fp16 cannot simply be turned on: on 1 of 200 sampled M4 daily series the fp16 engine (the builder's fp16 path) returns non-finite forecasts. That series' input to the input residual block reaches 1.53e9 and its residual stream 8.96e8, past the fp16 maximum (65504) from layer 0 on. The fp32 engine and Hugging Face fp32 are finite on all 200 series. For comparison, the median per-series maximum on M4 daily is 32.4 (input) and 138 (residual); on M4 hourly the maximum over all series is 66.2 and 173. TimesFM normalizes each series by the mean and standard deviation of its first unpadded patch, so a nearly flat start can give very large normalized values (likely cause, not verified per series). fp32_layers cannot fix it, because the residual stream of every layer is out of range.
Proposed outcome
Accept precision=fp16 for timesfm with an overflow guard, for example scaling or clamping the normalized input before the input residual block (or keeping the input block and residual stream in fp32), so that all M4 series stay finite, with its own fp16 E2E case. fp32 stays the default.
Model and target details
google/timesfm-2.0-500m-pytorch @ dc2443792ce5516872b89b37cf1bc058c3bf0c10 (the family manifest model); TensorRT 11.4; B200 / B300.
| fp32 (default) | fp16 (builder path) | |
|---|---|---|
| Time, batch 1, B200 / B300 | 6.94 / 6.64 ms | 1.96 / 2.11 ms |
| Time, batch 32, B200 / B300 | 51.45 / 45.91 ms | 4.17 / 3.98 ms |
| Plan size (B200) | 1906 MiB | 956 MiB |
| M4 hourly MASE (HF fp32 0.5866) | 0.5866 | 0.5859 |
| M4 daily series with non-finite forecast (of 200) | 0 | 1 |
Alternatives considered
fp32_layers (does not help: every layer is out of range on that series). FP8 (measured in #2005, not shipped; it runs on fp16 activations and has the same non-finite series).
Additional context
Found during the FP8 study recorded in families/timesfm/README.md (#2005, "fp16 overflow found on the way").
- Ngôn ngữ chính
- Python
- Star
- 288
- Fork
- 73
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 273
Chuẩn bị môi trường
- Có Dockerfile hoặc 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-Model-Connect
-
Docs: ITrtModule::forward() output-buffer lifetime and dtype contract are undocumentedCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NVIDIA/TensorRT-Model-Connect#1126 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NVIDIA/TensorRT-Model-Connect#2060 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
NVIDIA/TensorRT-Model-Connect#2054 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
NVIDIA/TensorRT-Model-Connect#2053 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
NVIDIA/TensorRT-Model-Connect#2049 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/TensorRT-Model-Connect
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
NVIDIA/auto-ontology#463 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NousResearch/hermes-agent#151165 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
code-health
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tinaudio/synth-setter#3750 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] vllm-sr config migrate drops providers.models[].deploymentCó thể đã có người làm @Bevisy đã nhận hôm nay. Đang mởneeds-acceptance wg/developer-experience-ecosystem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
vllm-project/semantic-router#5996 ·
Maintainer thường phản hồi trong vòng 2 ngày