Is there any why to make safe trt fp16 conversion according the torch AMP training process
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
After converting the ONNX fp32 model to a TensorRT fp16 model, numerical overflow occurred during inference. The model was trained using the PyTorch framework with automatic mixed precision, and the ONNX fp32 model inference works normally. Therefore, it may be necessary to manually specify certain model layers to maintain fp32 precision. Is it possible to determine whether the TensorRT operations related to this operator are full precision based on the parameter types used in the mixed precision training process of the PyTorch model? How can this be carried out?
We had tried keep some classical layers fp32, like Softmax, LayerNorm, Sigmoid, .... with no luck.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the numerical overflow during TensorRT FP16 inference and compare it with the working ONNX FP32 inference from the PyTorch AMP-trained model. Investigate whether the affected TensorRT operators can be identified from the model’s mixed-precision parameter types and verify any proposed precision assignments against the listed Softmax, LayerNorm, and Sigmoid cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100