TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

🐛 [Bug] torch._export.verifier.SpecViolationError when using Torch-TensorRT

Open DefTruth opened this issue 1 year ago • 4 comments

Bug Description

got the export error with torch_tensorrt 2.2.0 use dynamo IR

torch._export.verifier.SpecViolationError: Node.meta max_pool2d_default is missing val field.

To Reproduce

optimized_model = torch_tensorrt.compile(
                        self.model,
                        ir="dynamo",
                        inputs=inputs,
                        enabled_precisions=enabled_precisions,
                        debug=debug,
                        workspace_size=(2147483648) * 4, # 8GB,
                        min_block_size=7,
                        torch_executed_ops=torch_executed_ops,
                        truncate_long_and_double=True,
                        enable_experimental_decompositions=True
 )

Steps to reproduce the behavior:

Expected behavior

Environment

Build information about Torch-TensorRT can be found by turning on debug messages

  • Torch-TensorRT Version 2.2.0:
  • PyTorch Version 2.2.1:
  • CPU Architecture: x86_64
  • OS (e.g., Linux): Linux
  • How you installed PyTorch (conda, pip, libtorch, source): pip
  • Build command you used (if compiling from source): no
  • Are you using local sources or building from archives: no
  • Python version: 3.10
  • CUDA version: cuda 12.3
  • GPU models and configuration: A30
  • Any other relevant information: no

Additional context

DefTruth avatar Feb 23 '24 10:02 DefTruth

how to fix this error

DefTruth avatar Feb 23 '24 10:02 DefTruth

use the latest nightly build on 20240110 solve this problem.

python -m pip install --pre torch==2.3.0.dev20240110+cu121 torch-tensorrt==2.3.0.dev20240110+cu121 --extra-index-url https://download.pytorch.org/whl/nightly/cu121
python -m pip install --pre torchvision==0.18.0.dev20240110+cu121 --extra-index-url https://download.pytorch.org/whl/nightly/cu121
python -m pip install --pre torchtext==0.17.0.dev20240110+cpu --extra-index-url https://download.pytorch.org/whl/nightly/cu121

DefTruth avatar Feb 23 '24 10:02 DefTruth

but the nightly build after 20240110 is not avaliable

ERROR: Could not find a version that satisfies the requirement torch-tensorrt==2.3.0.dev20240222+cu121 (from versions: 0.0.0.post1, 1.3.0, 1.4.0, 2.2.0.dev20231010+cu121, 2.2.0.dev20231106+cu121, 2.2.0.dev20231107+cu121, 2.2.0.dev20231108+cu121, 2.2.0.dev20231109+cu121, 2.2.0.dev20231110+cu121, 2.2.0.dev20231111+cu121, 2.2.0.dev20231112+cu121, 2.2.0.dev20231113+cu121, 2.2.0.dev20231114+cu121, 2.2.0.dev20231115+cu121, 2.2.0.dev20231116+cu121, 2.2.0.dev20231117+cu121, 2.2.0.dev20231118+cu121, 2.2.0.dev20231119+cu121, 2.2.0.dev20231120+cu121, 2.2.0.dev20231121+cu121, 2.2.0.dev20231122+cu121, 2.2.0.dev20231123+cu121, 2.2.0.dev20231124+cu121, 2.2.0.dev20231125+cu121, 2.2.0.dev20231126+cu121, 2.2.0.dev20231127+cu121, 2.2.0.dev20231128+cu121, 2.2.0.dev20231129+cu121, 2.2.0.dev20231130+cu121, 2.2.0.dev20231201+cu121, 2.2.0.dev20231202+cu121, 2.2.0.dev20231203+cu121, 2.2.0.dev20231204+cu121, 2.2.0.dev20231205+cu121, 2.2.0.dev20231207+cu121, 2.2.0.dev20231208+cu121, 2.2.0.dev20231209+cu121, 2.2.0.dev20231210+cu121, 2.2.0.dev20231211+cu121, 2.2.0.dev20231212+cu121, 2.2.0.dev20231213+cu121, 2.2.0.dev20231219+cu121, 2.2.0.dev20231220+cu121, 2.2.0.dev20231221+cu121, 2.2.0.dev20231222+cu121, 2.2.0.dev20231223+cu121, 2.2.0.dev20231224+cu121, 2.2.0.dev20231225+cu121, 2.2.0.dev20231226+cu121, 2.2.0.dev20231227+cu121, 2.2.0.dev20231228+cu121, 2.2.0.dev20231229+cu121, 2.2.0.dev20231230+cu121, 2.2.0.dev20231231+cu121, 2.2.0.dev20240101+cu121, 2.2.0.dev20240102+cu121, 2.2.0.dev20240103+cu121, 2.2.0.dev20240104+cu121, 2.2.0.dev20240105+cu121, 2.2.0.dev20240106+cu121, 2.2.0.dev20240107+cu121, 2.2.0.dev20240108+cu121, 2.2.0.dev20240109+cu121, 2.3.0.dev20240110+cu121)
ERROR: No matching distribution found for torch-tensorrt==2.3.0.dev20240222+cu121

DefTruth avatar Feb 24 '24 07:02 DefTruth