Telemetry Callback#
Telemetry callback utilities#
Structured logging of metrics, losses, and state during training/evaluation.
This module provides two callbacks:
TelemetryLogger: appends JSON records to a JSONL file with periodic flush, suitable for long runs.MemoryLogger: collects records in memory for debugging or tests.
- class qmlhc.callbacks.telemetry.MemoryLogger[source]#
Bases:
CallbackIn-memory telemetry collector.
Useful for unit tests or quick debugging sessions where file I/O is undesirable. Each call appends a small dictionary to
records.- on_epoch_end(epoch, context)[source]#
Record the end of an epoch.
- Return type:
Notes
contextis converted to a plaindictto keep a JSON-safe record.
- class qmlhc.callbacks.telemetry.TelemetryLogger(path='telemetry.jsonl', flush_interval=1)[source]#
Bases:
CallbackJSONL-based telemetry logger.
Records tagged events (e.g., step/epoch begin/end, errors) into an internal buffer and flushes to a JSONL file either when the buffer reaches a given length or when a time threshold elapses.
- Parameters:
Notes
- Each JSON line includes:
ts(float): UNIX timestamp (seconds).tag(str): event tag ("step_begin","epoch_end", etc.).Any extra payload fields provided by the caller.
- on_epoch_end(epoch, context)[source]#
Record the end of an epoch.
- Return type:
Notes
contextis converted to a plaindictto ensure JSON safety.