Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model registry docs consolidation #5133

Merged
merged 14 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/basic-concepts/model_registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ tooltip: >-
The model registry connects all of your team's models through Git. Find,
organize, and manage all of them, and use GitOps workflows to version,
promote, demote, and deploy them. [Learn
more](/doc/studio/user-guide/model-registry/what-is-a-model-registry).
more](/doc/studio/user-guide/model-registry).
---
4 changes: 2 additions & 2 deletions content/docs/dvclive/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ make Git ignore it. It will generate a `model.pt.dvc` metadata file, which can
be tracked in Git and becomes part of the experiment. With this metadata file,
you can [retrieve](/doc/start/data-management/data-versioning#retrieving) the
versioned artifact from the Git commit. You can also use
`Live.log_artifact("model.pt", type="model")` to add it to the
[DVC Studio Model Registry](/doc/studio/model-registry).
`Live.log_artifact("model.pt", type="model")` to add it to the <abbr>model
registry</abbr>.

Using `Live.log_image()` to log multiple images may also grow too large to track
with Git, in which case you can use
Expand Down
6 changes: 3 additions & 3 deletions content/docs/gto/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
GTO lets you build an artifact registry or <abbr>model registry</abbr> out of
your Git repository by creating annotated
[Git tags](https://git-scm.com/book/en/v2/Git-Basics-Tagging) with a
[special format](#git-tags-format). To read more about building a Model
Registry, read this [DVC Studio User Guide].
[special format](#git-tags-format). To read more about building a model
registry, read this [get started guide].

[DVC Studio User Guide]: https://dvc.org/doc/studio/user-guide/model-registry
[get started guide]: /doc/start/model-registry

## Finding the right artifact version

Expand Down
17 changes: 11 additions & 6 deletions content/docs/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,20 @@
]
},
{
"label": "Model Management",
"slug": "model-management",
"source": "model-management/index.md",
"label": "Model Registry",
"slug": "model-registry",
"source": "model-registry/index.md",
"children": [
{
dberenbaum marked this conversation as resolved.
Show resolved Hide resolved
"label": "Model registry",
"slug": "model-registry"
"label": "Add a model",
"slug": "add-model"
},
{
"label": "Using and deploying models",
"label": "Manage models",
"slug": "manage-models"
},
{
"label": "Use and deploy models",
"slug": "model-cicd"
}
]
Expand Down Expand Up @@ -716,6 +720,7 @@
},
{
"slug": "model-registry",
"source": false,
"children": [
"add-a-model",
"register-version",
Expand Down
2 changes: 1 addition & 1 deletion content/docs/start/experiments/experiment-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Framework and any
also [log additional info](/doc/dvclive#log-data) to be included in the
experiment. `live.log_artifact("mymodel", type="model")` will
[track your model with DVC](/doc/dvclive/live/log_artifact) and enable managing
it with [DVC Studio Model Registry](/doc/studio/user-guide/model-registry).
it with the <abbr>model registry</abbr>.

<admon type="info">

Expand Down
4 changes: 2 additions & 2 deletions content/docs/start/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ Choose a trail to jump into its first chapter:
by only instrumenting your code, and collaborate on ML experiments like
software engineers do for code.

- **[Model Management]** - Use the DVC model registry to manage the lifecycle of
- **[Model Registry]** - Use the DVC model registry to manage the lifecycle of
your models in an auditable way. Easily access your models and integrate your
model registry actions into CICD pipelines to follow GitOps best practices.

[Data Management]: /doc/start/data-management/data-versioning
[Experiment Management]: /doc/start/experiments/experiment-tracking
[Model Management]: /doc/start/model-management/model-registry
[Model Registry]: /doc/start/model-registry/model-registry

<admon type="tip">

Expand Down
42 changes: 0 additions & 42 deletions content/docs/start/model-management/index.md

This file was deleted.

98 changes: 98 additions & 0 deletions content/docs/start/model-registry/add-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: 'Get Started: Add a model'
description: 'Start tracking model artifacts with DVC.'
---

# Get Started: Add a model

Just as we use experiment tracking to manage model development, it is a good
idea to keep a <abbr>model registry</abbr> to manage the lifecycle of the models
we get from our experiments. With DVC, we can start tracking models using our
Git repository, which will serve as the single source of truth for our model
registry and enable us to trigger automated CICD workflows.
[DVC Studio](/doc/studio) will then provide a model registry on top of the Git
repositories to
[manage all our models](/doc/start/model-registry/manage-models).

## Log a model artifact

All you need to start is a <abbr>DVC repository</abbr> and the
[DVCLive](/doc/dvclive) Python library installed:

```cli
$ pip install dvclive
```

Use the [`log_artifact`](/doc/dvclive/live/log_artifact) method to
<abbr>cache</abbr> the model with DVC and add it to the model registry (this
snippet is from the
[training script](https://github.com/iterative/example-get-started-experiments/blob/main/src/train.py)
in our example repository):

<admon type="info">

You can
[fork our example repository](https://github.com/iterative/example-get-started-experiments/fork)
and follow the
[installation steps](https://github.com/iterative/example-get-started-experiments#installation)
to set it up locally.

</admon>

```python
from dvclive import Live


with Live() as live:

...

live.log_artifact(
str("models/model.pkl"),
type="model",
name="pool-segmentation",
desc="This is a Computer Vision (CV) model that's segmenting out swimming pools from satellite images.",
labels=["cv", "segmentation", "satellite-images", params.train.arch],
)
```

<details id="push-click-to-see-how-artifacts-are-registered">

#### 💡 Expand to see how it works under the hood and other ways to add models

When we call the `log_artifact()` method, DVC takes all the information we
provide in the call and edits the `dvc.yaml` file which will now contain the
following lines:

```yaml
artifacts:
pool-segmentation:
path: models/model.pkl
type: model
desc:
This is a Computer Vision (CV) model that's segmenting out swimming pools
from satellite images.
labels:
- cv
- segmentation
- satellite-images
```

If you don't want to add the model from a Python script, you can manually edit
`dvc.yaml` files to add information about model artifacts.

</details>

## From model to registry

If you are building your own repository, you will need to:

1. Run the script
2. Commit it and the resulting `dvc.yaml` file to Git
3. Push the result to your Git remote (e.g., GitHub)

If you are
[following](/doc/start/model-registry/manage-models#follow-along-instructions)
our example repository then this has already been done and we can continue to
the next section to find out how to set up a <abbr>model registry</abbr> for all
your models.
49 changes: 49 additions & 0 deletions content/docs/start/model-registry/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: 'Get Started: Model Registry'
description:
'Get started with the DVC model registry to manage the lifecycle of your
models in an auditable way. Easily access your models and integrate your model
registry actions into CICD pipelines to follow GitOps best practices.'
---

# Get Started: Model Registry

https://www.youtube.com/watch?v=T7MBFpnSr9Q

## Chapters

- **[Add a model]** - Start tracking model artifacts with DVC.

- **[Manage models in a central registry]** - Manage models, their versions and
lifecycle stages in a git-based model registry.

- **[Use and deploy models]** - Easily download your models from the model
registry. Set up your CICD pipelines to be trigger by model registry actions
(such as assigning model stages) and deploy models directly form the model
registry.

[Add a model]: /doc/start/model-registry/add-model
[Manage models in a central registry]: /doc/start/model-registry/manage-models
[Use and deploy models]: /doc/start/model-registry/model-cicd

<admon type="info">

These are captured in our [example-get-started-experiments] repo. You can [fork
it][example-get-started-experiments-fork] to follow along, or you can take a
look at our
[public model registry](https://studio.iterative.ai/team/Iterative/models) (read
only) to get a feel for what's possible.

[example-get-started-experiments]:
https://github.com/iterative/example-get-started-experiments
[example-get-started-experiments-fork]:
https://github.com/iterative/example-get-started-experiments/fork

</admon>

## Where To Go Next

Pick a page from the list above, the left-side navigation bar, or just click
`NEXT` below!

Click [here](/doc/start/) to jump back to the Get Started landing page.
Loading
Loading