Samsung / ONE

On-device Neural Engine
Other
429 stars 157 forks source link

[circle2circle] Check file size > 2G with unet #14074

Open seanshpark opened 1 week ago

seanshpark commented 1 week ago

Logs of issues with our 4G unet internal model.

This model is converted from ONNX.

tasks

seanshpark commented 1 week ago

Reshape Op shape with value of [0, 32, -1]

from https://onnx.ai/onnx/operators/onnx__Reshape.html#reshape-19

what to do

seanshpark commented 1 week ago
[luci] Shape for output #0 not same
[luci]    8014 [1,4,1,1] vs [1,4,128,128]
ERROR: Optimized graph is invalid

hum...

; [/conv_out/Conv <1,1,1,4>] = 0x5b849bdc17f0
%3838 = circle.CONV_2D(input: %3837, filter: %18, bias: %781, stride(h,w): 1,1, dilation(h,w): 1,1, padding: VALID, fused_activation_function: NONE)
pcs1265 commented 6 days ago

I wrote some code that supports dynamic shape inference for Conv2D operations quite a while ago. https://github.com/Samsung/ONE/pull/13950

It was related to Yamnet (https://github.com/Samsung/ONE/issues/13790), but I abandoned it because the height and width were static in Yamnet; So there were no issues related to Conv2D.

In conclusion, Conv2D operations do not support dynamic shapes currently. All dimensions of the ifm shape must be known except for the batch size. If input has unknown dimmension, the dim will be calculated as 0.

Since I can't access detailed info, I might be wrong about this is related to dynamic shapes inference. Could you check if this draft PR(#13950) will help address this issue? (I'm sorry, the commits in the draft PR are hard to read...)

seanshpark commented 6 days ago

@pcs1265 , thanks for the comment! no worry. there are lots of issues with this internal model that may take some time and I'll be working on it. if you like to contribute later after SAFFY program, please be tuned :)

pcs1265 commented 6 days ago

We have always appreciated for your kind advice to us! As you mentioned, it can take some time to resolve this issue. I have created an issue regarding dynamic shape support for Conv2D/DepthwiseConv2D, which I expect will help with this problem and is also related to our Yamnet issue.

If you have time, could you advise on one of the three methods I described here? https://github.com/Samsung/ONE/issues/14115 Thank you!