nnpd.core.runner

Plan first; train and cache models; analyze saved models with separate analysis settings.

Attributes

Classes

Job

Functions

expand_jobs(→ list[Job])

Validate every training alternative, and the analysis of each, before anything runs.

infeasible(→ dict[str, list[str]])

Configurations whose analysis would exceed the configured limits, with the reasons.

check_feasible(→ None)

Refuse the whole launch before anything is computed if any configuration cannot be analyzed.

plan(→ list[Job])

What run would train, with each model's analysis workload; computes nothing.

analyze_run(→ dict)

Compute the selected metrics and plots of one run, replacing earlier ones. Never trains.

save_references(→ None)

execute(→ list[pathlib.Path])

Train, analyze, or both, from the settings files in settings_dir; the CLI does the same.

restore(→ nnpd.core.api.Context)

Open a saved run, with the analysis settings it was analyzed with, on any supported device.

verify_store(→ int)

Recompute all saved artifact checksums; raises on the first damaged file.

Module Contents

nnpd.core.runner.TRAINING_FILE = 'settings_training.py'
nnpd.core.runner.ANALYSIS_FILE = 'settings_analysis.py'
nnpd.core.runner.KEEP_SETTINGS = 3
nnpd.core.runner.STAGES = ('train', 'run', 'analyze')
class nnpd.core.runner.Job
settings: dict
member: dict
changed: str | None
workload: dict
property id: str
as_dict() → dict
nnpd.core.runner.expand_jobs(training_settings: dict, experiment: nnpd.core.api.Experiment, analysis_settings: dict | None = None, analysis: nnpd.core.api.Analysis | None = None) → list[Job]

Validate every training alternative, and the analysis of each, before anything runs.

nnpd.core.runner.infeasible(jobs: list[Job]) → dict[str, list[str]]

Configurations whose analysis would exceed the configured limits, with the reasons.

nnpd.core.runner.check_feasible(jobs: list[Job]) → None

Refuse the whole launch before anything is computed if any configuration cannot be analyzed.

nnpd.core.runner.plan(profile: str | None = None, settings_dir: str | pathlib.Path = '.') → list[Job]

What run would train, with each model’s analysis workload; computes nothing.

nnpd.core.runner.analyze_run(context: nnpd.core.api.Context) → dict

Compute the selected metrics and plots of one run, replacing earlier ones. Never trains.

nnpd.core.runner.save_references(context: nnpd.core.api.Context) → None
nnpd.core.runner.execute(stage: str = 'run', *, profile: str | None = None, settings_dir: str | pathlib.Path = '.') → list[pathlib.Path]

Train, analyze, or both, from the settings files in settings_dir; the CLI does the same.

‘train’ trains the models of settings_training.py and resets their analysis. ‘analyze’ analyzes the latest trained models with settings_analysis.py; it never trains. ‘run’ does both. ‘jobs’: torchrun workers process disjoint runs; ‘ddp’: workers train each model together and only rank zero analyzes. After success, runs of earlier settings are removed, the cache keeps what the last KEEP_SETTINGS trainings used, and the settings files are copied into the output folder.

nnpd.core.runner.restore(run_dir: str | pathlib.Path, *, device: str = 'cpu') → nnpd.core.api.Context

Open a saved run, with the analysis settings it was analyzed with, on any supported device.

nnpd.core.runner.verify_store(root: str | pathlib.Path) → int

Recompute all saved artifact checksums; raises on the first damaged file.