Skip to content

Commit

Permalink
[quantizer] skip quantization for RMSNorm
Browse files Browse the repository at this point in the history
  • Loading branch information
zk1998 committed Sep 11, 2024
1 parent fca16f3 commit fc5eb63
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tinynn/graph/quantization/quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
'log': None,
'std': None,
'var': None,
'norm': None,
nn.LSTM: '1.13.0',
nn.ConvTranspose2d: '1.7.0',
nn.ConstantPad1d: '1.7.0',
Expand Down Expand Up @@ -261,6 +262,10 @@
Q_MODULES_MAPPING.update({nn.SiLU: QSiLU})
FUNCTIONAL_MODULE_MAPPING.update({'silu': nn.SiLU})

if hasattr(nn, 'RMSNorm'):
UNSUPPORTED_PYTORCH_QUANTIZATION_OP_LIST.update({nn.RMSNorm: None})
FUNCTIONAL_MODULE_MAPPING.update({'rms_norm': nn.RMSNorm})

# Processed QAT fuse rules
processed_qat_rules = {}
processed_ptq_rules = {}
Expand Down

0 comments on commit fc5eb63

Please sign in to comment.