Tasks are sets of interconnected executions, designed for running the same step with varying parameters and input data values.
One of the most common use cases for tasks is hyperparameter optimization. In this scenario, you execute a single step multiple times, each with distinct parameter configurations, to identify the most optimal setup for your neural network, encompassing its layout, weights, and biases.
Tasks can be generated for any step that has defined parameters.
How does a Task work?
When you launch a Task, Valohai will initiate a series of executions to conduct the search/optimization. Each execution will have a distinct combination of parameter values, determined by the ranges and types you provided.
Valohai efficiently manages the queueing of these executions, spawns virtual machines for job execution, and scales down the machines when they are no longer needed.
Keep in mind that a Task is essentially a collection of related executions, and you can find all the individual executions on the “Executions” tab of your project.
Use cases
Tasks serve several common purposes:
Parameter Sweeps (Grid, Random, Manual)
Tasks enable you to effortlessly conduct parameter sweeps using Grid or Random Search methods. Define the parameter values you want to test, and Valohai will handle the scheduling and execution of these parameterized jobs. Additionally, you can employ Manual search to specify parameter combinations for manual execution.
Bayesian Optimization
Valohai offers native support for Bayesian optimization through tools like Optuna and HyperOpt. To utilize Bayesian optimization:
- Indicate the metric you intend to optimize.
- Define the target value.
- Specify parameter details.
Training Multiple Models on Different Datasets
- Suppose you need to train 100 models, each on data from 100 different merchant stores, where each store has its data in S3 (e.g.,
s3://bucket/data/stores/store-335/data/*
, wherestore-335
represents a store’s ID). - You can define a parameter, e.g.,
store-id
, and create a Task where you provide 100 different values forstore-id
. Set your input data URL ass3://bucket/data/stores/{parameter:store-id}/data/*
. - Each execution within the Task will independently download its corresponding data from S3 and train its unique model concurrently, streamlining the process.