Skip to content

Configs

dnallm.configuration.configs

Classes

BenchmarkConfig

Bases: BaseModel

Top-level configuration for the DNA Large Language Model benchmark. This class validates and structures the entire YAML configuration file, where each top-level key in the YAML corresponds to an attribute of this class.

BenchmarkInfoConfig

Bases: BaseModel

Configuration for the benchmark's metadata.

CallbackConfig

Bases: BaseModel

Configuration for training callbacks.

Only predefined callbacks are supported in Phase 2. Custom callbacks are deferred to v2.

DNALLMConfig

Bases: TypedDict

Per-section configuration map returned by load_config.

Every key is optional (total=False): load_config fills a key only when the YAML file carries that section, and a minimal task+model YAML is legal. model intentionally stays a plain dict — the loader passes it through unvalidated. config_path is NOT a configs key; it is injected only into the raw YAML dict consumed by BenchmarkConfig.

DatasetConfig

Bases: BaseModel

Configuration for a single dataset used in the benchmark.

EarlyStoppingConfig

Bases: BaseModel

Configuration for early stopping callback.

EvaluationConfig

Bases: BaseModel

Configuration for the evaluation phase of the benchmark.

HeadConfig

Bases: BaseModel

Configuration for the classification/regression head

HyperparameterSearchConfig

Bases: BaseModel

Configuration for Optuna hyperparameter search.

Ia3Config

Bases: BaseModel

Configuration for IA³ (Infused Adapter by Inhibiting and Amplifying Inner Activations), mirroring peft's IA3Config field set (peft 0.21.1 surface).

Fields pass through into peft.tuners.ia3.IA3Config; the FFN subset is the explicit feedforward_modules list (peft has no feedforward-only boolean — D-01/D-18), and peft enforces feedforward_modules ⊆ target_modules at construction time.

InferenceConfig

Bases: BaseModel

Configuration for model inference

LoraConfig

Bases: BaseModel

Configuration for LoRA (Low-Rank Adaptation).

Compatible with both standard LoRA and QLoRA (4-bit quantization). When use_qlora=True, the base model is loaded in 4-bit and LoRA adapters are applied via prepare_model_for_kbit_training().

ModelConfig

Bases: BaseModel

Configuration for a single model to be benchmarked.

OutputConfig

Bases: BaseModel

Configuration for generating benchmark reports and artifacts.

SearchSpaceDistribution

Bases: BaseModel

A single hyperparameter distribution for Optuna search.

Supports both explicit type declaration and concise HF-like format.

SweepConfig

Bases: BaseModel

Configuration for the multi-seed sweep protocol with uncertainty aggregation.

Field-complete scaffold for the sweep runner; the aggregation utilities land with the sweep module in a later phase.

TaskConfig

Bases: BaseModel

Configuration for different fine-tuning tasks

TrainingConfig

Bases: BaseModel

Configuration for training

Methods:
reject_ia3_with_qlora
reject_ia3_with_qlora()

Reject the use_ia3 x use_qlora combination at config-load time.

peft only raises when merging IA³ vectors on a 4-bit quantized model (version-dependent foreign errors); rejecting here surfaces a matchable dnallm error before any training starts.

VepConfig

Bases: BaseModel

Configuration for zero-shot variant effect prediction (VEP).

Field-complete scaffold for the VEP module; the scoring kernels and the token-slot alignment rule land with the module itself in a later phase.

Functions:

load_config

load_config(config_path)

Load configuration from a YAML file and return a dictionary of configuration objects. Args: config_path (str): Path to the YAML configuration file.