Skip to main content
Back

UC San Diego's SNAC-Pack Cuts FPGA Neural Network Design From Months to Hours

SNAC-Pack automates FPGA-ready neural architecture search using hardware surrogate models, cutting months of manual tuning to hours

Pro

  • SNAC-Pack is an open-source AutoML framework that runs hardware-aware neural architecture search and produces synthesized FPGA firmware end-to-end.
  • A surrogate model predicts LUT, DSP, BRAM, FF, and latency for each candidate architecture, replacing expensive synthesis in the search loop.
  • Multi-objective search via NSGA-II in Optuna produces a Pareto front of accuracy vs. hardware cost tradeoffs, not a single model.
  • On LHC jet classification, the resource-optimized model cuts LUT usage by 78% and achieves 50 ns latency vs. 105 ns for the baseline.
  • On qubit readout, SNAC-Pack reduced design space exploration from months of manual tuning to a few hours of automated search.
  • Code is open-source on GitHub; configured via YAML with an optional AI agent (MCP) frontend.

Deploying neural networks on FPGAs is one of the most unforgiving engineering challenges in applied ML. Unlike CPUs or GPUs, where you can roughly predict cost from floating-point operations, FPGAs impose a five-dimensional resource budget: lookup tables (LUTs), digital signal processors (DSPs), block RAM (BRAM), flip-flops (FFs), and clock cycles. Get any one of those wrong and your design simply does not fit. A team from UC San Diego, ETH Zurich, and Fermi National Accelerator Laboratory has now released SNAC-Pack, an open-source AutoML framework that automates the entire pipeline from architecture search to synthesized FPGA firmware.

The gap that existing NAS tools leave open

Neural architecture search (NAS) has matured a lot, but almost all existing tools optimize for accuracy or use software-level proxies like FLOPs or bit operations (BOPs) as stand-ins for hardware cost. The hls4ml library is open-source software designed to facilitate the deployment of ML models on FPGAs, targeting low-latency and low-power edge applications. But hls4ml is a synthesis tool, not a search system. The missing piece was a framework that could explore thousands of candidate architectures and score them on real FPGA metrics without running a full synthesis pass (which can take minutes to hours per candidate) on every single trial.

Taking a neural network model as input, hls4ml generates C/C++ code designed to be transpiled into FPGA firmware by processing it with a high-level synthesis (HLS) library. That synthesis step is the bottleneck. SNAC-Pack solves this by inserting a fast surrogate model into the search loop that predicts resource utilization and latency without invoking the synthesizer, reserving full synthesis only for the final selected architectures.

How the pipeline works, step by step

SNAC-Pack system architecture diagram showing global search, local compression, and hardware synthesis stages

SNAC-Pack operates in two main stages: a global search and a local compression pass. Here is the full flow:

  1. Configure via YAML (or an AI agent): Users specify the dataset, search space (layer depths, widths, activations, regularization), optimization objectives, and target FPGA board in a YAML file. An optional Model Context Protocol (MCP) frontend lets agentic clients drive the same pipeline through natural language.
  2. Global search with NSGA-II: The framework uses NSGA-II, which stands for "Nondominated Sorting Genetic Algorithm II", a well-known, fast, and elitist multi-objective genetic algorithm. For each trial, the sampler draws architecture and training hyperparameters, builds a Keras model, trains it for a few epochs, and scores it on accuracy and hardware metrics.
  3. Surrogate hardware scoring: Instead of running Vivado synthesis on every candidate, SNAC-Pack passes each trained model to rule4ml, a fast regressor that predicts LUT, FF, BRAM, DSP utilization, and clock-cycle latency. This makes the search loop orders of magnitude faster.
  4. Parallel trials via SQLite: All workers, whether on a single machine or spread across Slurm nodes, write completed trials to a shared SQLite database. The Pareto archive is maintained centrally, and workers pick up new trials independently.
  5. Local compression: Selected Pareto-optimal architectures go through a combined quantization-aware training (QAT) and iterative magnitude pruning loop. QAT simulates low-precision arithmetic during training so the model learns to tolerate quantization. Pruning iteratively zeros out the smallest weights, and a lottery-ticket-style weight rewind resets surviving weights to their post-warmup values before each iteration.
  6. FPGA synthesis: The compressed model is exported through hls4ml, which generates HLS code that Vivado compiles into actual FPGA firmware. The post-route resource numbers from Vivado are the ground truth reported in the paper.

A key design choice is that the surrogate scores are used for exploration, while synthesis is used only for validation. This keeps wall time dominated by short training runs rather than place-and-route.

Two demanding benchmarks, two different stories

The team validated SNAC-Pack on two scientific ML tasks that sit at opposite ends of the FPGA deployment spectrum.

Jet classification at the LHC. The development of hls4ml was historically driven by the need to integrate ML algorithms in the first stage of the real-time data processing of particle physics experiments operating at the CERN Large Hadron Collider. The task here is classifying collision-created jets into five categories (light quark, gluon, W boson, Z boson, top quark) from kinematic properties, with sub-microsecond inference required at the trigger level. SNAC-Pack ran 500 trials over ~6 hours of global search on a single A100, then ~8 hours of local search. The results against a state-of-the-art baseline:

ModelAccuracyLUTFFLatency (ns)
Baseline63.77%155,080 (9.0%)25,714 (0.7%)105 ns
SNAC-Pack (Optimal Accuracy)63.84%57,728 (3.34%)12,605 (0.36%)140 ns
SNAC-Pack (Optimal Resource)62.30%34,472 (1.99%)5,061 (0.15%)50 ns

The resource-optimized model cuts LUT usage by 78% and FF usage by 80% compared to the baseline, while achieving 50 ns latency. The accuracy-focused model actually beats the baseline on accuracy while still using 63% fewer LUTs.

Pareto front scatter plot showing accuracy vs average FPGA resource utilization across 500 trials

Superconducting qubit readout. This is where the time savings become dramatic. The task is classifying qubit states from microwave readout signals under strict latency and hardware budgets. Previously, engineers had spent months manually hand-tuning candidate architectures and readout windows. SNAC-Pack distributed 500 trials across ten Slurm nodes, completing global search in ~3 hours per node and local search in ~1.5 hours per node. The final model cut LUT usage roughly in half (from 15,045 to 6,996) and reduced latency from 19.35 ns to 12.9 ns, with readout fidelity dropping only marginally from 96.06% to 95.21%.

What the surrogate gets wrong

The paper is honest about a key limitation: surrogate scores during global search can disagree with Vivado's actual timing results. The accuracy-focused SNAC-Pack model for jet classification was predicted to have low latency by the surrogate, but post-synthesis it turned out slower than the baseline. This "surrogate-Vivado misalignment" is a known challenge in hardware-aware NAS, and the authors flag improving surrogate calibration as future work. The current setup is best understood as a powerful exploration tool that narrows the search space, not a perfect predictor of final hardware performance.

Other current limitations worth noting:

  • The search space is currently focused on MLP architectures; broader support for CNNs and other layer types depends on expanding the surrogate predictors.
  • The framework uses TensorFlow/Keras internally; PyTorch users will need to work within those constraints.
  • Search variance across random seeds is not yet reported, so reproducibility bounds are unclear.

The real unlock: closing the loop end-to-end

The deeper contribution here is not any single algorithmic novelty but the integration of the full stack into one configurable pipeline. Most AutoML frameworks stop at a trained checkpoint. hls4ml is open-source software designed to facilitate the deployment of ML models on FPGAs, targeting low-latency and low-power edge applications; taking a neural network model as input, it generates C/C++ code for FPGA deployment. SNAC-Pack is the first open-source framework to connect NAS directly to hls4ml synthesis, with hardware-aware objectives feeding back into the search rather than being evaluated only after the fact.

This matters most for domains where FPGA deployment is non-negotiable: particle physics triggers, quantum computing control electronics, radar signal processing, and any edge application where microsecond-scale latency is a hard requirement. In those settings, the alternative to a tool like SNAC-Pack is months of manual iteration by engineers who understand both ML and FPGA design, a rare and expensive combination.

The code is publicly available on GitHub under the fastmachinelearning organization. The framework is configured entirely through YAML files, and the optional MCP interface means it can be driven by an AI agent without modifying any source code, making it accessible to teams that want to automate the automation.