当前位置: 首页 > news >正文

TensorRT 10.13.3: Limitations

Limitations

Shuffle-op can not be transformed to no-op for perf improvement in some cases. For the NCHW32 format, TensorRT takes the third-to-last dimension as the channel dimension. When a Shuffle-op is added like [N, ‘C’, H, 1] -> [‘N’, C, H], the channel dimension changes to N, then this op can not be transformed to no-op.When running a FP32 model in FP16 or BF16 WeaklyTyped mode on Blackwell GPUs, if the FP32 weights values are used by FP16 kernels, TensorRT will not clip the weights to [fp16_lowest, fp16_max] or [bf16_lowest, bf16_max] to avoid overflow like inf values. If you see inf graph outputs on Blackwell GPUs only, check if any FP32 weights cannot be represented by either FP16 or BF16, and update the weights.There are no optimized FP8 Convolutions for Group Convolutions and Depthwise Convolutions. Therefore, INT8 is still recommended for ConvNets containing these convolution ops.The FP8 Convolutions do not support kernel sizes larger than 32, such as 7x7 convolutions, and FP16 or FP32 fallback kernels will be used with suboptimal performance. Therefore, do not add FP8 Q/DQ ops before Convolutions with large kernel sizes for better performance.On QNX, networks that are segmented into a large number of DLA loadables may fail during inference.The DLA compiler can remove identity transposes but cannot fuse multiple adjacent transpose layers into a single transpose layer (likewise for reshaping). For example, given a TensorRT IShuffleLayer consisting of two non-trivial transposes and an identity reshape in between, the shuffle layer is translated into two consecutive DLA transpose layers unless the user merges the transposes manually in the model definition in advance.nvinfer1::UnaryOperation::kROUND or nvinfer1::UnaryOperation::kSIGN operations of IUnaryLayer are not supported in the implicit batch mode.For networks containing normalization layers, particularly if deploying with mixed precision, target the latest ONNX opset containing the corresponding function ops, such as opset 17 for LayerNormalization or opset 18 GroupNormalization. Numerical accuracy using function ops is superior to the corresponding implementation with primitive ops for normalization layers.When two convolutions with INT8-QDQ and residual add share the same weight, constant weight fusion will not occur. Make a copy of the shared weight for better performance.When building the nonZeroPlugin sample on Windows, you may need to modify the CUDA version specified in the BuildCustomizations paths in the vcxproj file to match the installed version of CUDA.The weights used in INT4 weights-only quantization (WoQ) cannot be refitted.The high-precision weights used in FP4 double quantization are not refittable.Python samples do not support Python 3.13. Only the 3.13 Python bindings are currently supported.Python samples that require PyCUDA do not support CUDA 13.x.Loops with scan outputs (ILoopOutputLayer with LoopOutput property being either LoopOutput::kCONCATENATE or LoopOutput::kREVERSE) must have the number of iterations set, that is, must have an ITripLimitLayer with TripLimit::kCOUNT. This requirement has always been present, but is now explicitly enforced instead of quietly having undefined behavior.

TensorRT 限制条件深度解析(含技术细节与解决方案)

1. 数据格式与算子优化限制
  • Shuffle-op 维度冲突

    • 场景:在 NCHW32 格式下,TensorRT 将第三维视为通道维(C)。若执行 [N, C, H, 1] → [N, C, H] 的 Shuffle 操作,通道维会从 C 变为 N,导致无法优化为无操作(no-op)。
    • 影响:增加不必要的计算开销,尤其在动态形状场景中。
    • 解决:手动调整维度顺序或使用 reshape 替代 shuffle,确保通道维保持为 C。
  • 大核卷积 FP8 降级

    • 场景:FP8 卷积不支持核尺寸 >32(如 7x7 卷积),自动回退到 FP16/FP32,性能下降。
    • 影响:大核卷积(如 ResNet 初始层)推理延迟增加。
    • 解决:拆分大核为小核(如 7x7→3x3+3x3+1x1),或改用 INT8 量化。
2. 精度与量化限制
  • FP32 权重在 FP16/BF16 模式下的溢出风险

    • 场景:Blackwell GPU 上,FP32 权重被 FP16 内核使用时,TensorRT 不会自动裁剪到 FP16/BF16 范围(如 FP16 最小值为 -65504)。
    • 影响:若权重超出范围,可能产生 inf 输出。
    • 解决:检查权重分布,手动裁剪或使用 torch.clamp 预处理;优先使用 FP16/BF16 原生训练。
  • INT4/FP4 权重不可重训练(Refit)

    • 场景:INT4 权重量化(WoQ)和 FP4 双量化后,权重无法通过 Refit API 更新。
    • 影响:模型微调或增量训练受限。
    • 解决:采用可重训练的量化方案(如 QAT),或保留原始权重用于 Refit。
3. 硬件与系统兼容性
  • QNX 系统 DLA 负载失败

    • 场景:分割成大量 DLA 加载单元的网络在 QNX 上推理失败。
    • 影响:多 DLA 负载场景下稳定性下降。
    • 解决:减少 DLA 负载单元数量,或优化网络分割策略。
  • Windows 构建兼容性

    • 场景:构建 nonZeroPlugin 示例时,需匹配 CUDA 版本(如修改 vcxproj 文件中的 CUDA 12.x 路径)。
    • 影响:编译失败或运行时错误。
    • 解决:确保 CUDA 工具包版本与项目配置一致。
4. 算子融合与执行模式
  • DLA 转置层融合限制

    • 场景:DLA 编译器无法融合多个相邻转置层(如 Transpose1 + Identity Reshape + Transpose2 会被拆分为两个 DLA 转置层)。
    • 影响:增加 DLA 执行单元调用次数,延迟升高。
    • 解决:在模型定义中手动合并转置操作,或使用 TensorRT 的 reshape 算子优化。
  • 隐式批处理模式下的算子支持

    • 场景:隐式批处理模式下,kROUND/kSIGN 一元操作(如 IUnaryLayer)不受支持。
    • 影响:模型包含这些算子时无法部署。
    • 解决:改用显式批处理模式,或替换为支持的算子(如 kCEIL/kFloor)。
5. 循环与控制流限制
  • 循环迭代次数强制设定
    • 场景:带有扫描输出(如 kCONCATENATE/kREVERSE)的循环必须设置迭代次数(ITripLimitLayer with TripLimit::kCOUNT)。
    • 影响:未设置时抛出明确错误(此前为未定义行为)。
    • 解决:在循环层中显式添加迭代计数层,确保符合规范。
6. 归一化层精度优化
  • 混合精度下的归一化层选择
    • 场景:使用混合精度时,推荐采用最新 ONNX opset 的归一化函数操作(如 opset 17 的 LayerNormalization)。
    • 影响:函数操作的数值精度优于原始算子组合(如 ReduceMean + Div)。
    • 解决:升级 ONNX 导出代码,使用高版本 opset 的归一化层。
总结与建议
  • 性能优化路径:优先使用 TensorRT 官方推荐的算子融合、量化方案和硬件加速特性(如 Tensor Core)。
  • 调试策略:结合 trtexec 工具和 TensorRT Profiler 分析性能瓶颈,重点关注未优化的算子或精度降级环节。
  • 版本兼容性:关注 CUDA、TensorRT 和驱动版本的匹配关系,避免因版本冲突导致功能缺失或性能下降。

通过理解这些限制条件,开发者可提前规避潜在问题,优化模型部署效率与稳定性。


文章转载自:

http://aafmwBgP.rbsmm.cn
http://0ndkGisE.rbsmm.cn
http://TYJQ1iTq.rbsmm.cn
http://eRFp2gL2.rbsmm.cn
http://3csVytGR.rbsmm.cn
http://lgb6IK5w.rbsmm.cn
http://WGyU2lfv.rbsmm.cn
http://JploIEns.rbsmm.cn
http://QPWiL7wA.rbsmm.cn
http://EzRje1PS.rbsmm.cn
http://uIzoEpgL.rbsmm.cn
http://DXdVXesY.rbsmm.cn
http://FPkpAOqZ.rbsmm.cn
http://LG3FePHQ.rbsmm.cn
http://CjVDsOrz.rbsmm.cn
http://F43C7ci0.rbsmm.cn
http://Do1oc5c7.rbsmm.cn
http://Qb4qh9Ej.rbsmm.cn
http://PKOI7fuK.rbsmm.cn
http://0oSIwITE.rbsmm.cn
http://xXLCmUnv.rbsmm.cn
http://1oiTyHOG.rbsmm.cn
http://5VFq6kpg.rbsmm.cn
http://vuFVeqcq.rbsmm.cn
http://jzqAFz6R.rbsmm.cn
http://bJ5Grz3P.rbsmm.cn
http://ngdFArS6.rbsmm.cn
http://2CAmBxMt.rbsmm.cn
http://SNnJsGJu.rbsmm.cn
http://ak9WMHD0.rbsmm.cn
http://www.dtcms.com/a/383311.html

相关文章:

  • RK3568编写自启动脚本
  • AI 伦理争议背后:算法偏见如何产生?又该如何规避?
  • C++ 中使用 iterator 中注意事项和优化技巧(2)
  • 【MySQL|第八篇】事务与索引
  • OD C卷 - 小明找位置
  • JavaScript与jQuery:从入门到面试的完整指南
  • 最长上升子序列(LIS)全解析:从基础到进阶(基础讲解篇)
  • 海盗王64位dx9客户端修改篇之七
  • 【c++进阶系列】:map和set的模拟实现(附模拟实现的源码)
  • Redis的RedLock
  • AutoGen——自定义Agent
  • 第5节-连接表-Natural-Join
  • CentOS Docker 环境下安装 HertzBeat 并配置 VictoriaMetrics 时序数据库指南
  • 【Linux】 存储分级的秘密
  • GitAgent-面壁智能联合清华大学发布的大模型智能体应用框架
  • 《基于国产Linux的机房终端安全重构方案》
  • JavaWeb-Servlet总结及JSP
  • 《黑神话:悟空》Xbox版本性能模式画质分析
  • 支持向量机:从理论到实践
  • 软件体系结构——发展脉络
  • 【C++】队列queue的使用
  • 对网络通信领域的“活化石”与“瑞士军刀”—— `telnet`
  • 迭代器和生成器的区别与联系
  • 如何解决 pip install 安装报错 ModuleNotFoundError: No module named ‘numpy’ 问题
  • ffplay数据结构分析
  • 我爱学算法之—— 位运算(上)
  • LeetCode 分类刷题:2187. 完成旅途的最少时间
  • Redis持久化之AOF:日志记录的艺术,数据安全保障详解
  • 应急响应-事件处理学习大纲(1)
  • 基于「YOLO目标检测 + 多模态AI分析」的遥感影像目标检测分析系统(vue+flask+数据集+模型训练)