qat.core.config.session module

class QatSessionConfig(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _cli_shortcuts=None, _secrets_dir=None, **values)

Bases: QatConfig

Configuration for QAT() sessions extending qat.purr.qatconfig configuration.

>>> import os
>>> os.environ["QAT_MAX_REPEATS_LIMIT"] = "654321"
>>> QatSessionConfig() 
QatSessionConfig(MAX_REPEATS_LIMIT=654321, ...)
>>> QatSessionConfig(MAX_REPEATS_LIMIT=123) 
QatSessionConfig(MAX_REPEATS_LIMIT=123, ...)
>>> del os.environ["QAT_MAX_REPEATS_LIMIT"]
>>> qatconfig = QatSessionConfig()
>>> qatconfig.MAX_REPEATS_LIMIT = 16000
>>> qatconfig 
QatSessionConfig(MAX_REPEATS_LIMIT=16000, ...)
>>> QatSessionConfig(MAX_REPEATS_LIMIT=100.5) 
Traceback (most recent call last):
...
pydantic_core._pydantic_core.ValidationError
...
Input should be a valid integer, got a number with a fractional part

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

COMPILE: list[PipelineInstanceDescription | UpdateablePipelineDescription | PipelineFactoryDescription | CompilePipelineDescription] | None

QAT Pipelines for compilation to add on start-up, None adds default pipelines

ENGINES: list[EngineDescription]

QAT Engines to add on start-up

EXECUTE: list[PipelineInstanceDescription | UpdateablePipelineDescription | PipelineFactoryDescription | ExecutePipelineDescription] | None

QAT Pipelines for execution to add on start-up, None adds default pipelines

EXTENSIONS: list[ImportString]

QAT Extensions to initialise on start-up

HARDWARE: list[HardwareLoaderDescription]

QAT Hardware Models to load on start-up

PIPELINES: list[PipelineInstanceDescription | UpdateablePipelineDescription | PipelineFactoryDescription | PipelineClassDescription] | None

QAT Pipelines for compilation and execution to add on start-up, None adds default pipelines

classmethod from_yaml(path)
load_extensions()
classmethod matching_engines(pipelines, info)
classmethod matching_hardware_loaders(pipelines, info)
model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_shortcuts': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': '_', 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'QAT_', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_assignment': True, 'validate_default': True, 'yaml_config_section': None, 'yaml_file': 'qatconfig.yaml', 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod no_duplicate_names(val, info)

Checks that there are no duplicate names in the list of descriptions.

classmethod no_duplicate_pipeline_names(val, info)

For each of the PIPELINES, COMPILE, and EXECUTE fields, this checks that there are no duplicate names in the list of descriptions. Also checks there are no shared names between PIPELINES and COMPILE/EXECUTE.

classmethod one_default(values)

Ensures that exactly one PIPELINE is marked as default, or alternatively, one of COMPILE and EXECUTE pipelines is marked as default.

Return type:

dict