Skip to main content

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

Project description

sif2jax

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 TODO fix

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
  • args - returns any arguments (frequently none)

bounded problems also have a bounds method, and constrained problems additionally include a constraint method. You can find more information in our documentation TODO Fix.

cyipopt installation

I recommend using the conda install as it packages all necessary binaries. I can add this to the dockerimage later.

conda install -c conda-forge cyipopt

CUTEst problems in SIF format

To make the CUTEst problems in SIF format accessible to the LLM:

mkdir archive  # This name is in the .gitignore
cd archive
git clone https://bitbucket.org/optrove/sif ./mastsif

Suggestion: change the permissions to that folder to remove write access.

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.2.tar.gz (161.2 kB 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.2-py3-none-any.whl (384.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sif2jax-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4245d323b24d3f8b9c50fd5f55d34cf3522612cd716d2e2592eddae17889af5b
MD5 3f9f3b13f61768291b973e7eb0b81390
BLAKE2b-256 1b21270b958e01cd5e30b3cf33392df665ff243b54377a71030446ab7e4c0805

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sif2jax-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 384.1 kB
  • 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94e3e5da7c4653faa5dae6b0ac7e3150774b7708cde7b07d7bfa5e29d36517c2
MD5 f8a7ca8d28a22bd2072b7a17d6aa89dc
BLAKE2b-256 4325c0f49c2cf2634d799ebcc6a7953ac57e9441ff0dd31f28cd8af54d8fb906

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