Skip to content

llmcompressor.utils.metric_logging

Utility functions for metrics logging and GPU memory monitoring.

This module provides functions for tracking device memory usage, loss, and runtime during module compression (optimization). Supports both NVIDIA and AMD GPU monitoring

Classes:

CompressionLogger

CompressionLogger(module: Module)

Log metrics related to compression algorithms

Source code in src/llmcompressor/utils/metric_logging.py
def __init__(self, module: torch.nn.Module):
    self.module = module
    self.start_tick = None

    self._name = None
    self._loss = None