TL;DR
Alchemist is a system that allows Apache Spark to offload heavy linear algebra and machine learning computations to high-performance MPI-based libraries. By bypassing Spark’s significant scheduling and communication overheads, Alchemist achieves speedups of up to an order of magnitude and enables Spark to scale to terabyte-sized matrix operations that were previously impractical.
What Problem Does This Paper Address?
Apache Spark is the "Swiss Army Knife" of big data, beloved for its high productivity, fault tolerance, and rich ecosystem. However, it has a well-known Achilles' heel: heavy iterative linear algebra.
In Spark, every iteration of an algorithm (like those used in Principal Component Analysis or solving linear systems) incurs "taxation" in the form of scheduler delays, task startup overhead, and communication bottlenecks. Meanwhile, the High-Performance Computing (HPC) community has spent decades perfecting the Message-Passing Interface (MPI) and libraries like ScaLAPACK or Elemental, which are significantly faster but lack Spark's user-friendly features. The authors tackle the challenge of combining Spark’s productivity with MPI’s raw performance without the massive overhead of writing data to disk between steps.
Methods
The authors introduce Alchemist, a bridge between the Spark and MPI worlds. Its architecture consists of three main parts:
- Alchemist Server: A standalone process (running on a separate set of nodes) that manages MPI-based worker processes.
- Alchemist-Client Interface (ACI): A Spark-side library that allows users to send data from Spark RDDs (specifically
IndexedRowMatrix) to Alchemist. - Alchemist-Library Interface (ALI): A dynamic linking system that allows Alchemist to call various MPI libraries (like Elemental or Skylark) at runtime.
The "Secret Sauce": Instead of using slow file-based transfers (like HDFS), Alchemist uses asynchronous TCP sockets to transfer data directly from Spark executors' memory to MPI workers' memory. This "in-memory" transfer is the key to maintaining high performance.
Datasets
The paper evaluates Alchemist using two primary data science case studies:
- Modified TIMIT Speech Corpus: Used for a speech classification problem. The original dataset (2.2M training examples, 440 features) was expanded using the "random feature method" to create matrices with up to 60,000 features to test scalability.
- Ocean Temperature Data: A real-world 3D dataset from the Climate Forecast System Reanalysis (CFSR). The authors used an abridged 400GB version for performance comparisons and then replicated it to create massive datasets ranging from 2.2TB to 17.6TB for scaling tests.
Key Insights and Ideas
- The "Best of Both Worlds": Alchemist allows a data scientist to stay within the Spark ecosystem (using Scala, Python, or R) for data cleaning and ETL, but "outsource" the mathematically intense parts to HPC libraries.
- Overhead is the Enemy: The paper highlights that for large-scale SVD (Singular Value Decomposition), Spark’s overhead actually "anti-scales"—as you add more nodes, the management overhead grows faster than the computational benefit. Alchemist circumvents this by using the more efficient MPI communication model.
- Matrix Proxies: Alchemist uses
AlMatrixobjects in Spark. These act as "handles" or pointers to data living in the MPI environment. This allows users to chain multiple MPI operations together without ever sending the data back to Spark until the very end.
Key Results
- Conjugate Gradient (CG) Solver: For a speech classification problem with 10,000 features, Alchemist was over 30x faster than a pure Spark implementation (646 seconds vs. 21,442 seconds). Furthermore, Spark failed to run at all when features exceeded 10,000, while Alchemist scaled easily to 60,000 features.
- Truncated SVD: On a 400GB ocean temperature dataset, offloading to Alchemist provided a 7.9x speedup compared to Spark’s native MLlib implementation.
- Extreme Scaling: The authors demonstrated that Alchemist could perform a rank-20 SVD on a 17.6TB dataset in roughly 4 minutes (excluding data load time), proving it can handle "true" big data that would likely crash standard Spark MLlib routines.
Limitations and Future Work
- Memory Redundancy: Currently, Alchemist requires two copies of the data to exist: one in Spark’s RDDs and one in Alchemist’s distributed matrices. This increases the total memory footprint of the cluster.
- Inelasticity: Unlike Spark, which can handle nodes dropping out mid-job, MPI is "inelastic." If an Alchemist node fails, the MPI computation generally fails and must be restarted.
- Library Support: At the time of writing, Alchemist primarily supported libraries built on the Elemental framework. The authors noted that adding support for other packages like ScaLAPACK would require additional wrapper functions.
- Language Support: While the paper focuses on Scala/Spark, the authors mentioned that a Python interface (PySpark) was a high-priority future development.
Summary updated