ONEforALL-S003 / ONE

On-device Neural Engine / q-implant
Other
1 stars 2 forks source link

[q-implant] Integration op level tests for q-implant #18

Open Judgement9882 opened 1 year ago

Judgement9882 commented 1 year ago

About op-level-test of q-implant.

We want to check if we can proceed with q-implant on the operator used in the frequently used MobileNet, ResNet, and Inception models.

We converted the model to circle and checked the operator through the circledump command.

Model Source

MobileNet : ONE/runtime/contrib/TFLiteSharp/TFLiteTestApp/res/mobilenet_v1_1.0_224.tflite

ResNet : ResNet_V2_101

Inception : Inception_V3

Operators

MobileNet

Operator Codes: [order] OpCodeName (OpCode Enum)
[0] AVERAGE_POOL_2D (code: 1, dep_code: 1, version: 1)
[1] CONV_2D (code: 3, dep_code: 3, version: 1)
[2] DEPTHWISE_CONV_2D (code: 4, dep_code: 4, version: 1)
[3] SOFTMAX (code: 25, dep_code: 25, version: 1)
[4] RESHAPE (code: 22, dep_code: 22, version: 1)

ResNet

Operator Codes: [order] OpCodeName (OpCode Enum)
[0] ADD (code: 0, dep_code: 0, version: 1)
[1] CONV_2D (code: 3, dep_code: 3, version: 1)
[2] MAX_POOL_2D (code: 17, dep_code: 17, version: 1)
[3] MUL (code: 18, dep_code: 18, version: 1)
[4] PAD (code: 34, dep_code: 34, version: 1)
[5] MEAN (code: 40, dep_code: 40, version: 1)
[6] RESHAPE (code: 22, dep_code: 22, version: 1)

Inception

Operator Codes: [order] OpCodeName (OpCode Enum)
[0] AVERAGE_POOL_2D (code: 1, dep_code: 1, version: 1)
[1] CONV_2D (code: 3, dep_code: 3, version: 1)
[2] CONCATENATION (code: 2, dep_code: 2, version: 1)
[3] MAX_POOL_2D (code: 17, dep_code: 17, version: 1)
[4] SOFTMAX (code: 25, dep_code: 25, version: 1)
[5] RESHAPE (code: 22, dep_code: 22, version: 1)

Based on the information above, we made a list of operators to proceed with the test.

11 operators

[0] AVERAGE_POOL_2D
[1] CONV_2D
[2] DEPTHWISE_CONV_2D
[3] SOFTMAX
[4] RESHAPE
[5] ADD
[6] MAX_POOL_2D
[7] MUL
[8] PAD
[9] MEAN
[10] CONCATENATION

We use the input circles and qparam required for q-implant as follows.

FantBlog commented 1 year ago

LGTM