Samsung / ONE

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

Run While Op with HE(tvn+cpu) via single circle model #9390

Open chunseoklee opened 2 years ago

chunseoklee commented 2 years ago

Why

  1. Let's consider a single circle model which contains a operation like TRIX instead of partitioned model.

Originally posted by @chunseoklee in https://github.com/Samsung/ONE/issues/9300#issuecomment-1162600017

All the tasks for https://github.com/Samsung/ONE/projects/9 assume that we have multiple models in nnpacakge. However, inserting TRIX(or Bulk)-like Op into single circle model could be another solution.

What

chunseoklee commented 2 years ago

cc @ragmani

chunseoklee commented 2 years ago

Let's depict the whole workflow in this approach

Let's imagine input and output circle file of this workflow.

Assume that our input circle(A.circle) is like:

Conv2D(op1) - Conv2D(op2) - FC(op3) - Softmax(op4)

Also, if we'd like to run op1,op2 in TRIX backend and to run others in CPU backend

Then, our output circle is like:

Bulk(or CustomOp) - FC - Softmax

Of course, we have trix binary for Bulk layer in nnpackage as well as circle.

glistening commented 2 years ago

@chunseoklee Will you prepare A.circle? Do you have any existing graph which contains this pattern? Or do we need to create it manually?

Conv2D(op1) - Conv2D(op2) - FC(op3) - Softmax(op4)
chunseoklee commented 2 years ago

@chunseoklee Will you prepare A.circle? Do you have any existing graph which contains this pattern? Or do we need to create it manually?

Conv2D(op1) - Conv2D(op2) - FC(op3) - Softmax(op4)

No. It is just a example to explain.