Skip to main content
QUICK REVIEW

[Paper Review] Flare: Native Compilation for Heterogeneous Workloads in Apache Spark

Grégory M. Essertel, Ruby Y. Tahboub|arXiv (Cornell University)|Mar 23, 2017
Advanced Database Systems and QueriesComputer Science29 references10 citations
TL;DR

Flare is a native code compilation back-end for Apache Spark that accelerates heterogeneous workloads by replacing Spark's JVM-based execution with natively compiled code, achieving order-of-magnitude performance improvements on TPC-H benchmarks and machine learning kernels without sacrificing Spark's high-level expressiveness. It leverages Delite's DSL compilation stack to optimize user-defined functions and enables scale-up on modern multi-core, in-memory systems.

ABSTRACT

The need for modern data analytics to combine relational, procedural, and map-reduce-style functional processing is widely recognized. State-of-the-art systems like Spark have added SQL front-ends and relational query optimization, which promise an increase in expressiveness and performance. But how good are these extensions at extracting high performance from modern hardware platforms? While Spark has made impressive progress, we show that for relational workloads, there is still a significant gap compared with best-of-breed query engines. And when stepping outside of the relational world, query optimization techniques are ineffective if large parts of a computation have to be treated as user-defined functions (UDFs). We present Flare: a new back-end for Spark that brings performance closer to the best SQL engines, without giving up the added expressiveness of Spark. We demonstrate order of magnitude speedups both for relational workloads such as TPC-H, as well as for a range of machine learning kernels that combine relational and iterative functional processing. Flare achieves these results through (1) compilation to native code, (2) replacing parts of the Spark runtime system, and (3) extending the scope of optimization and code generation to large classes of UDFs.

Motivation & Objective

  • Address the performance gap between Spark SQL and high-end relational engines like HyPer, which still lag by an order of magnitude on TPC-H benchmarks.
  • Overcome the limitations of Spark’s current runtime and code generation stack, especially for heterogeneous workloads combining relational and iterative functional processing.
  • Enable high-performance execution of user-defined functions (UDFs) in machine learning and data analytics pipelines by integrating with Delite’s domain-specific language (DSL) compilation stack.
  • Re-evaluate Spark’s scale-out-first design by demonstrating that scale-up on powerful, in-memory, multi-core systems can deliver superior performance with reduced resource overhead.
  • Maintain Spark’s high-level APIs and expressiveness while achieving performance close to hand-optimized, native systems through advanced code generation and optimization techniques.

Proposed method

  • Introduces Flare Level 1: replaces Spark’s JVM code generation with native code generation at the granularity of query stages, eliminating JVM overhead.
  • Introduces Flare Level 2: compiles entire query plans into native code, bypassing Spark’s RDD layer and optimizing for shared-memory, multi-core architectures.
  • Introduces Flare Level 3: maps Spark query plans to Delite’s intermediate language (DMLL), enabling end-to-end optimization of relational queries and UDFs written in Delite DSLs.
  • Leverages Delite’s compiler stack to generate highly optimized code, including GPU-parallel code, for UDFs in domains like machine learning (OptiML), graph processing (OptiGraph), and PDE solvers (OptiMesh).
  • Uses a hybrid execution model where relational operators are natively compiled, while UDFs are compiled via Delite’s DSLs, enabling unified optimization across data and compute phases.
  • Designs Flare to target scale-up architectures—large in-memory, multi-core systems—where fault tolerance is less critical, enabling efficient use of modern hardware resources.

Experimental results

Research questions

  • RQ1Can native code compilation close the performance gap between Spark SQL and best-of-breed relational engines like HyPer on standard benchmarks such as TPC-H?
  • RQ2To what extent can performance be improved for heterogeneous workloads combining relational processing and iterative functional computation (e.g., machine learning pipelines) using Spark’s high-level APIs?
  • RQ3How effective is integrating Spark with a domain-specific language (DSL) compilation stack like Delite in enabling end-to-end optimization of UDFs and relational operators?
  • RQ4What are the performance implications of shifting from a scale-out-first to a scale-up-first design in modern data analytics systems?
  • RQ5Can high-level abstractions in Spark be preserved while achieving low-level performance through advanced code generation and optimization techniques?

Key findings

  • Flare achieves order-of-magnitude speedups on TPC-H benchmarks, reducing query execution time to within a factor of 2–3 of HyPer, a best-of-breed relational engine.
  • For machine learning workloads combining DataFrame operations and iterative UDFs, Flare delivers 10x speedups compared to standard Spark implementations.
  • Flare Level 2, which compiles entire query plans to native code, significantly reduces runtime overhead by eliminating the RDD layer and JVM abstractions.
  • Integration with Delite enables optimization of UDFs written in OptiML and other DSLs, allowing for GPU-parallel execution and performance comparable to hand-optimized kernels.
  • The study demonstrates that scale-up on modern, large-memory, multi-core systems can outperform traditional scale-out architectures for many workloads, especially when CPU is the bottleneck.
  • Flare maintains full compatibility with Spark SQL’s high-level APIs and DataFrame abstractions, proving that performance and expressiveness are not mutually exclusive in data analytics systems.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.