TL;DR
MetaML-Pro is an automated co-optimization framework that bridges the gap between software-level deep learning optimizations and hardware-level High-Level Synthesis (HLS) for FPGAs. By combining a modular "blackboard" architecture with constraint-aware Bayesian optimization, it automatically navigates complex design trade-offs to drastically reduce hardware resource usage while preserving model accuracy.
What Problem Does This Paper Address?
Deploying Deep Neural Networks (DNNs) onto resource-constrained hardware like FPGAs requires a delicate balance between performance, resource utilization (such as DSPs and LUTs), and inference accuracy. Traditionally, this process is siloed: machine learning engineers optimize the model in software (e.g., via pruning or scaling), while hardware engineers optimize the implementation details in hardware.
Information typically flows one way—top-down—from the application to the hardware. When hardware constraints are violated, fixing them requires slow, manual, expert-driven iterations. Existing frameworks lack a unified, automated way to handle both top-down and bottom-up feedback loops across these distinct abstraction layers, making the design space exploration (DSE) incredibly time-consuming and heavily reliant on domain expertise.
Methods
MetaML-Pro introduces a customizable, multi-level, cross-stage design flow automation framework. Its architecture relies on two pillars:
- Pipe Tasks: Reusable building blocks categorized into O-tasks (optimization tasks like pruning and scaling), K-tasks (control flow tasks like
BRANCH,FORK,REDUCE), and $\lambda$-tasks (functional transformations like HLS4ML or Vivado HLS compilation). - Meta-Model (Blackboard Architecture): Instead of tasks communicating directly, they interact via a shared meta-model containing configuration data (CFG), execution logs (LOG), and a versioned model space. This allows downstream hardware metrics to seamlessly inform upstream software optimizations.
To optimize the hardware directly, MetaML-Pro leverages HLS Metaprogramming to operate directly on the C++ Abstract Syntax Tree (AST). This allows it to dynamically adjust data types, bit-widths, and insert pragmas (like loop unrolling) across heterogeneous codebases.
Finally, the entire flow is governed by a Cross-Stage Constrained Bayesian Optimization (BO) algorithm. It uses FORK/REDUCE to explore different optimization task permutations in parallel and aggregates the results based on Pareto dominance, automatically tuning global tolerance variables without manual intervention.
Datasets
The framework was evaluated using diverse benchmark workloads across multiple application domains:
- Jet-HLF: A high-level features dataset used for a jet identification task (Jet-DNN / Jet-CNN) in particle physics, targeting ultra-low latency CERN Large Hadron Collider (LHC) trigger systems.
- MNIST: Used for standard image classification with a VGG-7 network and sequence classification with an LSTM network.
- SVHN (Street View House Numbers): Used for image classification with a ResNet-9 network.
- GNN Case Study: The authors also evaluated their framework on an irregular, graph-based jet classifier model family to demonstrate scaling.
No new datasets were introduced in this paper.
Key Insights and Ideas
- The Order of Optimizations Matters: The sequence in which optimizations are applied (e.g., scaling before pruning vs. pruning before scaling) significantly alters the final hardware efficiency and accuracy trade-off. MetaML-Pro automates this ordering search rather than assuming a fixed pipeline.
- AST Metaprogramming Beats Templates: Traditional HLS code generation relies on rigid templates. By manipulating the AST directly, MetaML-Pro ensures type consistency across intermediate streams and customizes code without needing to modify the underlying generator tool.
- Bottom-Up Feedback Prevents Wasted Search: Allowing hardware synthesis reports to actively adjust software-level accuracy tolerances (via
BRANCHK-tasks) prevents the design space exploration from getting stuck on unroutable or over-mapped hardware candidates.
Key Results
- Massive Resource Savings: For the Jet-DNN network, the optimized
S→P→Q(Scaling $\rightarrow$ Pruning $\rightarrow$ Quantization) design achieved up to a 92% reduction in DSP usage and an 89% reduction in LUT usage compared to the baseline, while preserving model accuracy. - 15.6× Faster Exploration: The constraint-aware Bayesian Optimization strategy achieved comparable Pareto-optimal results to an extensive grid search but with a 15.6-fold reduction in optimization time (22 iterations over 40 hours vs. 343 iterations over 624 hours).
- Cross-Vendor Portability: The framework successfully targeted both AMD/Xilinx (Vivado HLS) and Intel (oneAPI) FPGAs, automatically adapting to vendor-specific architectural tendencies (e.g., Intel's compiler favoring soft multipliers over DSP blocks for certain tasks).
Limitations and Future Work
- Downstream Hardware Stages: The current implementation focuses primarily on custom optimizations in the software (SW) and HLS stages, leaving default configurations for downstream stages like RTL generation and Netlist placement.
- Evolving Model Architectures: While evaluated successfully on CNNs, RNNs, and GNNs, the authors note that extending the framework to support emerging Transformer families and Large Language Models (LLMs) is a crucial next step.
- ASIC Backend: The framework currently targets FPGAs; the authors plan to extend future iterations to include RTL space and ASIC platform support.
Summary updated