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.
Results live under runs/phasesweep_starter/ beside the config, including run.log. show-winners prints concise phase winners, the generation directory, and publication state; finished phases appear as unpublished while later phases run. 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'
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
- Configuration guide and per-key reference.
- Minimal configuration: one toy-trainer attempt from the checkout root.
- Runtime: outputs, locks, leases, supervision, fingerprints, and resume.
- MCP operator reference: catalog fields, tools, authorization, run state, and recovery.
- Toy experiment and MCP catalog: checkout-local examples with MCP state and outputs under
/tmp. - Tiny Decoder Enwik8: real-trainer integration.
- Durability invariants: ledger, publication, and recovery rules, with their tests.
- Development: contributor setup, quality gates, and declined requests.
License
MIT. See LICENSE.
Metadata
Release files for phasesweep 0.3.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| phasesweep-0.3.13.tar.gz | 2.6 MB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| phasesweep-0.3.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.2 MB
Release files / phasesweep-0.3.13.tar.gz
| Download URL | phasesweep-0.3.13.tar.gz |
|---|---|
| Size | 2.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71e6bf26a07f9dd407be44c234f16cfb8490b974a14b2e77badc8894002f9136
|
|
BLAKE2b-256 checksum How to use checksums |
2b5ae094048174d715f1facef16aee7b0428b2c4d676d08a90e72b9734f66ab9
|
| 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 25, 2026.
Transparency logRelease files / phasesweep-0.3.13-py3-none-any.whl
| Download URL | phasesweep-0.3.13-py3-none-any.whl |
|---|---|
| Size | 536.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
811fa6126228c64a7f15f7449e2d08a49c846afcf1447ebe4f7c3f51ceb57ca2
|
|
BLAKE2b-256 checksum How to use checksums |
a1077a8a0ac04afd454cb6e5f05a5f52afe7e7a5c5179b5a2611bed6d59acfaa
|
| 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 25, 2026.
Transparency logSecurity for phasesweep 0.3.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for phasesweep-0.3.13.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 25, 2026.
Transparency logA 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.