Samsung / ONE

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

[onert] In-place Reshape and ExpandDims operation #12836

Open hseok-oh opened 7 months ago

hseok-oh commented 7 months ago

We are always using memcpy for Reshape and ExpandDims operation. If these operation's input is used only once and updated shape does not require padding, we can skip copy operation.

For this, we need to modify memory allocation and tensor handling implementation.

mbencer commented 2 months ago

Due to recommendation from https://github.com/Samsung/ONE/issues/12814#issuecomment-2316619907 I'm assigning myself to this issue ;)

mbencer commented 1 month ago

@hseok-oh Could you please take a look at https://github.com/Samsung/ONE/pull/14057? I am not sure if you plan implementation similar to my draft or maybe more global approach (like creating common buffer during tensor creation). The second one approach has much larger affected area.