返回模型
说明文档
GPT2
本仓库包含兼容 TensorRT 的 GPT2 onnx 模型:
- gpt2-xl.onnx - 用于 fp32 或 fp16 引擎的 GPT2-XL onnx 模型
- gpt2-xl-i8.onnx - 用于 int8+fp32 引擎的 GPT2-XL onnx 模型
模型的量化由 ENOT-AutoDL 框架完成。 构建 TensorRT 引擎的代码和示例已发布在 github。
指标:
GPT2-XL
| TensorRT INT8+FP32 | torch FP16 | |
|---|---|---|
| Lambada 准确率 | 72.11% | 71.43% |
测试环境
- GPU RTX 4090
- CPU 11th Gen Intel(R) Core(TM) i7-11700K
- TensorRT 8.5.3.1
- pytorch 1.13.1+cu116
延迟:
GPT2-XL
| 输入序列长度 | 生成 token 数量 | TensorRT INT8+FP32 毫秒 | torch FP16 毫秒 | 加速比 |
|---|---|---|---|---|
| 64 | 64 | 462 | 1190 | 2.58 |
| 64 | 128 | 920 | 2360 | 2.54 |
| 64 | 256 | 1890 | 4710 | 2.54 |
测试环境
- GPU RTX 4090
- CPU 11th Gen Intel(R) Core(TM) i7-11700K
- TensorRT 8.5.3.1
- pytorch 1.13.1+cu116
使用方法
推理和精度测试的示例已发布在 github:
git clone https://github.com/ENOT-AutoDL/ENOT-transformers
ENOT-AutoDL/gpt2-tensorrt
作者 ENOT-AutoDL
text-generation
transformers
↓ 0
♥ 4
创建时间: 2023-06-05 13:46:50+00:00
更新时间: 2023-06-08 13:42:08+00:00
在 Hugging Face 上查看文件 (6)
.gitattributes
README.md
gpt2-xl-i8.data
gpt2-xl-i8.onnx
ONNX
gpt2-xl.data
gpt2-xl.onnx
ONNX