W HAT TO EXPECT OF HARDWARE METRIC PREDICTORS IN N EURAL A RCHITECTURE S EARCH
Anonymous authors
Paper under double-blind review
A BSTRACT
Modern Neural Architecture Search (NAS) focuses on ﬁnding the best performing architectures in hardware-aware settings; e.g., those with an optimal tradeoff of accuracy and latency.
Due to many advantages of prediction models over live measurements, the search process is often guided by estimates of how well each considered network architecture performs on the desired metrics.
Typical prediction models range from operation-wise lookup tables over gradient-boosted trees and neural networks, with little known information on how they compare.
We evaluate 18 different performance predictors on ten combinations of metrics, devices, network types, and training tasks, and ﬁnd that MLP models are the most promising.
We then simulate and evaluate how the guidance of such prediction models affects the subsequent architecture selection.
Due to inaccurate predictions, the selected architectures are generally suboptimal, which we quantify as an expected reduction in accuracy and hypervolume.
We show that simply verifying the predictions of just the selected architectures can lead to substantially improved results.
Under a time budget, we ﬁnd it preferable to use a fast and inaccurate prediction model over accurate but slow live measurements.
I NTRODUCTION
Modern neural network architectures are designed not only considering their primary objective, such as accuracy.
While existing architectures can be scaled down to work with the limited available memory and computational power of, e.g., mobile phones, they are signiﬁcantly outperformed by speciﬁcally designed architectures (Howard et al., 2017; Sandler et al., 2018; Zhang et al., 2018;
Ma et al., 2018).
Standard hardware metrics include memory usage, number of model parameters,
Multiply-Accumulate operations, energy consumption, latency, and more; each of which may be limited by the hardware platform or network task.
As the range of tasks and target platforms grows, specialized architectures and the methods to ﬁnd them efﬁciently are gaining importance.
The automated design and discovery of specialized architectures is the main intent of Neural Architecture Search (NAS).
This recent ﬁeld of study repeatedly broke state of the art records (Zoph et al., 2018; Real et al., 2018;
Cai et al., 2019; Tan & Le, 2019; Chu et al., 2019a;
Hu et al., 2020) while aiming to reduce the researchers’ involvement with this tedious and time-consuming process to a minimum.
As the performance of each considered architecture needs to be evaluated, the hardware metrics need to be either measured live or guessed by a trained prediction model.
While measuring live has the advantage of not suffering from inaccurate predictions, the corresponding hardware needs to be available during the search process.
Measuring on-demand may also signiﬁcantly slow down the search process and necessitates further measurements for each new architecture search.
On the other hand, a prediction model abstracts the hardware from the search code and simpliﬁes changes to the optimization targets, such as metrics or devices.
The data set to train the predictor also has to be collected only once so that a trained predictor then works in the absence of the hardware it is predicting for, e.g., in a cloud environment.
Furthermore, a differentiable predictor can be used for gradient-based architecture optimization of typically non-differentiable metrics (Cai et al., 2019;
Xu et al., 2020; Nayman et al., 2021).
While the many advantages make predictors a popular choice of hardware-aware NAS (e.g. Xu et al.
; Wu et al.
; Wan et al.
Dai et al.
Nayman et al.
, there are no guidelines on which predictors perform best, how many training samples are required, or what happens when a predictor is inaccurate.
This work investigates the above points.
As a ﬁrst contribution, we conduct large-scale experiments on ten hardware-metric datasets chosen from HWNAS-Bench (Li et al., 2021a) and TransNAS-Bench-101 (Duan et al., 2021).
We explore how powerful the different predictors are when using different amounts of training data and whether these results generalize across different network architecture types.
As a second contribution, we extensively simulate the subsequent architecture selection to investigate the impact of inaccurate predictors.
Our results demonstrate the effectiveness of network-based prediction models; provide insights into predictor mistakes and what to expect from them.
To facilitate reproducibility and further research, our experimental results and code are made available in Appendix A.
R ELATED WORK
NAS Benchmarks: As the search spaces of NAS methods often differ from one another and lack extensive studies, the difﬁculty of fair comparisons and reproducibility have become a major concern (Yang et al., 2019; Li & Talwalkar, 2020).
To alleviate this problem, researchers have exhaustively evaluated search spaces of several thousand architectures to create benchmarks (Ying et al., 2019;
Dong & Yang, 2020; Dong et al., 2020; Siems et al., 2020), containing detailed statistics for each architecture.
TransNAS-Bench-101 (Duan et al., 2021) evaluates several thousand architectures across seven diverse tasks and ﬁnds that the best task-speciﬁc architectures may vary signiﬁcantly.
The popular NAS-BENCH 201 benchmark (Dong & Yang, 2020) has been further extended with ten different hardware metrics for all 15625 architectures on each of the three data sets CIFAR10, CIFAR100 (Krizhevsky et al., 2009) and ImageNet16-120 (Chrabaszcz et al., 2017).
Major ﬁndings of this HW-NAS Bench (Li et al., 2021a) include that FLOPs and the number of parameters are a poor approximation for other metrics such as latency.
Many existing NAS methods use such inadequate substitutes for their simplicity and would beneﬁt from their replacement with better prediction models.
Li et al.
also ﬁnd that hardware-speciﬁc costs do not correlate well across hardware platforms.
While accounting for each device’s characteristics improves the NAS results, it is also expensive.
Predictors can reduce costs by requiring fewer measurements and shorter query times.
Predictors in NAS: Aside from real-time measurements (Tan et al., 2019; Yang et al., 2018), hardware metric estimation in NAS is commonly performed via Lookup Table (Wu et al., 2019),
Analytical Estimation or a Prediction Model (Dai et al., 2020; Xu et al., 2020).
While an operationand layer-wise Lookup Table can accurately estimate hardware-agnostic metrics, such as FLOPs or the number of parameters (Cai et al., 2019; Guo et al., 2020;
Chu et al., 2019a), they may be suboptimal for device-dependent metrics.
Latency and energy consumption have non-obvious factors that depend on hardware speciﬁcs such as memory, cache usage, the ability to parallelize each operation, and an interplay between different network operations.
Such details can be captured with neural networks (Dai et al., 2020; Mendoza & Wang, 2020;
Ponomarev et al., 2020; Xu et al., 2020) or other specialized models (Yao et al., 2018;
Wess et al., 2021).
Of particular interest is the correct prediction of the model loss or accuracy, possibly reducing the architecture search time by orders of magnitude (Mellor et al., 2020;
Wang et al., 2021; Li et al., 2021b).
In addition to common predictors such as Linear Regression, Random Forests (Liaw et al., 2002) or Gaussian Processes (Rasmussen, 2003); specialized techniques may exploit training curve extrapolation, network weight sharing or gradient information.
Our experiments follow the recent large-scale study of White et al.
(2021), who compare 31 diverse accuracy prediction methods based on initialization and query time, using three NAS benchmarks.
P REDICTING HARDWARE METRICS
Our methods follow the large-scale study of White et al.
(2021), who compared a total of 31 accuracy prediction methods.
The differences between accuracy and hardware-metric prediction, our selection of predictors, and the general training pipeline are described in this section.
In our experiments on HW-NAS-Bench and TransNAS-Bench-101, described in Section 4, we then compare these predictors across different training set sizes.
Differences to accuracy predictors: There are fundamental differences when predicting hardware metrics and the accuracy of network topologies.
The most essential is the cost to obtain a helpful predictor, which may vary widely for accuracy prediction methods.
While determining the test accuracy requires the costly and lengthy training of networks, measuring hardware metrics does not necessitate any network training.
Consequentially, specialized accuracy-estimation methods that rely on trained networks, loss history, learning curve extrapolation, or early stopping do not apply to hardware metrics.
Furthermore, so-called zero-cost proxies that predict metrics from the gradients of a single batch are dependant on the network topology but not on the hardware the network is placed on.
Therefore, the dominant hardware-metric predictor family is model-based.
Since all relevant predictors are model-based, they can be compared by their training set size.
This simpliﬁes the initialization time of a predictor as the number of prior measured architectures on which they are trained.
In stark contrast, some accuracy predictors do not need any training data, while others require several partially or fully trained networks.
Since an untrained network and a few batches sufﬁce to measure a hardware-metric, the collection of such a training set is comparably inexpensive.
Additionally, hardware predictors are generally used supplementary to a one-shot network optimized for loss or accuracy.
Depending on the NAS method, a fully differentiable predictor is required in order to guide the gradient-based architecture selection.
Typical choices are Lookup Tables (Cai et al., 2019; Nayman et al., 2021) and neural networks (Xu et al., 2020).
Model-based predictors: The goal of a predictor f p ( a ) is to accurately approximate the function f
( a ) , which may be, e.g., the latency of an architecture a from the search space A .
A model-based predictor is trained via supervised learning on a set D train of datapoints ( a, f ( a )) , after which it can be inexpensively queried for estimates on further architectures.
The collection of the dataset and the duration of the training are referred to as initialization time and training time respectively.
The quality of such a trained predictor is generally determined by the (ranking) correlation between measurements { f ( a ) | a ∈ A test } and predictions { f p ( a ) | a ∈ A test } on the unseen architectures
A test ⊂ A .
Common correlation metric choices are Pearson (PCC), Spearman (SCC) and Kendall’s
Tau (KT) (Chu et al., 2019b; Yu et al., 2020; Siems et al., 2020).
Our experiments include 18 model-based predictors from different families: Linear Regression,
Ridge Regression (Saunders et al., 1998), Bayesian Linear Regression (Bishop, 2007), Support
Vector Machines (Cortes & Vapnik, 1995), Gaussian Process (Rasmussen, 2003), Sparse Gaussian Process (Candela & Rasmussen, 2005), Random Forests (Liaw et al., 2002), XGBoost (Chen &
Guestrin, 2016), NGBoost (Duan et al., 2020), LGBoost (Ke et al., 2017), BOHAMIANN (Springenberg et al., 2016), BANANAS (White et al., 2019), BONAS (Shi et al., 2020), GCN (Wen et al., 2020), small and large Multi-Layer-Perceptrons (MLP), NAO (Luo et al., 2018), and a layeroperation-wise Lookup Table model.
We provide further descriptions and implementation details in
Appendix B.
Hyper-parameter tuning:
The default hyperparameters of the used predictors vary signiﬁcantly in their levels of hyper-parameter tuning, especially in the context of NAS.
Additionally, some predictors may internally make use of cross-validation, while others do not.
Following White et al.
(2021), we attempt to level the playing ﬁeld by running a cross-validation random-search over hyperparameters each time a predictor is ﬁt to data.
Each search is limited to 5000 iterations and a total run time of 15 minutes and naturally excludes any test data.
The predictor-speciﬁc parameter details are given in Appendix C.
Training pipeline To make a reliable comparison, we use the NASLib library (Ruchte et al.
(2020), see Appendix A).
We ﬁt each predictor on each dataset and training size 50 times, using seeds { 0 , ..., 49 } .
Some predictors internally normalize the training values (subtract mean, divide by standard deviation).
We choose to explicitly do this for all predictors and datasets, which reduces the dependency of hyper-parameters (e.g. learning rate) on the dataset and allows us to analyze and compare the prediction errors across datasets more effectively.
P REDICTOR E XPERIMENTS
We compare the different predictor models based on two NAS benchmarks, HW-NAS-Bench (Li et al., 2021a) and TransNAS-Bench-101 (Duan et al., 2021).
They differ considerably by their network tasks, hardware devices, and architecture designs.
HW-NAS-Bench architecture design and datasets In HW-NAS-Bench, each architecture is solely deﬁned by the topology of a building block (”cell”), which is stacked multiple times to create a complete network.
Each cell is completely deﬁned by choosing six candidate operations.
Since they select from ﬁve different candidates each time, there are 5 6 = 15625 unique cell topologies.
These cells are not fully sequential but contain paths of different lengths, which is visualized in Appendix D.
HW-NAS-Bench provides ten hardware statistics on CIFAR10, CIFAR100 Krizhevsky et al.
and ImageNet16-120 Chrabaszcz et al.
(2017), of which we exclude the incomplete EdgeTPU metric.
Thus there are 27 data sets of varying difﬁculty.
As detailed in Appendix E, 12 of them can be accurately ﬁt with Linear Regression and only 25 training samples.
Many are also very similar since their measured networks differ only by the number of image classes.
We therefore select ﬁve datasets that (1.) are not trivial to learn as they are non-linear and (2.)
not redundant:
• ImageNet16-120, raspi4, latency • CIFAR100, pixel3, latency • CIFAR10, edgegpu, latency • CIFAR100, edgegpu, energy consumption • ImageNet16-120, eyeriss, arithmetic intensity
TransNAS-Bench-101 architecture design and datasets TransNAS-Bench-101 contains information for 7,352 different network architectures, used as backbones in seven diverse vision tasks.
Since 4,096 are also a subset of HW-NAS-Bench, we focus on the remaining 3,256 architectures with a macro-level search space.
Unlike a micro-level search space, where a cell is stacked multiple times to create a network, each network layer and block is considered individually.
In particular, the TransNAS-Bench-101 networks consist of four to six pairs of ResNet blocks (He et al., 2016), which may modify the image size and channels in four ways: not at all, double the channel count, halve the spatial size, and both.
Every network has to double the channel count 1 to 3 times, resulting in 3, unique architectures.
The networks may consequentially differ in their number of layers (depth), the number of channels (width), and image size at any layer.
As done for HW-NAS-Bench, we select ﬁve of the seven available datasets for their latency measurements.
Aside from the self-supervised Jigsaw task, there is little difference between the cross-task latency measurements (see Appendix E).
We evaluate the possibly redundant datasets nonetheless, since latency predictions in macro-level search spaces are an important domain for NAS on image classiﬁcation and object detection tasks: • Object classiﬁcation • Scene classiﬁcation • Room layout • Jigsaw • Semantic segmentation
Fitting results and comparison The results, averaged over all selected HW-NAS-Bench and TransNAS-Bench-101 datasets, are presented in Figures 1a and 1b, respectively.
The left plots present the absolute predictor performance, the right ones make relative comparisons easier.
Unsurprisingly, more training samples (i.e., evaluated architectures) generally lead to better prediction results, even until the entire search space is known (aside from the test set).
This is true for most of the predictors, although e.g. Gaussian Processes and BOHAMIANN saturate early.
The simple Linear Regression and Ridge Regression models also fail to make proper use of hundreds of data points but perform decently when only a few training samples are available.
Interestingly, the same is true for the graph-encoding network-based predictors BONAS and GCN.
While knowing how the different paths within each cell connect (see Appendix B) is especially useful given less than ﬁfty training samples, the advantage disappears afterward. In contrast, the graph-encoding encoder-decoder approach of NAO performs decently at all times. [Figure] [Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table] [Figure] [Table] Due to their powerful rule-based approach, tree-based models perform much better given many training samples.
Under such circumstances, LGBoost is a candidate for the best predictor model.
Similarly, the predictions of Support Vector Machines also beneﬁt strongly from more samples.
The model we ﬁnd to perform best for most training set sizes are MLPs.
They are among the top predictors at almost all times in the HW-NAS-Bench, although tree-based models are competitive given enough data.
After around 3,000 training samples, thinner and deeper MLPs improve over the wider and smaller ones.
The path-encoding BANANAS model behaves similarly to a regular large
MLP but requires more samples to reach the same performance.
This is interesting since, aside from the data encoding, BANANAS is an ensemble of three large MLP models.
Even though only the ﬁrst network layer is affected by the data encoding, the more complicated path-encoding proves harmful
[Table]
when the connectivity of the architectures in the search space is ﬁxed.
On TransNAS-Bench-101,
MLP perform exceptionally well.
They are much better than any other tested predictor once more than just 20 training samples are available.
The small MLP model can achieve a KT correlation of 80% with just 200 training samples, which takes the best non-network-based predictor (Support Vector Machine)
four times as many.
They are also the only models that achieve a KT correlation of over 90%, about 5% higher than the next best model (LGBoost).
Finally, the Lookup Table models (black horizontal lines) perform poorly in comparison to any other predictor.
Even though building such a model for HW-NAS-Bench datasets requires only 25 neighbored architectures, NAO and GCN perform better after just ten random samples.
More than half of the predictor models require less than 25 random samples, while the worst need at most 60.
On TransNAS-Bench-101, Lookup Tables perform comparably better.
Building one requires onlyneighbored architectures, and it takes most models between 50 and 100 random training samples to achieve better performance.
When measured on a per dataset basis, we ﬁnd that the Lookup Table models display a severe performance difference ranging from about 20% KT correlation (cifar10edgegpu latency and Jigsaw) to over 70% (ImageNet16-120-eyeriss arithmetic intensity and Semantic Segmentation, see Appendix E). Other models prove to be much more stable. Devices and Metrics
The previously described results are based on a speciﬁc selection of HWNAS-Bench and TransNAS-Bench-101 datasets that are hard to ﬁt for Lookup Table models. As shown in Table 1, that is not always the case. The FPGA and Eyeriss hardware devices are very suitable for Lookup Tables, achieving an almost perfect ranking correlation is possible. Nonetheless,
Linear Regression requires only 124 training samples to compete even there and is signiﬁcantly better in every other case.
We ﬁnally observe that the difﬁculty of ﬁtting predictors primarily depends on the hardware device, much more than the measured metric.
E VALUATING THE PREDICTOR - GUIDED ARCHITECTURE SELECTION
Although the experiments in Section 4 greatly assist us in selecting a predictor, it is not clear what a speciﬁc Kendall’s Tau correlation implies for the subsequent architecture selection.
Given a perfect hardware metric predictor (Kendall’s Tau = 1.0), we can expect that an ideal architecture search process will select the architectures with the best tradeoff of accuracy and the hardware metric, i.e., the true Pareto front.
On the other hand, imperfect predictions result in the selection of supposedlybest architectures that are wrongly believed to be better.
To study how hardware predictors affect NAS results, we extensively evaluate the selection of such supposedly-best architectures in simulation.
This approach can evaluate any combination of predictor quality, test set size, and dataset, without the technical difﬁculties of obtaining actual predictor models that precisely match such requirements. Since the hardware and accuracy prediction models are usually independent and can be studied in isolation, we use ground-truth accuracy values in all cases.
Simulating predictors The main challenge of the simulation is to quickly and accurately model predictor outputs.
We base our simulation on how predictor-generated values deviate from their ground-truth targets on the test set, which is explained in Figure 2 and further detailed in Appendix G. Since the simulated deviations are similar to those of actual predictors, simulated predictions are obtained by drawing random values from this deviation distribution and adding them to the ground-truth hardware measurements. [Figure] [Figure]
A single example of a simulation can be seen in Figure 3.
Although most selected architectures (orange) are close to the true optimum (red Pareto front), there almost always exists an architecture that has superior accuracy and, at most, the same latency.
Simply accepting the 13 selected architectures in this particular example results in a mean reduction of accuracy ( MRA all ) of 1 . 06% .
In other words, the average selected architecture has 1 .
06% lower accuracy than a comparable one on the true Paret front.
However, simply verifying the hardware metric predictions through actual measurements reveals that some selected architectures are suboptimal. By choosing only the Pareto subset of the selection, the opportunity loss can be reduced to 0 . 43% ( MRA pareto ).
An important property of this approach is that it is independent of any particular optimization method. The supposedly-best architectures are always correctly identiﬁed, which is an upper bound on how well Bayesian Optimization, Evolutionary Algorithms, and other approaches can perform.
The exemplary MRA pareto opportunity loss of 0 . 43% is therefore unavoidable and depends solely on the hardware metric predictor, the dataset, and the number of considered architectures.
Results We simulate 1,000 architecture selections for each of the ﬁve chosen HW-NAS-Bench datasets, six different test set sizes, and eleven distribution standard deviations between 0 . 0 and 1 . 0 .
As exemplarily shown in Figure 3, each such simulation allows us to compute the mean reduction in accuracy (MRA) and the hypervolume (HV) under the Pareto fronts.
The most important insights are visualized in Figure 4 and summarized below.
[Figure]
Verifying the predicted results matters (Figure 4, left).
The best prediction models achieve a KT correlation of almost 0.9, which translates to a mean reduction in accuracy of MRA all ≈ 1.5%.
That means, for each selected architecture, there exists an architecture of equal or lower latency in the true Pareto set (if latency is the hardware metric) that improves the average accuracy by 1.5%.
Even though all selected architectures are believed to form a Pareto set, that is not the case.
Their optimal subset has a reduction of only MRA pareto ≈ 0 . 5% , a signiﬁcant improvement. However, ﬁnding this optimal subset requires actually measuring the hardware metrics of the architectures selected by the used NAS method. Furthermore, the left of Figure 4 aids in anticipating the MRA given a speciﬁc predictor.
If one used e.g. BOHAMIANN (KT ≈ 0.8, see Figure1a) instead of MLPs or LGBoost (KT ≈ 0.9), MRA pareto increases from around 0.5% to roughly 1.2%.
The average accuracy of the selected architectures is thus reduced by another 0.7%, just by using an unsuitable hardware metric predictor.
Lookup Tables (KT ≈ 0.45) are not even visualized anymore, they have an MRA pareto of over 2.5%. Another interesting observation is that the gap between MRA all and MRA pareto is wider for better predictors.
This is a shortcoming of the MRA metric that we elaborate on in Appendix H.
The dataset and metric matter (Figure 4, center).
While we generally present the results averaged over datasets, there exists some discrepancy among them.
Most interestingly, predicting hardware metrics on harder classiﬁcation problems (ImageNet16-120 is harder than CIFAR10) also results in a higher MRA.
This is especially important since MRA is an absolute accuracy reduction.
Even though the CIFAR10 networks achieve twice the accuracy of ImageNet16-120 networks, they lose less absolute accuracy to imperfect predictions.
The order of MRA/dataset is primarily stable for any predictor KT correlation.
Finally, as visualized by the shaded areas, the standard deviation of the MRA is generally huge.
Consequentially, predictor-guided NAS is very likely to produce results of varying quality for each different predictor or search attempt, especially with less accurate predictors.
The number of considered architectures matters (Figure 4, right).
We measure the hypervolume of the discovered Pareto front (i.e., the area beneath it, see Appendix H), which, unlike MRA, also considers the hardware metric.
Quite obviously, if the architectures from the true Pareto set are not considered, they can not be selected.
To achieve the highest possible hypervolume of around 4.
(i.e. ﬁnd the true Pareto set), every architecture in the search space must be evaluated with a perfect predictor.
This is impossible in most real-world cases, where only a tiny fraction of all possible architectures can ever be considered. For HW-NAS-Bench, considering 5000 architectures with perfect live measurements and predicting the metrics for all 15625 with ranking correlation KT ≈ 0.73 results in selecting equivalent sets of architectures.
As seen in Figure1a, Ridge Regression can achieve this performance with fewer than 100 training samples.
Thus, a worse predictor leads to better results if it enables considering more architectures.
This insight is especially crucial for live measurements, which are accurate but slow.
Similarly, estimating the network accuracy with super-networks takes much more time than predicting their performance with a neural predictor (Wen et al., 2020).
If the measurement of any metrics is the limiting factor, a guided selection of a cheap predictor is likely to do better.
D ISCUSSION
Chosen prediction methods Given the nature of hardware-metric prediction, only the subset of model-based predictors evaluated by White et al.
(2021) is suitable.
We extended this subset with four models, including the popular Lookup Table.
We abstained from evaluating layer-wise predictors (e.g. Wess et al.
since such data is not available, and meta-learning predictors (Lee et al., 2021) due to the vast possibilities to conﬁgure them.
A separate and specialized comparison between classic and meta-learning predictors seems favorable to us.
Simulation limitations In contrast to evaluating real predictors, the simulation allows us to quickly make statements for any test set sizes and predictor-inaccuracies.
However, naturally, the results are only approximations.
While they match actual values, they are generally slightly pessimistic (see Appendix I).
We also limit the simulation to HW-NAS-Bench since the changes to classiﬁcation results are more accessible to interpretation than changes to loss values across different problem types.
Finally, the current simulation approach can not investigate methods that absolutely require a trained one-shot network, such as gradient-based approaches.
Including such methods is an interesting direction for future research.
Transferability of the results Our evaluation includes ﬁve challenging and diverse datasets based on the micro-level search space of HW-NAS-Bench and ﬁve latency-based datasets of various macro-level search space architectures in TransNAS-Bench-101.
Nonetheless, we ﬁnd shared trends: All tested prediction models improve over Lookup Tables with little amounts of training data.
Furthermore, most predictors beneﬁt from more training data, even until the entire search space (aside from the test set) is known.
We also ﬁnd that network-based predictors are generally best but may be challenged by tree-based predictors if enough training data is available.
Given only a few samples, Ridge Regression performs better than most other models.
Recommendations While Lookup Tables are a cheap, simple, and popular model in gradientbased architecture selection, we ﬁnd a signiﬁcant variance in performance across tasks and devices (see Table 1 and Appendix E).
We recommend replacing such models with either MLPs or Ridge Regression, which are more stable, fully differentiable, and often take less than 100 training samples to achieve better results.
For most realistic scenarios where more than 100 training samples are available, MLP models are the most promising.
They are among the top predictors on HW-NAS-Bench and demonstrate outstanding performance on the TransNAS-Bench-101 datasets.
We found that specialized architecture encodings are primarily beneﬁcial for little training data but suspect that they enjoy an additional advantage when network topologies are more complex and diverse (White et al., 2021).
While the query time for all predictors is less than 0 .
05 s and thus negligible, there is a notable difference in training time (see Appendix F), primarily due to the hyper-parameter optimization.
We recommend Ridge Regression for very little amounts of training data and LGBoost otherwise if that is an important factor.
If a NAS method selects architectures based on hardware metric predictions, we strongly suggest verifying the results by measuring the true metric value afterward.
Doing so may eliminate inferior candidates and improve the average result substantially.
Finally, if the limiting factor to a NAS method is the slow measurement of hardware metrics, using a much faster predictor may lead to an improvement, even if the prediction model is less accurate.
C ONCLUSIONS
This work evaluated various hardware-metric prediction models on ten problems of different metrics, devices, and network architecture types.
We then simulated the selection process for different test set sizes and predictor inaccuracies to improve our understanding of predictor-based architecture selection.
We ﬁnd that even imperfect predictors may improve NAS if their low query time enables considering more candidate architectures.
Finally, verifying the predictions for the selected candidates can lead to a drastic improvement of their average performance.
The code and results are made available, thus acting both for recommendation and as a baseline for future works.
A B EST PRACTICES FOR NAS, C ODE AND D ATA
To improve the reproducibility and facilitate fair experimental comparisons, we follow the bestpractices checklist (Lindauer & Hutter, 2020):
• Release Code for the Training Pipeline(s) you use.
Our experiments are based on White et al.
(2021), who use NASLib (Ruchte et al., 2020) to compare 31 methods for accuracy prediction.
Our NASLib fork, extending the framework for HW-NAS-Bench, TransNASBench, some performance predictors and the hypervolume simulations, is provided in the supplementary materials.
We intend to either make our fork available on GitHub or submit the changes upstream once this paper is accepted/published.
• Use the Same Evaluation Protocol for the Methods Being Compared.
Aside from the implementation of each predictor, all experiments use the same pipeline.
• Validate
The Results Several Times.
We ran each predictor 50 times, with seeds { 0 , ..., 49 } .
The reductions in hypervolume are simulated 1000 times using different a different subset of the data set, for each combination of { iteration, HW-NAS data set, noise on HW metric } .
• Control
Confounding Factors.
While all experiments used the same software libraries and hardware resources, they were run on different machines to speed up the evaluation.
We found hardly any beneﬁt in using a GPU even for the network-based predictors, which is why every method only used two CPU cores.
The OS is Ubuntu 18.04, notable software packages are PyTorch 1.9.0, numpy 1.19.5, scikit-learn 0.24.2, pybnn 0.0.5, ngboost 0.3.11, and xgboost 1.4.
• Report the Use of Hyperparameter Optimization.
See Appendix C.
In addition to the code in the supplementary materials, we also provide the experimental results as csv ﬁles.
Running the predictors and hypervolume simulations takes some time, but the easy access to the data of the ﬁnished experiments may prove useful for future research.
Please see readme.md in the accompanying code zip ﬁle for instructions.
B E NCODINGS AND P REDICTORS B. D ATA ENCODINGS
Every architecture a ∈ A requires a unique representation, which depends on the used predictor.
The common encoding types are:
Adjacency one-hot : Each architecture a is uniquely deﬁned by the chosen candidate operation on every path.
For example, each architecture in NAS-BENCH-201 consists of a repeated cell structure, which has ﬁve candidate operations on each of the six paths.
Therefore there are 5 6 = 15625 unique architectures, which can each be referenced by a sequence of operation-indices such as [0 1 2 3 4 0] .
Many predictors perform better if the sequence is presented as a one-hot encoding, which is in this case [10000 01000 00100 00010 00001 10000] .
Similarly, the path-encoding (used by BANANAS) is a one-hot representation over the used candidate operation all possible paths.
Since the connectivity within cells for HW-NAS-Bench and
TransNAS-Bench-101 is ﬁxed, it provides no more information than the adjacency one-hot encoding.
If the connectivity can be adjusted more freely, as in the NAS-Bench-101 search space, the additional information may improve the ﬁt.
The encodings for BONAS , GCN , and NAO each provide further information in addition to the
Adjacency one-hot vector, most notably the adjacency-matrix.
This { 0 , 1 } ( N +2) ×
( N +2) matrix lists describes which of the N architecture paths (rows) serves as inputs for each other path (column), and also includes input/output.
B. P REDICTORS
We brieﬂy describe the 18 predictor methods in our experiments.
We adopt their implementations from the NASLib library (see Appendix A), which we extend with Linear Regression, Ridge Regression, and Support Vector Machines from the scikit-learn package; and a simple Lookup Table implementation.
Unless speciﬁed otherwise, the methods use the adjacency one-hot encoding.
• BANANAS
An ensemble of three MLP models with ﬁve to 20 layers, each using the pathencoding (White et al., 2019).
• Bayesian Linear Regression A bayesian model that assumes (1) a linear dependency between inputs and outputs, and (2) that the samples are normally distributed (Bishop, 2007).
• BOHAMIANN A bayesian inference predictor using stochastic gradient Hamiltonian Monte Carlo (SGHMC) to sample from a bayesian neural network (Springenberg et al., 2016).
• BONAS Bayesian Optimization for NAS (Shi et al., 2020) uses a GCN predictor within an outer loop of bayesian optimization, as a meta-learning task.
The GCN requires encoding the adjacency matrix of each architecture.
• Gaussian Process
A simple model that assumes a joint Gaussian distribution underlying the training data (Rasmussen, 2003).
• GCN A Graph Convolutional Network that makes use of an adjacency-matrix encoding of each architecture (Wen et al., 2020).
• Linear Regression
A simple model that assumes an independent value/cost for each operation/layer, which only need to be summed up.
Unlike the Lookup Table model, it uses a least-square ﬁt on the training data.
• Lookup Table
The most simple and perhaps widely used model for differentiable architecture selection.
It generally assumes a single baseline architecture (e.g. [001 001] in adjacency one-hot encoding), and a lookup matrix R (num layers) ×
(num candidates) that contains the increases/reductions in the metric for each layer and candidate operation.
The metric value of a new architecture can be predicted with a simple sum over the respective matrix entries and the baseline value.
The model is obtained from measuring either each candidate operation in isolation, or by computing the differences between the baseline architecture and speciﬁc variations (e.g. [010 001] or [100 001] , to measure the ﬁrst candidates).
This model always requires 1+ ( num layers ) · ( num candidates − 1 ) neighbored architectures to ﬁt.
We detail the resulting correlation values for each used dataset in Appendix E. • LGBoost Light Gradient Boosting Machine (LightGBM or LGBoost, Ke et al.
(2017)) is a lightweight gradient-boosted decision tree model.
• MLP
We use fully-connected Multi Layer Perceptrons in two size-categories.
• NAO NAO
(Luo et al., 2018) uses an encoder-decoder topology, which encodes/compresses an architecture to a continuous representation, and decodes it again.
This representation is further used to make architecture predictions.
• NGBoost Natural Gradient Boosting (NGBoost, Duan et al.
(2020)) is a gradient-boosted decision tree model that uses natural gradients to estimate uncertainty.
• Ridge Regression Ridge Regression (Saunders et al., 1998) extends the Linear Regression least-squares ﬁt with a regularization term that serves as bias-variance tradeoff.
• Random Forests
An ensemble of decision trees (Liaw et al., 2002).
• Sparse Gaussian Process an approximation of Gaussian Processes that summarizes training data (Candela & Rasmussen, 2005).
• Support Vector Machine A model that maps its inputs to a high-dimensional space, where training samples are used as support-vectors for decision-boundaries (Cortes & Vapnik, 1995).
• XGBoost eXtreme Gradient Boosting (XGBoost, Chen & Guestrin (2016)) is a gradientboosted decision tree model.
C H YPERPARAMETERS
We list our default and hyper-parameter sample ranges in Table 2.
For comparability with White et al.
(2021), we only change the values of newly introduced parameterized predictors: Ridge Regression, Support Vector Machines, and small MLPs.
[Table]
D NAS-B ENCH -201 / HW-NAS-B ENCH CELL DESIGN
[Figure]
E S ELECTION OF DATASETS
[Figure]
[Table]
(rows), for different amounts of available training data (columns), tested on the remaining 625 samples.
The Lookup Table model is tested on all 15625 architectures.
We selected the ﬁve data sets at the top.
[Table]
HW-NAS-Bench:
To select ﬁve datasets that are (1) non-linear and (2) different from one another, we ﬁrst ﬁt
Linear Regression to every available dataset, with the results listed in Table 3.
The bottom 12 datasets can be accurately ﬁt with only 25 training samples, so they are not very interesting as a challenge.
On these datasets, the Lookup Table model achieves exceptional performance.
Since the networks for CIFAR10, CIFAR100 and ImageNet16-120 only differ slightly, their measurements on the same device and metric (e.g. raspi4 latency) is very similar.
To improve the generalizability of our results, we thus select datasets on different devices and metrics, which are listed at the top of
Table 3.
As displayed in Figure 6, their data distributions are generally different.
TransNAS-Bench-101: Since the latency measurements of the architectures is generally very similarly distributed (see Figure 7), it is not necessary to train the predictors on all of them.
We select all data sets that provide the test loss and inference time attributes for all architectures, resulting in exactly the ﬁve datasets listed in Section 4 (the other two datasets contain more speciﬁc test losses).
[Figure]
[Figure]
F P REDICTOR FIT TIME
[Figure]
i
[Figure]
t h
[Figure]
r
[Figure]
i
[Figure] [Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
t o f i t t h e p r
[Figure]
i c t o r ( a b s o l u t
[Figure]
[Figure]
f i t t h
[Figure]
r
[Figure]
i
[Figure]
r
[Figure]
c
[Figure]
r
[Figure]
G A PPROXIMATING PREDICTOR MISTAKES
[Figure]
Intuitively, the predictor deviation distributions (see Figures 2 and 9) generally resemble a normal distribution.
However, most predictors:
(1) Have a notable peak, sometimes off-center (e
g. at x=0.2) (2) Have less density than a normal distribution almost everywhere else (3) Have some outliers (e g. at x > 1.5) that are extremely unlikely for a normal distribution
We measured the p-value for different distributions on the ﬁrst 100 test samples using a T-Test, every time we evaluated a predictor.
The average statistics can be found in Table 5.
Since a large number of empirical observations generally pushes the p-value to 0, this only serves to compare them to each other.
We ﬁnd that the outliers (3) appear often enough and are so unlikely to happen for a normal distribution, that even a uniform distribution has a higher statistical support.
Consequentially, we approximate the common predictor deviations by sampling from a mixed distribution that adresses (1) to (3).
[Table]
This mixed distribution consists of two Normal distributions ( N 1 , N 2 ) and one Uniform distribution ( U ), from which we sample with 72.5%, 26.5% and 1% respectively.
For some constant v :
• We uniformly sample a shift c from [0 , 2 · v ] , that is used to push the centers of N
and Nto x > 0 and x < 0 respectively.
• We sample each value from N 1 ( c, v ) , N 2 ( − c, 3 · v ) , and U 1 ( − 15 · v, 15 · v ) randomly, with the weighting given above.
• We normalize (subtract mean, divide by standard deviation) our sampled distribution and then scale it to the desired standard deviation.
• The predictors produce non-smooth distributions.
We simulate that by sampling 15 times fewer values as needed, and repeat them as often.
The code for the simulation is also provided (see Appendix A).
As seen in Figure 10, the resulting simulated deviation distributions generally resemble a common predictor pattern.
We do not account for differences in predictors, training set sizes or more, since that may become too speciﬁc and overengineered.
Appendix I visualizes simulation sanity checks.
We ﬁnd that the simulation is slightly pessimistic and simpliﬁed, but resembles the results of actual predictors.
[Figure]
H M EASURING SIMULATED MISTAKES
[Figure]
[Figure] [Figure]
[Figure]
I S IMULATION SANITY CHECK
[Figure]
All candidates
[Figure]
candidate occurrences in the architecture candidate not at all exactly once exactly twice
Zero
[Figure]
Skip
[Figure]
[Figure]