Samsung / ONE

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

[Compiler][luci] Upgrade logic of shape/type inference algorithm #5683

Open llFreetimell opened 3 years ago

llFreetimell commented 3 years ago

What?

Let's re-implement(upgrade) shape and type inference algorithm for following things!

How

  1. Select an operation/operations to implement and write your name in the list of table at assignee.
    • You can select multiple operations which logic is similar so that PR can be reviewed at once. (ex: ReLU and ReLU6)
    • Only reserve as much as you can finish in one week. DO NOT BE GREEDY.
  2. Implement each operations as following rules
    • Shape Inference
      • Write new recipes with dynamic shape, which are enough to cover most of algorithm codes. (For code coverage)
      • Add the recipes to common-artifacts/exclude.lst. (TestDataGenerator not supports yet)
      • Add the recipes to res/TensorFlowLiteRecipes/ or res/CircleRecipes.
      • Upgrade shape inference algorithm with considering unknown dimension. (Group similar algorithms as helper function)
      • Deprecate old shape inference algorithm
    • Type Inference
      • Move original type inference algorithm. (Group similar algorithms as helper function)
  3. Create PR(s). Then write the PR number in the table at
    • PR(exclude), for adding recipe to common-artifacts/exclude.lst.
    • PR(res), for adding recipe to res/.
    • PR(type), for type inference algorithm implementation
    • PR(shape), for shape inference algorithm implementation
  4. After PR is merged, write :heavy_check_mark: at Status in the table.

Examples (Guide)

Background

This issue is originated from #5501. Please refer to the comment in that issue.

llFreetimell commented 3 years ago

Operation Table (A-C)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
Abs
Add
AddN
All
ArgMax
ArgMin
AveragePool2D
BatchMatMul
BatchToSpaceND
Cast
Ceil
Concatenation
Const :no_entry_sign: :no_entry_sign:
Conv2D
Cos
Custom :no_entry_sign: :no_entry_sign:
llFreetimell commented 3 years ago

Operation Table (D-F)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
DepthToSpace
DepthwiseConv2D
Dequantize
Div
Elu
Equal
Exp
ExpandDims
FakeQuant
Fill
Floor
FloorDiv
FloorMod
FullyConnected
llFreetimell commented 3 years ago

Operation Table (G-L)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
Gather
GatherNd
Greater
GreaterEqual
If
L2Normalize
L2Pool2D
LeakyRelu
Less
LessEqual
LocalResponseNormalization
Log
LogicalAnd
LogicalNot
LogicalOr
Logistic
LogSoftmax
llFreetimell commented 3 years ago

Operation Table (M-P)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
MatrixDiag
MatrixSetDiag
Maximum
MaxPool2D
Mean
Minimum
MirrorPad
Mul
Neg
NonMaxSuppressionV4
NonMaxSuppressionV5
NotEqual
OneHot
Pack
Pad
PadV2
Pow
PRelu
llFreetimell commented 3 years ago

Operation Table (R)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
Range
Rank
ReduceAny
ReduceMax
ReduceMin
ReduceProd
Relu @llFreetimell #5611 #5079
Relu6 @llFreetimell #5611 #5079
ReluN1To1 @llFreetimell #5072 #5079
Reshape
ResizeBilinear
ResizeNearestNeighbor
ReverseSequence
ReverseV2
Round
Rsqrt
llFreetimell commented 3 years ago

Operation Table (S)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
ScatterNd
SegmentSum
Select
SelectV2
Shape
Sin
Slice
Softmax
SpaceToBatchND
SpaceToDepth
SparseToDense
Split
SplitV
Sqrt
Square
SquaredDifference
Squeeze
StridedSlice
Sub
Sum
llFreetimell commented 3 years ago

Operation Table (T-Z)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
Tanh
Tile
TopKV2
Transpose
TransposeConv
UnidirectionalSequenceLSTM
Unique
Unpack
Where
While
ZerosLike
llFreetimell commented 3 years ago

Operation Table (Circle Only Ops)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
BCQFullyConnected
BCQGather
InstanceNorm
llFreetimell commented 3 years ago

Operation Table (Virtual Ops)

:no_entry_sign: : Not needed :heavy_check_mark: : Done

Operation Assignee PR(exlucde) PR(res) PR(type) PR(shape) Status
CustomOut :no_entry_sign: :no_entry_sign:
IfOut @llFreetimell :no_entry_sign: :no_entry_sign: #6312 #6312 :heavy_check_mark:
Input :no_entry_sign: :no_entry_sign:
NonMaxSuppressionV4Out :no_entry_sign: :no_entry_sign:
NonMaxSuppressionV5Out :no_entry_sign: :no_entry_sign:
Output :no_entry_sign: :no_entry_sign:
OutputDummy :no_entry_sign: :no_entry_sign:
OutputExclude :no_entry_sign: :no_entry_sign:
SplitOut :no_entry_sign: :no_entry_sign:
SplitVOut :no_entry_sign: :no_entry_sign:
TopKV2Out :no_entry_sign: :no_entry_sign:
UniqueOut :no_entry_sign: :no_entry_sign:
UnpackOut :no_entry_sign: :no_entry_sign:
WhileOut :no_entry_sign: :no_entry_sign: