The Impact of Partial Computations on the Red-Blue Pebble Game

Pál András Papp, Aleksandros Sobczyk, A. N. Yzelman · DOI

TL;DR

This paper introduces the Partial-Computing Red-Blue Pebble Game (PRBP), an extension of the classic model used to analyze data movement (I/O) costs between fast and slow memory. By allowing inputs to be aggregated step-by-step rather than requiring all inputs to reside in cache simultaneously, PRBP provides a much more realistic model for associative and commutative operations like matrix multiplication. The authors establish the fundamental properties of this new game, prove that finding optimal strategies remains NP-hard, and develop novel partitioning tools to derive tight I/O lower bounds for core algorithms.

What Problem Does This Paper Address?

In modern computing—especially in deep learning and large-scale scientific simulations—the primary performance bottleneck is often not the raw CPU/GPU cycles, but the time and energy spent moving data between fast, limited memory (cache) and slow, large memory (RAM).

To study this mathematically, researchers use the Red-Blue Pebble Game (RBP), introduced by Hong and Kung in 1981. In this game, a computation is modeled as a Directed Acyclic Graph (DAG). Red pebbles represent data in fast memory, and blue pebbles represent data in slow memory. A strict rule of the original RBP is that to compute a node, all of its incoming inputs must be in fast memory at the exact same time.

However, many real-world operations are associative and commutative (e.g., large summations or matrix reductions). You don't need all 100 inputs in cache at once; you can load them one by one, accumulating them into a running total. The original RBP overestimates the required cache size and I/O costs for these scenarios. This paper addresses this gap by formalizing a version of the game that permits partial computations.

Methods

The authors introduce the Partial-Computing Red-Blue Pebble Game (PRBP). To track the state of incomplete computations, they split the classic red pebble into two types:

  • Light Red Pebbles: The value in cache is up-to-date with slow memory.
  • Dark Red Pebbles: The value in cache has been modified/updated but hasn't been saved to slow memory yet.

The game introduces a new partial compute rule: you can update a node's value by processing just a single incoming edge, provided the source node is in cache.

To prove lower bounds on I/O costs, the original RBP relies on a graph-theoretic technique called $S$-partitions, which divides a DAG into chunks based on how much data can fit into cache. Because partial computations allow a node to be visited multiple times across different phases of execution, standard $S$-partitions break down. The authors invent two new mathematical frameworks to fix this:

  1. $S$-edge partitions: Shifting the partitioning focus from the graph's nodes to its edges.
  2. $S$-dominator partitions: A relaxed version of the classic partition that drops constraints on the output boundaries ("terminal sets") of the graph chunks.

Datasets

Not discussed in the paper. This is a purely theoretical paper utilizing mathematical proofs and graph-theoretic analysis; no empirical datasets or benchmarks were used.

Key Insights and Ideas

  • Massive Cost Reductions: Allowing partial computations isn't just a minor tweak; it can reduce the non-trivial I/O cost of a graph by a linear factor ($\Theta(n)$). The authors present a gadget where the original RBP requires a cost proportional to the size of the graph, whereas PRBP can compute it with a constant I/O cost of 2.

    Figure 1: Example DAG for OPT𝑃𝑅𝐵𝑃< OPT𝑅𝐵𝑃, with 𝑟= 4. For Proposition 4.2, 𝑢0, 𝑣0 and the dashed edges are part of the DAG; in this case, we have OPT𝑃𝑅𝐵𝑃= 2 but OPT𝑅𝐵𝑃= 3. For Proposition 4.7, we disregard 𝑢0, 𝑣0 and the dashed edges, and concatenate several copies of the remaining gadget.
  • The Complexity Irony: Even though partial computing provides more flexibility to optimize data movement, deciding whether partial computations can reduce the I/O cost for an arbitrary DAG is NP-hard. Furthermore, finding the absolute optimal pebbling strategy remains NP-hard to approximate to any reasonable factor.

  • Why Standard S-Partitions Fail: The authors provide a clear counterexample showing that a graph can have a massive standard $S$-partition bound (suggesting high I/O costs), yet PRBP can evaluate it with trivial I/O overhead by trickling data through a single node sequentially.

    Figure 3: Construction for Lemma 5.4, consisting of 7 source nodes 𝑢1, ...,𝑢7, 7 distinct groups 𝐻1, ..., 𝐻7 of Θ(𝑛) nodes each, and a single sink 𝑣. The node 𝑢𝑖always has edges to all the nodes in 𝐻𝑖, and all the nodes in 𝐻𝑖have an edge towards 𝑣.

Key Results

The authors successfully map out the theoretical boundaries of PRBP and apply their new partitioning tools to establish lower bounds for foundational algorithms:

  • Asymptotic Equivalence for Core Tasks: For standard Fast Fourier Transforms (FFT), Matrix Multiplication, and Flash Attention, the asymptotic lower bounds in PRBP match those of RBP. For example, Matrix Multiplication still requires an I/O cost of $\Omega(\frac{m_1 m_2 m_3}{\sqrt{r}})$. This proves that while partial computation helps with small, specific graph structures, it cannot bypass fundamental communication lower bounds for highly interconnected algorithms.
  • Inapproximability: They prove that approximating the optimal I/O cost in PRBP within a factor of $n^{1-\epsilon}$ is NP-hard, adapting complex "tower" gadget constructions from classic RBP literature to handle partial steps.

Limitations and Future Work

  • One-Shot Restriction: The primary limitation is that this work focuses on the one-shot version of the game, meaning each edge is processed exactly once. In real-world computing, discarding an intermediate value and re-computing it later (rematerialization) is a common strategy to save memory.
  • Future Directions: The authors highlight that extending PRBP to support re-computations is a delicate but crucial next step. They also suggest exploring mixed-model DAGs that contain a combination of both associative (partial-computable) and non-associative operations.

Summary updated

Abstract

We study an extension of the well-known red-blue pebble game (RBP) with partial computation steps, inspired by the recent work of Sobczyk. While the original RBP assumes that we need to have all the inputs of an operation in fast memory at the same time, in many concrete computations, the inputs can be aggregated one by one into the final output value. These partial computation steps can enable pebbling strategies with much smaller I/O cost, and in settings where such a step-by-step aggregation is possible, this extended red-blue pebble game offers a much more realistic cost model. We establish the fundamental properties of this partial-computing red-blue pebble game (PRBP), and compare it to the original RBP. We begin with some simple examples where allowing partial computations can decrease the optimal I/O cost. It is also shown that the cost can decrease by up to a linear factor this way, but in general, it is NP-hard to decide whether partial computations allow for a smaller cost in a specific DAG. We then discuss how $S$-partitions, a crucial tool for deriving I/O lower bounds in RBP, can be adapted to the PRBP model. These new tools are then used to establish lower bounds on the I/O cost of some prominent computational tasks. Finally, we also adapt a hardness result from RBP, showing that the optimum cost is still NP-hard to approximate in PRBP to any reasonable factor.
BibTeX
@inproceedings{papp2025impact,
  author = {Pál András Papp and Aleksandros Sobczyk and A. N. Yzelman},
  title = {{The Impact of Partial Computations on the Red-Blue Pebble Game}},
  booktitle = {SPAA},
  year = {2025},
  url = {https://openreview.net/forum?id=Gxe4HiedX2},
}
Figure