Skip to content

Execution Capability Matrix

The executable source of truth is tide.core.backends.backend_capabilities(). The table below mirrors the current rows. A new combination is supported only after code, capability selection, numerical tests, and public documentation agree.

OperationMeaning
forwardNonlinear propagation F(m)F(m)
jvpTangent action J(m)vJ(m)v
vjpAdjoint action J(m)rJ(m)^\top r
second_vjpNonlinear second-order action (DJ(m)[v])r(DJ(m)[v])^\top r

forward and vjp share capability rows because standard reverse-mode differentiation begins with the stored or recomputed forward trajectory.

All rows support CPU and CUDA devices, float32 and float64 dtypes, subject to native library availability on the selected machine.

BackendDimensionOperationsStorage modesGradient targetsCallbacksReusable background
ReferenceTM2Dforward, vjpauto, device, CPU, disk, noneepsilon, sigma, mu, perturbation, source, stateyesno
ReferenceTM2Djvpauto, device, CPU, disk, noneepsilon, sigma, mu, perturbation, source, statenono
ReferenceTM2Dsecond_vjpdevice, CPU, diskepsilon, sigma, mu, perturbation, source, statenono
ReferenceEM3Dforward, vjpauto, device, CPU, disk, noneepsilon, sigma, mu, perturbation, source, stateyesno
ReferenceEM3Djvpdevice, noneepsilon, sigma, mu, perturbation, source, statenono
ReferenceEM3Dsecond_vjpdeviceepsilon, sigma, mu, perturbation, source, statenono
NativeTM2Dforward, vjpauto, device, CPU, disk, noneepsilon, sigma, sourceyesno
NativeTM2Djvpauto, device, CPU, disk, noneepsilon, sigma, perturbationnoyes
NativeTM2Dsecond_vjpdevice, CPU, diskepsilon, sigmanono
NativeEM3Dforward, vjpauto, device, CPU, disk, noneepsilon, sigma, sourceyesno
NativeEM3Djvpdevice, noneepsilon, sigma, perturbationnono
NativeEM3Dsecond_vjpdeviceepsilon, sigmanono
  • epsilon, sigma, and mu refer to background material tensors.
  • perturbation refers to EMDirection fields used by JVP and differentiated tangent workflows.
  • source refers to source-amplitude samples.
  • state refers to initial field or derivative-state tensors.

A capability row lists the largest target set that the backend family can accept. Individual physics adapters may impose a narrower operation-specific rule. For example, TM2D JVP does not currently accept a mu direction.

Storage cells describe accepted public policy for that operation:

  • auto resolves from configured device and host byte limits.
  • device stores eligible trajectory state on the compute device.
  • cpu stores on the host.
  • disk stores below the configured path.
  • none avoids snapshot allocation where the operation permits it.

Native EM3D JVP accepts device or no snapshot storage. Native EM3D second VJP requires device storage. Reference capability is not universally broader: it intentionally follows the same EM3D derivative storage boundaries for operations that lack another implemented path.

Backend selection evaluates the complete plan. A request can be rejected because of operation, gradient target, storage, callbacks, device, dtype, dispersion, batched-model layout, or native availability.

  • FallbackPolicy.ERROR raises with the unsupported reason.
  • FallbackPolicy.REFERENCE selects the reference backend only if a reference row covers the full request.
  • BackendPreference.NATIVE combined with error fallback is the appropriate choice when benchmarking native execution.

No solver adapter should invent a fallback after the central decision.

The matrix captures stable declarative capability. Some conditions remain dependent on the loaded binary or runtime object:

  • Required native ABI symbol exists.
  • CUDA architecture is compatible with the built library.
  • Tensor layout is contiguous where the ABI requires it.
  • Dispersion and snapshot representation are compatible.
  • torch.func transform state can use the selected adapter.

These checks must honor the same fallback policy and report a descriptive reason.

import tide
from tide.core.backends import backend_capabilities
for preference in (
tide.BackendPreference.REFERENCE,
tide.BackendPreference.NATIVE,
):
print(preference.value)
for row in backend_capabilities(preference).matrix:
print(row)

When this output and the rendered table disagree, treat the Python output as authoritative and update the documentation in the same change.