Experiment tracking¶
Logs a Repository revision and its provenance bundle to Weights &
Biases or MLflow, so a run pins the exact record CIDs and the lexicon
manifest hash it was built against. Requires the lairs[tracking]
extra. For usage see Guides > Experiment
tracking.
lairs.integrations.tracking ¶
Experiment-tracking hooks.
Logs a Repository revision (not a copy) as an artifact with the provenance
bundle, so a logged run pins exact record CIDs. Backends are Weights & Biases
and MLflow. Requires the lairs[tracking] extra at runtime.
Reproducibility comes from the revision id: a logged run records the exact
commit (or tag) and the vendored lexicon manifest hash that the records were
generated against, so the dataset behind a run can always be rebuilt. The
revision is validated against the Repository before anything is logged, so a
typo'd commit id fails loudly rather than pinning confidently-wrong provenance.
The backend libraries are imported lazily inside their _import_* gates, so
importing this module never pulls in wandb or mlflow.
ProvenanceBundle ¶
Bases: Model
The provenance pinned alongside a logged Repository revision.
| ATTRIBUTE | DESCRIPTION |
|---|---|
revision |
The Repository revision (commit id or tag) the run was logged against.
TYPE:
|
lexicon_tree_hash |
The content hash of the vendored lexicon tree the records were generated
from, read from
TYPE:
|
layers_version |
The upstream Layers release version the lexicons were vendored from.
TYPE:
|
working_dir |
The Repository working directory the revision was read from.
TYPE:
|
log_revision ¶
Log a Repository revision as a tracked artifact.
The revision itself (not a copy of the data) is recorded together with a
:class:ProvenanceBundle, so a logged run pins the exact commit and the
vendored lexicon manifest hash that the records were generated against. The
revision is validated against the Repository first, so a typo'd commit id
raises before anything is logged. The backend library is imported lazily, so
a missing optional dependency raises a clear error only when that backend is
used.
| PARAMETER | DESCRIPTION |
|---|---|
repo
|
The Repository holding the revision.
TYPE:
|
revision
|
The revision (commit id, tag, or branch) to log. It must resolve to a
commit in
TYPE:
|
backend
|
The tracking backend (
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
The tracked artifact identifier, as |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |
ImportError
|
If the backend's optional dependency is not installed. |
RuntimeError
|
For the |