Skip to content

Commit 2c43204

Browse files
authored
Api refractor (#1579)
* cleanup names Signed-off-by: Qubitium <Qubitium@modelcloud.ai> * format Signed-off-by: Qubitium <Qubitium@modelcloud.ai> --------- Signed-off-by: Qubitium <Qubitium@modelcloud.ai>
1 parent 3dd2071 commit 2c43204

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

gptqmodel/looper/gptq_processor.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from ..quantization.config import QUANT_METHOD, QuantizeConfig
3030
from ..utils.logger import setup_logger
3131
from ..utils.model import move_to, pack_model
32-
from ..utils.torch import CPU, DEVICE_0, torch_streamCtx, torch_sync
32+
from ..utils.torch import CPU, DEVICE_0, DEVICE_1, torch_streamCtx, torch_sync
3333

3434
log = setup_logger()
3535

@@ -235,9 +235,7 @@ def process(self, module: NamedModule, auto_gc: bool = True):
235235
"wq": wq, # fp16, quantized weight but not int4 (packed qweight)
236236
})
237237

238-
old = module.weight.data # TODO HACK since we cannot delete weight.data directly
239238
module.weight.data = wq
240-
del old
241239

242240
# if auto_gc:
243241
# torch_empty_cache()

gptqmodel/looper/qqq_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from ..quantization.qqq import QQQ
3131
from ..utils.logger import setup_logger
3232
from ..utils.model import move_to, pack_model
33-
from ..utils.torch import CPU, torch_sync, torch_streamCtx, DEVICE_0
33+
from ..utils.torch import CPU, DEVICE_0, torch_streamCtx, torch_sync
3434

3535
log = setup_logger()
3636

tests/models/model_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def quantModel(self, model_id_or_path, trust_remote_code=False, torch_dtype="aut
211211
is_ovis_model = model.__class__.__name__ == "OvisGPTQ"
212212
need_create_processor = is_image_to_text_model and not is_ovis_model
213213
if not is_quantized:
214-
model.quantize(calibration_dataset, backend=self.QUANT_BACKEND, batch_size=batch_size, buffered_fwd=True)
214+
model.quantize(calibration_dataset, backend=self.QUANT_BACKEND, batch_size=batch_size, buffered_fwd=False)
215215

216216
self.check_kernel(model, self.KERNEL_QUANT)
217217

0 commit comments

Comments
 (0)