NVIDIA / trt-samples-for-hackathon-cn

Simple samples for TensorRT programming
Apache License 2.0
1.47k stars 337 forks source link

Skip layerNorm layer weight quantitation while conversion #85

Open siddhawan opened 1 year ago

siddhawan commented 1 year ago

I am trying to convert my torchscript module to tensorrt using torch_tensorrt.compile is there any argument to skip the layers which shows warnings while converting. This is the warning its giving. WARNING: [Torch-TensorRT TorchScript Conversion Context] - Running layernorm after self-attention in FP16 may cause overflow. Exporting the model to the latest available ONNX opset (later than opset 17) to use the INormalizationLayer, or forcing layernorm layers to run in FP32 precision can help with preserving accuracy. Although I am not converting to onnx at my end as I am using torch_tensorrt.