Best of Both Worlds: AutoML Codesign of a CNN and its Hardware Accelerator
Paper · 2020 · Mohamed S. Abdelfattah, Łukasz Dudziak, Thomas Chau et al.
Summary
Choosing a convolutional neural network for image recognition also determines what its eventual hardware will have to do. The network specifies the operations, how they connect, and which intermediate results must be available for later work. An accelerator can be configured to handle those demands, but its designer has fewer options once the network is fixed. Mohamed S. Abdelfattah and colleagues study what happens when the two decisions are made together. Their method, Codesign-NAS, selects both the structure of a convolutional neural network, or CNN, and the settings of an accelerator built on a field-programmable gate array, or FPGA. It judges each pair on recognition accuracy, accelerator area, and the time needed to run inference.
A controller learns from the designs it proposes. It can search across network and accelerator choices at every step, or alternate between changing the network and changing the hardware. The paper compares both approaches with a sequential procedure that selects a network for accuracy before tuning its accelerator. On CIFAR-10, the authors use stored results from NASBench-101 and fast hardware estimates to examine all 3.7 billion pairs in their defined space. They identify 3096 pairs on the Pareto frontier, where a gain on one metric entails a loss on another. With this reference, they can see how close a limited search comes to the best available tradeoffs. Combined search generally does better without hard constraints and converges sooner. Alternating phases reach higher rewards in the constrained cases, though some runs still miss the requirements within the allotted steps.
The CIFAR-100 experiment tests whether the method can find useful designs when each new CNN needs training. The authors compare discovered cells, the recurring units inside a CNN, with ResNet and GoogLeNet cells in the same surrounding network structure. For each baseline, they select the accelerator that gives it the highest performance per area among the available configurations. Even against that tuned comparison, Cod-1 reaches 74.2% top-1 accuracy and 18.1 img/s/cm², compared with 72.9% and 12.8 img/s/cm² for the ResNet-cell pair. Cod-2 improves on the GoogLeNet-cell pair on both measures. Cod-1’s efficiency gain comes mainly from using less estimated accelerator area, while Cod-2 makes its gain with shorter inference latency. Together the examples show what joint search can find within the particular network family, hardware options, and evaluation procedure the authors study.
Deep dive: Best of Both Worlds: AutoML Codesign of a CNN and its Hardware Accelerator
Codesign-NAS searches for an image classifier and its FPGA accelerator together to improve accuracy, inference latency, and hardware efficiency. · about 33 minutes to read
The problem and its context
What gets decided when a network is designed
A convolutional network is a sequence and arrangement of computations used to turn an image into a classification. A convolution applies a filter across its input, producing values that can be used by later operations. A network can call for different filter sizes, join the results of several branches, and pass information along connections that bypass some operations. The architecture specifies this pattern. Training supplies the numerical weights that the operations use. These are different decisions, and the paper searches over the architecture while treating training as part of evaluating the chosen architecture where necessary.
From the perspective of a hardware designer, that architecture is also a workload description. Filter sizes influence which computation units will be useful. Branches create intermediate results that may have to be buffered before a subsequent operation can use them. The work within an operation can sometimes be divided across filters or across image positions. The accelerator’s design determines how much parallel work it can carry out in each dimension and how quickly it can bring in data. A change to the network can therefore change which accelerator configuration is attractive even when both configurations can run the network.
The same dependence is visible in the other direction. Suppose an accelerator has separate resources for small and larger filters. How much capacity to give each engine depends on the operations it will receive. An allocation that works well for a cell with many small convolutions could leave some resources underused when a different cell is substituted. For a fixed cell, hardware exploration can look for a better allocation. By allowing the cell to change too, codesign can investigate whether a different mix of computations suits the available hardware while still recognizing images accurately.
The evaluation follows this division of responsibilities. Accuracy describes how well the trained CNN recognizes images. Area describes the hardware resources assigned to its accelerator, expressed as an estimated physical area. Inference latency describes the time required to run the network on that accelerator. The third measure depends on both choices. A designer choosing a network solely for accuracy does not yet know how favorable its latency will be after hardware tuning. That uncertainty gives the paper its comparison with a procedure that chooses the CNN first.
Why search both sides
The authors bring together developments in machine learning and in custom hardware. Automated machine learning includes methods that use search to make decisions otherwise made by a designer. Neural architecture search, or NAS, applies that idea to the structure of the network. A search procedure puts together an architecture from options defined in advance, obtains a measure of how well it works, and uses that information to decide which candidates to consider. The paper describes earlier applications in image classification, super-resolution, speech recognition, and machine translation. It cites the Evolved Transformer in connection with translation.
The paper also describes the increasing use of specialized accelerators to run neural networks. FPGA implementations expose hardware choices through configurable resources. Application-specific integrated circuits are another route to acceleration, represented in the paper’s discussion by work including the Tensor Processing Unit analysis. Codesign-NAS takes an FPGA accelerator library as its starting point. The hardware decisions are choices within that library’s accelerator organization, such as how wide to make a memory interface or how much parallel computation to provide.
An earlier step toward bringing the two fields together was to include inference latency in the feedback for architecture search. The paper discusses platform-aware work for mobile devices as an example. With a target platform specified, a latency term gives the search a reason to prefer networks that run well on it. The hardware in such a setup is part of the evaluation conditions. In Codesign-NAS, the hardware settings are candidates for selection, so the search has an additional way to improve latency or change the balance between latency and area.
Reinforcement learning supplies the search mechanism. In the paper’s setting, reinforcement learning means training a policy to propose designs using the feedback obtained from previous proposals. The authors take the controller approach from Neural Architecture Search with Reinforcement Learning. Its role is distinct from that of the CNN. The controller chooses architecture options, while the CNN learns to classify images after those choices define its structure. Codesign-NAS extends the controller’s proposals to include accelerator options, and the resulting feedback can reflect both the accuracy of the CNN and the cost of running it.
The earlier codesign approaches
The paper describes two precedents that already made network and hardware decisions interdependent. In one, reinforcement learning discovers a neural network and decides how to distribute it across multiple FPGAs. The method uses a theoretical description of device utilization to guide the partitioning. The hardware question emphasized there is how to divide a computation among devices. The question emphasized in Codesign-NAS is which configuration of an accelerator to pair with a network whose structure is also being chosen.
Another cited approach uses stochastic coordinate descent. As described by the authors, it uses hardware constraints to refine the network search space, then codesigns the accelerator and the network using the refined set of operations. This procedure illustrates that hardware requirements can influence the choices available to the network search itself. Codesign-NAS instead presents a common objective for already specified sets of CNN and accelerator options and investigates several ways for a reinforcement-learning controller to move through their combinations.
The comparison the authors want to make is about the order and scope of design decisions. A sequential procedure starts with the network and then gives hardware exploration a fixed job. A combined controller can propose a different workload and a different way to execute it in the same step. An alternating procedure keeps the workload or the hardware fixed for a period, then revisits the other choice. All three are recognizable ways of organizing the work. Whether giving the search more freedom at a given moment helps depends on how easily it can learn from the candidates it evaluates and whether it can find designs that meet the requirements.
That last point matters because several objectives must be considered at once. A system might accept some extra area to shorten response time, or it might have an area ceiling that rules out the same design altogether. Once there is a minimum acceptable accuracy or a maximum acceptable latency, the search needs a way to distinguish candidates that satisfy the requirement from candidates that merely score well on other measures. The paper expresses these decisions through thresholds and through weights for judging designs that pass the thresholds.
The method, step by step
Represent the network and accelerator as choices
Codesign-NAS starts with a family of permitted CNNs and a family of permitted accelerators. To propose a pair, the controller makes choices from these families. On the CNN side it chooses operations and connections inside a recurring cell. On the accelerator side it chooses settings such as buffer depth and the allocation of parallel computation. A proposal identifies the cell that defines the CNN and the parameter settings that define the accelerator. The evaluator can then obtain an accuracy for the CNN and estimate the area and latency associated with the pairing.
How Codesign-NAS searches for a design pair
The steps in order.
The paper represents the combined space as a Cartesian product. This is the set formed by taking choices from the network and hardware option sets together.
S = Oₙₙ₁ × Oₙₙ₂ × ⋯ × Oₕ𝓌₁ × Oₕ𝓌₂ × ⋯
Here S denotes the search space. Each O is a set of alternatives for a decision. The subscript nn identifies a neural-network decision and hw identifies a hardware decision. The numbered subscripts distinguish decisions within those groups. The sign × combines choices into tuples, and ⋯ indicates the remaining option sets. A point in S contains enough choices from the defined space to specify a candidate pair.
The network family comes from NASBench-101. The part that changes is the cell, a group of operations linked so that results flow from the cell input towards its output. The network uses the same cell design repeatedly. A stack repeats the cell three times, so a change to the cell can affect operations at several positions in the complete CNN. The benchmark allows at most 7 operations and 9 connections in a cell. It inserts addition and concatenation according to its construction rules. Addition combines corresponding values, while concatenation joins outputs for use together. These rules allow a compact description of the cell to specify details that would otherwise have to be chosen separately.
A fixed outer structure gives cell comparisons a common setting. When the search chooses a connection or operation, it makes that choice within the cell and inherits the rest of the CNN’s construction. This matters for accuracy evaluation. NASBench-101 contains stored statistics, including accuracy and training time, for ~423 thousand distinct CNNs on CIFAR-10. An accuracy record is available for a particular network derived from its cell. Changing the accelerator paired with that record calls for a new hardware evaluation, while the CNN’s stored accuracy remains the same. In the CIFAR-100 experiment, the authors retain the architecture family and obtain accuracy by training.
Configure the execution hardware
The hardware family is based on CHaiDNN, an accelerator library for CNNs on system-on-chip FPGAs. In this arrangement, the accelerator handles convolution and pooling, and layers it does not support are run by the CPU. Pooling is an operation that combines values from a region of its input into a smaller representation. Its presence in a network is a workload property. Whether to allocate a dedicated pooling engine is a hardware decision exposed by the accelerator configuration.
Other choices affect how computation and data movement are provisioned. The filter and pixel parallelism settings govern the amount of work the hardware can perform concurrently across filters and across pixel positions. Buffer depths specify how much temporary storage is available in parts of the design. External memory interface width governs how much data the interface can carry together. A buffer or interface can matter to an operation even when the arithmetic units themselves are unchanged. Conversely, an increase in available parallel work is useful only to the extent that the workload and data supply let the hardware exploit it.
The authors add a choice called ratio conv engines. At its default setting of 1, the accelerator uses a general convolution engine for the different convolution types. A setting below 1 gives the accelerator separate engines for 3x3 and 1x1 filters. The ratio determines the division of digital signal processors, or DSPs, between the specialized engines. These are FPGA resources used for arithmetic. The added option therefore lets the search choose both whether to specialize and how to divide arithmetic capacity when it does.
There are 8640 valid CHaiDNN configurations in the study. Holding the CNN fixed would make this the set of accelerators over which to tune it. Holding the accelerator fixed would leave the CNN alternatives available for that particular hardware setting. Their product exposes both choices to a common evaluation. The hardware space is parameterized around an existing implementation, which gives each configuration a concrete meaning and makes it possible to estimate its resource usage component by component.
Establish what counts as a good proposal
The ideal optimization asks for the candidate with the greatest evaluation over the full space.
s★ = argmaxₛ∈S E(s)
The symbol s denotes a candidate, and ∈ says that it belongs to S. The function E gives a candidate its evaluation according to the chosen objectives. The operator argmax returns a candidate that attains the largest value of that function. The symbol s★ denotes such a full-space optimum. Its identity depends on how E turns the measurements into a preference and on which constraints apply.
A practical search visits a sequence of candidates. The paper describes the sequence after a budget of T search steps as follows.
τ(T) = (s₁, s₂, ⋯, sₜ, ⋯, sᵀ)
Here τ(T) is the ordered record of visited candidates, and T is the total number of steps. A subscript on s gives the candidate’s position, with t standing for a particular step. The final symbol sᵀ denotes the candidate at step T. The parentheses enclose the sequence, and the ellipses stand for the intermediate steps.
The practical target is the strongest candidate among the ones visited.
s★ ≈ s∗ = argmaxₛ∈τ(T) E(s)
Here s∗ denotes the best candidate encountered through step T. The membership condition under argmax restricts the comparison to entries in τ(T). The sign ≈ expresses the goal of approaching s★ with a limited evaluation budget. It supplies no bound on how close a search will get. That distance is one reason the authors build a full-space reference in the CIFAR-10 investigation.
The evaluation uses quantities with different meanings and scales. Accuracy should increase, whereas area and latency should decrease. Some applications also impose a minimum or maximum beyond which a design is unacceptable. The paper handles the latter decision first. It writes the domain of the ordinary reward as the set of metric vectors whose applicable components meet their thresholds.
R : {m | m ∈ ℝⁿ ∧ ∀i [mᵢ ≥ thᵢ]} → ℝ
The function R returns a reward. The vector m holds the metrics, with n components, and ℝ denotes the real numbers. Thus ℝⁿ is the set of real-valued vectors of that length. The braces describe a set, and the vertical bar introduces its membership condition. The conjunction ∧ requires both conditions to hold. The symbol ∀ means that the comparison applies for every applicable metric index i. The symbols mᵢ and thᵢ are the value and threshold at index i, and ≥ means greater than or equal to. The arrow shows that R assigns a real value to a vector in its domain. The experiments state their particular limits with strict inequalities.
The paper then rescales the eligible metrics and combines them.
R(m) = w · N(m)
The function N applies linear normalization to each component. It maps from a range with endpoints xₘᵢₙ and xₘₐₓ to one with endpoints 0 and 1. The first pair denotes the minimum and maximum used for rescaling the metric. The vector w holds the weights. The dot is a dot product, so the reward adds the normalized metrics after multiplying each by its own weight. Rescaling puts quantities measured in unrelated units onto a common numerical range. The weights express which improvements the experiment values among eligible candidates.
To use the same threshold direction for all metrics, the paper gives area and latency negative signs.
E(s) = R(−area(s), −lat(s), acc(s))
Here area(s) is the area of the accelerator in s, lat(s) is the latency of running its CNN on that accelerator, and acc(s) is the CNN’s accuracy. Each minus sign reverses the order of its physical measurement so that a smaller area or latency gives a higher component value. Accuracy already has the desired direction. The commas give the order of the components sent to R, and E is the evaluation of a candidate that passes the applicable checks.
The authors use a punishment function, Rᵥ, to supply feedback when a candidate fails a constraint. Its sign opposes that of the reward. A design that is very accurate yet runs beyond an applicable latency limit receives this feedback even when its accuracy would otherwise earn it a high score. The paper explains the role and sign of Rᵥ and leaves its numerical form unspecified. The distinction between the two kinds of feedback is also important to the interpretation of the results, where the reward curves display R alone.
Learn which choices to propose
The controller is a trainable probability distribution over sequences of choices. The paper denotes its policy by πθ, with θ standing for the parameters that the search updates. The implementation uses a single long short-term memory cell followed by a linear layer. The recurrent cell provides a state for making selections in succession, and the linear layer supplies the outputs used to make a choice. Sampling enables the controller to try different candidates even when the current policy favors some choices over others.
At step t, the controller samples a candidate sₜ. The evaluator obtains the candidate’s metrics and produces the feedback for that step. The authors use REINFORCE, a policy-gradient procedure, with stochastic gradient descent to update the controller. The paper presents the update term in this form.
∇θ πθ(sₜ) E(sₜ)
The operator ∇θ indicates differentiation with respect to the controller parameters θ. The function πθ(sₜ) denotes the policy’s probability for the sampled candidate at step t, and E(sₜ) is the evaluation associated with that candidate. Juxtaposition multiplies the derivative term by the evaluation. The expression shows how an evaluated sample affects learning in the search policy. Training the CNN’s classification weights is a separate process, used to supply an accuracy value where that value has to be obtained from scratch.
Estimate area and latency at search speed
The hardware evaluator avoids the need to compile and run each proposed accelerator in full. Area estimation starts by dividing the design into pieces, including convolution, pooling, buffers, and the memory interface. Smaller pieces within each component receive parameterized resource descriptions. The paper gives the sliding-window buffer in the convolution engine as an example. Its resource requirements depend on the chosen pixel parallelism and filter parallelism. Putting such descriptions together gives an estimate for the complete accelerator.
The resource descriptions track configurable logic blocks, digital signal processors, and block RAM. Configurable logic blocks, or CLBs, supply programmable logic. DSPs supply arithmetic resources, and block RAM, or BRAM, supplies on-chip storage. The authors assign a silicon area to each resource type and use the estimated counts to express the accelerator size as a single quantity in mm². Table I gives tile areas of 0.0044 mm² for a CLB, 0.026 mm² for a 36 Kbit BRAM, and 0.044 mm² for a DSP. The scalar estimate makes it possible to compare configurations that draw on these resources in different proportions.
The latency estimator starts with measurements taken on the FPGA accelerator. Within the CNN search space the authors identify 85 distinct variants of convolution, pooling, and element-wise operations. A variant can differ in input dimensions or filter size even if it belongs to the same operation family. They measure operations across accelerator settings and record the timings in a lookup table. This gives a way to retrieve a timing for an operation under the proposed settings without rerunning that operation for every occurrence in every candidate.
A scheduler turns those timings into a latency estimate for the CNN. It assigns operations greedily to the available parallel compute units; in other words, it makes assignments as the schedule is built. The resulting arrangement determines how the operation timings contribute to the total. The lookup table describes individual work items. The scheduler accounts for the fact that the CNN has a pattern of connected work and that available compute units can carry out some operations in parallel. The paper validates the area and latency estimators separately against full compilations or executions.
Decide which choices can change at each step
In combined search, the controller chooses both the CNN and the accelerator as part of the same sampled candidate. It can change the cell and the resource configuration in a single step and receive feedback for that combination. This provides a direct route to a design that needs coordinated changes. It also makes the policy responsible for navigating the larger product of the two spaces. The authors give combined search 10,000 steps per experiment in the NASBench-101 investigation.
Phase search uses separate controllers for the CNN and FPGA choices. In a CNN phase the accelerator is fixed, so the controller can learn how alternative cells behave with that hardware. The best CNN found in the phase can then be held fixed while the hardware controller searches for an accelerator configuration. The procedure alternates these phases. A CNN phase is allotted 1000 steps and a hardware phase 200 steps within the total budget of 10,000. The restricted choice in each phase can help the controller explore its current subproblem. The eventual pairing also depends on which design is carried forward at a switch.
Separate search is the conventional sequence used as a baseline. The first stage uses 8,333 steps to seek an accurate CNN. The second uses 1,667 steps to explore accelerator settings for the selected CNN, giving the procedure the same total of 10,000 steps. The first selection fixes the workload for the rest of the search. If the second stage reveals that this workload is difficult to fit within a hardware limit, the procedure can try different accelerators but has no further CNN stage in which to use that information.
Experiments and results
A reference frontier for CIFAR-10
The first investigation combines CIFAR-10 accuracies from NASBench-101 with the area and latency evaluations of the FPGA accelerator family. The stored accuracies remove the need to train CNNs during this experiment. The fast hardware estimates make it possible to evaluate the full grid of 3.7 billion candidate pairs. This exhaustive pass establishes a reference for the search strategies. Later, a controller given only its allotted steps can be judged against the tradeoffs available in the full grid.
The authors obtain the reference by removing dominated points. A design is dominated if an alternative is at least as accurate, requires no more area, and has no greater latency, with a strict advantage in at least one of those comparisons. The Pareto frontier is the set of points that survive this test. Any improvement in one metric from a surviving position requires giving something up on another metric within the enumerated space. This definition leaves room for several practical choices because a user’s area, latency, and accuracy requirements determine which compromises are acceptable.
There are 3096 Pareto-optimal pairs, which the paper reports as less than 0.0001% of the points in the space. The surviving pairs include 338 accelerator variants and 136 CNN cells. Viewed across the latency and accuracy axes, the points form families of tradeoff curves associated with different accelerator areas. The variation in the surviving cells and accelerators shows how many distinct pairings can be relevant. A small subset of hardware settings or an accuracy-only ranking of the cells would omit some of the frontier.
This reference can answer a more specific question than whether a search finds something on the frontier. For a given experiment, the authors rank eligible frontier points according to its reward and display the top 100. A controller whose results lie near that region has found the kinds of compromises that matter for the requirements at hand. A candidate can be strong under another objective yet far from this set. Ranking the frontier again for each experiment gives a different reference when the requirements change.
Search behavior under different requirements
The unconstrained experiment has weights of (0.1, 0.8, 0.1) for area, latency, and accuracy, respectively. Latency has the largest weight, so improvements in normalized latency are particularly valuable. Designs can still earn reward across the range of measured values without first passing an imposed resource or accuracy threshold. The authors select the weights for the scenario and use it to explore the behavior of the search when the objective supplies a preference over the space without an explicit feasibility boundary.
In the latency-constrained experiment, inference latency must be below 100ms. The weights for area, latency, and accuracy are (0.1, 0, 0.9). A proposal must therefore satisfy the timing requirement to enter the reward comparison. Among eligible alternatives, accuracy has the largest weight and area has a smaller one. Faster inference within the eligible region does not directly raise the reward. This setup represents a case where an application knows how soon it needs an answer and can compare acceptable options on recognition quality and the hardware they occupy.
In the remaining scenario, accuracy must exceed 0.92 and accelerator area must be below 100mm². The search then seeks the lowest latency. Accuracy has a screening role: the controller must find a network that is good enough before speed makes it a worthwhile result. The area threshold also limits the accelerator resources available for reaching that speed. This setting exercises a different part of the search space from the latency-constrained setting, where a fast-enough design is evaluated chiefly for its accuracy.
Each experiment is repeated 10 times. In the comparison with the top 100 reference points, each run can contribute its best result, so at most 10 points per strategy are available for each scenario. The authors also track reward over the course of the search and average the traces over 10 repetitions. The positions of the final results show where a strategy ends up. The trajectories show how long it takes to reach favorable rewards. Because the separate procedure seeks only accuracy in its CNN stage, its multiobjective reward applies in its subsequent hardware stage.
The sequential baseline produces a pair of particularly strong results in the experiment with the latency limit. The 8 remaining separate-search results are substantially slower than the threshold. In the other comparisons as well, only a few of the separate results lie within the region shown in the paper’s plots, and many have high accuracy with poor hardware efficiency. For a network chosen on accuracy, a good result is possible if its workload happens to have a suitable accelerator in the available family. The repeated trials show how unreliable that outcome can be.
Combined search generally earns higher rewards in the unconstrained experiment and reaches favorable solutions faster. Phase search reaches higher rewards in both constrained experiments. Its results in the scenario with area and accuracy requirements come closer to the top reference points, while some runs fail to satisfy the stated limits. That coexistence matters: the ability to reach a high-quality part of the feasible region in successful runs can come with a slower or less dependable route to finding feasible designs under the same budget.
Training CNNs for CIFAR-100
The second investigation changes the image-classification task to CIFAR-100. Since the authors have no stored accuracy results for that task, they train the proposed CNNs from scratch. They retain the same network and accelerator design spaces, allowing the area and latency evaluators to be reused. Their experimental procedure prescribes 108 epochs of training, where an epoch is a pass through the training data. The data augmentation uses padding, random cropping, and flipping to vary the inputs encountered during training. The initial learning rate is 0.1 and follows a cosine decay schedule. Weight decay is 10⁻⁴.
The paper gives approximately 1-GPU hour as the time to train a new CNN. The authors distribute evaluation across 6 machines, each with 8 Nvidia-1080 GPUs, making it possible to train 48 CNNs in parallel. Parallel training lets the search see the outcomes of multiple architecture proposals during the same period. It remains costly to obtain classification feedback, which is why the ability to do the hardware part of evaluation with reusable estimates matters in this experiment as well.
Rather than impose independent upper limits on area and latency, the CIFAR-100 search uses a minimum for performance per area. Here performance per area expresses image-processing throughput relative to the estimated hardware footprint, in img/s/cm². It can improve when an accelerator processes images faster or when it occupies less area. The controller maximizes accuracy subject to this efficiency requirement. A setting that leaves throughput almost unchanged but reduces the area can meet a higher efficiency target, as can a setting that improves throughput enough to compensate for a somewhat larger area.
The controller encounters performance-per-area thresholds in the sequence (2, 8, 16, 30, 40). The authors start at the easiest threshold and tighten it as search proceeds. They report ~2300 valid points across the staged search, with 300 at the first threshold and 1000 at the last. Their reason for the progression is to give the controller an opportunity to learn choices associated with high accuracy before it has to meet the more demanding efficiency levels. They use combined search because it converged faster in the earlier comparisons.
Comparing the pairs with tuned baselines
The CIFAR-100 comparison uses a ResNet cell and a GoogLeNet cell inserted into the same surrounding CNN structure used for the discovered cells. The ResNet cell comes from the architectural approach in Deep Residual Learning. The shared structure makes the cell the architectural unit being compared. Each conventional cell is assigned the accelerator yielding its best performance per area within the hardware space. The resulting baselines already benefit from finding a favorable pairing for their fixed computations.
The paper displays the top 10 visited pairs at each efficiency threshold along with the two baselines. It singles out Cod-1 for comparison with the ResNet-cell pair and Cod-2 for comparison with the GoogLeNet-cell pair. The two comparisons describe different operating points. Cod-1 emphasizes accuracy among the reported pairs while improving on the efficiency of its baseline. Cod-2 sits in the region of higher performance per area and improves on the accuracy of the baseline in that region.
CIFAR-100 top-1 accuracy for baseline and codesigned pairs
Each selected codesigned cell improves on its matched baseline.
The numbers
| System or setting | accuracy % |
|---|---|
| ResNet cell | 72.9 |
| Cod-1 (this paper) | 74.2 |
| GoogLeNet cell | 71.5 |
| Cod-2 | 72.0 |
Top-1 accuracy counts an image as correctly classified when the CNN’s highest-ranked class is the correct one. For the ResNet-cell comparison, the paper labels the change in CIFAR-100 accuracy +1.3%. For the GoogLeNet-cell comparison, it reports +0.5%. These values refer to cells used inside the common skeleton. The report describes the metric as CIFAR-100 top-1 accuracy without specifying a split for these figures.
CIFAR-100 performance per area for the selected FPGA pairs
Joint search improves throughput per unit of estimated area in both comparisons.
The numbers
| System or setting | img/s/cm² |
|---|---|
| ResNet cell | 12.8 |
| Cod-1 | 18.1 |
| GoogLeNet cell | 39.3 |
| Cod-2 (this paper) | 40.6 |
The paper gives a +41% performance-per-area improvement for Cod-1 against the ResNet-cell pair and +3.3% for Cod-2 against the GoogLeNet-cell pair. The combined measure answers how much throughput is obtained per unit of estimated hardware area. The separate area and latency values show the source of each advantage. In Cod-1’s case, the accelerator uses 132 mm² by the paper’s estimate, compared with 186 mm² for the ResNet cell’s selected accelerator. The paper records the area change as −29%. The corresponding latency improvement is small, reported as −0.5%.
CIFAR-100 inference latency for baseline and codesigned pairs
Cod-2 has the lowest latency and Cod-1 stays close to the latency of its baseline.
The numbers
| System or setting | ms |
|---|---|
| ResNet cell | 42.0 |
| Cod-1 | 41.8 |
| GoogLeNet cell | 19.3 |
| Cod-2 (this paper) | 18.5 |
For the GoogLeNet-cell comparison, the authors describe Cod-2 as 4.2% faster in absolute inference latency. The listed estimated areas are 132 mm² for the GoogLeNet-cell accelerator and 133 mm² for Cod-2. The area annotation in the comparison table reads −0.8%, which is inconsistent in direction with the two listed areas. Taken directly, the area entries and latency values show Cod-2 gaining performance per area with faster inference and a slightly larger estimated footprint.
The discovery counts give a sense of the search effort behind the highlighted examples. The authors report finding Cod-1 after exploring ~1000 points and Cod-2 after ~2000 points. The abstract associates the headline ResNet-cell improvement with ~1000 GPU-hours. That computing-time figure and the ~2300 valid points reported for the whole staged search describe different parts of the experiment. The counts show how far into the search the reported designs appeared, while the hardware and accuracy comparisons describe the quality of the pairs that were found.
What the ablations show
The search comparison tests how choices are revisited
The paper’s main controlled analysis compares search strategies under common design options, evaluation criteria, and total step budgets. It varies how the controller is allowed to revisit network and hardware choices. The separate strategy uses accuracy to choose the CNN and exposes it to hardware tradeoffs afterwards. Phase search revisits the CNN after a hardware stage and revisits the hardware after a CNN stage. Combined search lets each proposal pair a newly chosen cell with newly chosen accelerator settings. This comparison concerns the organization of search, with different controllers and schedules implementing that organization.
Under the unconstrained reward, the combined controller can respond immediately to promising correlations between cell choices and accelerator settings. It generally reaches a favorable reward sooner in that experiment. Phase search, by design, has to wait until a switch to change the frozen part of the proposal. Its reward trajectories show periods of exploration before it reaches its strongest results. The advantage in convergence time helps explain why the authors choose combined search for CIFAR-100, where assessing accuracy requires training.
The constrained comparisons show a benefit of the narrower active problem in phase search. Holding an accelerator fixed makes it possible to look for CNNs that suit it, and holding a CNN fixed makes it possible to explore the hardware consequences of that workload. The experiments show higher rewards from this strategy in the constrained settings. The evidence supports its ability to reach strong tradeoffs with the chosen phase lengths and objectives. It leaves open how much of that result comes from narrowing the options at each step, using separate controllers, or the particular pattern of switches.
The best outcomes also need to be read alongside feasibility. In the latency-constrained scenario, the separate method’s strongest points can appear superior if attention stays on the plotted region. The runs beyond the latency limit are part of the same experiment and change the interpretation. Phase search likewise misses some constraints in spite of reaching better rewards in successful searches. The paper suggests that the allotted schedule gives phase search too few chances to switch from CNN exploration to hardware exploration. Its expectation that extra steps would help is an explanation to test.
The reward traces make the comparison clearer in one respect and leave it incomplete in another. They show how rewarding outcomes develop over the steps, averaged across runs. They omit the punishment values given to violating proposals. Accordingly, the traces alone cannot establish how frequently a strategy meets requirements, how severe its violations are, or what fraction of steps it spends exploring outside the feasible region. The outcome plots and the authors’ account of the omitted or unsuccessful points supply evidence about feasibility that the trajectories do not encode.
The hardware checks test different parts of the evaluation
The authors check predicted FPGA resource use against 10 full compilations with different settings. The average error reported for the area estimator is 1.6%. This comparison tests whether the component descriptions reproduce resource usage for complete accelerator configurations. A small average error on those checks gives some basis for using the estimates when comparing hardware variants in a large search. The conversion from resource quantities into physical area still depends on the tile-area assumptions.
The latency check changes hardware around a common network. The authors use a NASBench-101 CNN with a GoogLeNet cell and run it on 10 accelerator variants. They report 85% accuracy for the latency estimator on this validation set. The test exercises the composition of operation timings into a complete prediction, including the scheduler. Its network is fixed, so it shows how well the evaluator tracks selected hardware changes for that workload. The full search also asks it to assess different workloads, making this validation narrower than its eventual use.
These checks support different inferences from the search comparison. Area and latency validation compare predicted hardware quantities with results from compilation or execution. The strategy experiment compares the designs that controllers discover when they receive feedback from those estimators. Good search behavior can therefore coexist with uncertainty about some of the underlying timings. A controller can find a strong candidate according to all evaluated quantities, while physical runtime measurements still have to determine how closely its timing matches the prediction.
The selected designs suggest explanations to test
The authors inspect the cells and hardware configurations of Cod-1 and Cod-2. The Cod-1 cell includes a skip connection and element-wise addition, features associated with ResNet. A skip connection provides a route around some of the operations, with the outputs then combined where the routes meet. The discovered cell therefore uses a familiar way of combining information even though the search determines its overall arrangement. Its accuracy comparison reflects the whole selected cell. The paper does not remove that connection and retrain the resulting CNN to measure the connection’s contribution.
Both selected accelerators use filter and pixel parallelism of (16, 64), the largest convolution engine described for these designs, and have dedicated pooling disabled. The buffer depths are (4K, 2K, 4K) for Cod-1 and (8K, 2K, 2K) for Cod-2. The respective memory-interface width settings are 256 and 512, and the convolution-engine ratio settings are 0.33 and 0.25. Both ratios select specialized engines, while the different settings divide the arithmetic resources differently.
The authors propose that Cod-1’s smaller input buffer and narrower memory interface may suit a cell with more small convolutions than Cod-2. The selected configurations make this relationship plausible, but several network and hardware choices change together. The paper does not report swapping an individual buffer or interface setting while holding the rest of each pair fixed. It also gives no isolated comparison of the staged efficiency thresholds against a fixed threshold. The controlled search comparisons demonstrate differences in what the procedures find. The cell inspection and the threshold schedule give possible explanations and practical observations whose individual effects remain unmeasured.
Limitations
Limits identified by the authors
The authors describe the CHaiDNN hardware space as relatively simple. Its choices change a defined accelerator organization through buffer sizes, interface width, parallelism, pooling, and the division of convolution resources. The search shows how these choices can be matched to the allowed CNN cells. The authors expect that richer hardware spaces might yield larger gains and identify expansion of the hardware design choices as future work. Larger spaces could also change the difficulty of navigation, a question the reported experiments leave open.
The authors also identify the latency evaluator as an area for improvement. It uses measurements of individual operations and a greedy scheduler to compose them. The reported validation leaves room for more accurate per-layer estimates. This affects the interpretation of both experiments, since predicted latency can determine whether a candidate passes a constraint and can change its ranking by reward or performance per area. The quality of the evaluator near a decision boundary matters especially when a small change in timing could make a candidate admissible or inadmissible.
The choice of weights is another limit the authors make explicit. The weights determine which region of favorable points the controller is encouraged to explore. The paper selects weights for its scenarios and does not study how to choose them. Its comparison therefore describes the search behavior induced by those particular preferences and thresholds. With a different relative emphasis on latency, accuracy, or area, the reward can lead the same controller towards another region of the frontier.
Phase search’s convergence is also bounded by the reported schedule. The authors believe that more steps and additional switches would give the controllers more chances to find feasible pairings. Their data show that the schedule can reach high-reward constrained points and that it can fail to meet the constraints. The outcome under a longer budget remains a prediction. Similarly, the CIFAR-100 discussion allows for better pairs elsewhere in the large space. The search is evidence of finding useful designs with limited exploration, and the reported winners are the best highlighted among visited candidates.
The physical-area conversion carries a sourcing limitation described in the paper. Silicon-area figures for the target device are unavailable to the authors, so they adapt figures for similar FPGA resources, accounting for differences in process and block characteristics. This supplies a common numerical scale for combining logic, storage, and arithmetic resources. Its validation against compilations concerns estimated resource usage. The final area figures also depend on how the resource counts are translated into area.
Limits visible in the experimental setup
Enumeration makes the CIFAR-10 reference exhaustive with respect to its candidate list and evaluation procedure. Each possible cell–accelerator pair in the defined space participates in the dominance comparison. The hardware side of that comparison consists of estimated latencies and areas, so physical measurements for every pair would potentially yield a different reference. A reversal in the predicted ordering of nearby designs could change which points survive. The frontier is most precisely understood as the set of non-dominated pairs under the values available to the authors.
The latency validation holds the cell fixed while hardware varies. This checks an important direction in the space, because hardware changes can alter timings significantly. Variation across cell structures is another direction in which prediction errors may differ. The paper gives no error distribution across the full population of CNNs or across the best-scoring pairs. The reported validation accuracy therefore cannot establish a uniform degree of timing agreement for any architecture that the search might propose.
The CNN comparison uses a common skeleton. It supports conclusions about substituting cells within that skeleton and about choosing hardware for the resulting network. The authors discuss putting discovered cells into the larger structures associated with the original ResNet and GoogLeNet designs and anticipate similar findings. The experiment described here leaves that expectation untested. Changing the surrounding structure could affect the frequency and sizes of operations and the balance between computation and storage that influenced the hardware choice.
The hardware setting is similarly concrete. Some layers execute on the CPU, and the accelerator is drawn from the CHaiDNN configurations that the authors expose. The optimum for a different accelerator family would depend on its operations, resource choices, and scheduling. The paper’s general setup can describe another hardware space if equivalent evaluations are available. The configurations that win here and their numerical gains belong to the FPGA environment studied.
The CIFAR-100 results provide accuracy and efficiency for selected designs. The paper does not report confidence intervals or distributions from repeated training of those designs, so the reader cannot use the reported numbers to quantify how much variation might result from retraining. The experiment also compares trained pairs at selected points in the search. It does not give repeated CIFAR-100 comparisons of the three controllers under the same training budget, which would be needed to see whether the earlier strategy ordering persists on that task.
The experiments evaluate reinforcement learning as a way to navigate the design space. They compare several uses of it, including a sequential baseline. This supports conclusions about the merits of giving hardware information a role in network selection under the study’s procedures. It leaves the comparative effectiveness of other search algorithms open. In particular, the reference enumeration supplies a target for limited-budget search quality, but it does not establish how a different limited-budget optimizer would perform.
The paper’s general system description includes power as an example of a hardware metric. The developed experiments report accuracy, latency, area, and performance per area. The efficiency improvements are accordingly about throughput relative to estimated accelerator size. A power or energy claim would require its own measurements. Even among the reported quantities, the application’s requirements determine which improvement matters. Cod-1 shows a substantial area advantage at similar latency, while Cod-2 shows how latency can improve when the estimated footprint is close to that of a tuned baseline.
What came after
No later citing work is documented here. The paper itself leaves questions about whether a richer accelerator design space would produce larger gains, whether a more accurate latency estimator would change the preferred pairings, and whether more opportunities to switch phases would improve feasibility. Those are directions the authors identify for subsequent investigation. Their experiments establish the tradeoffs found within the network family and FPGA configuration space they evaluated.
Cite
Cite as Mohamed S. Abdelfattah, Łukasz Dudziak, Thomas Chau, Royson Lee, Hyeji Kim and Nicholas D. Lane. 2020. Best of Both Worlds: AutoML Codesign of a CNN and its Hardware Accelerator. arXiv:2002.05022.
@misc{abdelfattah2020best,
title = {{Best of Both Worlds: AutoML Codesign of a CNN and its Hardware Accelerator}},
author = {Mohamed S. Abdelfattah, Lukasz Dudziak, Thomas Chau, Royson Lee, Hyeji Kim and Nicholas D. Lane},
year = {2020},
doi = {10.48550/arxiv.2002.05022},
eprint = {2002.05022},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2002.05022}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/abdelfattah-2020-best-both-worlds-automl-codesign/