Papers
Topics
Authors
Recent
Search
2000 character limit reached

Flash-ABFT: Fused Fault Detection in Transformers

Updated 7 July 2026
  • The paper introduces Flash-ABFT, a fused fault detection mechanism that computes a single online checksum spanning QKᵀ, softmax, and AV to monitor the entire attention operator.
  • It leverages hardware-produced values like dot products, running log-sum-exp normalizers, and streamed row sums to detect errors without separate GEMM checks.
  • Experimental results show detection rates up to 98.87% with only about 5.3% area and 1.9% energy overhead, emphasizing its efficiency for inference accelerators.

Flash-ABFT is a fused, algorithm-based fault detection mechanism for the full attention operator in Transformers. It computes a single online checksum spanning QKQK^\top, row-wise softmax, and the final AVAV product while preserving the streaming and tiling structure of FlashAttention-style kernels. The method derives an invariant equal to the total sum of the output matrix OO and predicts it online from quantities already produced by the hardware—dot products, running log-sum-exp normalizers, and streamed rows of VV—thereby avoiding separate checks of the intermediate GEMMs and the nonlinearity barrier at softmax. In reported experiments, it incurred 5.3% hardware area overhead and less than 1.9% energy overhead (Titopoulos et al., 22 Jul 2025).

1. Scope, nomenclature, and problem setting

Flash-ABFT addresses error detection in attention accelerators for Transformers and LLMs. Its immediate target is the attention layer with query, key, and value matrices QRN×dkQ \in \mathbb{R}^{N \times d_k}, KRN×dkK \in \mathbb{R}^{N \times d_k}, and VRN×dvV \in \mathbb{R}^{N \times d_v}, where each row corresponds to a token, NN is sequence length, dkd_k is the key/query dimension, and dvd_v is the value dimension. The pre-softmax score matrix is

AVAV0

with AVAV1 representing optional positional or relative bias and AVAV2 representing causal or padding masks. Attention weights are defined by row-wise softmax, AVAV3, and the output is AVAV4.

Within this setting, Flash-ABFT is not a generic ABFT wrapper around separate matrix multiplications. It is tailored to the fused attention pipeline as executed by FlashAttention-style kernels, including their streaming and tiling structure. The mechanism uses one online checksum across the entire operator rather than verifying AVAV5 and AVAV6 independently.

The term should not be conflated with the unrelated system named “Flash,” an asynchronous Byzantine fault-tolerant payment protocol based on a blocklace data structure (Lewis-Pye et al., 2023). In Flash-ABFT, “ABFT” denotes algorithm-based fault tolerance for hardware error detection in attention computation rather than asynchronous Byzantine fault tolerance in distributed systems.

2. Why conventional ABFT is insufficient for attention

Classical ABFT for a single matrix multiplication AVAV7 relies on linear invariants such as row sums, column sums, or weighted sums. With a checksum vector AVAV8, one may verify relations of the form AVAV9, or use augmented rows and columns so that the augmented product reproduces the augmented output. These checks are preserved by linear operators.

Attention disrupts this structure at two points. First, softmax is nonlinear and normalizes each row independently. Its outputs depend on OO0 and row-local denominators OO1, so any checksum constructed upstream of softmax cannot be propagated through exponentiation and row-wise normalization by standard linear ABFT arguments. Second, masking and optional dropout alter the structure of the attention weights. Even if softmax yields a row-stochastic matrix OO2, multiplicative masks applied after softmax can break or modify that property unless scaled appropriately.

For this reason, per-GEMM ABFT applied separately to OO3 and OO4 cannot detect faults introduced inside the softmax and cannot guarantee consistency across the fused pipeline. The lost invariant is linearity: the usual “augment rows/columns” technique does not survive normalization. Flash-ABFT is designed specifically to recover a usable invariant at the level of the full attention operator rather than at the level of its constituent GEMMs.

3. Checksum formulation and online propagation

The central invariant in Flash-ABFT is the total sum of the elements of the attention output OO5. From OO6, the global checksum can be written as

OO7

Defining

OO8

the checksum is

OO9

The same quantity admits a per-query decomposition. For query row VV0, let VV1 together with any bias and mask applied at position VV2. Then

VV3

with

VV4

This is exactly the total sum of the VV5-th output row:

VV6

This decomposition makes the check implementable online during streaming execution. FlashAttention-2 already maintains, for each query row, a running maximum VV7, a running denominator VV8, and a running unnormalized output vector VV9. For a single query with streamed keys and values indexed by QRN×dkQ \in \mathbb{R}^{N \times d_k}0, the standard updates are

QRN×dkQ \in \mathbb{R}^{N \times d_k}1

QRN×dkQ \in \mathbb{R}^{N \times d_k}2

QRN×dkQ \in \mathbb{R}^{N \times d_k}3

QRN×dkQ \in \mathbb{R}^{N \times d_k}4

Flash-ABFT adds a scalar accumulator QRN×dkQ \in \mathbb{R}^{N \times d_k}5 that mirrors QRN×dkQ \in \mathbb{R}^{N \times d_k}6 but replaces the streamed vector QRN×dkQ \in \mathbb{R}^{N \times d_k}7 with the row sum of that vector:

QRN×dkQ \in \mathbb{R}^{N \times d_k}8

At the end of the row,

QRN×dkQ \in \mathbb{R}^{N \times d_k}9

and the global predicted checksum is

KRN×dkK \in \mathbb{R}^{N \times d_k}0

Masking and dropout are incorporated directly into the streamed update. Masking is folded into KRN×dkK \in \mathbb{R}^{N \times d_k}1 through KRN×dkK \in \mathbb{R}^{N \times d_k}2, so a masked position with KRN×dkK \in \mathbb{R}^{N \times d_k}3 effectively contributes zero to both KRN×dkK \in \mathbb{R}^{N \times d_k}4 and KRN×dkK \in \mathbb{R}^{N \times d_k}5. If dropout is applied after softmax with keep probability KRN×dkK \in \mathbb{R}^{N \times d_k}6 and mask KRN×dkK \in \mathbb{R}^{N \times d_k}7, then KRN×dkK \in \mathbb{R}^{N \times d_k}8 and KRN×dkK \in \mathbb{R}^{N \times d_k}9 are multiplied by VRN×dvV \in \mathbb{R}^{N \times d_v}0 in the updates for VRN×dvV \in \mathbb{R}^{N \times d_v}1 and VRN×dvV \in \mathbb{R}^{N \times d_v}2, while VRN×dvV \in \mathbb{R}^{N \times d_v}3 remains unchanged.

Numerical stability follows the same log-sum-exp procedure used by FlashAttention. Whenever the running maximum increases, both VRN×dvV \in \mathbb{R}^{N \times d_v}4 and VRN×dvV \in \mathbb{R}^{N \times d_v}5 are rescaled by VRN×dvV \in \mathbb{R}^{N \times d_v}6. Flash-ABFT rescales VRN×dvV \in \mathbb{R}^{N \times d_v}7 identically. The stated equivalence between VRN×dvV \in \mathbb{R}^{N \times d_v}8 and VRN×dvV \in \mathbb{R}^{N \times d_v}9 is preserved algebraically provided the arithmetic format can represent the intermediate products and exponentials. The implementation guidance keeps NN0, NN1, and NN2 in higher precision to minimize rounding-induced silent errors.

4. Detection rule and hardware realization

The predicted checksum is compared against an “actual” checksum produced directly from the computed output. After each query row is normalized as NN3, the hardware sums the elements of that row,

NN4

and accumulates the result into a global register NN5. In parallel, it accumulates the predicted per-query values NN6 into NN7. Fault detection is triggered by the condition

NN8

In the reported experiments, NN9 was used to avoid false negatives due to rounding while maintaining sensitivity (Titopoulos et al., 22 Jul 2025).

The hardware additions are modest and closely aligned with the existing FlashAttention datapath. A dkd_k0-wide adder tree computes dkd_k1 for each streamed row of dkd_k2. Each active query lane receives one additional scalar register dkd_k3 and one scalar fused multiply-add update of the form

dkd_k4

or the dropout-adjusted form when dropout is enabled. A post-normalization adder tree computes dkd_k5, and two global accumulators hold dkd_k6 and dkd_k7.

The control changes are similarly limited. The finite-state machine must initialize dkd_k8 on tile entry, update it in lockstep with dkd_k9 and dvd_v0, and accumulate dvd_v1 on tile exit. The divider used to normalize dvd_v2 can also be reused or multiplexed to compute dvd_v3. The checker preserves FlashAttention’s streaming, blockwise execution and IO-awareness; checksum updates are performed tile-by-tile, and end-of-layer detection latency is described as a handful of cycles beyond the last tile’s normalization.

Precision choices are integral to the design. The compute path may use FP16 or BF16, while dvd_v4, dvd_v5, dvd_v6, dvd_v7, and dvd_v8 are kept in FP32 or double precision. Compatibility with FP32 is explicit. For INT8 or other quantized inference, the exponentials and normalizers are still required in floating-point, or fixed-point exponential approximations must be validated so that the checksum identity remains valid.

5. Fault model, experimental methodology, and measured behavior

The evaluation injects random single-bit flips during execution into registers of the FlashAttention-2 kernel and of the checker, including MAC array accumulators, local buffers, running normalizers, and checker accumulators. Input memories for dvd_v9, AVAV00, and AVAV01 are assumed to be protected by separate logic and are therefore excluded from the fault model. The methodology comprises 10,000 independent single-fault campaigns on the first attention layer across four LLMs—BERT, Phi-3-mini, Llama-3.1, and Gemma2—at sequence length AVAV02 and hidden dimensions AVAV03, using BF16 arithmetic, double-precision checksum accumulators, and AVAV04 (Titopoulos et al., 22 Jul 2025).

Three outcome categories are reported. “Detected” means AVAV05. “False Positive” denotes a checker fault that flips AVAV06 or AVAV07 and raises an alarm even though AVAV08 is correct. “Silent” covers cases where a fault produces NaN/INF or produces an incorrect AVAV09 while the checksum difference remains within AVAV10.

AVAV11 Outcome rates
64 Detected 96.94%, False Positive 2.66%, Silent 0.40%
96 Detected 97.56%, False Positive 1.99%, Silent 0.45%
128 Detected 98.45%, False Positive 1.25%, Silent 0.30%
256 Detected 98.87%, False Positive 0.62%, Silent 0.51%

The paper states that detection improves with larger hidden dimension because the checker occupies a smaller fraction of total state. It also reports that no false negatives were observed, noting that a fault in the compute path and an offsetting fault in the checker would be required to cancel at the checksum.

The overhead measurements are reported in two forms. The headline results are 5.3% area overhead and less than 1.9% energy overhead. For a 28 nm implementation with BF16 compute and double-precision checksum accumulators, the average overheads across configurations are approximately 4.55% area and approximately 1.53% dynamic power, with the per-row AVAV12 adder shared across lanes.

Qualitative baselines situate the method within the broader fault-tolerance landscape. Per-GEMM ABFT cannot verify the nonlinear softmax and therefore leaves faults in normalization and streaming updates uncovered. ECC protects storage rather than compute datapaths and does not cover compute faults. DMR and TMR incur higher area, energy, and latency penalties relative to the single-check design used here.

6. Limitations, edge cases, and development directions

Several limitations are explicit. When softmax saturates and one score dominates a row, the attention vector becomes nearly one-hot; small faults in strongly suppressed entries may have limited effect on AVAV13 and therefore on the checksum, reducing sensitivity to subtle errors. Heavy masking reduces the number of contributing terms in AVAV14 and AVAV15, so larger localized errors may be required to exceed the detection threshold. Very low-precision maintenance of AVAV16, AVAV17, or AVAV18 can increase silent faults, which is why FP32 or double precision is recommended for the running sums. Very long sequences enlarge the dynamic range of AVAV19 and AVAV20, again motivating higher-precision accumulators.

Kernel fusion and stalls are treated as compatible with the method because the checksum lane shares timing with AVAV21 and AVAV22; pipeline stalls therefore propagate consistently. Corner cases producing NaN or INF are expected to be trapped by standard floating-point exception handling, which can be integrated with the checker.

The stated application domain is primarily inference accelerators. Forward-pass checking remains valid in the presence of dropout by incorporating the dropout factor into the checksum update, but training introduces gradient backpropagation and different invariants. Extending the derivation to the backward pass is identified as future work. Other stated directions include extension to multi-head fusion with head-wise aggregation and adaptive thresholds AVAV23 that vary with precision and sequence length.

A plausible implication is that Flash-ABFT is most compelling where fused attention kernels are already present and the design objective is low-cost online detection rather than replication-based fault masking. That implication is consistent with the paper’s emphasis on preserving FlashAttention’s streaming structure, using values already produced by the hardware, and replacing multiple checks with a single end-to-end invariant (Titopoulos et al., 22 Jul 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Flash-ABFT.