Skip to main content

Neural Pipeline Search (NePS)

PyPI version Python versions License Tests

NePS is a tool for tuning the design choices of deep learning pipelines efficiently and across scales. Use it for hyperparameter optimization (HPO), neural architecture search (NAS), or any other design choice in your pipeline, from a single GPU to a multi-node cluster or even multiple clusters.

NePS brings together years of our algorithmic advances (e.g., in NeurIPS, ICML, or ICLR) with a runtime tailored to large scale models. NePS is actively maintained and used to run on many different clusters, tuning even billion-parameter scale models with many concurrent trials.

To learn about NePS, check out the documentation, our examples, or our Colab tutorials.

Why NePS

Tailored to large scale models

  • Tuning distributed models: NePS works with DDP and FSDP, on a single node or across multiple nodes, out of the box (examples).
  • Zero-effort to run many concurrent models: start more workers on the same machine or in a multi-node setup. As long as they share the results directory, they coordinate on their own, with no server to set up.
  • Live monitoring and interventions: follow a run with neps.status, live plots, or TensorBoard, and steer it without starting over: add workers, extend the budget, re-run failed trials, or import tuning results from anywhere (even cross-cluster).

Efficient tuning algorithms

  • Low-fidelity evaluations: principled use of cheap evaluations, such as fewer epochs or less data, to rule out bad configurations early.
  • Expert knowledge and prior studies: use your intuition as priors, and results from earlier studies, when you have them.
  • Model-based search: strategies such as Bayesian optimization choose promising configurations smartly instead of sampling blindly.

Generally applicable

  • Any design space: hyperparameters, architectures, resource allocation, or any component of the pipeline.
  • Any scaling dimension: use epochs, dataset size, model size, or any other quantity as the fidelity.
  • Any and multiple objective: optimize pre-training loss, downstream tasks, resource usage, or several of them at once.

Installation

NePS supports Python 3.11 to 3.14. Install the latest release from PyPI:

pip install neural-pipeline-search

Basic Usage

Using neps is based on the following pattern:

  1. Define an evaluate_pipeline function that evaluates a configuration of your pipeline.
  2. Define a pipeline_space of the parameters to optimize.
  3. Call neps.run(evaluate_pipeline, pipeline_space).

In code, the usage pattern can look like this:

import neps
import logging

logging.basicConfig(level=logging.INFO)


# 1. Define a function that accepts hyperparameters and computes the validation error
def evaluate_pipeline(lr: float, alpha: int, optimizer: str):
    # Create your model
    model = MyModel(lr=lr, alpha=alpha, optimizer=optimizer)

    # Train and evaluate the model with your training pipeline
    validation_error = train_and_eval(model)
    return validation_error


# 2. Define a search space of parameters; use the same parameter names as in evaluate_pipeline
class ExampleSpace(neps.PipelineSpace):
    lr = neps.Float(
        lower=1e-5,
        upper=1e-1,
        log=True,  # Log spaces
        log_base=10,  # Logarithm base, by default it's natural log
        prior=1e-3,  # Incorporate your knowledge to help optimization
    )
    alpha = neps.Integer(lower=1, upper=42)
    optimizer = neps.Categorical(choices=["sgd", "adam"])


# 3. Run the NePS optimization
neps.run(
    evaluate_pipeline=evaluate_pipeline,
    pipeline_space=ExampleSpace(),
    root_directory="path/to/save/results",  # Replace with the actual path.
    total_evaluations_to_spend=100,
)

Resources to Get Started

Tutorials

Interactive notebooks that run in Google Colab:

Tutorial What it covers Run
1. Getting Started with HPO Basic HPO workflow, synthetic functions, and deep learning tasks Open In Colab
2. Defining Search Spaces Parameter types, fidelity parameters, and PipelineSpace classes Open In Colab
3. Efficient Optimization Multi-fidelity optimization, expert priors, optimizer selection, and parallelization Open In Colab
4. Multi-Objective Optimization Multi-objective optimization with PriMO, including per-objective expert priors Open In Colab

To run them locally instead, see the tutorials folder.

Examples

Documentation

Contributing

Please see the documentation for contributors.

Citing NePS

To cite NePS or the papers behind its algorithms, see our citation guide.

Metadata

Release files for neural-pipeline-search 0.17.0

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

Source distribution (sdist)

Source distribution for neural-pipeline-search 0.17.0
File Size Uploaded
neural_pipeline_search-0.17.0.tar.gz 242.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neural-pipeline-search 0.17.0
File Interpreter ABI Platform
neural_pipeline_search-0.17.0-py3-none-any.whl Python 3 none any Details

Total release size: 516.9 kB

Release files / neural_pipeline_search-0.17.0.tar.gz

Download URL neural_pipeline_search-0.17.0.tar.gz
Size 242.2 kB
Tags Source
SHA-256 checksum
How to use checksums
04678b3594511b0095ee085595f7f229cdd7138d7c2bca9cb82fbf27a34c65eb
BLAKE2b-256 checksum
How to use checksums
f13622bf1caeb061c23b9637222af69fce1a56c201b9ef349636c4bb119997f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / neural_pipeline_search-0.17.0-py3-none-any.whl

Download URL neural_pipeline_search-0.17.0-py3-none-any.whl
Size 274.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2cba61bcc0c75856f4fea1f4bb6861804d1411eb30cff9025c4ed4357eeacac
BLAKE2b-256 checksum
How to use checksums
9d7345dd18e4c1a8c07379a7accc392cf7b10961959e998507b456e5e208cec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.17.0 This release

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.11.1

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.9

2 release files

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