onnx-mlir
onnx-mlir copied to clipboard
Resnet with batch size>1 has issue on NNPA
Reporting an error that Cindy Guo experienced when targeting Resnet for NNPA with batch size > 1. She reported the error using this benchmark:
this is one I used: resnet18-v1-7.onnx
error:
ERROR: verify_transformed_descriptor() (tensor_desc.c:145): ZDNN_INVALID_SHAPE: Invalid shape (reasons: tensor size: 7536640000, maximum: 4294967296 bytes
ERROR: invoke_nnpa() (zdnn.c:288): ZDNN_EXCEEDS_MTS: Total number of elements in tensor exceeds maximum tensor size (MTS).
From the best of my understandig, this is a benchmark from the model zoo what can executed that way.
python ../utils/RunONNXModelZoo.py -c "-O3 <nnpa options>" -k -m resnet18-v1-7
The model is dynamic in its batch size as the input should be (batch, colors, size h, size w)
func.func @main_graph(%arg0: tensor<?x3x224x224xf32>) -> tensor<?x1000xf32> attributes {input_names = ["data"], output_names = ["resnetv15_dense0_fwd"]} {
She reported it works fine with B=1 but not B=2, 4, or 8.
I wonder if we collapse dims too aggressively, because the dims are not excessively large