[Paper Review] Weld: Rethinking the Interface Between Data-Intensive Applications
Weld proposes a new interface for data-intensive applications that optimizes cross-library data movement by using a unified, lazily-evaluated intermediate representation (IR) to enable cross-function optimizations like loop fusion and vectorization. It achieves up to 29× speedup in multi-library workflows and 6.5× in single-library pipelines without changing existing APIs, by compiling optimized code across disparate libraries such as Spark, TensorFlow, Pandas, and NumPy.
Data analytics applications combine multiple functions from different libraries and frameworks. Even when each function is optimized in isolation, the performance of the combined application can be an order of magnitude below hardware limits due to extensive data movement across these functions. To address this problem, we propose Weld, a new interface between data-intensive libraries that can optimize across disjoint libraries and functions. Weld exposes a lazily-evaluated API where diverse functions can submit their computations in a simple but general intermediate representation that captures their data-parallel structure. It then optimizes data movement across these functions and emits efficient code for diverse hardware. Weld can be integrated into existing frameworks such as Spark, TensorFlow, Pandas and NumPy without changing their user-facing APIs. We demonstrate that Weld can speed up applications using these frameworks by up to 29x.
Motivation & Objective
- To address the performance bottleneck in data analytics workloads caused by excessive data movement between independently optimized libraries.
- To enable cross-library optimizations—such as loop fusion and vectorization—without requiring changes to existing library APIs.
- To design a general-purpose, hardware-agnostic intermediate representation (IR) that captures data-parallel computations across diverse workloads.
- To demonstrate that runtime optimization across independently developed libraries can achieve performance close to hand-optimized code.
- To enable efficient execution of single-threaded libraries like NumPy and Pandas on parallel hardware via automatic parallelization.
Proposed method
- Weld uses a functional intermediate representation (IR) based on nested parallel loops and 'builders'—abstractions that specify what result to compute without low-level implementation details.
- Libraries submit their computations as IR fragments through a lazily-evaluated runtime API, deferring execution until evaluation is forced.
- The Weld optimizer combines IR fragments from multiple libraries and applies optimizations such as loop fusion, loop tiling, and vectorization across function boundaries.
- The system emits efficient machine code for diverse hardware, including multicore CPUs and GPUs, while preserving native in-memory data formats of libraries like Spark SQL and NumPy.
- Weld integrates with existing frameworks via lightweight wrappers, maintaining backward compatibility with user-facing APIs.
- The IR supports expressing relational, graph, and machine learning workloads, enabling optimization across heterogeneous data-parallel operations.
Experimental results
Research questions
- RQ1Can a unified intermediate representation enable cross-library optimizations that are not possible within individual libraries?
- RQ2To what extent can lazy evaluation and IR composition reduce data movement overhead in multi-library data analytics pipelines?
- RQ3Can a general-purpose IR achieve performance comparable to specialized systems like XLA or Hyper in diverse workloads?
- RQ4How effective is Weld in optimizing workloads that combine both well-optimized libraries and single-threaded functions?
- RQ5Can Weld enable automatic parallelization of single-threaded libraries like NumPy and Pandas without source code changes?
Key findings
- Weld achieves up to 29× speedup in applications that combine multiple data-intensive libraries such as Spark, TensorFlow, Pandas, and NumPy.
- Even in workflows using only functions from a single library, Weld delivers up to 6.5× speedup by minimizing data movement and enabling cross-optimization.
- Weld enables up to 180× speedup when parallelizing single-threaded libraries like NumPy and Pandas by automatically exploiting data-parallelism.
- The system successfully integrates with existing frameworks including Spark SQL, TensorFlow, Pandas, and NumPy without modifying their public APIs.
- Weld's optimizer applies loop fusion and vectorization across library boundaries, reducing intermediate data materialization and improving memory bandwidth utilization.
- The intermediate representation is general enough to express relational, graph, and machine learning workloads while enabling high-performance code generation across diverse hardware platforms.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.