Abstract

A distributed intermediate representation (DIR) is the abstraction a distributed framework uses to carry partial results between stages and nodes — the layer where optimization, fault tolerance, and synchronization actually happen. This paper surveys how five production systems (Apache Spark, TensorFlow, Horovod, Hadoop MapReduce, Apache Flink) realize their DIRs, and identifies the recurring design axes: lazy vs. eager evaluation, lineage- vs. checkpoint-based recovery, and synchronous vs. asynchronous update. We frame these systems through the lens of composable intermediate stages [1, 2, 3] — an intermediate representation is, at bottom, the value passed between composed functions — and note where efficient primitives such as attention [4, 5] fit as stage operations.

1. Introduction

Every distributed data or model pipeline must decide what flows between its stages and how that flow survives failure and stays consistent. That "what" is the intermediate representation. The choice of DIR determines which optimizations are possible (can operations be reordered? fused?), how recovery works (recompute from lineage? restore from checkpoint?), and how nodes agree (synchronous barrier? asynchronous progress?). This survey compares five well-documented systems along those axes. Its contribution is descriptive and integrative: naming the shared design vocabulary beneath systems that are usually discussed in isolation.

Viewed abstractly, an intermediate representation is the value handed from one composed function to the next [1, 2, 3]; a DIR is that value made distributable, fault tolerant, and reorderable. This compositional framing is the paper's organizing idea: the same lens reads every system below.

2. Related Work

Intermediate representations are a classical idea in compilation and functional programming: programs as compositions of stage-to-stage values [1, 2], with the intermediate value's semantics as first-class as the operations [3]. Within ML pipelines, the stage operation of interest is frequently attention [4], whose distributed cost is addressed by IO-aware kernels [5]. The systems surveyed below are documented in their own literature; this paper cites the compositional-IR lineage that unifies them.

3. Survey

3.1 Machine Learning frameworks

Apache Spark (MLlib). The DIR is the RDD/DataFrame. Transformations are lazily evaluated, letting Spark build a directed acyclic graph and optimize it (Catalyst) to minimize shuffles. Fault tolerance comes from RDD lineage: a lost partition is recomputed from its derivation. ML pipelines chain stages (tokenizer vector assembler model), each producing an intermediate consumed by the next — a direct instance of stage-to-stage composition [2].

TensorFlow. The DIR is the tensor within a computation graph. Distribution splits work by data parallelism (each worker computes gradients on a data shard) or model parallelism (graph regions on different devices), synchronized via parameter servers or AllReduce. Graph-level optimization (op fusion, memory planning) is the reordering that lazy IRs enable.

3.2 Artificial Intelligence / distributed training

Horovod. The DIR is the gradient/weight tensor; Ring-AllReduce averages gradients across GPUs/nodes. Synchronous averaging keeps weights consistent per step; checkpointing provides recovery.

Reinforcement learning (actor–learner). The DIR is the experience tuple in a replay buffer; actors produce experience, a learner consumes aggregated experience and broadcasts updated parameters. Prioritized replay is an optimization on which intermediates are sampled.

3.3 Big Data

Hadoop MapReduce. The DIR is the intermediate key–value pair between Map and Reduce, moved through a shuffle-and-sort. Fault tolerance is task re-execution plus HDFS redundancy; combiners cut network transfer by local pre-aggregation.

Apache Flink. The DIR is the data stream plus stateful transformation state. Distributed, checkpointed state gives exactly-once semantics; watermarks synchronize event-time processing; the optimizer minimizes shuffles.

4. Cross-Cutting Design Axes

System Intermediate representation Recovery Synchronization
Spark RDD / DataFrame (lazy DAG) Lineage recompute Stage barriers
TensorFlow Tensor in compute graph Checkpoint Param server / AllReduce
Horovod Gradient tensor Checkpoint Ring-AllReduce (sync)
RL actor–learner Experience tuple (replay buffer) Buffer / checkpoint Param broadcast (often async)
Hadoop MR Key–value pair Task re-execution Shuffle barrier
Flink Stream + state Checkpointed state Watermarks (event time)

This table lays out System, Intermediate representation, Recovery, Synchronization across 6 rows.

The recurring lesson is that the DIR is the design: choose a lineage-recomputable IR and you get Spark's recovery model; choose checkpointed state and you get Flink's exactly-once semantics. Each is a concrete answer to "what value flows between composed stages, and how does it survive?" [1, 2, 3].

Evidence & Scope

This is a comparative survey of documented, production-deployed designs — Spark, TensorFlow, Horovod, Hadoop MapReduce, and Flink — read along three axes: evaluation strategy, recovery model, and synchronization. The evidence is each system's own established behavior, and the contribution is the shared vocabulary that connects them: the DIR is the design. The compositional lens [2] — a DIR as the value between composed functions — is what makes that vocabulary portable across frameworks that are usually studied apart.

References

  1. John Backus (1978). Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs. Communications of the ACM. [1977 ACM Turing Award Lecture]
  2. John Hughes (1989). Why Functional Programming Matters. The Computer Journal.
  3. Christopher Strachey (2000). Fundamental Concepts in Programming Languages. Higher-Order and Symbolic Computation. [Reprint of 1967 lecture notes]
  4. Ashish Vaswani et al. (2017). Attention Is All You Need. Advances in Neural Information Processing Systems (NeurIPS). arXiv:1706.03762.
  5. Tri Dao et al. (2022). FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness. Advances in Neural Information Processing Systems (NeurIPS). arXiv:2205.14135.