P ARA D I S: P ARALLELLY D ISTRIBUTABLE S LIMMABLE N EURAL N ETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
When several limited power devices are available, one of the most efﬁcient ways to make proﬁt of these resources, while reducing the processing latency and communication load, is to run in parallel several neural sub-networks and to fuse the result at the end of processing.
However, such a combination of sub-networks must be trained speciﬁcally for each particular conﬁguration of devices (characterized by number of devices and their capacities) which may vary over different model deployments and even within the same deployment.
In this work we introduce parallelly distributable slimmable (ParaDiS) neural networks that are splittable in parallel among various device conﬁgurations without retraining.
While inspired by slimmable networks allowing instant adaptation to resources on just one device, ParaDiS networks consist of several multi-device distributable conﬁgurations or switches that strongly share the parameters between them.
We evaluate
ParaDiS framework on MobileNet v1 and ResNet-50 architectures on ImageNet classiﬁcation task and WDSR architecture for image super-resolution task.
We show that ParaDiS switches achieve similar or better accuracy than the individual models, i.e., distributed models of the same structure trained individually.
Moreover, we show that, as compared to universally slimmable networks that are not distributable, the accuracy of distributable ParaDiS switches either does not drop at all or drops by a maximum of 1 % only in the worst cases.
Finally, once distributed over several devices, ParaDiS outperforms greatly slimmable models.
I NTRODUCTION
Neural networks are more and more frequently run on end user devices such as mobile phones or
Internet of Things (IoT) devices instead of the cloud.
This is due to clear advantages in terms of better processing latency and privacy preservation.
However, those devices have often very limited (runtime and memory) resources.
While manually designing lightweight networks (Howard et al., 2017; Zhang et al., 2018) or using model compression schemes (Cheng et al., 2018)
(e.g., pruning (LeCun et al., 1990) or knowledge distillation (Hinton et al., 2015; Xie et al., 2020)) allow satisfying particular constraints, these approaches are not well suited when those resources vary across devices and over time.
Indeed, a particular model is handcrafted or compressed for given resource constraints, and once those constraints change, a new model needs to be created.
To this end, a new family of approaches that are able to instantly trade off between the accuracy and efﬁciency was introduced.
We call these approaches (or models) ﬂexible (Ozerov & Duong, 2021), and they include among others early-exit models (Huang et al., 2018), slimmable neural networks (Yu et al., 2019; Yu & Huang, 2019), Once-for-All (OFA) networks (Cai et al., 2019; Sahni et al., 2021), and neural mixture models (Ruiz & Verbeek, 2020).
An alternative path to gain in efﬁciency under constrained resources setting, consists in distributing the neural network inference over several devices (if available) (Teerapittayanon et al., 2017).
The simplest way is to distribute a neural network sequentially, e.g., in case of two devices by executing early layers on the ﬁrst device and the remaining layers on the second one, while transmitting the intermediate features between the two devices over a network (see Fig.
1 (B)).
Depending on the transmission network bandwidth, the features might undergo a lossless or a more or less severe lossy compression (Choi et al., 2018).
Neural network (A) (see Fig. 1) might be either distributed as it is or, in case the features are distorted by compression, after a ﬁne-tuning or retraining (Choi et al., 2018).
Though sequential distribution might overcome issues of limited memory and com- puting power, it does not decrease the processing latency and might only increase it because of the additional communication delay.
This might be overcome via a parallel distribution (Hadidi et al., 2019), as illustrated on Fig.
1 (C).
However, to maintain the functionality of the original neural network all convolutional and fully connected layers need to communicate, which requires a considerable communication burden and increases processing latency.
To overcome this the model may be distributed parallelly without intermediate communication (Bhardwaj et al., 2019;
Asif et al., 2019), as on Fig.
1 (D), where the only communication needed is to transmit the data to each device and the ﬁnal result from each device for a fusion.
In this work we chose to focus on this parallel distribution without communication and call it simply parallel distribution hereafter, since it leads to a much smaller processing latency, as compared to sequential distribution; does not suffer from high communication burden of communicating parallel distribution, and is also easy to deploy.
The price to be paid for these advantages consists in a potentially decreasing performance and a need of retraining due to the loss of connections between the intermediate layers.
The question we are trying to answer in this work is: Can we have one neural network that may instantly and near-optimally 1 be parallelly distributed over several devices, regardless of the number of devices and their capacities?
In this paper we introduce a new framework called parallelly distributable slimmable neural networks or ParaDiS in short that allows such functionality.
As its name suggests, ParaDiS is inspired by slimmable neural networks framework (Yu et al., 2019), where the full model variants (or so-called switches ) consist of the model sub-networks of different widths, and all variants are trained jointly while sharing the parameters.
For example, the switch denoted as 0 .
25 × is a sub-network with each layer composed of the ﬁrst 25 % of the channels of the full network.
Similarly, in ParaDiS framework we consider several variants or switches.
However,
ParaDiS switches include conﬁgurations distributable on several devices as illustrated on Figure 2.
As such, we represent each conﬁguration or switch as a list of widths.
For example, [0 . 5 , 0 . 5] × denotes a conﬁguration consisting of two parallel networks extracted from the ﬁrst and the second halves of channels of the full network, respectively.
All ParaDiS model switches are trained jointly, while strongly sharing most of their parameters.
Once a set of available devices is known, a suitable conﬁguration may be selected and instantly deployed.
Moreover, if a copy of the full model is available on each device, the conﬁguration may be changed instantly without re-loading a new model with a new conﬁguration.
For example, if one device has got more computational resources for some reason (e.g., some other process has ﬁnished) conﬁguration [0 . 5 , 0 . 25 , 0 . 25] × may be instantly changed to [0 . 5 , 0 . 5] × by simply changing the sub-models executed on each device.
Finally, similar to slimmable framework, ParaDiS framework is applicable for most modern convolutional neural network (CNN) architectures and for different tasks (e.g., classiﬁcation, detection, identiﬁcation, image restoration and super-resolution).
[Figure]
It has been noticed in (Yu et al., 2019) that slimmable network switches may share all the parameters except the global statistics of batch normalization (BN) blocks.
Individual BN statistics are adopted instead, which does not lead to any serious drawback.
Indeed, individual BN statistics may be computed within a simple calibration phase after the model is trained (Yu & Huang, 2019), and they represent a very tiny overhead in terms of the total number of parameters.
Since ParaDiS is an extension of the slimmable framework, we adopt in this work the same strategy of individual BN statistics.
As for training, while it is inspired by the training procedure for universally slimmable (US) networks (Yu & Huang, 2019), where all switches are trained jointly, the full model is trained from the data and all other switches are distilled via knowledge distillation (KD)
(Hinton et al., 2015) from the full model. We introduce two important differences.
First, instead of distilling the knowledge from the full model (switch [1 . 0] × )
we distill it from a wider model (e.g., switch [1 . 2] × ) called simply wide model hereafter.
Second, we change the KD procedure by distilling the feature activation maps before the ﬁnal fully connected layer in addition to the output predicted by the wide model.
We have shown that these new ingredients are important for training ParaDiS.
We investigate the proposed ParaDiS framework on ImageNet classiﬁcation task using MobileNet v (Howard et al., 2017) and ResNet-50 (He et al., 2016) as underlying architectures and on image super-resolution task using WDSR architecture (Yu et al., 2020a).
We compare ParaDiS models with the corresponding parallelly distributed conﬁgurations trained individually and with the US models (Yu & Huang, 2019) that are not distributable.
First, we ﬁnd that ParaDiS model performs as good as and in many cases better than the individually trained distributed conﬁgurations.
Second, we observe that distributable ParaDiS switches perform almost as good as non-distributable US model switches of the same overall complexity.
Third, we show that, once distributed overs several devices,
ParaDiS outperforms greatly the US models.
Finally, we conduct an exhaustive ablation study to show the importance of knowledge distillation, using a wide model and distilling activations.
R ELATED WORK
Compressed and ﬂexible models.
Model compression schemes (Cheng et al., 2018)
(e.g., pruning (LeCun et al., 1990) or knowledge distillation (Hinton et al., 2015)) allow satisfying particular memory and processing constraints, though they do only allow producing a ﬁxed model for every particular setting.
To go further, a new family of so-called ﬂexible approaches allowing to instantly trade off between the accuracy and efﬁciency was introduced.
These approaches include among others early-exit models (Huang et al., 2018), slimmable neural networks (Yu et al., 2019; Yu & Huang, 2019), Once-for-All (OFA) networks (Cai et al., 2019; Sahni et al., 2021), and neural mixture models (Ruiz & Verbeek, 2020).
Moreover, ﬂexible models like OFA networks have been shown to be useful for efﬁcient neural architecture search (Yu et al., 2020b) and for developing dynamic inference approaches (Li et al., 2021).
However, unlike our approach, all these approaches are within one device non-distributed settings.
Sequentially distributed models.
In Neurosurgeon (Kang et al., 2017), the authors propose a dynamic partitioning scheme of an existing deep neural network between a client (end-user device, for example) and a distant server (edge or cloud) (see also Fig.
1 (B)).
The neural network can only be split between layers to form a head and a tail and the optimal partition is obtained by estimating the execution time of each part on the different devices.
The main drawback of this approach is the added communication time occurring between the different partitions.
To this end other optimization strategies have been developed and intermediate feature compression schemes have been proposed (Matsubara et al., 2021).
However, as we have discussed above, distributing a model sequentially does not allow making use of a plurality of devices to reduce processing latency.
Parallelly distributed models.
In contrast to sequential distribution, distributing model parallelly with no communication (see Fig.
1 (D)) allows reducing processing latency without increasing communication burden at the same time.
Several recently proposed approaches (Bhardwaj et al., 2019;
Asif et al., 2019) suggest creating such efﬁcient parallel models via knowledge transfer from a bigger single pre-trained model.
Wang et al.
(2020) revisit model ensembles that are parallellizable as well, and show that they are almost as efﬁcient as individual non-distributable models of the same complexity.
However, in contrast to our proposal, none of those models are sharing parameters.
P ARA D I S NEURAL NETWORKS 3. S WITCHABLE BATCH NORMALIZATION STATISTICS
Batch normalization (BN) (Ioffe & Szegedy, 2015) is an essential block present nowadays in most popular deep CNNs.
BN is very simple and consists in normalizing CNN features in each layer and channel with mean and variance of the current mini-batch.
While during training the statistics of the current mini-batch are considered, during testing these statistics are replaced by global statistics computed as moving averages over the whole or a part of the training set.
Because of this inconsistency between training and testing, the BN parameters cannot be simply shared in slimmable neural networks (Yu et al., 2019; Yu & Huang, 2019).
As such, it was ﬁrst proposed in (Yu et al., 2019) to consider a so-called switchable BN block having separate set of parameters for every switch.
It was then shown that it is sufﬁcient to consider only switchable BN statistics, while the remaining parameters of the BN block might be shared between switches.
Finally, it was proposed (Yu &
Huang, 2019) to compute switchable BN statistics in a so-called calibration phase after training.
For each switch the calibration consists simply in a forward pass over the corresponding network over a subset of the training set, so as to compute global BN statistics.
Since the proposed ParaDiS framework is based on slimmable networks, we here adopt switchable BN statistics together with the calibration procedure.
3. T RAINING P ARA D I S NETWORKS
The switches of a ParaDiS network are trained jointly using a training procedure inspired by US networks training (Yu & Huang, 2019), though with several modiﬁcations we introduced that we have shown to be important for achieving good performance.
Recall that US networks training (Yu & Huang, 2019) consists in updating all switches jointly (though sampling a limited number of switches per epoch), while only the full 1 .
× model is trained from data and all other switches are trained from the output of the full model via a knowledge distillation (KD)
(Hinton et al., 2015).
This procedure is referred to as inplace knowledge distillation (IPKD) since all the switches are strongly sharing their parameters.
More speciﬁcally, assuming here without loss of generality an image classiﬁcation task, the full 1 .
× model in US training (Yu & Huang, 2019) is updated based on the true labels using the conventional cross-entropy (CE) loss
[Equation]
where C is the number of classes, and y and y (cid:48) are C -dimensional hot vectors of true and predicted labels, respectively.
All other switches are trained by optimizing the following KD loss 2 :
[Equation]
where ˆ y and y (cid:48) are hot vectors of labels predicted by the current switch and by the full model, respectively.
We adopt this approach to train the ParaDiS networks, while improving it with two novel add-ons (that are important for training) explained just below and depicted on Fig.
loss =
L CE (ˆ y, y (cid:48) )
+ β L MSE (ˆ a, a (cid:48) ) loss =
L CE (ˆ y, y (cid:48) ) loss =
L CE ( y (cid:48) , y ) x x x x x y ”landscape” y (cid:48)
ˆ y ˆ y a (cid:48) ˆ a y (cid:48)
[Figure]
(cid:48)
[Figure]
Knowledge distillation from a wider model.
Within our early experiments on training ParaDiS
MobileNet v1 network with 4 switches (as shown on Fig. 2) on ImageNet dataset we tried applying directly the US training framework, but this did not lead to a satisfactory result.
Indeed, the full [1 . 0] × model was not training well enough under-performing by about 1 % the individual MobileNet v1.
Since all the other switches were distilled from the full model, their performances were degraded by at least the same amount, as compared to the expected ones.
We believed that this is because all the switches span the full 1 .
× network width, while sharing their parameters, and thus the full [1 . 0] × model is not “free enough” to train well.
In fact, this is not the case for slimmable (Yu et al., 2019) or US (Yu & Huang, 2019) networks, where all other switches have smaller widths as compared to the full model.
This gave us the idea to perform IPKD from a wider (e.g., [1 . 2] × ) network, which is simply called hereafter wide network .
Indeed, the wide network is always wider than all other ParaDiS switches, and thus it is not constrained and can train better.
Note also that the wide network is only needed for training, as such its additional parameters (as compared to the full network) may be simply discarded after training.
Moreover, as another alternative, any other big network (completely independent from the ParaDiS network) may be also used as wide network.
Distilling feature activation maps.
Another issue we have noticed is that the training of ParaDiS network distributed switches is not always very stable.
Indeed, since the fusion occurs only after the last layer (see, e.g., Fig.
3, bottom) training of one sub-network depends on the outputs of all other sub-networks, and thus not very “independent”.
To make this IPKD training more “sub-model dependent”, we modify the IPKD to distill as well the full [1 . 0]
× model feature activation maps just before the ﬁnal fully connected (FC) layer to all other sub-models.
More precisely, we propose to modify the KD-loss (2) as follows:
[Equation]
where β is a constant parameter, a (cid:48) is an N -dimensional vector containing a vectorization of the feature activation maps before the ﬁnal FC layer, and ˆ a is the vector including the respective activation maps of the corresponding switch 3 (see Fig. 3).
We believe that this should stabilize training since when β grows training of each sub-network becomes more and more independent of the outputs of other sub-networks within a switch.
Such kind of regularisation of KD-loss has been already considered in (Bhardwaj et al., 2019)
(see Eq.
(6) in the paper), but not in the case of inplace knowledge distillation as we consider here.
We refer to this proposed activation distillation as IPKD-A .
Note also that in contrast to US training (Yu & Huang, 2019), where a random selection of switches is updated at each iteration, we update all the switches at each iteration.
The resulting procedure is schematized on Figure 3 and described in detail by Algorithm 1.
Algorithm
(see also Fig. 3)
Require
5] × , . . .
25] × ]
Execute full model, (ˆ y, a (cid:48) )
=
M ( x, [1 . 0] × ) , where a (cid:48) is the activation maps vector.
loss =
CE
E XPERIMENTS
We evaluate our approach on the ImageNet classiﬁcation dataset (Deng et al., 2009) withclasses.
We conducted experiments on one light-weight model (MobileNet v1) and one large model (ResNet-50).
For both models 4 different switches are trained at each epoch:
[4 × 0 .
25] × 4 , [0 . 5 , 0 .
5] × , [1 . 0]
× and [1 . 2] × .
We compare our performance with US model and individually trained models ( [4 × 0 .
25] × , [0 . 5 , 0 . 5] × , [0 . 5 , 0 .
25] × and [1 . 0] × ).
Note that for a fair comparison the reference US model, similarly to our ParaDiS model, was trained while distilling from a wide [1 . 2] × model instead of the full [1 . 0] × model as in the original work (Yu & Huang, 2019).
The corresponding approach is then referred to as US Wide (some results on the effect of wide distillation for US and slimmable Nets are in Appendix B).
We evaluate the accuracy (1 - top-1 error) on the center 224 × 224 crop of images in the validation set.
For all models, we show the complexity in terms of Millions of Multiply-Adds (MFLOPs).
For readability the results of wide [1 . 2] × model as well as of small switches for the reference models are not shown on the plots, however detailed results can be found in the corresponding appendices.
However, this representation in terms of total MFLOPs does not represent any gain of ParaDiS over
US and Slimmable models in terms of latency.
Also, it is not trivial since such gain depends on the available devices and their capacities.
To represent this gain, we add additional curves to the main graphs as follows.
We assume a situation when all the devices have equal capacities, and we have any number of them.
In that case the US switch 0 .
5 × and the ParaDiS switch [0 . 5 , 0 .
5] × will run with the same latency (neglecting the communication latency that is small) and the same number of MFLOPs per device, while [0 . 5 , 0 . 5] × has a superior accuracy.
In summary, we add to the corresponding graphs below a curve tagged as “distributed” that shows the accuracies of switches [0 .
25] × , [0 . 5 , 0 . 5] × , [1 . 0]
× as a function of MFLOPs for one sub-model (and not a sum of MFLOPs for all sub-models).
This curve is representative of a deployment with several equal capacities devices and shows the real advantage of ParaDiS over US and Slimmable models.
In order to diversify the tasks and architectures, we also investigated ParaDiS for image superresolution using WDSR model (Yu et al., 2020a).
Detailed results can be found Appendix D, they are inline with those for ImageNet classiﬁcation.
4. M OBILE N ET V
We use the default training and testing settings (Howard et al., 2017) for MobileNet v1 with the same adjustments as proposed in US-Nets paper (Yu & Huang, 2019): 250 epochs, stochastic gradient descent as optimizer (instead of RMSProp), a linearly decaying learning rate from 0.5 to 0 and a batch size of 1024 images.
The results are shown on Figure 4 (see Appendix C for details).
First, one may see that ParaDiS performs on par with or in some cases ( [4 × 0 .
25] × and [0 . 5 , 0 . 5] × ) better than the individual models.
This is inline with similar ﬁndings for slimmable and US models (Yu et al., 2019; Yu & Huang, 2019), and this is mostly thanks to implicit KD (parameters sharing) and explicit KD.
Second, yet more striking is the fact that the distributable ParaDiS switches perform as good as non-distributable
US switches of the same overall complexity.
Finally, while [0 . 5 , 0 . 25 , 0 . 25] × switch has not been explicitly trained at all, it performs well.
This is possibly because it spans the full width, as other switches, and all its sub-models were trained within other switches.
Thanks to the “distributed” curve we see also a great improvement of distributed ParaDiS over US model.
4. R ESNET -
For ResNet-50, we use the same parameters as in slimmable networks (Yu et al., 2019): 100 epochs with a batch size of 256 images, a learning rate of 0.1 divided by 10 at 30, 60 and 90 epochs.
We use stochastic gradient descent (SGD) as optimizer, Nesterov momentum with a momentum weight of 0.9 without dampening, and a weight decay of 1e-4 for all training settings.
The results are shown on Figure 5 (see Appendix C for details), where we also compare with slimmable and slimmable wide, since they perform better than US wide for ResNet-50.
Almost the same conclusions as for MobileNet v1 may be drawn with the following differences.
First, the improvement of ParaDiS over individual models is yet more signiﬁcant.
Second, the performance of ParaDiS [4 × 0 .
25] × switch drops a little as compare to the similar US switch.
A BLATION S TUDY
In this section we show the impact of different training settings such as Inplace Knowledge Distillation (IPKD), the use of a wide network for the IPKD and the importance of distilling the activation.
We use MobileNet v1 and Resnet-50 trained on ImageNet to measure the contribution of these different parameters (additional plots may be found in Appendix E).
First, results in Table 1 indicate the importance of IPKD and of the wide model for ParaDiS training.
At the same time it shows that distilling activations (either with β = 0 .
1 or β = 1 ) does not help for training ParaDiS MobileNet v1.
However, results in Table 2 conﬁrm the importance of distilling activations for training ParaDiS ResNet-50.
[Figure] [Figure]
[Table] [Table]
S CALABILITY ISSUES
Within the proposed ParaDiS networks there is potentially many more possible switches than in slimmable or US nets.
Indeed, each ParaDiS switch sub-network might be of any width.
As such, it seems quite important to be able to scale the approach to more switches than the 4 used in our experiments.
We have shown in our experiments that some switches might perform satisfactory though they were never explicitly trained, e.g., switch [0 . 5 , 0 .
25] × (see Figs.
4 and 5), possibly because it spans the full width, as other switches, and all its sub-models were trained within other switches.
Based on this observation, we conjecture that if we have smaller sub-models, e.g., by considering wider full model, we may have more non-trained satisfactory switches “for free”.
For example, if we split the full model in 8 sub-models and train [1 . 2] × , [1 . 0] × , [0 . 5 , 0 . 5] × , [4 × 0 . 25] × and [8 × 0 .
125] × , we would have 6 other switches coming for free.
We show experimentally in Appendix F.1 that this path to scale up ParaDiS framework is viable.
Alternatively, we have also tried training ParaDiS with 8 switches, where we also vary the width spanned by the switch.
The results we obtained (see Appendix F.2 for details) are very unsatisfactory: the accuracy of each switch is at least 4 % below the accuracy of the corresponding US net switch.
What remains unclear and should be a subject of a further study is: Is this performance drop because all these switches cannot co-exist within the shared ParaDiS parameters setting or because we have not found yet how to train them correctly?
C ONCLUSION
In this work we have introduced parallelly distributable slimmable (ParaDiS) neural networks.
These networks are splittable in parallel between various device conﬁgurations without retraining.
While so-called ﬂexible networks allowing instant adjusting to a given complexity have been already widely studied, the kind of “ﬂexibility-to-distribute” property of ParaDiS networks is considered for the ﬁrst time to our best knowledge.
ParaDiS networks are inspired by one-device ﬂexible slimmable networks and consist of several distributable conﬁgurations or switches that strongly share the parameters between them.
We evaluated ParaDiS framework on MobileNet v1 and ResNet-50 architectures on ImageNet classiﬁcation task and on WDSR architecture for image super-resolution task.
First, we have shown that ParaDiS models perform as good as and in many cases better than the individually trained distributed conﬁgurations.
Second, we have found that distributable ParaDiS switches perform almost as good as non-distributable universally slimmable model switches of the same overall complexity.
Finally, we have shown that once distributed over several devices, ParaDiS outperforms greatly slimmable models.
A very important topic for further study would be scaling the ParaDiS networks to more conﬁgurations/switches than 4.
As we have demonstrated in Appendix F.1, one way to achieve that consists in considering more sub-models at the last level of split with “for freee”non-trained switches as a result.
To yet improve on that, one might also consider width-overlapping sub-models.
A P ARA D I S AND S LIMMABLE NEURAL NETWORKS REPRESENTATION
Here we present a graphical representation of Slimmable and ParaDiS switches that allows a better understanding of these models.
An important observation is that in most cases slimming a CNN from 1 . 0 × (full model) to W × leads to roughly W 2 times more parameters in switch 1 . 0 × than in switch W × (the same is valid for the computational complexity in FLOPs).
This is because most parameters reside in the weights of convolutional and fully connected layers, and the number of these weights scales with network width W as W 2 const .
The same holds for ParaDiS sub-models.
As such we have found very intuitive to represent slimmable switches as squares and ParaDiS switches as sets of squares, as shown on Figure 6.
For each switch within this representation the surface of the blue area is roughly equal to the relative number of parameters, as compared to the full 1 .
× model, and the relative number of FLOPs.
For example, from this representation we may conclude that ParaDiS switch [4 × 0 .
25] × has roughly the same complexity as slimmable or US switch 0 .
5 × since their surfaces are equal.
This is conﬁrmed by the fact that, as we may see from Tables 4 and 5 below, the US switch that is closest in complexity to ParaDiS switch [4 × 0 .
25] × is of width 0 .
525 ≈ 0 .
Finally, Yu et al.
(2020b) were also using such a representation with “squares” for slimmable networks (see Fig.
1 in (Yu et al., 2020b)).
B W IDE VS . NON - WIDE FOR US AND SLIMMABLE NETS
Table 3 regroups the results of experiments using US or slimmable networks for MobileNet v1 or
Resnet-50.
Interestingly, it is MobileNetv1 that beneﬁts the most of the wide network, the results for slimmable Resnet-50 show a slight loss of performance for the biggest switches and a small gain for the lowest switches.
C D ETAILED RESULTS FOR I MAGE N ET CLASSIFICATION
Tables 4 and 5 summarize the detailed results corresponding to those plotted on Figures 4 and 5, respectively.
We may see in Table 5 that for most of ParaDiS switches we do not indicate results of slimmable networks.
This is simply because the complexities of slimmable switches do not correspond exactly to those of ParaDiS switches.
As for results of US nets on both Tables 4 and 5,
[Table] [Table]
summarizes more in details the results plotted on Figure 4.
As for US results, the accuracy of the switch having the closest complexity to the corresponding ParaDiS switch is given every time.
ParaDiS switch [1 . 2] × [1 . 0] × [0 . 5; 0 . 5] × [0 . 5; 0 . 25; 0 . 25] × [4 × 0 .
25] × (corresponding US switch) (1 . 2 × ) (1 . 0 × ) (0 . 7 × ) (0 . 625 × )
(0 . 525 × )
ParaDiS Wide IPKD
[Table]
, β =
[Table]
Slimmable
[Table]
[Table]
[Table]
Slimmable
[Table]
[Table]
Individual
[Table]
more in details the results plotted on Figure 5.
As for US results, the accuracy of the switch having the closest complexity to the corresponding ParaDiS switch is given every time
D D ETAILED RESULTS FOR IMAGE SUPER - RESOLUTION
In order to investigate ParaDiS on a different task and with yet different architecture, we study it here for image super-resolution task using WDSR architecture (Yu et al., 2020a).
Inspired by (Yu & Huang, 2019), we experiment with DIV2K dataset (Timofte et al., 2017) which contains 800 training and 100 validation 2K-resolution images, on the task of bicubic × 2 image super-resolution.
WDSR network has no batch normalization layer, instead weight normalization (Salimans & Kingma, 2016) is used.
We use the latest implementation of the WDSR network released in April 2020 5 and adapt the model and training to support Slimmable, Universally Slimmable (US) and ParaDiS conﬁgurations.
Note that, to our best knowledge, there is no publicly available implementation of WDSR
US-Nets as reported in (Yu & Huang, 2019). We use the same maximum width ( 64 channels), number of residual blocks ( 8 ) and width multiplier ( 4 ) as reported by Yu & Huang (2019).
The default hyper-parameters (number of training epochs, learning rate, weight decay ...) are used for all experiments.
We report results in Figure 7 and show that ParaDiS exhibits a performance on par with US-Nets and slightly below individually trained models.
When distributing the ParaDiS network on several devices (orange dotted curve in Figure 7), the beneﬁts of the parallelization allows our model to outperform individual models running on a single device. The results are consistent with reported [Figure]
of Multiply-Adds (MFLOPs) [Figure] results for individual models (Yu et al., 2020a) and for US-Nets without inplace distillation (Yu &
Huang, 2019).
However we were unable to reproduce the results reported for US-Nets when inplace distillation is used during training.
All models showed a degradation of performance when using knowledge distillation.
E A BLATION S TUDY
In this section we present the results of our ablation study for MobileNet v1 and Resnet-50 trained on ImageNet.
E. W IDE VS . NON - WIDE AND IPKD VS . NO KD
First we study the impact of IPKD and distilling from a wide network.
Figure 8 clearly shows the beneﬁt of IPKD from a wide model by comparing the ParaDiS models trained without Knowledge
Distillation, trained with IPKD from model [1 . 0] × and trained with IPKD from wide model [1 . 2] × .
It is interesting to note a positive impact of using Knowledge Distillation on untrained switches.
In our case we see a big improvement in performance, thanks to IPKD, for the [0 . 5 , 0 . 25 , 0 .
25] × switch that is never explicitly trained.
E. D ISTILLATION OF THE ACTIVATIONS
We present in this section the results of experiments using MobileNet v1 and Resnet-50 with and without distilling feature activation maps from the [1 . 0] × model.
From Figure 9 one may notice that the distillation of feature activation maps does not help training different switches of ParaDiS MobileNet v1. [Figure]
[Figure] From Figure 10 one may see that the beneﬁt of distillation of feature activation maps is clearly visible especially for the largest switches of ParaDiS ResNet-50. [Figure]
Millions of Multiply-Adds (MFLOPs)
[Figure]
F S CALING P ARA D I S MODELS TO MORE SWITCHES F. N ON - TRAINED SWITCHES “ FOR FREE ”
First, we conjecture that if we train for example switches [1 . 2] × , [1 . 0] × , [0 . 5 , 0 . 5] × , [4 × 0 .
25] × , and [8 × 0 .
125] × , we would have 6 other switches coming for free:
25] × , • [0 . 5 , 0 .
125 , 0 . 125] × , • [0 . 5 , 0 .
125 , 0 . 125] × , • [0 . 25 , 0 . 25 , 0 . 25 , 0 . 125 , 0 . 125] × , • [0 . 25 , 0 . 25 , 0 .
125 , 0 . 125] × , • [0 . 25 , 0 .
125 , 0 . 125] × ,
because they span the full width as other trained switches, and all their sub-models were trained within other switches.
Second, we have chosen ResNet-50 to verify this conjecture.
Indeed, ImageNet v1 is already too optimized (thus thin) to be split into sub-models of widthes 0 .
The results are shown on Figure 11.
We may see that the performance of model trained on 5 switches drops just slightly (less than 1 % of accuracy) as compared to the one trained on 4 switches.
Moreover, the performance ofnon-trained switches coming ”for free” seems to be descent, assuming especially that these switches are distributable over several devices.
As such, this way of scaling ParaDiS to more switches seems to be viable. [Figure] Millions of Multiply-
Adds (MFLOPs
[Figure]
[Figure] F. V ARYING THE WIDTH SPANNED BY THE SWITCHES
This section presents detailed results when scaling ParaDiS to more switches.
We used MobileNet v trained on ImageNet for the experiments.
8 different switches are explicitly trained at each epoch (compared to 4 in the remainder of the experiments): [1 . 2] × , [1 . 0] × , [0 . 5 , 0 . 5] × , [0 . 5] ×
[4 × 0 . 25] × , [3 × 0 .
25] × , [2 × 0 .
25] × and [0 . 25] × .
Figure 12 shows the difference in performance betweenand 8 switches.
[Figure]