Backend Types #
Small vocabulary for backend selection and trust boundaries.
TorchLean owns the spec, graph, and proof-facing contracts. Backends are execution providers for parts of that graph: a Lean reference path, the TorchLean runtime, native CUDA kernels, LibTorch, ATen, cuBLAS/cuDNN/cuFFT, TPU/XLA, AWS Neuron/Trainium, or future platform-specific providers. This file deliberately contains only data. It should stay cheap to import from specs, runtime wrappers, docs generators, and tests.
Stable spelling used in profile names, reports, and CLI bridges.
Instances For
Concrete provider family used to execute a kernel capsule.
- reference : Provider
- torchLean : Provider
- nativeCuda : Provider
- libTorch : Provider
- aten : Provider
- mps : Provider
- webGpu : Provider
- cuBLAS : Provider
- cuDNN : Provider
- cuFFT : Provider
- xla : Provider
- neuron : Provider
- customChip : Provider
- external : Provider
Instances For
Stable operation vocabulary used by backend capsules, graph planning, and runtime guards.
This is deliberately a closed vocabulary. New backend-visible operations should be added here and then wired through the IR adapter and capsule registry. Runtime tape/debug labels may still be strings, but the backend planner should not accept arbitrary stringly-typed operation names.
- randUniform : BackendOp
- bernoulliMask : BackendOp
- add : BackendOp
- sub : BackendOp
- mul : BackendOp
- scale : BackendOp
- abs : BackendOp
- sqrt : BackendOp
- clamp : BackendOp
- max : BackendOp
- min : BackendOp
- relu : BackendOp
- gelu : BackendOp
- sigmoid : BackendOp
- tanh : BackendOp
- softplus : BackendOp
- exp : BackendOp
- log : BackendOp
- sin : BackendOp
- cos : BackendOp
- inv : BackendOp
- safeLog : BackendOp
- logSoftmax : BackendOp
- softmax : BackendOp
- sum : BackendOp
- reduceSum : BackendOp
- reduceMean : BackendOp
- flatten : BackendOp
- reshape : BackendOp
- permute : BackendOp
- transpose2d : BackendOp
- swapAdjacentAtDepth : BackendOp
- transpose3dFirstToLast : BackendOp
- transpose3dLastToFirst : BackendOp
- transpose3dLastTwo : BackendOp
- broadcastTo : BackendOp
- concatVectors : BackendOp
- concatLeadingAxis : BackendOp
- sliceLeadingAxisRange : BackendOp
- gatherScalar : BackendOp
- gatherScalarNat : BackendOp
- gatherRow : BackendOp
- gatherVecNat : BackendOp
- gatherRowsNat : BackendOp
- scatterAddVec : BackendOp
- scatterAddRow : BackendOp
- matmul : BackendOp
- bmm : BackendOp
- linear : BackendOp
- mseLoss : BackendOp
- layerNorm : BackendOp
- batchNorm : BackendOp
- batchNormChannelFirst : BackendOp
- conv : BackendOp
- conv2d : BackendOp
- convTranspose : BackendOp
- convTranspose2d : BackendOp
- maxPool : BackendOp
- maxPool2d : BackendOp
- maxPool2dPad : BackendOp
- smoothMaxPool : BackendOp
- smoothMaxPool2d : BackendOp
- avgPool : BackendOp
- avgPool2d : BackendOp
- avgPool2dPad : BackendOp
- fftFno : BackendOp
- selectiveScan : BackendOp
- scaledDotProductAttention : BackendOp
Instances For
Stable spelling used in reports, capsule names, and CLI diagnostics.
Instances For
Whether training through this operation requires a registered local VJP.
Random sources create values but are not themselves differentiated. Every other backend-visible operation must provide a compatible VJP whenever gradient tracking is requested.
Instances For
How much TorchLean knows about an implementation.
trustedExternal is allowed, but it is intentionally loud: the contract names the boundary instead
of silently treating an industrial kernel as though Lean had verified its source.
- verified : TrustLevel
- checked : TrustLevel
- fuzzed : TrustLevel
- trustedExternal : TrustLevel
Instances For
User- or CI-selected policy for which backend capsules may be used.
- verifiedOnly : TrustPolicy
- checked : TrustPolicy
- fuzzedOk : TrustPolicy
- allowTrustedExternal : TrustPolicy
Instances For
Whether a policy admits a capsule at the given trust level.
Instances For
Backend preference requested by a runtime configuration.
- auto : BackendPreference
- prefer (provider : Provider) : BackendPreference
- only (provider : Provider) : BackendPreference
Instances For
Instances For
Instances For
Runtime-level backend configuration. Public APIs can wrap this with friendlier defaults.
- device : Device
- backend : BackendPreference
- trustPolicy : TrustPolicy
- vjpMode : VJPMode