Runner Configuration¶
The runner configuration is a Chanfig config hierarchy. The top-level Config controls experiment behavior; nested
config classes describe datasets, dataloaders, model construction, optimization, scheduling, and EMA.
multimolecule.runner.config.Config
¶
Bases: RunnerConfig
Top-level runner configuration.
Extends dl.RunnerConfig with MultiMolecule defaults and validation. The runner
accepts either a fully-constructed Config instance or any mapping that this class can be built from.
The name attribute is auto-derived in [post][multimolecule.runner.Config.post] from the pretrained
identifier, optimizer settings, and seed when the user does not set it explicitly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Base random seed. |
required | |
|
When |
required | |
|
Registry key resolved through |
required | |
|
Alias for |
required | |
|
Pretrained backbone identifier (Hugging Face Hub repo or local path). Copied into
|
required | |
|
When |
required | |
|
Training step budget. Mutually exclusive with |
required | |
|
Training epoch budget. Defaults to
[ |
required | |
|
Dataset configuration. A bare string is promoted to |
required | |
|
DataLoader configuration. |
required | |
|
Model configuration. |
required | |
|
Optimizer configuration. |
required | |
|
Learning rate scheduler configuration. |
required | |
|
Optional EMA configuration. |
required | |
|
Whether to allow TF32 matmul / cuDNN kernels on Ampere+ GPUs. |
required | |
|
Whether to allow reduced-precision reductions for fp16 / bf16 matmul accumulators. |
required |
Source code in multimolecule/runner/config.py
| Python | |
|---|---|
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | |
multimolecule.runner.config.DataConfig
¶
Bases: Config
Dataset configuration for the runner.
data accepts either a string (treated as root) or a mapping (parsed into this class). The runner resolves
root to either a local directory or a Hugging Face dataset ID and uses the split keys below to locate files;
when none are given for a local dataset, splits are discovered with Hugging Face’s standard data-file patterns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Dataset root. Either a local directory containing split files or a Hugging Face Hub dataset ID such as
|
required | |
|
Training split file (local) or split name (Hugging Face). |
required | |
|
Validation split file (local) or split name (Hugging Face).
|
required | |
|
Alias for |
required | |
|
Alias for |
required | |
|
Test split file (local) or split name (Hugging Face). |
required | |
|
Inference split file (local) or split name (Hugging Face). |
required | |
|
Alias for |
required | |
|
Columns to treat as biological sequences. Forwarded to |
required | |
|
Non-sequence input columns retained alongside |
required | |
|
Label columns. Task metadata (level / type / num_labels) is inferred per column and one head is built per label. |
required | |
|
Single-label shortcut; promoted to |
required | |
|
Columns to drop before training. |
required | |
|
Whether to truncate sequences longer than |
required | |
|
Maximum sequence length in tokens. |
required | |
|
Optional sub-sampling fraction (float in |
required |
Source code in multimolecule/runner/config.py
multimolecule.runner.config.DataloaderConfig
¶
Bases: Config
DataLoader configuration.
Additional keys are forwarded to torch.utils.data.DataLoader through the
underlying DanLing dataloader builder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Per-process batch size. |
required | |
|
Number of worker processes used to load batches. |
required |
Source code in multimolecule/runner/config.py
multimolecule.runner.config.NetworkConfig
¶
Bases: Config
Model configuration consumed by MODELS.build.
network.backbone.sequence is the only required sub-tree; the runner populates backbone.sequence.name and
backbone.sequence.use_pretrained from top-level pretrained / use_pretrained when those keys are not already
set. One head is added to network.heads for each task inferred from the dataset labels, with user-provided
head settings (e.g. dropout, hidden_size) preserved through merge-without-overwrite.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Backbone configuration. Must contain a |
required | |
|
Per-task head configuration. Each entry is merged with the task metadata
( |
required | |
|
Optional neck applied between backbone and heads. |
required |
Source code in multimolecule/runner/config.py
multimolecule.runner.config.OptimConfig
¶
Bases: Config
Optimizer configuration.
Forwarded to [dl.OPTIMIZERS.build][danling.OPTIMIZERS] after popping pretrained_ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Optimizer name registered in [ |
required | |
|
Base learning rate applied to newly initialised parameters (heads, necks, …). |
required | |
|
Base weight decay applied to newly initialised parameters. |
required | |
|
Multiplier applied to |
required |
Source code in multimolecule/runner/config.py
multimolecule.runner.config.SchedulerConfig
¶
Bases: Config
Learning rate scheduler configuration.
Forwarded to DanLing’s scheduler builder. Common warmup keys (warmup_ratio, warmup_steps, …) are accepted
and passed through unchanged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Scheduler name. |
required | |
|
Target learning rate at the end of training. |
required |
Source code in multimolecule/runner/config.py
multimolecule.runner.config.EmaConfig
¶
Bases: Config
Exponential moving average configuration.
When enabled, the runner instantiates an ema_pytorch.EMA wrapper around the trained model and uses it for
evaluation and inference. Remaining fields are forwarded to EMA unchanged.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Whether EMA is active. |
required | |
|
Coerce EMA weights to the online model’s dtype. |
required | |
|
EMA decay. |
required | |
|
Skip EMA updates until this many optimizer steps have elapsed. |
required | |
|
Run an EMA update once every N optimizer steps. |
required | |
|
If set, periodically copy EMA weights back onto the online model. |
required | |
|
Mixing factor for the periodic EMA-to-online copy. |
required |