🐛 [Bug] FX intro example broken
Bug Description
FX front-end simple example is broken due to API change. Reported by @jaybdub
File /opt/conda/lib/python3.8/site-packages/torch_tensorrt/_compile.py:116, in compile(module, ir, inputs, enabled_precisions, **kwargs) 114 lower_precision = LowerPrecision.FP16 115 elif torch.float32 in enabled_precisions or torch_tensorrt.dtype.float in enabled_precisions: --> 116 lower_precision = LowerPrecision.FP32 117 else: 118 raise ValueError(f"Precision {enabled_precisions} not supported on FX")
NameError: name 'LowerPrecision' is not defined
To Reproduce
Steps to reproduce the behavior:
- Run this example
Expected behavior
examples should be stable & in CI
Environment
Build information about Torch-TensorRT can be found by turning on debug messages
- NGC 22.08
@jaybdub, I suspect the installation has some problems. Could you try from torch_tensorrt.fx.utils import LowerPrecision? How about import torch_tensorrt.fx?
Hi @frank-wei ,
Thanks for your reply!
Both of the commands you provided pass, but the example still fails.
I'm using the NGC 22.08 PyTorch container, which ships with torch_tensorrt.
Let me know if anything else needed.
Best, John
Got it.
- How about other fx examples?
- Are you testing with master branch?
CC: @narendasan @andi4191
Do we have test cases in DLFW for FX?
I think the root cause for this failure is here: https://github.com/pytorch/TensorRT/blob/release/ngc/22.08/py/torch_tensorrt/_compile.py#L8-L10
@jaybdub: Please uncomment these lines and re-install. You should be able to run it correctly.
I see that this has been resolved in master branch already.
@ncomly-nvidia : We don't have fx frontend test cases in DLFW CI yet. @apbose : Please add fx examples to the DLFW CI tests.
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days
@apbose DLFW tests have been added, correct? Can we confirm this example is tested & works?
@ncomly-nvidia FX tests have been added in DLFW and this example works in the latest containers (verified in 22.11).