aitune.torch.tuning
Main tune function.
Module Contents
Functions
Data
API
Activate all tuned modules after tuning is complete.
Clear the cache.
Validate and normalize batch sizes for tuning.
Load the tuned module from a file.
If storage is not provided, a default storage will be used. Check save function for more details.
Parameters:
The module to load.
The path to load the module from.
The storage to use to load the module. If not provided, a local storage will be used.
The device map to load modules to. Overrides the device of stored in state dict.
If True, libraries logging will be suppressed.
Save the tuned module to a file.
If storage is not provided, a default storage will be used.
If you would like to save the module to a different folder, you can use the storage parameter.
For example, if you want to save the module to the ckpt folder, you can do the following:
Parameters:
The module to save.
The path to save the module to.
The storage to use to save the module. If not provided, a local storage will be used.
Tune a callable which runs inference on a pipeline or a model.
Parameters:
The function to tune.
The dataset to tune on. It can be DataLoaderFactory or any dataset/iterable and even torch.Tensor. Tensor will be treated as a single sample dataset.
The batch sizes to use for tuning. At least 2 different batch sizes are required for determining batch axis.
The maximum number of batches to use for tuning per batch size.
The device to use for tuning.
If True, only dry run the tuning.
If True, libraries logging will be suppressed.
If True, the cache will be cleared before tuning.
If True, failing modules will be ignored and tuning will continue.