## 7 Performance Evaluation  
This section aims at showing the actual capabilities of the developed _DeepFogSim_ toolkit by numerically testing and comparing the energy-delay-tracking performance of its natively supported optimization tools of Section 5 under some use cases of practical interest.  
The peculiar features of the considered CDNN with early exits is the presence of a number of hierarchically organized delay-constraints (see Equation (23b)) on the allowed per-exit maximum tolerated inference times. To the best of authors' knowledge, neither resource allocation algorithms nor related simulation packages are currently present in the open literature, which explicitly consider these multiple inference delays featuring the considered operating framework. Hence, motivated by this consideration, the proposed  
Figure 7: An illustrative screenshot of the Fog topology rendered by the execution of the _plot_Topology_ function.  
_DeepFogSim_ simulator natively supports, as a benchmark for performance comparison, the so-called Maximal Resource Allocation strategy of Algorithm 2. This is a not adaptive resource allocation strategy that takes fixed at their allowed maximum values all the components of the resource allocation vectors \(\left\{\vec{f}^{(MAX)},\vec{\vec{f}}^{(MAX)},\vec{R}^{(MAX)}\right\}\). The performance comparisons against this benchmark allow us to appreciate, indeed, the actual resources savings arising from the implementation of the adaptive resource allocation engine of Algorithm 1 which is the core of the proposed _DeepFogSim_ simulator.  
A joint examination of the volumes of the input and output workloads in Equations (1) and (2) processed by the \((j,m)\)-th FN, and the related model for the dynamic power profile \(\mathcal{P}_{\text{CON}}^{(DYN)}(j,m)\) of the \((j,m)\)-th convolutional processor in Equation (8), points out that the information about the CDNN with early exits, needed for running the _DeepFogSim_ simulator are [15]: (i) the vector of the per-layer compression factors \(\widehat{cm}\triangleq\left[cm_{1},\ldots,cm_{L-1}\right]^{T}\in\mathbb{R}_{ +}^{L-1}\), where \(cm_{l}\), \(1\leq l\leq L-1\), is the ratio between the size (in bit) of the workload at the output from _layer_\(\#l\) with respect to that at its input (i.e., \(0\leq cm_{l}\leq 1\) takes account of the fraction of the workload that does not undergo early exit); and (ii) the vector of the Layer-to-Tier mappings featured by the actually performed partition \(\overline{L2T}_{map}\triangleq\left[|\mathcal{T}_{1}|,\ldots,|\mathcal{T}_{M }|\right]^{T}\in\mathbb{N}_{+}^{M}\), where \(|\mathcal{T}_{m}|\), \(1\leq m\leq M\), is the number of (adjacent) CDNN layers in Figure 0(a) mapped onto the \(m\)-the tier in Figure 0(b).  
An in-depth analysis and evaluation of the overall topic of the optimized design of CDNNs with early exits is presented in Reference [15], together with numerical examples of the vectors \(\widehat{cm}\) and \(\overline{L2T}_{map}\) for some CDNNs of practical interest (see, in particular, Tables 4-6 of Reference [15] and the related texts). As already detailed in Reference [15], we note that, in practice, the actual values of these vectors depend on a number of design factors, like the topology of the considered CDNN, the number and placement of the corresponding early exits, the sets of examples used to train and validate the CDNN, just to name a few.  
All the simulations have been carried out by exploiting an hardware execution platform equipped with: (i) an Intel 10-core i9-7900X processor; (ii) 32 GB of RAM DDR 4; (iii) an SSD with 512 GB plus an HDD with 2 TB; and (iv) a GPU ZOTAC GeForce GTX 1070. The release R2020a of MATLAB provided the underlying software execution platform.  
We remark that, unless otherwise stated, all the simulations have been carried out under the parameter setting reported in the last column of the final Table 1 in Appendix B.