---
title: Out-of-Core Linear Algebra
url: https://www.emergentmind.com/topics/out-of-core-linear-algebra
type: topic
---

# Out-of-Core Linear Algebra

Out-of-core linear algebra encompasses algorithms and computational frameworks that enable the efficient solution of linear algebra problems when the working data greatly exceeds the available fast memory (RAM or device memory). This paradigm requires explicit optimization of data movement (communication) between a limited fast memory and (potentially unbounded) slow memory, such as hard drives or SSDs. Key advances in this field include optimal communication lower bounds for classical matrix factorizations, randomized block algorithms for singular value and rank-revealing decompositions, and general runtime strategies that minimize wall-clock times even as matrices scale far beyond in-core capacity.

## 1. Two-Level Memory Model and Communication Cost

Central to out-of-core linear algebra is the two-level memory model: computation is performed in fast memory (size $S$ words), while the dataset resides on an unbounded slow memory medium. Data not in fast memory must be explicitly transferred ("read" or "written") with the total communication volume $Q$—the sum of all words moved—becoming a primary performance constraint [2202.10217][2002.06960]. The arithmetic intensity $\rho$ (ratio of arithmetic ops to data movement) is dictated by the chosen algorithm's schedule, and the minimum attainable $Q$ is a limiting factor for large-scale problems.

A generic lower bound on communication for fixed-work algorithms is derived as follows. If a subcomputation accessing at most $X$ distinct data items can perform at most $H_{max}$ arithmetic operations, then
$$
\rho \leq \frac{H_{max}}{X-S} \qquad \implies \qquad Q \geq \frac{V}{\rho} \geq \frac{V(X-S)}{H_{max}}
$$
where $V$ is the total number of arithmetic operations [2202.10217].


## 2. Communication-Optimal Algorithms for Symmetric Kernels

Fundamental symmetric linear algebra operations—including the symmetric rank-$k$ update (SYRK) and Cholesky factorization—exhibit structural redundancy that can be exploited for higher arithmetic intensity, and thus reduced data movement, compared to conventional non-symmetric kernels.

For SYRK (computing $C \leftarrow C + AA^T$ for $A \in \mathbb{R}^{N \times M}$), the optimal communication lower bound is
$$
Q_{SYRK}(N, M, S) \geq \frac{1}{\sqrt{2}}\frac{N^2 M}{\sqrt{S}}
$$
For Cholesky factorization of $N \times N$ symmetric positive definite matrices,
$$
Q_{Chol}(N, S) \geq \frac{1}{3\sqrt{2}} \frac{N^3}{\sqrt{S}}
$$
Both bounds improve on those for non-symmetric kernels (e.g., GEMM, LU) by a factor of $\sqrt{2}$, reflecting the doubled utility of each matrix element in symmetric updates [2202.10217].

Matching algorithms with optimal $Q$ include:
- **Tiled Block SYRK (TBS):** Block decomposition with recursive processing of "triangle" submatrices, enabling communication volume $Q_{TBS} \leq (1/\sqrt{2}) N^2M/\sqrt{S} + O(N^2 + NM \log N)$.
- **Levelwise Block Cholesky (LBC):** Combines OOC Cholesky on diagonal blocks with panel updates via TBS, yielding $Q_{LBC}(N,S) \leq (1/(3\sqrt{2})) N^3/\sqrt{S} + O(N^{5/2} + N^2\log N)$.

These approaches establish that for symmetric kernels, the minimum communication volume is $(\#ops)/\sqrt{S/2}$, demonstrating their intrinsic $\sqrt{2}$ higher operational intensity relative to non-symmetric counterparts [2202.10217].


## 3. Out-of-Core Singular Value and Rank-Revealing Factorizations

Out-of-core SVD, QRCP, and UTV factorizations address the challenge of computing rank structure and low-rank approximations when input matrices (dense or sparse) exceed memory constraints. The leading approaches leverage randomized block algorithms that effectuate bulk data movement, block-level computation, and overlap of I/O with numerical kernels [1706.07191][1907.06470][2002.06960].

### Out-of-Core Randomized SVD (RSVD)

Block-wise RSVD algorithms partition $A\in\mathbb{R}^{m\times n}$ (dense or sparse) across one or both indices so all submatrices fit in memory. The main steps are:
1. **Sketching:** $Y = A\Omega$ using Gaussian random matrix $\Omega\in\mathbb{R}^{n\times \ell}$.
2. **Blockwise Power Iterations:** Repeated multiplications $(AA^T)^q A\Omega$, each pass performed out-of-core.
3. **Out-of-Core Block QR:** $Y=QR$ is orthonormalized via block Gram-Schmidt or TSQR.
4. **Subspace Projection:** $B = Q^T A$ is formed blockwise and then a small (in-core) SVD is computed: $B = \widetilde U \Sigma V^T$.
5. **Reconstruction:** $U = Q\widetilde U$ assembled out-of-core.

I/O is performed asynchronously; checkpointing supports mid-computation resumption. The total I/O volume is $(q+2)\cdot$size$(A)$ plus minor contributions from $Q,~B,~Y,~U$ [1907.06470].

### Out-of-Core Blocked QRCP / UTV

For column-pivoted QR, a "left-looking" blocked algorithm (HQRRP_left) minimizes writes by only updating the current $b$ columns of $A$ per block. Reads per iteration are needed for Gaussian pivot-sketch and local QR, producing an overall read volume of $2n^3/b$ words and write volume of $n^2$ words for $A\in\mathbb{R}^{n\times n}$.

Randomized UTV (randUTV_AB) generalizes this to $A=UTV^T$ with explicit power-iteration blocks and staged block-level SVDs. Both methods partition $A$ into $b\times b$ blocks, schedule tasks to overlap compute and I/O, and maintain an in-RAM least-recently-used (LRU) cache of blocks [2002.06960].

A summary of algorithmic features is presented below.

| Algorithm        | Blocked | Communication-Optimal | Out-of-Core Checkpointing |
|------------------|---------|----------------------|--------------------------|
| Blocked SVD/RSVD |   Yes   |        Yes           |          Yes             |
| HQRRP_left QRCP  |   Yes   |        Yes           |       Not specified      |
| randUTV_AB UTV   |   Yes   |        Yes           |          Yes             |


## 4. GPU-Accelerated and High-Performance Out-of-Core Methods

Modern advances leverage GPUs for out-of-core SVD and related tasks, with the host memory or disk supplying streamed partitioned blocks to device memory.

The block randomized SVD (BRSVD) algorithm operates in two main passes—one for sketching and one for subspace projection—using up to two passes over the data regardless of power-iteration exponent $q$. GPU-specific optimizations include:
- In-GPU random matrix generation overlapped with host-device transfers.
- GEMM (matrix-matrix multiply) ordering to minimize memory requirements.
- Communication-avoiding QR (CAQR) on GPU for orthonormalization.
- Block size adaptation to maximize occupancy given constrained device memory.

Performance measurements indicate near-peak in-core GPU performance (up to $\sim$4.8 Tflop/s, $\sim$90% of in-core), 13–35$\times$ CPU speedup, and 3–5$\times$ above naïve multi-GPU approaches, with accuracy matching in-core MKL RSVD (Frobenius-norm error $\sim10^{-15}$ double/ $\sim10^{-7}$ single precision) [1706.07191].

Proposed extensions include multi-GPU or heterogeneous CPU+GPU orchestration, out-of-core tensor decomposition, and asynchronous pipelining for storage-level out-of-core workloads.


## 5. Practical Implementation Strategies and Memory Planning

Performance and scalability in out-of-core linear algebra depend strongly on block size, prefetching, and overlap of compute with data movement. Key strategies include:
- **Block Size Selection:** Chosen to keep the aggregate block memory below the constraint $M$ but large enough to amortize I/O overhead and optimize CPU/GPU utilization. For SSDs and $n\sim 10^5-10^6$, block sizes of $b\sim10^3-2\cdot10^4$ are typical [2002.06960], while dense RSVD recommends $b$ such that the largest of several possible block-wise product sizes fits within $M$ [1907.06470].
- **Threading and I/O:** Designate a dedicated I/O thread per storage device for asynchronous data movement, with all remaining cores assigned to numerical kernels. RAM management integrates an LRU block cache and reserves space for filesystem buffer cache [2002.06960].
- **Checkpointing and Persistence:** All intermediate blocks are checkpointed to disk with metadata and checksums, enabling robust "resume" operation in the event of failure—significantly improving practical usability in extreme matrix scales [1907.06470].
- **Overlap and Scheduling:** The runtime builds block-wise dependency digraphs, dynamically schedules ready tasks, and avoids re-reading non-updated data blocks (e.g., left-looking QR).

With careful implementation, the real-world slowdown relative to in-core methods remains moderate (e.g., out-of-core SVD or QRCP at $\sim$2–5$\times$ walltime on modern SSDs vs. RAM), with compute often dominating unless memory is extremely constrained [2002.06960][1907.06470].


## 6. Performance Characteristics and Application Domains

Empirical benchmarks confirm the scalability of out-of-core algorithms:
- Out-of-core RSVD and blocked factorizations scale to matrices with $\sim10^6$ rows/columns, both dense and sparse, and handle arbitrarily small memory limits, with sub-linear increases in runtime due to overlap and optimized scheduling [1907.06470][2002.06960].
- GPU-accelerated out-of-core SVD retains high throughput even for data far exceeding GPU memory, with minimal loss in accuracy [1706.07191].
- In symmetric kernel factorizations, communication lower bounds are achieved up to leading order by TBS and LBC [2202.10217].

Out-of-core linear algebra methods are now fundamental in domains ranging from robust PCA in computer vision to large-scale data science pipelines and scientific computing, wherever data volumes preclude classic in-memory techniques.


## 7. Theoretical and Algorithmic Implications

The asymptotic lower bounds on communication volume ($\Omega(N^3/\sqrt{S})$ for dense matrix factorizations), and their realization via carefully blocked and scheduled algorithms, define the practical frontier of out-of-core linear algebra [2202.10217][2002.06960]. The $\sqrt{2}$-fold operational intensity improvement for symmetric kernels (SYRK, Cholesky) highlights the algorithmic leverage conferred by exploiting mathematical structure.

Blocked randomized algorithms (both for low-rank approximation and full rank-revealing factorizations) demonstrate that randomized sketches, power iterations, and block-level factorizations can be orchestrated effectively in external memory settings.

As device and storage-level parallelism advances, these approaches remain essential for scaling core linear algebraic operations to the exabyte regime and beyond. A plausible implication is that as SSD and NVMe bandwidths increase and overlap techniques continue to mature, out-of-core algorithms will achieve near parity with in-memory performance for a growing set of problem classes [2002.06960].

---

**References**

- I/O-Optimal Algorithms for Symmetric Linear Algebra Kernels [2202.10217]
- High-Performance Out-of-core Block Randomized Singular Value Decomposition on GPU [1706.07191]
- Out-of-core singular value decomposition [1907.06470]
- Computing rank-revealing factorizations of matrices stored out-of-core [2002.06960]

Source: https://www.emergentmind.com/topics/out-of-core-linear-algebra