Composable computation for intelligence that evolves.
Explicit tensor graphs, composable transformations, and execution across compiler backends.
Documentation · Get started · Program populations · Backends · Ecosystem · Project homepage
EvoX Compiler makes numerical programs inspectable, transformable, and reusable. Its Python interface turns tensor computations into explicit graphs, combines them through graph transformations, and connects them to execution backends. The package is imported as evoxc and can be used independently for numerical computing.
Within the EvoX ecosystem, it provides a computation layer for intelligence that adapts, creates, and evolves across digital and physical worlds. It supports the experimental EvoX 2.0 line, the learning computations in EvoX Physics, and model forward passes through the separate evoxc-hf package.
Evolutionary systems repeatedly evaluate candidates and use their outcomes to guide the next generation. Those candidates may differ in their parameters, their model structure, or the programs they execute. Making computation explicit gives an application control over what is built, what is shared, and what runs again.
- Evaluate populations.
vectorizeandvmapbatch a computation over candidate parameters or inputs, with shared inputs specified explicitly. - Compose candidate programs.
batch_functionscombines compatible programs into one graph with a function axis. Each row preserves its candidate's computation, supporting workloads such as genetic programming and algorithm search. - Reuse execution. Build an executable and run it with new data, or use
build_cachedto reuse a matching build. On accelerator paths, explicitly placed state can remain on the device across iterations.
Automatic differentiation through grad, jvp, and vjp adds another way to transform supported computations. These transformations produce ordinary graphs that enter the same execution pipeline.
Use Python 3.11 or later. Install the published package in an isolated environment:
python -m pip install evoxcNumPy is the core Python runtime dependency. Published wheels include the Rust extension for Linux, macOS, and Windows; a source build requires Rust and a C compiler. Optional compiler backends have additional dependencies.
Define a sum-of-squares fitness function, build it for three candidate vectors, and evaluate them on the default NumPy CPU backend:
import numpy as np
import evoxc
@evoxc.defn
def score_population(candidates):
return evoxc.sum(candidates * candidates, axes=1)
spec = evoxc.TensorSpec((3, 2), evoxc.float32)
exe = evoxc.build(score_population, spec)
population = evoxc.tensor(
np.array([[1, 2], [3, 4], [5, 6]], dtype=np.float32)
)
print(evoxc.run(exe, population).numpy()) # [ 5. 25. 61.]
print(evoxc.run(exe, evoxc.zeros((3, 2))).numpy()) # [0. 0. 0.]Each row is a candidate, and each output is its fitness. Both calls reuse the same executable. TensorSpec describes future input data; @evoxc.defn marks a graph definition; build composes tracing, lowering, compilation, and loading. Runtime tensors supply the values that change between evaluations.
The two Python examples on this page work with v0.2.3. See the quickstart for the individual stages and installation guide for optional backends and development setup.
When candidates have different computations, batch_functions gives them a shared graph representation. This example merges three programs and evaluates each against the same input:
import numpy as np
import evoxc
@evoxc.defn
def add_one(x):
return x + 1.0
@evoxc.defn
def double(x):
return x * 2.0
@evoxc.defn
def subtract_three(x):
return x - 3.0
spec = evoxc.TensorSpec((4,), evoxc.float32)
graphs = [evoxc.trace(fn, spec) for fn in (add_one, double, subtract_three)]
merged = evoxc.batch_functions(graphs, axes=None, switch_ops=True)
exe = evoxc.load(evoxc.compile(evoxc.lower(merged)))
x = evoxc.tensor(np.array([1, 2, 3, 4], dtype=np.float32))
print(evoxc.run(exe, x).numpy())
# [[ 2. 3. 4. 5.]
# [ 2. 4. 6. 8.]
# [-2. -1. 0. 1.]]axes=None shares the input across all three programs; axes=0 assigns each program its own input row. Programs must have compatible input and output trees, shapes, dtypes, and recorded static values. The backend determines how the merged graph is compiled and scheduled.
Inspect merged.batch_report to understand shared operations, switched variants, and emitted operations. The graph-transform guide covers batching, differentiation, and population grouping.
On main, beyond v0.2.3: split_by_inputs separates a straight-line graph into a prepare stage for fixed inputs and an apply stage for varying inputs. analyze_inputs helps inspect that boundary. Re-run prepare when fixed inputs change. These APIs are currently listed under Unreleased; use a source checkout to explore them.
The program moves through explicit stages:
trace → Graph → transform → Graph → lower → compile → load → run
EvoX Compiler owns the graph language, EvoXIR, transformations, and the staging interface. Its Rust core implements numerical graph transformations and the native CPU engine. On compiler-adapter paths, IREE, XLA, and TVM handle optimization and code generation through their own runtimes.
Each stage returns an inspectable object: Graph, LoweredProgram, CompiledArtifact, or Executable. Graphs can be verified and saved; execution restores the graph's declared output tree. Runtime data, static specialization, and device placement remain distinct.
Use Tensor.to(device) to transfer data explicitly. Inputs must match the executable's device, and outputs remain there; reading an accelerator result as NumPy requires an explicit transfer to CPU. See core concepts and tensors and devices.
Choose a backend for its operation coverage, deployment environment, and measured workload behavior.
| Backend | Execution path | Recorded coverage |
|---|---|---|
numpy |
Default interpreter; included in the core installation | CPU reference execution |
native |
Rust CPU engine; included in supported wheels | CPU parity against NumPy with dtype-specific tolerances |
iree |
StableHLO compilation and IREE runtime; install evoxc[iree] |
LLVM CPU, AMD ROCm, NVIDIA CUDA, and Vulkan, with version-specific validation |
xla |
StableHLO compilation through a discovered or configured PJRT plugin | Real CUDA and ROCm plugins; CPU plumbing tested with a test plugin |
tvm |
StableHLO import and Relax VM; install evoxc[tvm] |
CPU execution; ROCm compilation only in the tested wheel |
Current IREE dependencies target 3.13.x, with CPU and ROCm revalidated on 3.13.0; the recorded CUDA validation used 3.11. Vulkan evidence includes software lavapipe and a small-graph Intel Panther Lake validation. These records describe particular devices and workloads.
XLA discovers compatible installed PJRT plugins without requiring the JAX Python frontend. TVM uses jaxlib for MLIR bindings. Follow the backend guide for installation, options, and capability checks.
| Project | Application |
|---|---|
| EvoX 2.0 alpha | Experimental functional evolutionary computation, with search steps compiled into reusable graphs |
| EvoX Physics | Policy inference, observation and reward computations, and evolutionary updates alongside a physics engine |
evoxc-hf |
HuggingFace checkpoint loading and static-shape model forward passes through the same graph pipeline |
EvoX 1.x continues to use PyTorch. evoxc-hf is independently distributed and versioned; its model coverage and configuration limits are documented separately. It currently provides forward computation without KV caching or incremental generation.
Performance depends on the program, backend, hardware, and how often an executable is reused. Trace and compilation cost, warm execution time, and end-to-end search time answer different questions.
| Evidence | What was measured |
|---|---|
| CPU test baseline | The November 28, 2026 environment recorded 8,139 passed, 88 skipped, and one expected failure, with IREE and the native extension installed. Hardware- and dependency-specific skips are documented. |
| Merged-program dispatch study | On AMD MI300X VF with IREE 3.11.0, an opt-in aggressive-fusion setting reduced warm execution time by 7–9% for the tested populations of 1,000–4,000 programs. Compilation remained a separate cost. |
| Computation-reuse study | NumPy CPU measurements compare a fixed preparation plus repeated applications with unsplit execution, including build cost, reuse count, and intermediate-data size. |
Check these current boundaries when selecting a workload:
- Graph transformations need rules for the operations they encounter; vectorizing or differentiating control-flow regions remains limited.
- Symbolic shapes and operation coverage vary by backend. Unsupported paths raise explicit errors.
- Sparse operations are currently NumPy-only, and compiler adapters do not yet provide multi-rank collective execution.
- Program splitting currently accepts straight-line graphs without effectful operations.
The current limitations reference maintains the detailed operation and backend matrix.
EvoX builds infrastructure for intelligence that adapts, creates, and evolves. Across models, software, physical interaction, and scientific design, its projects connect exploration with evaluation and feedback. EvoX Compiler contributes the numerical program representation and execution interface that make these computations composable.
EvoX · EvoX Physics · EvoX Genesis · Explore the ecosystem
The project was developed with EvoX Genesis, the ecosystem's recursive agentic software-development system.
- Documentation · API overview
- Graph transforms · Persistence and caching
- Custom ops and kernels · Compiler adapters
- Architecture and contracts · Rust core · Release guide
For bugs, open an issue with a minimal program, input specifications, package and backend versions, device, and the failing pipeline stage. For performance reports, separate build and warm-run measurements and include the reproduction command. Contributors should read the relevant package's CONTEXT.md before changing its API or semantics.
EvoX Compiler is licensed under Apache-2.0.