Skip to main content

PhaseSweep

PhaseSweep runs hyperparameter sweeps in ordered phases: choose model depth, then tune learning rate with the winning depth fixed, then regularization. One YAML file holds your trainer configuration, objective, and search plan. Each trial receives a complete trainer input with inherited, fixed, and sampled values applied.

Requires Python 3.11+ and Linux or macOS. GPUs are optional; the starter uses a packaged toy trainer. The project is unstable, so review the launch contract before using your own trainer.

Install and try it

Install from PyPI:

pip install phasesweep
phasesweep --version

mkdir phasesweep-demo && cd phasesweep-demo
phasesweep init                     # writes starter.yaml without overwriting files
phasesweep validate starter.yaml    # checks the config without launching work
phasesweep run starter.yaml         # runs four toy-trainer trials
phasesweep show-winners starter.yaml
phasesweep status starter.yaml --trials

The starter compares two depths, then two learning rates. Its run.log includes these winner lines (abridged; trial numbers depend on grid order):

phase=depth WINNER trial=0 metric=0.3 params={'model.n_layers': 8}
phase=learning_rate WINNER trial=0 metric=0.3 params={'optimizer.lr': 0.0003}

The depth winner's model.n_layers: 8 becomes a fixed input to every learning-rate trial. Inheritance transfers parameter values; the trainer owns initialization and checkpoint loading. The complete starter YAML and phase composition guide explain the configuration and its tradeoffs.

PhaseSweep phase DAG

Results live under runs/phasesweep_starter/ beside the config, including run.log. show-winners prints the validated generation directory and winners; status --trials inspects recorded attempts. See inspection commands for the output.

Use your own trainer

phasesweep init --list lists the templates. Replace the command, configuration keys, and objective extractor in the closest template:

Configure Choices and details
Trainer input Complete YAML, command-line flags, Hydra overrides, or nested JSON: input interfaces.
Objective Python report_objective(...), the phasesweep report-objective command, JSON, logs, W&B, or MLflow: reporting and extractors.
Environment execution.cwd, env, and execution.inherit_env: trainer contract.

Preview commands and the launch contract before training. Configuration errors name the relevant keys; explain gives their types, defaults, interactions, and warnings:

phasesweep run starter.yaml --dry-run
phasesweep explain
phasesweep explain 'phases[].sampler'

The inspection guide covers inherited placeholders and preview limits.

W&B and MLflow require their optional extras, phasesweep[wandb] and phasesweep[mlflow]; follow the W&B setup or MLflow guide. For noisy measurements, see small-budget advice and repeats.

Scope and continuation

PhaseSweep drives Optuna's grid, random, TPE, and CMA-ES samplers on one host, with an Optuna journal for persistent trials. GPU trials can run in parallel on that host; distributed sweeps and early pruning are outside its scope.

Apple silicon Macs discover one MPS device for same-host leasing, and the trainer selects its compute device. See GPU isolation.

With persistent storage, rerun the same config to resume interrupted work. Continuation and reruns covers aborted phases, trial budgets, and --from-phase NAME.

Connect an agent

The optional MCP server exposes experiments approved in an operator-owned catalog. Tool responses omit config and storage paths, trainer commands, environment values, and raw logs; sampled winner values follow visible_params. MCP setup covers installation, catalog permissions, client configuration, and verification. phasesweep mcp call invokes one tool from a shell without a client.

Reference

Ask DeepWiki

License

MIT. See LICENSE.

Metadata

Release files for phasesweep 0.3.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phasesweep 0.3.11
File Size Uploaded Provenance
phasesweep-0.3.11.tar.gz 2.6 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for phasesweep 0.3.11
File Interpreter ABI Platform
phasesweep-0.3.11-py3-none-any.whl Python 3 none any Details

Total release size: 3.1 MB

Release files / phasesweep-0.3.11.tar.gz

Download URL phasesweep-0.3.11.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
ae10f570360857a52ef2473c42f333a8598dd24623c11443c92bdf0e005491b5
BLAKE2b-256 checksum
How to use checksums
2a5ee569e902fa81fe05e3c8c24ed1163de07c9ff0c1849e6ead12d21f4588a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / phasesweep-0.3.11-py3-none-any.whl

Download URL phasesweep-0.3.11-py3-none-any.whl
Size 511.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c82c784d5410dc14716b40b60f5fded42db9fc1264c0f5036fe153a3f6ac5d8
BLAKE2b-256 checksum
How to use checksums
5ae4c7aaf94fce0dacbe79d23e2986f89021a1eb5f186f47be51159ec62e8526
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for phasesweep 0.3.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for phasesweep-0.3.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page