# Experiment trackers

## Experiment Tracking

### The Base Tracker Class

#### class accelerate.tracking.GeneralTracker

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L83)

( \_blank = False )

A base Tracker class to be used for all logging integration implementations.

Each function should take in `**kwargs` that will automatically be passed in from a base dictionary provided to [Accelerator](https://huggingface.co/docs/accelerate/v0.24.0/en/package_reference/accelerator#accelerate.Accelerator).

Should implement `name`, `requires_logging_directory`, and `tracker` properties such that:

`name` (`str`): String representation of the tracker class name, such as “TensorBoard” `requires_logging_directory` (`bool`): Whether the logger requires a directory to store their logs. `tracker` (`object`): Should return internal tracking mechanism used by a tracker class (such as the `run` for wandb)

Implementations can also include a `main_process_only` (`bool`) attribute to toggle if relevent logging, init, and other functions should occur on the main process or across all processes (by default will use `True`)

**finish**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L149)

( )

Should run any finalizing functions within the tracking API. If the API should not have one, just don’t overwrite that method.

**log**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L136)

( values: dictstep: typing.Optional\[int]\*\*kwargs )

Parameters

* **values** (Dictionary `str` to `str`, `float`, or `int`) — Values to be logged as key-value pairs. The values need to have type `str`, `float`, or `int`.
* **step** (`int`, *optional*) — The run step. If included, the log will be affiliated with this step.

Logs `values` to the current run. Base `log` implementations of a tracking API should go in here, along with special behavior for the \`step parameter.

**store\_init\_configuration**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L124)

( values: dict )

Parameters

* **values** (Dictionary `str` to `bool`, `str`, `float` or `int`) — Values to be stored as initial hyperparameters as key-value pairs. The values need to have type `bool`, `str`, `float`, `int`, or `None`.

Logs `values` as hyperparameters for the run. Implementations should use the experiment configuration functionality of a tracking API.

### Integrated Trackers

#### class accelerate.tracking.TensorBoardTracker

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L157)

( run\_name: strlogging\_dir: typing.Union\[str, os.PathLike]\*\*kwargs )

Parameters

* **run\_name** (`str`) — The name of the experiment run
* **logging\_dir** (`str`, `os.PathLike`) — Location for TensorBoard logs to be stored. kwargs — Additional key word arguments passed along to the `tensorboard.SummaryWriter.__init__` method.

A `Tracker` class that supports `tensorboard`. Should be initialized at the start of your script.

**\_\_init\_\_**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L173)

( run\_name: strlogging\_dir: typing.Union\[str, os.PathLike]\*\*kwargs )

#### class accelerate.tracking.WandBTracker

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L268)

( run\_name: str\*\*kwargs )

Parameters

* **run\_name** (`str`) — The name of the experiment run. kwargs — Additional key word arguments passed along to the `wandb.init` method.

A `Tracker` class that supports `wandb`. Should be initialized at the start of your script.

**\_\_init\_\_**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L283)

( run\_name: str\*\*kwargs )

#### class accelerate.tracking.CometMLTracker

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L391)

( run\_name: str\*\*kwargs )

Parameters

* **run\_name** (`str`) — The name of the experiment run. kwargs — Additional key word arguments passed along to the `Experiment.__init__` method.

A `Tracker` class that supports `comet_ml`. Should be initialized at the start of your script.

API keys must be stored in a Comet config file.

**\_\_init\_\_**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L407)

( run\_name: str\*\*kwargs )

#### class accelerate.tracking.AimTracker

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L472)

( run\_name: strlogging\_dir: typing.Union\[str, os.PathLike, NoneType] = '.'\*\*kwargs )

Parameters

* **run\_name** (`str`) — The name of the experiment run. kwargs — Additional key word arguments passed along to the `Run.__init__` method.

A `Tracker` class that supports `aim`. Should be initialized at the start of your script.

**\_\_init\_\_**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L486)

( run\_name: strlogging\_dir: typing.Union\[str, os.PathLike, NoneType] = '.'\*\*kwargs )

#### class accelerate.tracking.MLflowTracker

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L539)

( experiment\_name: str = Nonelogging\_dir: typing.Union\[str, os.PathLike, NoneType] = Nonerun\_id: typing.Optional\[str] = Nonetags: typing.Union\[typing.Dict\[str, typing.Any], str, NoneType] = Nonenested\_run: typing.Optional\[bool] = Falserun\_name: typing.Optional\[str] = Nonedescription: typing.Optional\[str] = None )

Parameters

* **experiment\_name** (`str`, *optional*) — Name of the experiment. Environment variable MLFLOW\_EXPERIMENT\_NAME has priority over this argument.
* **logging\_dir** (`str` or `os.PathLike`, defaults to `"."`) — Location for mlflow logs to be stored.
* **run\_id** (`str`, *optional*) — If specified, get the run with the specified UUID and log parameters and metrics under that run. The run’s end time is unset and its status is set to running, but the run’s other attributes (source\_version, source\_type, etc.) are not changed. Environment variable MLFLOW\_RUN\_ID has priority over this argument.
* **tags** (`Dict[str, str]`, *optional*) — An optional `dict` of `str` keys and values, or a `str` dump from a `dict`, to set as tags on the run. If a run is being resumed, these tags are set on the resumed run. If a new run is being created, these tags are set on the new run. Environment variable MLFLOW\_TAGS has priority over this argument.
* **nested\_run** (`bool`, *optional*, defaults to `False`) — Controls whether run is nested in parent run. True creates a nested run. Environment variable MLFLOW\_NESTED\_RUN has priority over this argument.
* **run\_name** (`str`, *optional*) — Name of new run (stored as a mlflow\.runName tag). Used only when `run_id` is unspecified.
* **description** (`str`, *optional*) — An optional string that populates the description box of the run. If a run is being resumed, the description is set on the resumed run. If a new run is being created, the description is set on the new run.

A `Tracker` class that supports `mlflow`. Should be initialized at the start of your script.

**\_\_init\_\_**

[\<source>](https://github.com/huggingface/accelerate/blob/v0.24.0/src/accelerate/tracking.py#L570)

( experiment\_name: str = Nonelogging\_dir: typing.Union\[str, os.PathLike, NoneType] = Nonerun\_id: typing.Optional\[str] = Nonetags: typing.Union\[typing.Dict\[str, typing.Any], str, NoneType] = Nonenested\_run: typing.Optional\[bool] = Falserun\_name: typing.Optional\[str] = Nonedescription: typing.Optional\[str] = None )

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boinc-ai.gitbook.io/accelerate/reference/experiment-trackers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
