Skip to content

I have a question about LSQ , LSQ+ model device embedding  #13

Description

@minkyukang707

I've tried to convert LSQ, LSQ+ model to ONNX model but I got a runtime error

This is the code what I tried to run

import torch
from brevitas.export import export_onnx_qcdq

export_onnx_qcdq(quantized_model, torch.randn(2048,52).cuda(), export_path='lsq+_.onnx')

here is the error message that I got from converting LSQ+ model to onnx
First error line
"name": "RuntimeError",
"message": "ONNX export failed: Couldn't export Python operator ALSQPlus\n\nDefined at:\ne:\LSQplus-master\LSQplus-master\quantization\lsqplus_quantize_V2.py(154):

Last error lines
e:\LSQplus-master\LSQplus-master\quantization\lsqplus_quantize_V2.py:154:0\n %onnx::Gemm_67 : Float(*, , strides=[16, 1], requires_grad=0, device=cuda:0) = ^WLSQPlus(0.007394637578467616, -128, 127, False)(%model_fp32.output.0.weight, %model_fp32.output.0.weight_quantizer.s) # e:\LSQplus-master\LSQplus-master\quantization\lsqplus_quantize_V2.py:221:0\n %68 : Float(, *, strides=[9, 1], requires_grad=0, device=cuda:0) = onnx::Gemm[alpha=1., beta=1., transB=1](%onnx::Gemm_66, %onnx::Gemm_67, %model_fp32.output.0.bias) # e:\LSQplus-master\LSQplus-master\quantization\lsqplus_quantize_V2.py:319:0\n return (%68)\n"
}

Have you ever tried this before? or It isn't supported from onnx itself? I wonder about it

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions