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.

PhaseSweep phase DAG

Requires Python 3.11+ and Linux or macOS. GPUs are optional; the starter uses a packaged toy trainer. The project is unstable: a release can change ledger and artifact formats, and data in an older format is refused.

Install and try it

Install from PyPI and check that the command runs:

pip install phasesweep
phasesweep --version

The demo runs four trials of the packaged toy trainer, which needs no GPU and takes a few seconds, and writes its results under runs/ in the new directory:

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 the four trials
phasesweep status starter.yaml --trials   # lists every recorded trial and marks each winner
phasesweep show-winners starter.yaml      # prints each phase's full winner record

The starter compares two depths, then two learning rates. status --trials then prints (the generation ID and durations vary):

experiment phasesweep_starter: winner (*) marks published generation 6413d5c1edd5475998cfadd4d3b59980

=== depth === (2 trials)
winner generation: 6413d5c1edd5475998cfadd4d3b59980 (published)
trial  state     value  params            duration_s  winner
    0  COMPLETE    0.3  model.n_layers=8         0.5  *
    1  COMPLETE    0.5  model.n_layers=6         0.5

=== learning_rate === (2 trials)
winner generation: 6413d5c1edd5475998cfadd4d3b59980 (published)
trial  state              value  params               duration_s  winner
    0  COMPLETE             0.3  optimizer.lr=0.0003         0.5  *
    1  COMPLETE  0.413822345853  optimizer.lr=0.0001         0.5

The depth winner's model.n_layers: 8 becomes a fixed input to every learning-rate trial: phases inherit parameter values, not weights. 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 adds the generation directory and publication state to each winner record; finished phases appear as unpublished while later phases run. 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.

Before training, run --dry-run prints the trainer command, environment and working directory and each phase's trial count without launching anything. 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.

On Apple silicon Macs, trials share the one MPS device and run one at a time. 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

With the optional MCP server, an agent can list the experiments in a catalog you write, launch and monitor a run where the catalog permits it, and read each phase's winner. Create and check a catalog beside the config:

pip install "phasesweep[mcp]"
phasesweep mcp init-catalog --from ./starter.yaml   # writes catalog.yaml; every entry starts read-only
phasesweep mcp check --catalog catalog.yaml         # validates it without launching anything

MCP setup covers permissions, client configuration, and verification. Tool responses omit config and storage paths, trainer commands, environment values, and raw logs; sampled winner values follow visible_params. 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.14

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.14
File Size Uploaded Provenance Actions
phasesweep-0.3.14.tar.gz 2.8 MB With provenance Details for phasesweep-0.3.14.tar.gz

Built distribution (wheel)

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

Total release size: 3.3 MB

Release files / phasesweep-0.3.14.tar.gz

Download URL phasesweep-0.3.14.tar.gz
Size 2.8 MB
Tags Source
SHA-256 checksum
How to use checksums
d2b5e1c94db9c05b158974094022be1d74749943049b7210b01a58db3dee759d
BLAKE2b-256 checksum
How to use checksums
1c55f5274b119953ea772b1ed732626000099488656fb1ecf36a7f3409436fca
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 Nov 21, 2026.

Transparency log

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

Download URL phasesweep-0.3.14-py3-none-any.whl
Size 578.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8eecd454b665cac372e9ad9d159a4c86c64956a6a75eae5139867716883e73d7
BLAKE2b-256 checksum
How to use checksums
54649b7898510298b390a547302dc9a60c18408d27d0e4363b8187b25a6c4fb8
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 Nov 21, 2026.

Transparency log

Security for phasesweep 0.3.14

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for phasesweep-0.3.14.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 Nov 21, 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