One: [Compiler FE] Supporting new BCQ Format

Created on 4 Jun 2020  路  5Comments  路  Source: Samsung/ONE

Draft PR : #2023

Format of BCQ operations is upgraded as follow.

  • More information is needed so the number of input will be increased
  • Format and interpretation of quantized weight/input is changed
  • Inserting Transpose or changing axis of Gather is needed often

Original codes for handling original BCQ format will be kept for a while.
However, those codes will be deprecated eventually in the near future.
In conclusion, FuseNewBCQPass will be introduced and it will substitute old FuseBCQPass in the future.

_(20200617)UPDATE : Old BCQ will be substituted by new BCQ immediately_

Todo

  • [x] Update schema of circle (Not needed)
  • [x] Update CircleBCQFullyConnected #2340
  • [x] Update CircleBCQGather #2340
  • [x] Update circledump (Not needed)
  • [x] Update tests in luci/lang #2446
  • [x] Update logex in luci #2349
  • [x] Update import in luci #2353
  • [x] Update export in luci #2447
  • [x] Update ShapeInference in luci/Service #2452
  • [x] Update FuseBCQPass in luci #2487 #2646
  • [x] Add testcase (#1517)

All 5 comments

AFAIK, We don't need to keep old BCQ version, so I will apply this change soon.

Huge problem occurred.... if values of constant nodes are same, they are removed.........

20200619 Update

Situation

When const1, const2, const3 have all same values, they are removed to one constant node in TFv2 converter as follow.

[before converting in TFv2]
const1 --- output1
const2 --- output2
const3 --- output3

[after converting in TFv2]
const1 --- output1
const1 --- output2 (const2 is removed)
const1 --- output3 (const3 is removed)

Workaround

When we use TFv1 converter, above constant nodes are not removed as follow.

[before converting in TFv1]
const1 --- output1
const2 --- output2
const3 --- output3

[after converting in TFv1]
const1 --- Reshape(with original shape) --- output1
const2 --- Reshape(with original shape) --- output2
const3 --- Reshape(with original shape) --- output3

Solution

I will find another solution to handle it because there will be some cases that we should use TFv2 converter.

20200623 Update

Initial PRs are all merged and test material with real model is uploaded at internal repository.

However, we should validate by end-to-end including runtime and runtime is working hard.
Therefore, there can be some changes according to the result of validation.

Related works are all finished! close this PR :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mhs4670go picture mhs4670go  路  3Comments

lucenticus picture lucenticus  路  3Comments

seanshpark picture seanshpark  路  3Comments

wateret picture wateret  路  4Comments

KimDongEon picture KimDongEon  路  4Comments