LEIP Pipeline
LEIP Pipeline is a single command or Python function call that allows you to execute one or more LEIP tasks sequentially. These operate on one or more models, and the input of each task may be the output of a previous task. The definition of each task and its configuration parameters is provided through a file in YAML or JSON format. This lets you easily group all the configuration of commands that you want to apply to your models and easily share it with anyone to run.
The configuration file is organized as a list of tasks. Each task defines its input source, options for a model, and options for an operation among Optimize, Compile, Package, Evaluate, Run, and Zoo Download.
Variables in Configuration
Any string value in the configuration of a LEIP Pipeline task may contain variables that get replaced by a value before executing the task. The types of variables are:
$VAR{<var-name>}
or$<var-name>
: a variable provided as environment variable or in the pipeline call. For example:$VAR{model_id}
or$model_id
.$TASK_OUTPUT{<task-name>:<task-type>}
: output path of a previous task. For example:$TASK_OUTPUT{myname:compile}
.
CLI Usage
The basic command is as follows:
leip pipeline --input_path inputModel/ \
--output_path pipelineOutputs/ \
--config_path config.yaml
Here the --input_path
argument maps to the $VAR{input_path}
variable in the configuration.
Refer to the CLI Reference for LEIP Pipeline for a detailed explanation of each option.
Here is a JSON schema that you can use to validate your configurations regardless of whether they are in JSON or YAML format:
We have provided several YAML configurations for you to download if you choose to use YAML for your configuration file: