A Gradient Workflow is composed of a series of steps. These steps specify how to orchestrate computational tasks. Each step can communicate with other steps through what are known as inputs and outputs.
There are three types of inputs and outputs. Understanding how these function will help you craft concise and elegant Workflows.
The dataset type leverages the Gradient platform native dataset primitive. Information stored within datasets is not limited to any single type of data. In fact, a generic dataset can include anything from pretrained models to generated images to configuration files. Inherent to datasets is the notion of versions. Workflows can consume and produce new dataset versions as well as tag new versions of existing datasets.
my-dataset-id can be the actual ID of the dataset, a 15 character string that looks like def123ghi456jkl (or appended with a version ID too), or a name for the dataset.
Unlike, e.g., GitHub Actions, it is likely that multiple Gradient Steps/Actions will execute on multiple compute nodes. To facilitate the passing of data between these nodes, Gradient Actions expose the notion of volumes and volume passing.
Volumes enable actions such as the @git-checkout action. Volumes can be defined as input volumes or output volumes or both. When a volume is an output it is mounted in /outputs and is writeable. When a volume is an input it is mounted in /inputs and is read only.
Note: Volumes are limited to 5GB of data currently. If you need more space we recommend using Datasets.
Here is how you would define an output volume:
In this example a volume is first created as an output and then used as an input in a subsequent job step:
Scenario 3: Creating a model from a dataset and passing the model ID as a string to a Deployment step
NOTE: There is no native Gradient Actions for Model Deployments today. Instead, you can use the Gradient SDK to create and manage your inference endpoints.
To run this example you will need to a) create a dataset named test-model and upload valid TensorFlow model files to it; b) define a secret named MY_API_KEY with your gradient-cli api-key; c) substitute your clusterId in the deployment create step.