Samsung / ONE

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

Compile FE: Merge same constants #3859

Closed seanshpark closed 4 years ago

seanshpark commented 4 years ago

If there are two or more Constant nodes that are identical in content, we can think of removing duplicates For example , for this network

[ifm] ----- [Add] ----- [Add] --- [ofm]
 [c1] --/    [c2] --/

we could change like this if c1 and c2 are identical

[ifm] ----- [Add] ----- [Add] --- [ofm]
 [c1] --/-----------/

Let's find out about this.

seanshpark commented 4 years ago

Things to do

mhs4670go commented 4 years ago

I think this pass will have to be executed after another fusion-like pass has been executed. Maybe other pass could be related as well.

seanshpark commented 4 years ago

Prepared draft code checks inside a graph, that is in one sub-graph in circle file; and this seems to work OK. Our target inhouse model is like indentical constants exist across different sub-graphs. Current luci cannot support this. Need to do some design...

seanshpark commented 4 years ago

How to, in view of TF lite file,

Overal how to, in luci

How to in Import

seanshpark commented 4 years ago

@llFreetimell finished this :)

llFreetimell commented 4 years ago

For records, #4754 resolved it :)