Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 2.07 KB

comet_logging.rst

File metadata and controls

60 lines (38 loc) · 2.07 KB

Logging to Comet

This deep-dive will guide you through how to set up logging to Comet in torchtune.

.. grid:: 1

    .. grid-item-card:: :octicon:`mortar-board;1em;` What this deep-dive will cover

      * How to get started with Comet
      * How to use the :class:`~torchtune.training.metric_logging.CometLogger`
      * How to log configs, metrics, and model checkpoints to Comet

torchtune supports logging your training runs to Comet. An example Comet workspace from a torchtune fine-tuning run can be seen in the screenshot below.

torchtune workspace in Comet

Note

You will need to install the comet_ml package to use this feature. You can install it via pip:

pip install comet_ml

You will also likely need to login to Comet in order to start logging data. You can do it through the command line with:

comet login

Metric Logger

The only change you need to make is to add the metric logger to your config. Comet will log the metrics and model checkpoints for you.

# enable logging to the built-in CometLogger
metric_logger:
  _component_: torchtune.training.metric_logging.CometLogger
  # the Comet project to log to
  project: comet-examples-torchtune
  experiment_name: my-experiment-name

We automatically grab the config from the recipe you are running and log it to Comet. You can find it in the Comet Hyperparameters tab and the actual file in the Assets & Artifacts tab.

Note

Click on this sample Comet project to see the logged metrics after fine-tuning. The config used to train the models can be found here.