🐛 [Bug] aten::add does not convert with dynamic batch
Bug Description
When using dynamic batch, aten::add dimension checks fail reporting:
ERROR: [TRTorch Conversion Context] - %457 : Tensor = aten::add_(%456, %455, %3): broadcast dimensions must be non-negative
ERROR: [TRTorch Conversion Context] - Builder failed while analyzing shapes.
To Reproduce
Steps to reproduce the behavior:
- Run trtorchc on ResNet50 with dynamic batch size
-
trtorchc tests/modules/resnet50_scripted.jit.pt /out/file.trt "[(1,3,224,224);(3,3,224,224);(5,3,224,224)]" -v
Expected behavior
Model converts properly
Environment
Build information about the TRTorch compiler can be found by turning on debug messages
- PyTorch Version (e.g., 1.0): 1.7.1
- CPU Architecture: x86
- OS (e.g., Linux): Linux
- How you installed PyTorch (
conda,pip,libtorch, source): pip - Build command you used (if compiling from source): source [00f2d78b2768c7f65bffcff6ba0aa287838b2ca0]
- Are you using local sources or building from archives: archives
- Python version: python 3.6
- CUDA version: 11.0
- GPU models and configuration: TITAN V
- Any other relevant information:
Additional context
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days
cc: @apbose
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days
@apbose any updates on this issue?
Hi @narendasan I tested this locally and the test passes now.
Do we have a dynamic batch aten::add test?
bump @apbose to Naren's question
I am not sure exactly, but should not these test cases be included in the test_dynamic_fallback.cpp in the TensorRT/tests/cpp tests?
test_dynamic_fallback has testcases where the model has dynamic shapes and ops that fallback. This issue is quite old and is related to dynamic shape aten::add not being converted properly. There are dynamic batch test cases for aten::add now. https://github.com/pytorch/TensorRT/blob/master/tests/core/conversion/converters/test_element_wise.cpp#L69-L70 We probably don't have an end-end dynamic batch model (full_compilation=True) testcase.
This now working, it just needs to be tested.
Closing the issue as it has been tested.