Skip to main content

Functionally pure definitions of optimisation problems extracted from Standard Input Format (SIF).

Project description

sif2jax

Progress

Functionally pure definitions of optimisation problems extracted from Standard Input Format (SIF), written in JAX.

This is for you if you write optimisation software in JAX (or Python) and want to stress-test it on the CUTEst set of benchmark problems. Features include

  • all JAX everything: no Fortran backends
  • full support for autodiff, batching, and JIT compilation
  • more JAX benefits: run on CPU/GPU/TPU
  • clear and human-readable problem definitions, no decoder required
  • lean API - no specific problem interface required

Installation

pip install sif2jax

Requires Python 3.11+.

Getting started

We recommend running the benchmarks with pytest-benchmark - use the familiar testing infrastructure to run your benchmarks:

import sif2jax

benchmark_problems = sif2jax.bounded_minimisation_problems

@pytest.mark.benchmark
@pytest.mark.parametrize("problem", sif2jax.unconstrained_minimisation_problems)
def test_lbfgs(benchmark, problem):
    ...

Alternatively, you can run any arbitrary benchmark problem by passing an index, or directly import a problem by name

import sif2jax

problem = sif2jax.problems[42]
another_problem = sif2jax.cutest.get_problem("ROSENBR")

The problems all have the following methods:

  • objective - a callable with signature f(y, args), where y is the optimisation variable
  • y0 - returns the initial guess provided by the SIF file (as a property)
  • args - returns any arguments (frequently None, this is also a property

bounded problems also have a bounds method, and constrained problems additionally include a constraint method.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sif2jax-0.0.7.tar.gz (11.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sif2jax-0.0.7-py3-none-any.whl (12.7 MB view details)

Uploaded Python 3

File details

Details for the file sif2jax-0.0.7.tar.gz.

File metadata

  • Download URL: sif2jax-0.0.7.tar.gz
  • Upload date:
  • Size: 11.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for sif2jax-0.0.7.tar.gz
Algorithm Hash digest
SHA256 483986d969d2487e921d58be4382c5d54974d80c1dd3339c8ec9c18bf0d58e6a
MD5 4940dc183932618ff8ec2bcc74febce1
BLAKE2b-256 02af4548b6328af3af64a14322c5a64fae56b96400c4376d90ffd5478696a038

See more details on using hashes here.

File details

Details for the file sif2jax-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: sif2jax-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 12.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for sif2jax-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 52ece37f3d4926e4e274b8dc8ead1693bead3ba022cbb97bca528ff8b594faac
MD5 78fdc51d30e23e06dc0355fb8dcd7628
BLAKE2b-256 cee661169deefb065006af490c4d481cd17a28ca47bc986522cf16866ebe7806

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page