Skip to content

Commit 98a7a05

Browse files
andrewor14Felipe Mello
authored andcommitted
Fix excessive QAT warning (#2174)
1 parent 30687d3 commit 98a7a05

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

torchtune/training/quantization.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ def quantize(self, model):
130130

131131

132132
# int4 weight-only
133-
Int4WeightOnlyQATQuantizerModuleSwap = Int4WeightOnlyQATQuantizer
133+
class Int4WeightOnlyQATQuantizerModuleSwap(Int4WeightOnlyQATQuantizer):
134+
pass
135+
136+
134137
disable_4w_fake_quant_module_swap = disable_4w_fake_quant
135138
enable_4w_fake_quant_module_swap = enable_4w_fake_quant
136139
_quantizer_to_mode[Int4WeightOnlyQATQuantizerModuleSwap] = "4w-qat-module-swap"
@@ -142,7 +145,10 @@ def quantize(self, model):
142145
] = enable_4w_fake_quant_module_swap
143146

144147
# int8 dynamic activations + int4 weight
145-
Int8DynActInt4WeightQATQuantizerModuleSwap = Int8DynActInt4WeightQATQuantizer
148+
class Int8DynActInt4WeightQATQuantizerModuleSwap(Int8DynActInt4WeightQATQuantizer):
149+
pass
150+
151+
146152
disable_8da4w_fake_quant_module_swap = disable_8da4w_fake_quant
147153
enable_8da4w_fake_quant_module_swap = enable_8da4w_fake_quant
148154
_quantizer_to_mode[Int8DynActInt4WeightQATQuantizerModuleSwap] = "8da4w-qat-module-swap"

0 commit comments

Comments
 (0)