Cross-Paradigm Relaxation Dialect
Ten operations, an MLIR and NIR-style exchange form, and a lowering matrix across substrates.
Charlot Lab ecosystem · released CC0 for comment
A relaxation dialect and cross-paradigm exchange for energy-native computing
| Status | Draft v0.1 — for public comment |
| Date | 2026-08-02 |
| License | CC0 1.0 — adopt, fork, or absorb without permission |
| Companion | EFA-RFC-001 (OER/1 receipts + DRIFT/1 benchmark) — every executing op in this dialect emits an OER receipt stub |
| Intended audience | MLIR community · NIR maintainers · Intel Lava · Extropic thrml · Klere flowg/Joule · Ferric · UXL Foundation · vendors of settling, sampling, annealing, crossbar, and neuromorphic hardware · GPU-simulation implementers |
RFC 2119 keywords apply.
Every portability layer in production — Triton, StableHLO/IREE, SYCL, Mojo/MAX, CANN, MUSA, Vulkan compute, ggml — shares one assumption: the primitive of computation is a kernel applied to tensors on a clock. A thermodynamic sampling unit, an Ising annealer, a memristor crossbar doing in-situ writes, or a ternary settling fabric has no representation in any of them. You cannot lower a matmul onto a device whose native operation is relax until stable. The consequence is structural: the entire make-hardware-fungible movement commoditizes GPU-class hardware while leaving the energy-native paradigm without a compiler target, so every new substrate rebuilds its stack from zero — the precise failure mode that killed the first neuromorphic wave.
One shipping counterexample proves the fix: NIR, the Neuromorphic Intermediate Representation, runs one spiking model across Loihi 2, SpiNNaker2, Xylo, Speck, and simulators — because its primitives match the physics (stateful neurons and spikes, not kernels). RELAX/1 is the analogous object for relaxation and sampling computation: a small op set whose primitives are settle, sample, anneal, local write, verify, certify — declarative about what equilibrium or distribution is sought, silent about how the substrate reaches it. It is specified as (a) an MLIR dialect (relax) so it lands inside the compiler commons the industry already runs, and (b) a JSON graph-exchange form (mirroring NIR) for runtimes without MLIR.
Design goal: a model expressed once in RELAX/1 runs today on a GPU in simulation, tomorrow on any conforming physical substrate, and produces an OER/1 receipt either way — with the provenance axes telling you which one you got.
provenance: simulated × emulation.flowg).!relax.energy<form, state_type, N>): a scalar function over states. Forms: ising (pairwise couplings + biases), hopfield (dense/ternary associative), factor_graph (sparse local factors), ebm_net (learned neural E_θ, carried as a StableHLO/ONNX sub-module), composite (sum/min of energies).!relax.state<domain, N>): binary, ternary, continuous<fN>, spiking (bridged to/from NIR).!relax.budget<joules|steps|seconds|schedule>): compile-time-checked where static; runtime-metered otherwise.!relax.fastweights<N, M>): inference-time-mutable coupling store — the Hebbian target; on crossbar substrates this is physical memory.| Op | Signature (informal) | Semantics |
|---|---|---|
relax.define_energy |
attrs(form, params/URI) → energy |
Declare/bind an energy landscape |
relax.encode / relax.decode |
tensor ⇄ state |
Move between tensor world and state world |
relax.settle |
(energy, state, budget, tol) → (state, receipt) | Reach a local fixed point: E non-increasing along the trajectory; stop at tol or budget; MAY refuse |
relax.sample |
(energy, n, temp, method, seed?) → (states, receipt) | Draw n samples ~ e^(−E/T); method ∈ gibbs | langevin | metropolis | native_thermal |
relax.anneal |
(energy, schedule, budget) → (state, receipt) | Settle under a declared temperature path; the op where the coupled-chain/annealing question is answered on hardware |
relax.local_write |
(fastweights, x, y?, rule, α, gate?) → fastweights′ | Gradient-free write: rule ∈ hebbian(αxxᵀ) | delta | decay | surprise_gated; the native crossbar/settle×2 op |
relax.nudge |
(energy, target, β) → energy′ | Clamp/bias toward a target (EqProp phase two) |
relax.eqprop_grad |
(x_free, x_nudged) → local Δcouplings | Learning signal from two relaxations |
relax.verify |
(energy, state, τ) → (bool, margin, receipt) | Energy-as-verifier: accept iff E(x) ≤ τ |
relax.certify |
(energy, region, type) → certificate | type ∈ energy_monotone | contraction_region; populates OER certificate |
relax.compose |
(E₁, E₂, mode) → energy | mode ∈ sum (conjunction) | min (disjunction) — zero-shot compositionality |
Illustrative MLIR-style listing (drift-benchmark inner loop, RFC-001 task D-A):
%E = relax.define_energy ising couplings(@W_world) : !relax.energy<ising, ternary, 4096>
%z = relax.encode %obs : tensor<4096xf32> -> !relax.state<ternary, 4096>
// think: K-step settle under a joule budget — may refuse
%z*, %r1 = relax.settle %E, %z budget(#relax.budget<joules 2.0e-6>) tol(1.0e-4)
// plan: sample candidate futures, verify with the same energy
%cands, %r2 = relax.sample %E_goal, 64 temp(0.8) method(metropolis) seed(17)
%ok, %m, %r3 = relax.verify %E_goal, %best threshold(0.12)
// adapt on surprise: gradient-free write to fast weights (native crossbar op)
%Z1 = relax.local_write %Z, %z* rule(hebbian) alpha(0.02) gate(surprise > 0.7)
// receipts %r1..%r3 aggregate under RFC-001 §3.3 min-grade composition
| Substrate family | settle |
sample |
anneal |
local_write |
Notes |
|---|---|---|---|---|---|
| gpu_sim (reference, REQUIRED) | unrolled descent (Triton/StableHLO) | Gibbs/Langevin kernels | scheduled Langevin | tensor update | Correctness oracle; auto-tag simulated×emulation |
| fpga_settling (Klere-class ternary fabric) | native | via settle+noise inject | clocked schedule | settle×2 / direct SRAM write | First physical conformance target; receipts via frequency-sweep (OER-L1) |
tsu_pbit (Extropic-class; thrml bridge) |
zero-T limit | native_thermal | native schedule control | host-side | DTM = chained relax.sample; seedless native sampling declared |
| ising_annealer (SBM / DA / CIM / D-Wave) | zero-T anneal | repeated anneal reads | native | n/a (couplings reload) | Latency-record substrate; QUBO adapter |
| cim_crossbar (memristor/PCM) | analog matvec iteration | + noise | scheduled | in-situ outer product — native | The write IS the physics; endurance budget declared |
| neuromorphic_snn (via NIR bridge) | attractor nets | stochastic neurons | intrinsic | on-chip plasticity rules | state<spiking> round-trips through NIR |
| photonic | iterative optical loop (exp.) | optical noise (exp.) | exp. | n/a | Marked experimental in v0.1 |
A conforming physical backend implements ≥1 column natively and MAY delegate the rest to gpu_sim with correct provenance tags — mixed executions compose under RFC-001 min-grade rules.
org.efa.relax for the ten ops (opset 1).state<spiking> encode/decode is specified against NIR node types; a spiking policy can be verified by a relax.verify energy and vice versa.thrml / Lava adapters: thin mappings published as reference code; neither project need change to be targeted.| Level | Meaning |
|---|---|
| RELAX-C0 | Dialect-valid programs run on gpu_sim reference lowering |
| RELAX-C1 | ≥1 op lowered to a physical substrate, oracle-checked against gpu_sim |
| RELAX-C2 | C1 + OER-L1 receipts emitted on every executing op |
| RELAX-C3 | C2 + relax.certify implemented for actuation-class workloads; DRIFT/1-eligible |
Not a kernel language (Triton/Mojo remain the right tools inside ebm_net). Not a spiking format (NIR owns that; we bridge). Not a quantum IR (annealers enter only through their classical interface). Not a scheduler — placement/routing across substrates is the runtime’s job (flowg-class systems), for which this dialect is the instruction set.
JSON-Schema + MLIR dialect definition (TableGen); gpu_sim lowerings for all ten ops; two physical backends on dissimilar substrates (one settling fabric, one sampler); the RFC-001 D-A task expressed end-to-end with receipts; conformance test suite with oracle tolerances.
Primitive set distilled from: EBT descent-as-thinking (Gladstone/Du); EqProp (Scellier–Bengio); fast-weight/delta-rule lineage (Schmidhuber; Ba; Yang; Behrouz); EFA’s unified readings (settle/verify/certify/write) and published negatives; Klere’s budget-refusal and receipt semantics; NIR’s proof that paradigm-matched primitives portabilize; Extropic’s DTM as chained sampling. CC0 — the point is adoption, not attribution. Drafted with AI assistance (Claude, Anthropic) at the direction of the EFA program.