ONEforALL-S003 / ONE

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

Purpose and description of q-extract-torch #14

Open 0minyoung0 opened 1 year ago

0minyoung0 commented 1 year ago

Let me tell you the result of our meeting.

New quantize techniques are sometimes implemented using PyTorch. Therefore, q-implant aims to output quantized circle model by inputting circle model and json & npy files containing quantization parameters of the quantized PyTorch model.

However, converting quantized pytorch model to onnx model is not officially supported. Therefore, starting q-implant from onnx rather than pytorch is difficult to satisfy q-implant's design objectives.

q-extract is a module designed to obtain circle model and json & npy files corresponding to the input of q-implant. Therefore, we judged that implementing q-extract for quantized onnx model rather than quantized pytorch model was also not in line with the existing purpose.

image

The figure above is a diagram of q-extract-torch.

I will explain the inputs and outputs of the q-extract-torch module in text. Input 1: original PyTorch model (not quantized) Input 2: quantized PyTorch model (quantized) Output 1: Circle model (not quantized, to be used as input for q-implant) Output 2: json & npy files (to be used as input for q-implant)

In addition, I will explain the functionality of the q-extract-torch module. First, Convert original PyTorch model (Input 1) to create original Circle model (Output 1). Second, Two input PyTorch models (Input 1 & 2) store mapping information for models before and after quantization. Based on this mapping information, output json & npy files (Output 2) corresponding to the input of q-implant.

ssafyWooJeong commented 1 year ago

New quantize techniques are sometimes implemented using PyTorch. Therefore, q-implant aims to output quantized circle model by inputting circle model and containing quantization parameters of the quantized PyTorch model.

into

New quantization techniques are normally implemented by PyTorch or Tensorflow. Tensorflow Lite is compatible with Circle, thus quantized by brand new/sota technique in Tensorflow can be directly converted to Circle. Therefore, q-implant aims to output quantized circle model ~~~~

What about mentioning why not extract from Tensorflow