Open xylcbd opened 1 year ago
Hi - could you also try this with allow_shape_tensors = False
and share the error message for that approach?
@peri044 - the IValue
unwrapping issue with Dynamic Shape + ATen size could be contributing here. Is interpolate with dynamic shapes supported?
@gs-olive failed when allow_shape_tensors = False:
WARNING:torch_tensorrt._compile:Input graph is a Torchscript module but the ir provided is default (dynamo). Please set ir=torchscript to suppress the warning. Compiling the module with ir=torchscript
WARNING: [Torch-TensorRT] - There may be undefined behavior using dynamic shape and aten::size without setting allow_shape_tensors
WARNING: [Torch-TensorRT] - There may be undefined behavior using dynamic shape and aten::size without setting allow_shape_tensors
ERROR: [Torch-TensorRT TorchScript Conversion Context] - 4: kOPT values for profile 0 violate shape constraints: %18 : Tensor = aten::add(%x1, %x, %8) # yyy.py:15:0: dimensions not compatible for elementwise. Condition '==' violated: 64 != 32.
ERROR: [Torch-TensorRT TorchScript Conversion Context] - 4: [shapeCompiler.cpp::evaluateShapeChecks::1276] Error Code 4: Internal Error (kOPT values for profile 0 violate shape constraints: %18 : Tensor = aten::add(%x1, %x, %8) # yyy.py:15:0: dimensions not compatible for elementwise. Condition '==' violated: 64 != 32.)
Traceback (most recent call last):
File "yyy.py", line 29, in <module>
trt_net = torch_tensorrt.compile(
File "/home/xx/miniconda3/lib/python3.8/site-packages/torch_tensorrt/_compile.py", line 185, in compile
compiled_ts_module: torch.jit.ScriptModule = torchscript_compile(
File "/home/xx/miniconda3/lib/python3.8/site-packages/torch_tensorrt/ts/_compiler.py", line 151, in compile
compiled_cpp_mod = _C.compile_graph(module._c, _parse_compile_spec(spec))
RuntimeError: [Error thrown at core/conversion/conversionctx/ConversionCtx.cpp:169] Building serialized network failed in TensorRT
Hi, is this issue not resolved yet? I am encountering the same error when using (interpolate function + addition) with dynamic input shape based torch to TRT compilation.
Thank you.
I tested out the sample with ir="dynamo"
, and ran into an issue which has been filed (#2443). Additionally, it seems the shape tensor issue is still present, and this should be addressed soon with #2409.
Bug Description
To Reproduce
log:
Expected behavior
support dynamic size as input
Environment