Skip to content

Commit 370cc68

Browse files
authored
fix bug of FusedMoE object has no attribute w13_weight (#94)
Signed-off-by: yuwenzho <yuwen.zhou@intel.com>
1 parent 9ceb958 commit 370cc68

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

neural_compressor/torch/algorithms/fp8_quant/_quant_common/helper_modules.py

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import torch
1616
import torch.nn as nn
17+
import types
1718

1819
from .quant_config import QuantMode, get_hqt_config, ScaleFormat
1920
from .._core.quant_dequant import QuantDequant as qdq
@@ -294,6 +295,8 @@ def __init__(self, mod, mod_extra_config, *args, **kwargs):
294295
if self.quantization_mode in [QuantMode.QUANTIZE, QuantMode.LOAD]:
295296
delattr(mod, "w13_weight")
296297
delattr(mod, "w2_weight")
298+
setattr(mod, "w13_weight", None)
299+
setattr(mod, "w2_weight", None)
297300
setattr(self, "w13_weight", None)
298301
setattr(self, "w2_weight", None)
299302
self.forward = self.forward_orig

0 commit comments

Comments
 (0)