QO-Stationary Dataflow for CIM Attention
- QO-stationary dataflow is a strategy that pins query (Q) and output (O) tiles in compute‐in‐memory architectures to maximize on‐chip data reuse.
- It eliminates redundant memory transfers by streaming key and value tiles exactly once, reducing repeated loads by up to 97%.
- The approach fuses operations to cut buffer transpositions and DRAM traffic, yielding nearly 2× speedup and significant energy savings.
A QO-stationary dataflow ("Query-Output-stationary" dataflow) is a data movement and computation scheduling strategy introduced for attention acceleration in operator-fusion-driven compute-in-memory (CIM) architectures. QO-stationary maximizes on-chip data reuse for attention mechanisms by pinning both the query (Q) tile and the corresponding output (O) tile in CIM-local buffer throughout the full inner loop over key (K) and value (V) tiles, while K and V tiles are streamed exactly once. This scheduling eliminates repeated loading of K and V, buffer transpose of , and intermediate buffering in multi-stage attention computation, enabling highly fused and bandwidth-efficient LLM inference at the hardware level (Xuan et al., 28 Apr 2026).
1. Formal Model and Operator Flow
Consider tiled attention with , , and . The matrices are partitioned rowwise: Q-tiles of shape , K/V-tiles of shape , indexed by and . The canonical sequence of operations is:
8
During this schedule:
- Q and O remain stationary on-chip throughout the 0 loop.
- K and V are each brought on-chip only once per 1, never reloaded for the same Q-tile.
- No explicit buffering or materialization of 2, S, or P across the entire tile dimension; data are pipelined immediately between attention subkernels.
2. Elimination of Redundant Transfers and Transpose Access
QO-stationary fundamentally decouples the movement of inputs and weights versus outputs:
- Classical (weight-stationary) attention: Pins K and V in the array, streams Q, which causes every K/V tile to be loaded 3 times (once per Q-tile).
- QO-stationary: Pins Q tile and O tile, streams each K/V tile once, eliminating 4 redundant loads for each K_s or V_s.
Additionally, QO-stationary natively fuses the transpose for 5 by streaming K in bit-serial format through inner-product CIM (IP-CIM), using bitline/wordline remapping to avoid explicit 6 materialization in auxiliary buffers. This minimization of buffer accesses is pivotal in energy-bound accelerators.
Softmax and PV (probability-value) sub-operators are pipelined such that S and P buffering is unnecessary. Each local attention score 7 (for row 8 in Q-tile 9 and K-tile 0) immediately enters the Softmax core, and its result 1 is propagated to OP-CIM for 2 accumulation in situ with streaming V_s.
3. Bandwidth, Buffer, and On-Chip Data Reuse Analysis
Quantitative Model
Let 3 be as above, with tile sizes 4 (5, 6).
- On-chip reuse factor for K/V:
Weight-stationary: 7, each K_s written 8 times. QO-stationary: 9, each K_s written once.
- DRAM traffic reduction for K (similarly for V):
0
- Bandwidth savings ratio:
1
Empirically, for 2, this yields a 3 reduction in repeated K (and V) loads, excluding the mandatory first pass. Including partial output traffic, the reported reduction in on-chip data movement is 4 (Fig. 7 in (Xuan et al., 28 Apr 2026)).
4. Integration with Hybrid IP-CIM/OP-CIM Pipeline
The QO-stationary dataflow is implemented in architectures such as FusionCIM via a hybrid pipeline:
- IP-CIM array: Holds the stationary Q-tile, streams K-tiles in, computes QK5.
- Softmax core: Receives per-row 6 scores in bit-serial fashion, performs pattern-aware online Softmax with opportunistic partial normalization given early row-max detection.
- OP-CIM array: Holds the stationary O-tile, receives P and V streams, accumulates PV in situ.
The entire 7-indexed workflow is scheduled in parallel across hardware engines (HEs), with each HE loading and pinning Q and O, streaming through all K and V once, issuing results to global buffer at the end of each Q-tile.
Pattern-aware K/V tile scheduling enables the Softmax unit to often observe the maximum score earlier in the pipeline, reducing total exponentiation and rescale events by up to 8 (Fig. 9). In QO-stationary, this directly reduces critical path latency.
5. Comparative Analysis with Classical Dataflow Schemes
A synthesis of classical attention-focused dataflows:
| Dataflow | Stationary On-Chip | Streamed Data | Tile Write Count (K/V) | Tile Write Count (Q) |
|---|---|---|---|---|
| Weight-stationary | K, V in array/CM | Q, O | 9 | 0 |
| Output-stationary | O (partial sums) | Q, K, V | 1 | 2 |
| Row-stationary | Mixed (row granularity) | Mixed | sub-optimal | sub-optimal |
| QO-stationary | Q, O | K, V | 3 | 4 |
QO-stationary is uniquely suited for tandem-fused attention, in which 5 and 6 occur sequentially with an in-the-loop non-linearity (Softmax). It achieves maximal stationary reuse for both the input Q tile (across all K/V tiles) and for the output O tile (across all partial-V contributions), with the minimal required load and store events.
6. Performance Characteristics: Latency, Throughput, and Energy
Time components per tile/operation:
- 7: QK8 tile on IP-CIM
- 9: Softmax (8-cycle Taylor series pipeline)
- 0: PV tile on OP-CIM
- 1: Stream K or V tile
- KV-stationary baseline:
Each (t, s) cycle incurs 2 repeated loads for Q and K, as well as O.
- QO-stationary:
Each Q-tile is loaded once, each O-tile written once, each K and V streamed through a single time per tile, with inner loop fusion.
The modeled speedup is nearly 23 for large 4, with measured results at 5 speedup for sequence length 4K tokens (LLaMA-3), and energy savings of 6 over prior state-of-the-art (Xuan et al., 28 Apr 2026). DRAM/global-buffer activity is reduced by 7.
7. Significance and Application Context
QO-stationary dataflow directly addresses the memory, bandwidth, and in-situ fusion challenges of large-scale attention in LLM inference. By constraining repeated access to DRAM and minimizing on-chip transfers for K and V, it enables CIM-based hardware to approach the arithmetic-to-bandwidth ratio dictated by attention's dual-GEMM structure and softmax interleaving. QO-stationary also forms the basis for further pipeline-level fusions, such as pattern-aware Softmax, which gain amplified benefit under this maximally reuse-centric schedule.
In sum, QO-stationary is the centerpiece of FusionCIM attention acceleration, providing the on-chip data reuse and operator fusion necessary for near-ideal hardware scaling in bandwidth-constrained scenarios, as evidenced empirically in power, throughput, and efficiency for multi-thousand-token LLM inference workloads (Xuan et al., 28 Apr 2026).