TensorBoard
Any training loop already calling writer.add_scalar(tag, value, step) can get read-only OmniLoop dashboard readouts for free. There is no need to edit your loop or define a separate OmniLoop schema.
Wrap your existing SummaryWriter once:
from torch.utils.tensorboard import SummaryWriterfrom omniloop.integrations.tensorboard import OmniLoopSummaryWriter
# Was: writer = SummaryWriter(log_dir)writer = OmniLoopSummaryWriter(SummaryWriter(log_dir))
# ... inside your loop ...writer.add_scalar("Loss/Policy", loss, it) # -> Sent to TensorBoard AND OmniLoopEvery scalar is forwarded unchanged to the wrapped TensorBoard writer. It is also published as an OmniLoop telemetry frame. The tag is automatically declared as a read-only parameter (e.g., "Loss/Policy" becomes group “Loss”, label “Policy”) so it appears in the dashboard’s readout section automatically.
Installation
Section titled “Installation”Install the TensorBoard extra:
pip install omniloop[tensorboard]Alternative: In-place patching
Section titled “Alternative: In-place patching”If you don’t control where the writer is instantiated (e.g., inside a framework’s runner), you can patch an existing SummaryWriter in place:
from omniloop.integrations.tensorboard import mirror_summary_writer
mirror_summary_writer(runner.writer)Coalesce Mode
Section titled “Coalesce Mode”By default, OmniLoopSummaryWriter operates with Coalesce mode enabled.
Scalars are buffered and flushed as a single telemetry frame per global_step. This ensures that a dashboard tick shows a consistent row of metrics that all correspond to the exact same training step.