Skip to content

0.55.0

Compare
Choose a tag to compare
@safoinme safoinme released this 23 Jan 12:04
· 707 commits to main since this release
734b205

This release comes with a range of new features, bug fixes and documentation updates. The most notable changes are the ability to do lazy loading of Artifacts and their Metadata and Model and its Metadata inside the pipeline code using pipeline context object, and the ability to link Artifacts to Model Versions implicitly via the save_artifact function.

Additionally, we've updated the documentation to include a new starter guide on how to manage artifacts, and a new production guide that walks you through how to configure your pipelines to run in production.

Breaking Change

The ModelVersion concept was renamed to Model going forward, which affects code bases using the Model Control Plane feature. This change is not backward compatible.

Pipeline decorator

@pipeline(model_version=ModelVersion(...)) -> @pipeline(model=Model(...))

Old syntax:

from zenml import pipeline, ModelVersion

@pipeline(model_version=ModelVersion(name="model_name",version="v42"))
def p():
  ...

New syntax:

from zenml import pipeline, Model

@pipeline(model=Model(name="model_name",version="v42"))
def p():
  ...

Step decorator

@step(model_version=ModelVersion(...)) -> @step(model=Model(...))

Old syntax:

from zenml import step, ModelVersion

@step(model_version=ModelVersion(name="model_name",version="v42"))
def s():
  ...

New syntax:

from zenml import step, Model

@step(model=Model(name="model_name",version="v42"))
def s():
  ...

Acquiring model configuration from pipeline/step context

Old syntax:

from zenml import pipeline, step, ModelVersion, get_step_context, get_pipeline_context

@pipeline(model_version=ModelVersion(name="model_name",version="v42"))
def p():
  model_version = get_pipeline_context().model_version
  ...

@step(model_version=ModelVersion(name="model_name",version="v42"))
def s():
  model_version = get_step_context().model_version
  ...

New syntax:

from zenml import pipeline, step, Model, get_step_context, get_pipeline_context

@pipeline(model=Model(name="model_name",version="v42"))
def p():
  model = get_pipeline_context().model
  ...

@step(model=Model(name="model_name",version="v42"))
def s():
  model = get_step_context().model
  ...

Usage of model configuration inside pipeline YAML config file

Old syntax:

model_version:
  name: model_name
  version: v42
  ...

New syntax:

model:
  name: model_name
  version: v42
  ...

ModelVersion.metadata -> Model.run_metadata

Old syntax:

from zenml import ModelVersion

def s():
  model_version = ModelVersion(name="model_name",version="production")
  some_metadata = model_version.metadata["some_metadata"].value
  ... 

New syntax:

from zenml import Model

def s():
  model = Model(name="model_name",version="production")
  some_metadata = model.run_metadata["some_metadata"].value
  ... 

Those using the older syntax are requested to update their code accordingly.

Full set of changes are highlighted here: #2267

What's Changed

New Contributors

Full Changelog: 0.54.1...0.55.0