Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
953250587 opened this issue Mar 12, 2025 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@953250587
Copy link

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?

@953250587 953250587 added the bug Something isn't working label Mar 12, 2025
@narendasan
Copy link
Collaborator

@cehongwang can you take a look

@cehongwang
Copy link
Collaborator

This is a version issue. Can you try with the latest Torch-TRT version with TRT 10.8?

@953250587
Copy link
Author

This is a version issue. Can you try with the latest Torch-TRT version with TRT 10.8?

I tried switching TensorRT to 10.7.0.post1 first and then back to 10.8.0.43, and surprisingly, the issue was resolved. I have no idea why. Anyway, thank you for your help!

@cehongwang
Copy link
Collaborator

I encountered the same thing before. You are welcome! Let me know if you have any other questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants