Myelin "Inconsistent strides" (tactic.cpp:4034) building a strongly typed fp16 network on sm_120, TRT 11.4; the fp32 export of the same model builds

未关闭
#4,925 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start by running the TensorRT Python reproduction script against the fp16 ONNX export, then compare with the fp32 build. The error points to tactic.cpp:4034 and Myelin codeGenerator.cpp:2011; the issue offers a random-weight export and input on request. Done means the strongly typed fp16 network builds successfully, or the failure is reduced to a reproducible case.

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

描述

Module:Engine Build

Description

Building a strongly typed engine from an fp16 ONNX export of BridgeDepth (stereo matching with a ViT-L encoder, 994x1482, fixed shapes) fails after 9 s with a Myelin internal check. The same model exported with fp32 weights builds (191 s) and runs. onnxruntime 1.32.0 (CPU) runs the fp16 file and matches PyTorch eager (max abs error 0.023 on disparities around 8).

[TRT] [E] Error Code: 9: Skipping tactic 0x0000000000000000 due to exception [myelin_graph.h:1295: attachExceptionMsgToGraph] MyelinCheckException: tactic.cpp:4034: CHECK(common_values(use_fc_src_strides) == common_values(ir::compute_strides_from_stride_order( use_fc_src_dims, collapse_stride_order, use_fc_use_opnd->paddings()))) failed. Inconsistent strides In compileGraph at /_src/optimizer/myelin/codeGenerator.cpp:2011
[TRT] [E] IBuilder::buildSerializedNetwork: Error Code 10: Internal Error (Could not find any implementation for node {ForeignNode[ONNXTRT_castHelper_8874_output[Constant]...node_slice_371]}. In computeCosts at /_src/optimizer/common/tactic/optimizer.cpp:4254)

The failing ForeignNode starts at a parser cast helper, so the fp16 graph has casts the fp32 graph does not have. The build fails the same way (20 s) with the weights replaced by random values (seed 0), so the graph structure alone triggers it.

Expected: an engine, as with the fp32 export. Actual: build fails inside Myelin for the fp16 graph only.

Environment

TensorRT 11.4.0.106 (tensorrt-cu13 wheel, current release), RTX 5060 Ti 16 GB (sm_120), driver 595.99.02, CUDA 13.0, Ubuntu 26.04, Python 3.12. ONNX: torch 2.14.1 dynamo exporter, opset 18, onnx 1.23.2.

Relevant Files

The ONNX file is 1.4 GB (the model weights are CC-BY-NC), far above the attachment limit. I can share the random-weight export plus the input npz on request, or reduce it with polygraphy first if that helps.

Steps To Reproduce

import tensorrt as trt
logger = trt.Logger(trt.Logger.WARNING)
builder = trt.Builder(logger)
network = builder.create_network(1 << int(trt.NetworkDefinitionCreationFlag.STRONGLY_TYPED))
parser = trt.OnnxParser(network, logger)
assert parser.parse_from_file("bridgedepth_994x1482_fp16.onnx")
plan = builder.build_serialized_network(network, builder.create_builder_config())
print(plan is None)  # True, with the errors above
主要语言
C++
星标
13.5k
派生
2.4k
平均合并
6 天 21 小时
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

NVIDIA/TensorRT 的其他 Issue

查看 NVIDIA/TensorRT 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

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