Direct Execution Architecture¶
Symmetrix-XL evaluates supported compact MACE models with
streamed_edges="direct" and execution_profile="capacity" by default. Edge
streaming is therefore an implementation property of the normal execution
path, not a feature that users need to enable.
This page describes the architecture and its invariants. Public modes and backend coverage are maintained in Execution Support Matrix; user-facing capacity controls are documented in Execution Modes and Capacity.
Execution Model¶
Direct execution specializes eligible radial and equivariant contractions for the model contract while keeping graph shape and learned weights as runtime values. Its principal goals are:
consume, aggregate, or recompute edge intermediates without retaining every materialized edge tensor;
select a qualified storage plan from the graph size, precision, backend, and requested properties;
compile model-specific host, CUDA, or HIP kernels and cache the resulting artifact; and
fail clearly when a required contract or artifact is unavailable instead of silently changing algorithms.
The implementation is part of Symmetrix-XL. The upstream direct-execution project is used as an algorithmic reference and validation oracle, not as a build or runtime dependency.
The compact two-interaction pipeline contains radial stages R0/R1, node message stages M0/M1, dense transforms, readouts, and coordinate or field reverse stages. Native built-in modules remain available on execution paths that do not request operator specialization. When capacity planning requests a contract-backed M0, M1, or R0 module, resolution prefers an exact installed artifact and otherwise compiles and caches the module for the requested backend. Compilation or loading failures are reported; the planner does not silently retain a builtin operator or change execution backends. R1 and compatible MACE-MH-1 programs are specialized from versioned model contracts.
For admitted MH-1 models, each nonlinear layer stops at a canonical product
boundary. Non-final products dispatch ordinary M0 modules and the final scalar
product dispatches M1. These modules are type-agnostic (type_count=1) and see
a zero type-index view even for multi-element models. Product output linear,
skip, readout, gates, conditioned messages, density normalization, tensor
products, and their nonlinear reverse phases remain inside the MH-1 pipeline;
the common module owns only the symmetric contraction and its reverse.
One common module is loaded per product layer and invoked in both directions. Its identity and origin are independent of the full nonlinear plugin. Thus an installed common module may be reused exactly across standard MACE and MH-1 while the surrounding MH-1 plugin comes from the cache or runtime compilation. Reporting the whole plugin as prebuilt because one or more product modules are prebuilt is incorrect.
Public Selection¶
The supported public spellings are:
Request |
Role |
|---|---|
|
Default prepared execution; two-interaction models require a matching R1 specialization, while admitted single-layer models use prepared R0/M0 execution without an R1 specialization. Capacity may still specialize their M0/R0 operators. |
|
Compiler-free compatibility and diagnostic path; no performance guarantee. |
|
Original Symmetrix execution path, principally for the original Symmetrix model format (named v1 here) and retained numerical controls. |
|
Temporary compatibility request resolved from model and evaluator capability. |
generic and all_interactions are deprecated aliases for non-compiled.
factorized and direct_streamed are compatibility aliases for direct; in
the Python frontend they preserve the former throughput behavior by changing
an otherwise-capacity request to the speed profile. Use literal direct
for capacity behavior. They do not emit a deprecation warning. The removed
receiver_factorized selector is rejected;
historical benchmark records that mention it describe an earlier
implementation.
There is one evaluator stack. A direct request runs the prepared path against
a contract-bound generated artifact and fails at graph preparation without one;
a reference request — reached by the reference, non-compiled, generic,
all_interactions, or materialized spelling — runs the generic implementation
through the whole-evaluator entry point on the default host execution space with
no artifact at all. The retired use_kokkos argument and the standalone
CPU-native evaluators it selected are gone; both legacy forms of the argument
are rejected explicitly.
Capacity Planning¶
execution_profile="capacity" ranks qualified internal plans using an advisory
memory estimate and selects the fastest estimated fit. If none fits the
advisory budget, it attempts the smallest qualified plan and lets allocation
determine feasibility. execution_profile="speed" selects the qualified
throughput plan without consulting available device memory.
The planner can vary harmonic-gradient retention, compact geometry, M1/readout
recomputation, and reuse of dead forward storage. Bounded tiled workspace is a
separate opt-in through allow_fixed_workspace=True; enabling it permits the
planner to consider those plans but does not force their selection.
low_memory=True and low_memory=False remain deprecated compatibility
spellings for the capacity and speed profiles. New callers should use
execution_profile.
After graph preparation, calculator.execution_plan reports the requested
algorithm and profile, selected MH-0 plan, active graph dimensions, planned
capacities, estimated bytes, and the selection reason. Private debug plan pins
exist for implementation tests and qualification drivers; they are not public
workflow controls.
Runtime Artifacts¶
Model-specialized two-interaction direct execution requires a model-, precision-, ABI-, generation-, and target-specific artifact:
Serial and OpenMP use a C++20 host compiler selected by
CXXorc++.CUDA uses NVRTC by default for device specialization.
HIP uses hipRTC by default for device specialization.
LAMMPS loads prepared host or device artifacts and never invokes a compiler.
CUDA compilation gives each generated unit two internal compiler threads with
--split-compile=2. When R1, M0, M1, and R0 require generated device modules,
artifact preparation compiles the independent units concurrently and then
loads and validates them in R1, M0, M1, R0 order. The outer pool is capped at
two compiler processes. The bounded per-unit split avoids
letting each concurrent compiler instance consume every host CPU.
Host low-memory preparation likewise compiles generated R1, M0, and M1 plugins concurrently in a pool bounded to two compiler processes, then loads them in that order. GCC and Clang do not have a portable single-translation-unit equivalent of NVRTC split compilation, so host parallelism is applied between independent artifacts rather than within one compiler invocation.
Compilation or loading failure is fatal for direct execution. Set
SYMMETRIX_JIT_POLICY=none only for diagnosis and select non-compiled when a
compiler-free evaluation is intended.
Generation-19 MH-1 device composition admits common operator ABI v3 with the
chunk32 production schedule. tiled128x4-v1 remains disabled and is not a
production alternative. The model-specific device module is version 5 and its
launch plan is version 6; the current host plugin ABI is v7. Release evidence
requires plan schema /6, plan version 6, device ABI 5, generation 19, and
split_phase_composition=true; the old external_product marker is not a
release-compatible alias. Stale, incomplete, or partial identities are rejected
rather than adapted. Common product buffers are disjoint. Device M0 uses
table revision 1, chunk32 revision 2, and experimental tiled128x4-v1
revision 3 with capability mask 0x1b; device M1 uses revisions 2, 3, and 4
respectively with capability mask 0x0b. Host M1 chunk32 remains revision 2
with the host-ABI 0x1b mask. No device schedule advertises alias safety, and
exact input/output and input/input-adjoint aliases are rejected before launch.
HIP follows the same contract and artifact split, but runtime support
must be qualified on accessible architecture-matched AMD hardware. Compiler and
rendered-source checks alone are not a HIP execution claim.
Artifacts are stored below a per-user cache created with owner-only
permissions. Set SYMMETRIX_JIT_CACHE before Python starts to choose an
explicit location. Cache roots, artifact directories, entries, manifests,
sources, and compiled modules writable by group or other are rejected. Paths
must be owned by the current user by default; a foreign-owned read-only cache
is admitted only when SYMMETRIX_JIT_TRUST_SHARED_CACHE=1 is set explicitly.
Trust is checked again immediately before loading compiled code. Publication
uses content-addressed entries and validates permissions, ownership, manifests,
target identity, file size, and SHA-256 digests before reuse.
Concurrent cache misses compile in private staging directories. Publication
requires atomic no-replace rename by default. On Linux, the cache must
therefore live on a filesystem supporting
renameat2(..., RENAME_NOREPLACE), such as local ext4 or tmpfs. Some parastor
and Lustre deployments on older kernels do not.
Use node-local storage such as /dev/shm, or explicitly set
SYMMETRIX_JIT_PUBLISH=lock-fallback to publish under a destination-adjacent
exclusive lock file with ordinary rename. The fallback has a small
cross-process race window and is intentionally not the default. Compilation
remains outside the publication lock, so shared HPC caches retain concurrent
builds.
Prepare deployable artifacts with:
symmetrix_prepare_jit_host_artifact \
--model model.json --precision float32
symmetrix_prepare_jit_device_artifact \
--model model.json --precision float32
Use --host-target portable only for an x86-64-v3 host artifact. Device
artifacts must be prepared for the exact architecture used by the installed
backend and deployment GPU.
Backend Invariants¶
Only one Kokkos backend may be initialized in a process. CUDA and HIP backends are separate architecture-qualified packages because Kokkos and SpheriCart device code is compiled ahead of time; runtime compilation cannot make an extension portable to another GPU architecture.
OpenMP deployments must be checked in the actual Python and module environment
with symmetrix doctor --json. Strict qualification verifies the expected
OpenMP runtime, loaded runtime identity, worker participation, and admitted
host-worker BLAS policy. Static ldd output alone is not sufficient.
Qualified owner-local CBLAS calls are controlled centrally. Runtime-compatible OpenMP OpenBLAS, sequential MKL, and compatible GNU-threaded MKL may be admitted; pthread OpenBLAS is admitted only with one OpenMP worker. Intel-threaded MKL, unidentified, runtime-incompatible, duplicate-runtime, and nested-enabled configurations use Kokkos contractions instead, as does pthread OpenBLAS with multiple OpenMP workers. See OpenMP and SIMD Coding Standard.
Prepared Graph Lifecycle¶
Prepared direct execution stores receiver-major schedules and reusable graph state. With a positive neighbor skin, candidate edges are built at the model cutoff plus the skin and reused until the Verlet displacement threshold is crossed. Candidates outside the exact model cutoff contribute zero through the compact radial boundary, keeping the prepared schedule stable.
Capacity allocation uses high-water marks. In-capacity graph updates reuse storage; exceptional growth replaces it without exposing partially updated state. Diagnostics distinguish active graph dimensions from planned allocation capacities.
LAMMPS domain decomposition additionally communicates the boundary H1 state
and its adjoint for two-interaction models. The narrower MPI and transport
qualification boundary is maintained in LAMMPS Integration and the
pair_symmetrix source guide.
Implementation Map¶
Public selection and artifact orchestration:
symmetrix/source/symmetrix/calculator.pyDeclared family registry, the shared compact mode vocabulary, and the per-family declarations beside each family’s modules:
symmetrix/source/symmetrix/family_registry.pywithmace_family.py,mace_nonlinear_family.py, andmace_polar_family.pyNeutral host neighbor-graph builder shared by both frontends:
symmetrix/source/symmetrix/neighbor_graph.pyPublic, family-neutral mode parser:
libsymmetrix/source/execution_mode.hppNative execution planner:
libsymmetrix/source/execution_plan.hppMACE Kokkos lifecycle and execution:
libsymmetrix/source/mace_kokkos_factorized_lifecycle.cppandlibsymmetrix/source/mace_kokkos_factorized_execution.cppHost, CUDA, and HIP artifact loaders:
libsymmetrix/source/mace_jit_host_plugin.cpp,libsymmetrix/source/mace_jit_cuda_plugin.cpp, andlibsymmetrix/source/mace_jit_hip_plugin.cppCUDA and HIP runtime compilers:
libsymmetrix/source/jit_nvrtc.cppandlibsymmetrix/source/jit_hiprtc.cppGenerated MH-1 contracts and source:
symmetrix/source/symmetrix/mace_nonlinear_execution_contract.pyandsymmetrix/source/symmetrix/mace_nonlinear_jit_codegen.py
The detailed native ownership map is maintained in MACE Kokkos source layout. Benchmark Markdown files are dated evidence, not current API documentation.