# TensorRT-LLM

TensorRT-LLM 是英伟达（NVIDIA）推出的开源库，用于在英伟达 GPU 上优化大语言模型（LLM）和视觉生成模型的推理，于 2023 年 8 月 16 日其 GitHub 仓库创建时首次公开发布。<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup> 它是一个服务与优化栈，而非模型：它接收已训练好的模型，通过自定义 GPU 内核、量化和调度技术，让模型在英伟达硬件上运行得更快、成本更低。<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup><sup> • </sup><sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup>

| 事实 | 详情 |
|---|---|
| 创建者 | 英伟达<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup> |
| 首次公开发布 | 2023 年 8 月 16 日（仓库创建）<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup> |
| 架构 | PyTorch 原生，配有高层 Python LLM API 和模块化 Python 运行时<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup><sup> • </sup><sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup> |
| 硬件范围 | 仅限英伟达 GPU，从桌面到数据中心<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup> |
| 许可证 | 非标准的“其他”许可证，不属于标准 OSI 许可证<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup> |
| 生态规模（2026 年 9 月） | 约 14,400 颗星、约 2,600 次复刻、约 1,550 个未关闭议题<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup> |
| API 稳定性 | 自 v1.0 起，提供 3 个月的弃用迁移期，与语义化版本规范一致<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup> |

## TensorRT-LLM 是什么

英伟达将 TensorRT-LLM 描述为一个开源库，用于在英伟达 GPU 上实现高性能、实时的 LLM 推理优化，无论桌面还是数据中心皆可适用。<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup> 该仓库称其提供最先进的优化手段，包括针对注意力、GEMM（通用矩阵乘法）和 MoE（混合专家）层等常见推理操作的自定义内核，以及预填充-解码分离、宽专家并行、投机解码等算法层面的运行时优化。<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup>

它以 PyTorch 为基础架构，对外暴露高层 Python LLM API，支持从单 GPU 到多 GPU、多节点的部署，并与英伟达 Dynamo 和 Triton 推理服务器集成以提供服务。<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup> 它区别于其所服务的模型，也区别于英伟达公司本身；本文所介绍的是作为产品的这个库。

## 工作原理

自定义内核与量化。该库附带针对注意力、GEMM 和 MoE 操作手工优化的 CUDA 内核。<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup> 在精度方面，它支持 FP8、FP4/NVFP4、INT4 AWQ 和 INT8 SmoothQuant 量化。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup> 根据英伟达的文档，在 H100 及之后几代 GPU 上，与 16 位浮点相比，FP8 量化可将性能翻倍、内存消耗减半，同时对模型精度的影响极小；此为厂商声明，本记录中没有独立的精度评估。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup> FP4/NVFP4 在英伟达 B200（Blackwell）GPU 上获得原生支持，配有优化的 FP4 内核，而 NVFP4 仅在 Blackwell 硬件上受支持。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup>

批处理与调度。在途批处理动态管理请求执行，将上下文（预填充）和生成（解码）阶段一并处理，以最大化 GPU 利用率并降低延迟，同时配合带块复用的分页 [KV 缓存](https://www.edgepedia.org/zh/kv-cache)和分块预填充。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup> CUDA 图将一系列 CUDA 操作捕获为单个图，减少 CPU 侧的内核启动开销，英伟达指出这在基于 PyTorch 的推理中影响尤为显著，因为 Python 宿主侧代码可能成为瓶颈；该公司报告称，在某些模型和硬件上，CUDA 图填充可将端到端吞吐量提升最高 22%。<sup>[4](https://nvidia.github.io/TensorRT-LLM/developer-guide/overview.html)</sup> 重叠调度器在第 n 步的 CPU 处理尚未完成时即启动第 n+1 步解码的 GPU 工作，以 GPU 计算掩盖 CPU 侧延迟，代价是多出一次解码步骤；该功能默认启用。<sup>[4](https://nvidia.github.io/TensorRT-LLM/developer-guide/overview.html)</sup>

投机解码与并行。该库支持投机解码，包含 EAGLE、MTP 和 NGram 等多种算法，后又扩展至 EAGLE-3 和多令牌预测，另支持 LoRA 多适配器、引导式解码，以及将上下文与生成阶段分离到不同 GPU 上以实现资源最优利用的分离式服务（测试版）。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup> 对于大模型，它支持张量并行、流水线并行、数据并行、专家并行、上下文并行和宽专家并行等多种多 GPU、多节点推理方式，其中宽专家并行（Wide-EP）包含面向大规模 MoE 模型的负载均衡。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup>

## 发布与版本历史

本记录中有日期的发布证据是 2023 年 8 月 16 日的 GitHub 仓库创建，这标志着公开发布开源版本。<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup>

1.0 版本是一个整合节点：英伟达称其带来了模块化 Python 运行时、PyTorch 原生模型编写方式和稳定的生产级 LLM API。<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup> 自 v1.0 起，项目遵循弃用政策，提供 3 个月迁移期，期间被弃用的 API 在移除前仍可正常使用，与语义化版本规范一致。<sup>[1](https://github.com/nvidia/tensorrt-llm)</sup>

## 数据一览：厂商声明，无独立测量

以下每项性能数据均为厂商报告；本记录不包含对 TensorRT-LLM 的任何独立基准测试、排行榜或第三方评估。

- **H100 上的 FP8**：英伟达文档称，与 16 位浮点相比，FP8 量化可将性能翻倍、内存消耗减半，精度影响极小。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup>
- **CUDA 图填充**：在某些模型和硬件上，端到端吞吐量提升最高 22%。<sup>[4](https://nvidia.github.io/TensorRT-LLM/developer-guide/overview.html)</sup>
- **v1.0**：英伟达声称取得“创纪录的 8 倍 AI 推理性能提升”；暂无独立测量可查。<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup>
- **Blackwell Ultra**：英伟达声称其 GB300 NVL72 平台在智能体 AI 上性能最高提升 50 倍、成本降至原来的三十五分之一，此为厂商声明。<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup>

## 硬件支持与 2025–2026 年的发展脉络

TensorRT-LLM 仅在英伟达 GPU 上运行，从桌面到数据中心；本记录中没有非英伟达硬件的支持。<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup> 在英伟达产品线内部，精度演进与硬件世代同步：FP8 用于 Hopper（H100）及之后的产品，NVFP4 原生用于 Blackwell（B200），配有优化的 FP4 内核，且仅在 Blackwell 上受支持。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup>

2025 至 2026 年间，功能集向大规模智能体工作负载扩展：分离式服务（测试版）将上下文和生成拆分到不同 GPU 上，宽专家并行面向大型 MoE 模型，以及包括 EAGLE-3 和多令牌预测在内的先进投机解码。<sup>[3](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)</sup><sup> • </sup><sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup> 英伟达报告称，包括微软、CoreWeave 和甲骨文云基础设施在内的云服务商正在大规模部署 GB300 NVL72 系统，用于智能体编程和编程助手等低延迟、长上下文用例，搭载 Dynamo 和 TensorRT-LLM；此为厂商声明，部署规模未经独立核实。<sup>[2](https://developer.nvidia.com/tensorrt-llm)</sup>

## References

1. [NVIDIA/TensorRT-LLM GitHub repository](https://github.com/nvidia/tensorrt-llm)
2. [TensorRT LLM | NVIDIA Developer](https://developer.nvidia.com/tensorrt-llm)
3. [Overview — TensorRT LLM (official documentation)](https://nvidia.github.io/TensorRT-LLM/latest/overview.html)
4. [Architecture Overview — TensorRT LLM](https://nvidia.github.io/TensorRT-LLM/developer-guide/overview.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 19, 2026 · Edited: Sep 19, 2026; Oct 11, 2026 · Last review: Sep 19, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › Foundation-model methods and training › Inference, serving, and efficiency of foundation models

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/tensorrt-llm

English original: https://www.edgepedia.org/tensorrt-llm
