An FPGA (a reconfigurable chip whose logic is set by a loaded configuration file) can measure its own power draw without any external probe. When a neural network accelerator on the chip switches heavily, the local supply voltage dips, and signals slow down slightly. A delay sensor turns that slowdown into a digital reading. One common design is a time-to-digital converter (TDC): a chain of logic stages, sampled once per clock, records how far a pulse travelled in that clock period. These readings have been used to spot out-of-distribution inputs to quantized accelerators with no added latency (Towards Functional Safety of Neural Network Hardware Accelerators) and to detect attacks (UniGuard). Both papers, however, set their sensors by hand. UniGuard reports that where the TDC sits on the chip changes detection accuracy, and it responds only with data augmentation.
This note proposes treating sensor configuration as a mixed-variable black-box optimization problem. That is a search over a space that mixes continuous, integer and unordered categorical settings, where each candidate can only be scored by running it. The twist is to split the knobs by how much it costs to change them. A chip-design step that must regenerate the configuration file takes tens of minutes to hours per trial. So we search only a few such choices: how many sensors to place, and in which chip regions. Everything else is made adjustable while the chip runs, by placing more sensors than needed. Runtime knobs include the sampling clock's phase offset, which taps of each chain are read, which sensors are enabled, how much the trace is averaged down, and the decision threshold. Each runtime candidate is scored in seconds on the live board. The claim is that runtime search over the physical measurement settings, done jointly with sensor selection, beats both hand-tuned single sensors and the obvious alternative of recording every sensor and letting a classifier sort it out. It should win at equal sensor area and on out-of-distribution sets it never saw during tuning.
Core Claim
The interesting part is that the best measurement settings cannot be recovered after the fact. The phase offset between the launch pulse and the sampling clock decides where the pulse edge lands in each chain. Set it wrong and the chain saturates or underflows: the calibration problem the file lists as open for delay sensors. Each physical sensor has its own process-dependent delay, so the best phase for one sensor is not the best for another. This is exactly the kind of interaction between a categorical choice (which sensor) and a continuous value (phase) that Challenges of Interaction in Optimizing Mixed Categorical-Continuous Variables identifies as hard for both surrogate models and joint stochastic search.
A trace recorded at one phase does not contain the information a different phase would have captured. Feature selection on fixed recordings therefore cannot substitute for searching on hardware. If that physical coupling is weak in practice, the simpler pipeline wins, and the experiments are built to show this either way.
Research Program
We build a FINN accelerator. FINN is AMD/Xilinx's tool that compiles quantized networks into streaming FPGA hardware. We use networks quantized with Brevitas down to 1-bit weights and activations, following the setup of Meyers et al. Next to the accelerator we place an overprovisioned grid of small TDC and routing-delay sensors spread over several clock regions. These sit near the DSP, memory and logic columns the accelerator uses.
A small on-chip controller exposes the runtime knobs: a per-group sampling phase (continuous); the assignment of each sensor to one of a few clock-phase groups (categorical); a read window of taps per sensor (integer); a decimation ratio (integer); an enable mask (binary); and a detection threshold (continuous). One evaluation streams a fixed batch of in-distribution and tuning-set inputs through the accelerator, collects traces, and fits a lightweight scorer. Following Meyers et al., this is a statistical threshold bound learned from in-distribution traces. The evaluation returns two objectives: the false-positive rate at 95% true-positive rate (FPR-95) on the tuning out-of-distribution set, and the flip-flop and routing cost of the enabled sensors.
The inner search over runtime knobs uses CatCMA with Margin and its multi-objective variant from CatCMA with Margin. This method keeps one joint distribution over all three variable types and uses a probability floor so that discrete choices are not frozen early. It has so far been tested only on synthetic functions. Seconds-per-evaluation hardware gives it the budget of several hundred to a few thousand evaluations it needs. Its authors concede that Bayesian methods win below about 100 evaluations, so we also run Bayesian baselines at matched budget rather than assume the outcome.
The outer search over synthesis-time choices (sensor count per region, sensor type) gets only twenty to thirty configuration builds. For that loop we use the tree-ensemble Bayesian optimizer ENTMOOT from Multi-Objective Constrained Optimization for Energy Applications via Tree Ensembles. ENTMOOT fits gradient-boosted trees, solves for the next candidate exactly with a mixed-integer program, and encodes hard constraints. We use those constraints for FPGA restrictions such as "this sensor type only fits these columns" and "tap count bounds depend on sensor type." Its score for each build is the best Pareto front the inner loop finds. The tree surrogate here stays small, so the solver-scaling concern ENTMOOT itself raises does not bind.
The protocol guards against an obvious leak. The optimizer could quietly tune itself to one out-of-distribution dataset. So every search tunes on a single out-of-distribution source and reports results on held-out ones. UniGuard's drop to 62.6% accuracy on unseen adversarial and model-extraction attacks shows that generalization, not in-sample accuracy, is the weak point.
Baselines
The naive reference point is the fixed routing-delay-sensor configuration of Towards Functional Safety of Neural Network Hardware Accelerators. We rebuild it on the same board with the same networks. That paper reports an FPR-95 of 0.67 on MNIST-C, and we quote this number as reported. Its text gives no isolated CIFAR-10 figure, so for CIFAR-10 we found no reported result on Lacuna for a delay-sensor FPR-95, and we compare only against our own reproduction. It is the right anchor because it is the published sensor-based detector on exactly this benchmark family.
The second baseline is careful manual engineering at matched evaluation count. An engineer places one sensor adjacent to the arithmetic core and grid-sweeps phase and tap window. This represents what practitioners actually do.
The strongest competitor is the overprovisioned array read out entirely at one calibrated default phase. On top of it we train either UniGuard's bidirectional recurrent classifier or greedy forward sensor selection, both at the same sensor cost. UniGuard reports 94.0% attack-detection accuracy at 0.48% LUT/FF overhead with a single TDC. It is the most capable learned detector in the file, and "record everything, learn the rest" is the simplest way to get most of what search promises. Beating it means a lower held-out FPR-95 at equal or lower enabled-sensor cost, consistent across at least three seeds and two boards.
For the optimizer itself we compare CatCMA with Margin against three alternatives. The first is TPE and SMAC3, the Bayesian tools its authors compared against. The second is a split design, with a bandit over the categorical choices and Gaussian-process Bayesian optimization over the continuous ones. That is the decoupling that Mixed-Variable Black-Box Optimisation Using Value Proposal Trees argues traps search. The third is continuous relaxation with rounding, which (1+1)-CMA-ES with Margin shows creates flat plateaus. All of them get the same evaluation count and wall-clock budget. Results are reported as hypervolume against number of hardware evaluations.
Two ablations isolate the key ingredient. One freezes phase at the calibrated default, which removes the physical knob. The other tunes each sensor's phase independently and then selects sensors, which removes the joint interaction. If the full method beats the second ablation, the interaction is real.
Why not just…?
Why not just record all sensors once and let a classifier or feature selection pick the useful ones? This is the serious threat. A trace recorded at a fixed phase is blind to information that a different phase would capture, but if that loss is small, offline selection is cheaper and simpler. The frozen-phase ablation and the all-channel baseline settle the question directly. If they come within noise of the full method on held-out out-of-distribution sets, we report that the simple pipeline suffices and that the useful contribution is the overprovisioned array plus offline selection.
Why not just grid-sweep a hand-placed sensor? UniGuard's own observation that accuracy varies with placement suggests a single hand placement leaves performance unused. Still, a small sweep could be near optimal. The matched-budget manual baseline measures this, and we will report the gap even if it is small.
Why not just use standard Bayesian optimization instead of an evolution strategy? No reported result was found on Lacuna for any optimizer on sensor configuration. The only evidence on the budget question is CatCMA with Margin's own concession that surrogates win below about 100 evaluations. We therefore treat optimizer choice as an empirical question within the study and report the crossover budget, not a fixed winner.
Proposed Experiments
We use MNIST, CIFAR-10 and GTSRB models compiled with FINN at 1-bit and at wider bit widths. Searches tune on FashionMNIST (for MNIST models) or SVHN (for CIFAR-10 models). Results are reported on MNIST-C, grayscale-resized CIFAR-10, TinyImageNet, and the remaining held-out set. Metrics are FPR-95, area under the ROC curve, enabled flip-flop/LUT cost, hypervolume against hardware evaluations, and total wall-clock time.
Three decisive checks follow. First, does the joint search beat the per-sensor-independent ablation on held-out sets? This tests the interaction claim. Second, does a configuration found on one board transfer to a second board of the same part, and after a thermal soak? Process variation and drift are the known enemies of raw delay readings, and a configuration that does not transfer would need re-tuning per device. Third, does the best configuration shift between 1-bit and wider accelerators? A shift would show that sensor tuning is coupled to quantization, as the file's quantization gap suggests. No shift would mean a single tuned sensor design can be reused across models.
References
- Towards Functional Safety of Neural Network Hardware Accelerators: Concurrent Out-of-Distribution Detection in Hardware Using Power Side-Channel Analysis
- UniGuard: A Unified Hardware-oriented Threat Detector for FPGA-based AI Accelerators
- Challenges of Interaction in Optimizing Mixed Categorical-Continuous Variables
- CatCMA with Margin: Stochastic Optimization for Continuous, Integer, and Categorical Variables
- Multi-Objective Constrained Optimization for Energy Applications via Tree Ensembles
- Mixed-Variable Black-Box Optimisation Using Value Proposal Trees
- (1+1)-CMA-ES with Margin for Discrete and Mixed-Integer Problems