Step Operators

How to execute individual steps in specialized environments

This is an older version of the ZenML documentation. To read and view the latest version please visit this up-to-date URL.

The step operator enables the execution of individual pipeline steps in specialized runtime environments that are optimized for certain workloads. These specialized environments can give your steps access to resources like GPUs or distributed processing frameworks like Spark.

Comparison to orchestrators: The orchestrator is a mandatory stack component that is responsible for executing all steps of a pipeline in the correct order and provide additional features such as scheduling pipeline runs. The step operator on the other hand is used to only execute individual steps of the pipeline in a separate environment in case the environment provided by the orchestrator is not feasible.

When to use it

A step operator should be used if one or more steps of a pipeline require resources that are not available in the runtime environments provided by the orchestrator. An example would be a step that trains a computer vision model and requires a GPU to run in reasonable time, combined with a Kubeflow orchestrator running on a kubernetes cluster which does not contain any GPU nodes. In that case it makes sense to include a step operator like SageMaker, Vertex or AzureML to execute the training step with a GPU.

Step Operator Flavors

Step operators to execute steps on one of the big cloud providers are provided by the following ZenML integrations:

Step OperatorFlavorIntegrationNotes

sagemaker

aws

Uses SageMaker to execute steps

vertex

gcp

Uses Vertex AI to execute steps

azureml

azure

Uses AzureML to execute steps

spark

spark

Uses Spark on Kubernetes to execute steps in a distributed manner

custom

Extend the step operator abstraction and provide your own implementation

If you would like to see the available flavors of step operators, you can use the command:

zenml step-operator flavor list

How to use it

You don't need to directly interact with any ZenML step operator in your code. As long as the step operator that you want to use is part of your active ZenML stack, you can simply specify it in the @step decorator of your step:

from zenml.steps import step

@step(custom_step_operator=<STEP_OPERATOR_NAME>)
def my_step(...) -> ...:
    ...

Specifying per-step resources

If some of your steps require additional hardware resources, you can specify them on your steps as described here.

Last updated