Skip to content

Commit 41715ad

Browse files
author
Kyle Sayers
committed
patch log function name
1 parent 5bfb497 commit 41715ad

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/llmcompressor/modifiers/quantization/gptq/utils/gptq_wrapper.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -314,23 +314,24 @@ def _log_metrics(self, start_tick: float, losses: torch.Tensor):
314314
:param start_tick: time when algorithm started"
315315
:param losses: loss as result of algorithm
316316
"""
317-
logger.log("METRIC", "time %.2f" % (time.time() - start_tick))
318-
logger.log("METRIC", "error %.2f" % torch.sum(losses).item())
317+
patch = logger.patch(lambda r: r.update(function="compress"))
318+
patch.log("METRIC", "time %.2f" % (time.time() - start_tick))
319+
patch.log("METRIC", "error %.2f" % torch.sum(losses).item())
319320

320321
gpu_usage = get_GPU_memory_usage()
321322
if len(gpu_usage) > 0:
322323
for i in range(len(gpu_usage)):
323324
perc = gpu_usage[i][0] * 100
324325
total_memory = int(gpu_usage[i][1]) # GB
325-
logger.log(
326+
patch.log(
326327
"METRIC",
327328
(
328329
f"GPU {i} | usage: {perc:.2f}%"
329330
f" | total memory: {total_memory} GB"
330331
),
331332
)
332333

333-
logger.log(
334+
patch.log(
334335
"METRIC",
335336
f"Compressed layer size: {get_layer_size_bytes(self.layer)} MB",
336337
)

0 commit comments

Comments
 (0)