evomo:Evolutionary multi-objective optimization on EvoX Compiler, with a functional API, constrained benchmarks and a unified optimization workflow.

Evolutionary multi-objective optimization on EvoX Compiler, with a functional API, constrained benchmarks and a unified optimization workflow.

Branch2Tags0

EvoMO 1.0 — tensorized evolutionary multiobjective optimization on the EvoX Compiler

Paper · Documentation · Measured benchmark · GPL-3.0-only

EvoMO is a tensorized, GPU-accelerated library for evolutionary multiobjective optimization (EMO). Version 1.0 is an extension of EvoX 2.0 and is written entirely in the EvoX Compiler (evoxc) tensor-graph language, so one generation of a population is one compiled graph. The same code runs on the numpy reference interpreter, on IREE and on XLA (ROCm or CUDA); the backend is a UnifiedWorkflow argument, not a build variant. There is no PyTorch anywhere in the library, the tests or the examples.

What is in the box

Area Contents
Algorithms 61 EMO algorithms, exported as <Name>Config + make_<name> (122 public names), grouped into mechanism-named family directories (nsga/, moead/, refvec/, indicator/, many/, surrogate/, weight/, swarm/, sparse/, constrained/). 58 declare TAKES_CV = True; HEA, MaOEAHAP and NRVMOEA are objective-only.
Benchmark problems 131 config dataclasses: 45 numerical (ZDT1-4/6, DTLZ1-7, MAF1-15, LSMOP1-9, WFG1-9) and 86 constrained (CTP1-8, DASCMOP1-9, DOC1-9, FCP1-5, LIRCMOP1-14, LSCM1-12, MW1-14, SDC1-15). MoRobtrol adds the Brax-backed robot-control suite (numpy backend only).
Kernels `evomo.operators.selection
Workflow UnifiedWorkflow + EvalMonitorConfig: one compile site, (fitness, cv) threading, opt_direction applied exactly once, backend/device selection, host-side monitor history.
Metrics Host-side numpy gd, igd, gd_plus, igd_plus, hv, ref_point.
Utilities Bounds/config/pytree helpers, lowering-safe tensor helpers and .pf reference-front loading.

src/evomo/DESIGN.md is the binding contract for the tree: component model, constraint protocol, kernel conventions, static-shape rules and porting policy.

Installation

Python >= 3.11 is required. Runtime dependencies are evox >= 2.0.0a1, evoxc >= 0.1.0 and numpy >= 2.0.0 (evox 2.0 is a pre-release line, so pre-releases must be allowed in the resolver).

The GitLab default branch is evoxc (source version 1.0.0). Install this checkout:

git clone --branch evoxc https://gitlab.com/emi-lab/evomo.git
cd evomo
python -m pip install --pre -e ".[test]" "evox==2.0.0a1"

# uv equivalent, inside a virtual environment
uv pip install --prerelease allow -e ".[test]" "evox==2.0.0a1"

The published stable evomo package is from the older 0.3.x line (checked 2026-12-05), so pip install evomo does not install this code. The evox==2.0.0a1 dependency supplies the functional evox.core API used here. It differs from the GitLab EvoX main branch (PyTorch 1.x) and the evoxc-exp checkout (import evox_etl); neither checkout is a drop-in replacement for this dependency. Use a separate virtual environment.

Optional extras:

extra installs for
test pytest >= 8.0 the unit_test/ suite
iree evoxc[iree], iree-base-compiler/iree-base-runtime 3.13.x the iree backend
vis plotly, pandas plotting helpers
neuroevolution brax, jax, jaxlib MoRobtrol (numpy backend only)

XLA has no pip extra. Install a PJRT plugin that matches the host and point evoxc at it:

# ROCm: 0.10.2 is the version that loads against a system ROCm 7 install.
pip install jax-rocm7-pjrt==0.10.2
export EVOXC_PJRT_PLUGIN="$VIRTUAL_ENV/lib/python3.12/site-packages/jax_plugins/xla_rocm7/xla_rocm_plugin.so"
export XLA_FLAGS="--xla_gpu_enable_command_buffer="   # HIP command buffers crash in PJRT_Executable_Execute

On CUDA use jax-cuda12-pjrt. The pinned ROCm plugin aborts during interpreter teardown after all work is done, so a script that uses XLA should finish with os._exit(code). The full recipe, the pin rationale and the exact failure texts are in scripts/README.md.

Quickstart

This is the complete, runnable smoke of the functional API. It runs on the numpy backend and needs no GPU.

import numpy as np

from evomo.algorithms import make_nsga2
from evomo.problems.numerical import DTLZ2
from evomo.workflows import EvalMonitorConfig, UnifiedWorkflow

algo = make_nsga2(pop_size=100, lb=np.zeros(12, np.float32), ub=np.ones(12, np.float32), n_objs=3)
wf = UnifiedWorkflow(algo, DTLZ2(d=12, m=3), EvalMonitorConfig(multi_obj=True),
                     opt_direction=["min"] * 3, backend="numpy")
state = wf.init(seed=42)
for _ in range(100):
    state = wf.step(state)
wf.flush()
pf = wf.monitor.get_pf_fitness()
print("generations recorded:", len(wf.monitor.get_fitness_history()))
print("pareto front:", pf.shape, pf.dtype)
print("mean f1:", round(float(pf[:, 0].mean()), 6))

Reference output captured on the original benchmark host (AMD Instinct MI300X VF, ROCm 7.1.0, Python 3.12.3). Exact front size and objective values can vary with compiler and NumPy versions:

generations recorded: 100
pareto front: (2279, 3) float32
mean f1: 0.505506

get_pf_fitness() returns the non-dominated front the monitor accumulated over the run as a numpy array. The numpy interpreter may print one benign RuntimeWarning: invalid value encountered in subtract per run; it comes from zero-range crowding normalization and does not affect the result.

For a constrained run, the same workflow threads the constraint-violation tensor:

from evomo.algorithms import make_nsga2
from evomo.problems.constrained import MW1
from evomo.workflows import EvalMonitorConfig, UnifiedWorkflow

algo = make_nsga2(pop_size=100, lb=np.zeros(10, np.float32), ub=np.ones(10, np.float32), n_objs=2)
wf = UnifiedWorkflow(algo, MW1(d=10, m=2), EvalMonitorConfig(multi_obj=True),
                     opt_direction=["min"] * 2, backend="numpy")
state = wf.init(seed=42)
for _ in range(50):
    state = wf.step(state)
wf.flush()
print(wf.monitor.get_latest_cv().shape)      # (n, n_con); cv == 0 means feasible

Architecture in brief

utils  →  operators  →  problems  →  algorithms  →  workflows
metrics  (host-side numpy only)
  • One component per module. An algorithm module defines a frozen <Name>Config dataclass, make_<name>(), an immutable tensor-only state and init/init_step/step. A problem module defines a config dataclass and evaluate(config, problem_state, pop).
  • Configs hold static leaves only (int, float, bool, str, flat float tuples). Shapes are fixed at init; population-size changes caused by reference-vector sampling are decided on the host in make_* and baked as config ints.
  • No eager tensor ops. Every evoxc op executes inside init/init_step/step/evaluate; an op outside a trace is an error. Control flow is evoxc.select / evoxc.cond / evoxc.while_loop with static shapes.
  • Minimization internally. UnifiedWorkflow applies opt_direction once at the fitness boundary; no algorithm or operator flips signs.
  • Constraints are never dropped. A constrained problem defines CONSTRAINED = True and evaluate_constrained(...) -> (fitness, cv, problem_state); cv is always 2-D with cv == 0 meaning feasible. Pairing a constrained problem with a TAKES_CV = False algorithm raises ValueError.
  • Ranks are 0-based and a mask is never a rank.
  • Reuse evox kernels; never copy them. evomo owns only what evox lacks.

Read src/evomo/DESIGN.md before writing library code.

Measured performance

The repository ships a measured comparison against the frozen PyTorch evomo 0.3.2 baseline. Every number below traces to a committed record under benchmarks/evoxc_vs_torch/results/; the full tables, methodology and provenance are in benchmarks/evoxc_vs_torch/REPORT.md.

Measured on one AMD Instinct MI300X VF (gfx942), ROCm 7.1.0, evox 2.0.0a1 and evoxc 0.1.0, 32 cases (5 algorithms × 3 problems × 2 scales, plus 2 constrained cases), 50 generations per timed region after 2 warmups, seed 42. The baseline is eager wf.step() — the code the rewrite replaced, not a tuned torch.compile baseline.

Backend Cases measured Faster than torch Geomean speedup Verdict
xla-rocm 26 23/26 11.24× numerically valid (26/26 generation-0 matches) and fastest — use it
iree-llvm-cpu 20 14/20 4.05× valid; portability result, not a speed result
iree-rocm 20 8/20 2.49× numerically invalid (gather miscompile) — speed only
numpy 32 11/32 0.75× correctness oracle; not the speed story

Highlights for xla-rocm (median ms/step, speedup over torch):

  • NSGA-II / NSGA-III: 3.44–4.55× at both scales (e.g. NSGA-II/DTLZ2: 2.45 → 0.554 ms/step).
  • MOEA/D: 438–1901×, because the legacy implementation costs 139.97–623.50 ms/step against 0.32–0.34 ms/step here. Quote MOEA/D separately: its numbers dominate every aggregate.
  • HypE: 1.98–2.23× at scale A but only 0.76–0.84× at scale B, where the compiled graph still costs 4.48–5.06 ms/step and compiling it takes ~35.5 s.
  • RVEA: the pinned XLA plugin cannot compile stablehlo.acos, so all six RVEA cases error on xla-rocm (they are not timed); RVEA is measured on numpy only.
  • Compile time is a one-off and reported separately: median 1.17 s on xla-rocm (0.37–35.50 s), 0.11 s on numpy.

IREE on ROCm is numerically invalid on this host. iree-base-* 3.13.0 compiles and runs the multi-objective graph, but the objectives built through evoxc.gather(x, arange(k-1, -1, -1), axis=1) are wrong: 12 of 20 measured rows disagree, with relative objective error up to 3.56e-02 (in the standalone smoke, objectives 2 and 3 are wrong for 99/100 individuals, up to 467 absolute), and once the wrong objectives feed selection the population itself stops tracking numpy. Those rows carry quality: "n/a (backend miscompile)". Never report an IREE-on-ROCm number as an optimization result.

The numpy backend is the correctness oracle: 32/32 cases run, but it is 10–15× slower than torch on NSGA-II/NSGA-III at scale B and 116–135× slower on HypE.

Repository map

src/evomo/              the library (DESIGN.md is the binding contract)
  algorithms/           61 algorithms in mechanism-named family directories
  operators/            shared selection / crossover / mutation / sampling kernels
  problems/             numerical/, constrained/ (+ pf data), neuroevolution/
  workflows/            UnifiedWorkflow + EvalMonitorConfig
  metrics/              host-side numpy gd / igd / hv
  utils/                config, bounds, lowering-safe tensor helpers, .pf loading
unit_test/              pytest suite mirroring the library
benchmarks/
  evoxc_vs_torch/       measured harness, committed JSON records, REPORT.md
  legacy/               frozen PyTorch 0.3.2 snapshot (baseline only; never installed)
scripts/                setup_env.sh, env.sh, smoke_backends.py, recipe README
docs/                   Sphinx site (guide, reference, examples)
.github/                CI: Ruff 0.8.5, wheel build/publish, pytest on the numpy backend
AGENTS.md               contributor / agent rulebook
pyproject.toml          packaging, extras, pytest and Ruff configuration

Tests, lint and docs

# whole suite (numpy backend; ~4.5 min on the verified host)
PYTHONPATH=src python -m pytest unit_test -q
# or use the pinned environment
source scripts/env.sh && "$PYTHON_A" -m pytest unit_test -q

# targeted runs
PYTHONPATH=src python -m pytest unit_test/algorithms/test_registry.py -q
PYTHONPATH=src python -m pytest unit_test/operators -q

# lint / format (Ruff 0.8.5, line length 128)
uvx ruff@0.8.5 check .
uvx ruff@0.8.5 format --check .

# docs (strict)
python -m sphinx -b html -W --keep-going docs docs/_build/html

The suite covers contract gates (the 122-name algorithm registry and its TAKES_CV classification), numpy oracles for every kernel family, the 131-problem catalogue, and cross-area integration of UnifiedWorkflow. Compiled-backend tests are marked and skipped when the backend or device is missing; there is no GPU in CI. The ~4.5 min figure is measured against the current evoxc head; the published evoxc 0.1.0 wheels are several times slower (same tests, same result), which is why the CI job allows 60 minutes.

Reproducing the benchmark

The harness runs one process per backend and writes one committed JSON record per (implementation, backend). From the repository root:

source scripts/env.sh && "$PYTHON_A" benchmarks/evoxc_vs_torch/run.py --impl evomo --backend numpy --seeds 42,0,1,2,3,4,5,6,7,8
source scripts/env.sh && "$PYTHON_A" benchmarks/evoxc_vs_torch/run.py --impl evomo --backend xla-rocm --seeds 42,0,1,2,3,4,5,6,7,8
source scripts/env.sh && "$PYTHON_A" benchmarks/evoxc_vs_torch/run.py --impl evomo --backend iree-llvm-cpu --seeds 42,0,1,2,3,4,5,6,7,8
source scripts/env.sh && "$PYTHON_A" benchmarks/evoxc_vs_torch/run.py --impl evomo --backend iree-rocm --seeds 42,0,1,2,3,4,5,6,7,8
source scripts/env.sh --legacy && "$PYTHON_LEGACY" benchmarks/evoxc_vs_torch/run.py --impl legacy --backend torch-cuda --seeds 42,0,1,2,3,4,5,6,7,8

These are the full protocol (50 generations, 3 repeats, 2 warmup, monitor-overhead probe, ten-seed CTP1 sweep) that a write to results/ requires; a subset or scratch run must pass --out /tmp/..., and run.py refuses a non-canonical write with exit code 2. --list prints the frozen backend and case ids; --selfcheck checks the harness's IGD/HV against evomo.metrics. The environment recipes (both venvs, the ROCm/XLA pins, the IREE defect and every known failure text) are in scripts/README.md.

Known platform limits

  • IREE on ROCm miscompiles gather — the backend is measured for speed and flagged numerically invalid.
  • jax-rocm7-pjrt 0.10.2 has no stablehlo.acos, so RVEA angle selection and NSGAII_SDR, NSBiDiCo, TELSO, LMOCSO run on numpy only; evoxc emits no stablehlo.solve, so AGEMOEA, EFRRR, ThetaDEA, tDEA_CPBI are numpy-only on compiled backends.
  • No GPU in CI; compiled backends, ROCm and the benchmarks are manual runs.
  • MoRobtrol simulates outside the graph and is numpy-backend-only.
  • Distributed/multi-rank evaluation is not implemented in 1.0 (UnifiedWorkflow raises NotImplementedError).

Citation

@article{evomo,
  title   = {Bridging Evolutionary Multiobjective Optimization and {GPU} Acceleration via Tensorization},
  author  = {Liang, Zhenyu and Li, Hao and Yu, Naiwei and Sun, Kebin and Cheng, Ran},
  journal = {IEEE Transactions on Evolutionary Computation},
  year    = 2025,
  doi     = {10.1109/TEVC.2025.3555605}
}

License

EvoMO is released under the GPL-3.0-only license; see LICENSE. EvoMO is an extension of EvoX and keeps the evox 2.0 component model unchanged so the two projects interoperate.

Introduction

Evolutionary multi-objective optimization on EvoX Compiler, with a functional API, constrained benchmarks and a unified optimization workflow.

Customize your domain