Skip to content

🐛 [Bug] Running refit_engine_example.py produces incorrect results. #3437

Closed
@953250587

Description

@953250587

Bug Description

run refit_engine_example.py get “AssertionError: Refit Result is not correct. Refit failed”

Image

To Reproduce

python refit_engine_example.py

Environment

  • Torch-TensorRT Version : 2.6.0
  • PyTorch Version :2.6.0+cu124
  • OS: Linux
  • Python version: 3.10.16
  • CUDA version: 12.4
  • Tensorrt version: 10.8.0.43

Additional context

Image
There are some warning.
It seems that the following code caused the above issue:
TRTInterpreter.check_weight_equal(sd[sd_weight_name], np_map[engine_weight_name]). This code in TensorRT/py/torch_tensorrt/dynamo/conversion/_TRTInterpreter.py in line 537.
The numerical difference between sd[sd_weight_name] and np_map[engine_weight_name] is significant. So “weight_name_map” will not record the corresponding weights. However, I don't know why this issue occurs. Could it be due to an incorrect version of TensorRT?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions