Attention Backend Capsules #
Attention is the first place where the backend-contract distinction matters in practice.
The proof-facing FlashAttention spec and every registered runtime provider use hard-mask semantics: blocked entries have exactly zero softmax numerator. Additive attention biases are a separate operation and are never used to encode a boolean mask.
Shared op tag for scaled dot-product attention capsules.
Instances For
Composed TorchLean attention path: slower, but aligned with the hard-mask spec.
Instances For
Native fused attention path: faster than the composed fallback, still a CUDA runtime boundary.
Instances For
LibTorch SDPA forward provider while TorchLean keeps the graph/tape boundary.
Instances For
LibTorch SDPA provider where LibTorch also owns the local autograd VJP.
Instances For
Candidate capsules in default CUDA planner order.
Instances For
Candidate capsules when the optional LibTorch backend is enabled by policy/config.
Instances For
Runtime implementation selector for CUDA attention.
true means call the fused native CUDA attention kernels. false means use the composed
TorchLean expression (bmm -> softmax -> bmm) on the CUDA tape. External providers such as
LibTorch intentionally fail here until their runtime bridge is wired through an explicit capsule.