Bug: starcoder2 fp16 engines give wrong output (bf16 and fp32 are correct); fp16 3B/7B fail to build on TensorRT 11.1

未关闭
#2,049 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python, pytorch

调研方向

Start by tracing the StarCoder2 TensorRT engine build and attention compilation paths, then compare fp16 engine logits with the bf16 and fp32 results using the reproducer in the issue. Check the TensorRT 11.1 attention compile failure (Expected 3 live inputs, got 4) alongside the output drift. Done means fp16 matches Hugging Face or is refused with the manifest moved to bf16, and the TensorRT 11.1 build behavior is addressed.

由索引模型根据 Issue 内容生成。

描述

bug

Affected area: Inference output or task execution

TensorRT-Model-Connect version: main @ 5a2ce7ef59b2089490e99ec9e96209dd31e4fb41

Installation method: Development container

Model and revision: bigcode/starcoder2-3b @ 733247c55e3f73af49ce8e9c7949bf14af205928 (manifest model), bigcode/starcoder2-7b

Environment: Linux, NVIDIA B200, TensorRT 11.4.0.106 and 11.1.0.106; reference Transformers.

Description

Found during the FP8 work of #2006 (Known issue there); independent of FP8.

  1. fp16 engines are wrong. The unquantized fp16 engine does not match Hugging Face, while the bf16 engine of the same build does and an fp32 engine of the 3B matches exactly:

    Model Engine Held-out code KL / top-1 wikitext-2 KL / top-1 / perplexity (HF)
    7B fp16 0.23 / 85.5% 0.76 / 61% / 22.9 (10.3)
    3B fp16 0.34 / 81.7% - / - / 32.6 (15.0)
    3B, 7B bf16 KL 0.0004 to 0.0009 -
    3B fp32 KL 0.0000 / top-1 100% -

    Hugging Face run in fp16 is fine (perplexity 2.684 against 2.684 in fp32), so this is not an fp16 range problem of the model; the cause is in the fp16 TensorRT engine and was not isolated.

  2. fp16 build fails on TensorRT 11.1. The unquantized fp16 3B and 7B builds fail in the attention compile: Expected 3 live inputs, got 4.

The starcoder2-3b manifest builds fp16 and its E2E case passes on main, so CI does not catch this drift.

Minimal reproducer

  1. Build bigcode/starcoder2-3b (manifest revision) twice, fp16 and bf16, and compare teacher-forced next-token logits with Hugging Face on wikitext-2 test or held-out code: fp16 KL 0.3 or more, bf16 KL below 0.001.
  2. With TensorRT 11.1, build the same model at fp16: Expected 3 live inputs, got 4 during the attention compile.

Expected behavior

fp16 engines match Hugging Face as the bf16 engines do, and build on TensorRT 11.1; or fp16 is refused and the manifest moves to bf16.

Actual behavior

fp16 output drifts (top-1 61% to 86%, perplexity 2x HF); the fp16 build fails on 11.1.

主要语言
Python
星标
288
派生
73
平均合并
1 天 3 小时
30 天内合并 PR
273

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/TensorRT-Model-Connect 的其他 Issue

查看 NVIDIA/TensorRT-Model-Connect 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。