aimet
aimet copied to clipboard
RNN can not be quantized by aimet
Hi,when i use aimet to quantize my rnn model,some tracing error happens.
import torch
import torch.nn as nn
from aimet_torch.model_preparer import prepare_model
rnn=nn.RNN(10,20,1)
rnn=prepare_model(rnn)
torch.fx.proxy.TraceError:symbolically traced variables cannot be used as inputs to control flow
it seems that nn.RNN can not be traced by torch.fx so i use torch.fx.symbolic_trace to directly trace the torch.nn.Rnn(10,20,1),but also failed the wheel i installed is aimet_torch-torch_cpu_pt19_1.31.0-cp38-cp38-linux_x86_64.whl
@TingfengTang This is the issue caused by torch. To solve this remove the control flow(if, else) and hardcode the process without control flow.
Hi @TingfengTang as @RangineniBalaji mentioned, this is indeed torch fx issue.
Coudl you please try with the latest torch if this still persists.