aitune.torch.config

View as Markdown

Inplace configuration.

Module Contents

Classes

NameDescription
AITuneConfigAITune configuration.
AITuneModeAITune execution mode used for tuning.

Functions

NameDescription
aitune_cache_dirConfigure cache dir location based on environment variable.

Data

DEFAULT_DEVICE

DEFAULT_DEVICE_AFTER_TUNING

DEFAULT_MAX_NUM_SAMPLES_STORED

DEFAULT_MIN_NUM_SAMPLES

DEFAULT_TUNING_DATA_OUTPUT_PATH

config

API

class aitune.torch.config.AITuneConfig()

AITune configuration.

_cache_dir
Path = aitune_cache_dir()
_min_num_samples
int = DEFAULT_MIN_NUM_SAMPLES
_tuning_data_output_path
Path
cache_dir
Path

Get the cache directory.

device_after_tuning
str = DEFAULT_DEVICE_AFTER_TUNING
enable_diffusers_integration
bool = AITUNE_DIFFUSERS_INTEGRATION
enable_transformers_integration
bool = AITUNE_TRANSFORMERS_INTEGRATION
max_num_samples_stored
int | float = DEFAULT_MAX_NUM_SAMPLES_STORED
min_num_samples
int

Get the minimum number of samples to collect before optimizing.

strict_mode
bool = True
tuning_data_output_path
Path

Get the output path for tuning data.

aitune.torch.config.AITuneConfig.to_dict() -> dict[str, typing.Any]

Return all configuration attributes keyed by their public name.

class aitune.torch.config.AITuneMode

Bases: enum.Enum

AITune execution mode used for tuning.

DECLARATIVE
= 'DECLARATIVE'
JIT
= 'JIT'
aitune.torch.config.aitune_cache_dir() -> pathlib.Path

Configure cache dir location based on environment variable.

Returns: Path

Cache dir from AITUNE_CACHE_DIR environment variable, or default.

aitune.torch.config.DEFAULT_DEVICE = 'cuda:0'
aitune.torch.config.DEFAULT_DEVICE_AFTER_TUNING = 'meta'
aitune.torch.config.DEFAULT_MAX_NUM_SAMPLES_STORED = 1
aitune.torch.config.DEFAULT_MIN_NUM_SAMPLES = 100
aitune.torch.config.DEFAULT_TUNING_DATA_OUTPUT_PATH = _AITUNE_CACHE_DIR / 'tuning_data' / 'report.json'
aitune.torch.config.config = AITuneConfig()