TL;DR
This paper introduces a novel methodology and unified framework to bridge the gap between domain-specific frameworks (like those for deep learning, classical machine learning, and data analysis) and a wide range of hardware devices. By employing multi-layer abstractions and a primitive operator set, they reduce the complexity of porting applications from O(M×N) to O(M+N), achieving significant performance improvements across diverse hardware.
What Problem Does This Paper Address?
The rapid proliferation of specialized frameworks for domains like deep learning (DL), classical machine learning (CML), and data analysis (DA) has led to a significant challenge: these frameworks often lack comprehensive support for the diverse and rapidly evolving landscape of hardware devices (CPUs, GPUs, RISC-V, IoT devices, etc.). This forces developers into a costly case-by-case implementation and porting process, leading to a theoretical complexity of O(M×N), where M is the number of frameworks and N is the number of hardware platforms. Furthermore, existing frameworks are often siloed, preventing knowledge and optimization sharing across domains. This fragmentation hinders efficient hardware utilization and software development, especially for emerging hardware that may lack mature software ecosystems.
Methods
The core of this work is a systematic methodology that employs multi-layer abstractions to bridge the gap between domain-specific frameworks and hardware.
- Domain-Specific Abstractions: For each domain (DL, CML, DA), they define specific abstractions for data and computation. For DL, this involves tensors and DL operators. For CML, it's tensors and a Classical Operator Representation (COR). For DA, it's TensorTable and DA operators.
- Unified Abstraction: These domain-specific abstractions are then transformed into a single, unified abstraction based on Directed Acyclic Graphs (DAGs). This unified abstraction can represent cross-domain applications.
- Primitive Operator Set: To manage the vast number of operators across domains, they distill them into a compact set of 80 primitive operators. These operators are designed to be combinable to represent complex algorithms.
- Multi-Level Optimizations: The framework applies optimizations at various levels:
- Domain-Specific Optimizations: Tailored to the unique characteristics of DL, CML, and DA.
- Cross-Domain Optimizations: For mixed workloads across domains.
- Generic Graph-Level Optimizations: Standard optimizations like constant folding.
- Operator-Level Optimizations: Both hardware-agnostic and hardware-specific optimizations for the primitive operators.
- Code Generation and Runtime: They leverage existing compilers like TVM and LLVM for code generation, supplementing them with custom modules for hardware like RISC-V. A lightweight runtime is used to execute the generated code on multiple hardware platforms.
Datasets
The paper does not explicitly mention datasets used for training their framework. However, for evaluation, they utilize:
- CML Models: A set of 10 CML models, including the YearPrediction dataset [24].
- DA Operators: Five DA operators, using the BIXI dataset [26] at various scales.
- DL Models: A set of 103 widely-used DL models from the ONNX model repository for operator coverage analysis.
- CML Models: 47 high-frequency models from scikit-learn and Spark MLlib for operator coverage analysis.
- DA Pipelines: 22 DA pipelines from TPC-H for operator coverage analysis.
Key Insights and Ideas
- Complexity Reduction is Key: The core insight is that by introducing intermediate abstractions and a unified representation, the complexity of porting applications across frameworks and hardware can be drastically reduced from O(M×N) to O(M+N). This is analogous to how general-purpose compilers use Intermediate Representations (IRs).
- A Universal Primitive Operator Set is Feasible: The paper demonstrates that a surprisingly small set of primitive operators (80) can adequately represent the vast majority of operations found in DL, CML, and DA, making it a practical target for optimization.
- Domain-Specific Abstractions are Crucial for Performance: While a unified abstraction is necessary for portability, the paper highlights the importance of domain-specific abstractions to capture unique features and enable targeted optimizations that are critical for performance.
- Bridging the "Software Ecosystem Gap": The work directly addresses the challenge of emerging hardware (like RISC-V) lacking mature software libraries by providing a compilation path that leverages existing tools (LLVM) and custom optimizations.
Key Results
The proposed framework demonstrates significant performance improvements and broad hardware support:
- Speedups:
- X86 Servers: 1.1x to 3.83x speedup compared to existing solutions.
- ARM IoT Devices: 1.06x to 4.33x speedup.
- RISC-V IoT Devices: 1.25x to 3.72x speedup.
- GPU: 1.93x speedup.
- Operator Coverage: The primitive operator set covers 98% of tested DL models, 100% of tested CML models, and 100% of tested DA pipelines.
- Hardware Support: The framework supports X86, ARM, RISC-V, IoT devices, and GPUs.
- Cross-Domain Applications: The methodology is designed to handle mixed workloads from different domains.
Limitations and Future Work
- Long-Tail Operators: While the primitive operator set covers the majority of common operations, two DL models contained "long-tail" operators (e.g.,
sequence_map,category_mapper) that were not directly covered by the primitive set. This suggests that while coverage is high, some specialized operations might still require custom handling or extension of the primitive set. - Performance Trade-offs: For the projection operator in DA, the framework exhibited weaker performance compared to pandas due to data layout adjustments made to ensure data locality for other operators. This highlights a potential trade-off between optimizing for specific operations and overall pipeline performance.
- Future Work: The paper implicitly suggests future work in expanding the primitive operator set to cover more specialized operations and further refining optimization strategies for specific hardware architectures and cross-domain scenarios. The authors also provide their source code, inviting community contributions.
Summary updated