llmcompressor.core.helpers
log_model_info(state, current_log_step)
Log model level info to the metrics Relies on state.model
having a loggable_items
method that returns a generator of tuples of the loggable item name and value. Also relies on state.loggers
being a LoggerManager
instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
state | State | The current state of sparsification | required |
current_log_step | The current log step to log model info at | required |
Source code in src/llmcompressor/core/helpers.py
should_log_model_info(model, loggers, current_log_step, last_log_step=None)
Check if we should log model level info Criteria: - model has a loggable_items method - state has a metrics manager - metrics manager is ready to log based on cadence and last log epoch
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model | Any | The model whose info we want to log | required |
loggers | LoggerManager | The metrics manager to log to | required |
current_log_step | float | The current epoch | required |
last_log_step | Optional[float] | The last step we logged model info at | None |
Returns:
Type | Description |
---|---|
bool | True if we should log model level info, False otherwise |