P ER -T ENSOR F IXED -P OINT Q UANTIZATION OF THE B ACK -P ROPAGATION A LGORITHM
A BSTRACT
The high computational and parameter complexity of neural networks makes their training very slow and difﬁcult to deploy on energy and storage constrained comput ing systems
Many network complexity reduction techniques have been proposed including ﬁxed-point implementation.
However, a systematic approach for designing full ﬁxed-point training and inference of deep neural networks remains elusive.
We describe a precision assignment methodology for neural network training in which all network parameters, i e., activations and weights in the feedforward path, gradients and weight accumulators in the feedback path, are assigned close to minimal precision.
The precision assignment is derived analytically and enables tracking the convergence behavior of the full precision training, known to converge a priori.
Thus, our work leads to a systematic methodology of determining suitable precision for ﬁxed-point training.
The near optimality (minimality) of the resulting precision assignment is validated empirically for four networks on the
CIFAR-10, CIFAR- and SVHN datasets.
The complexity reduction arising from our approach is compared with other ﬁxed-point neural network designs
I NTRODUCTION
Though deep neural networks (DNNs) have established themselves as powerful predictive models achieving human-level accuracy on many machine learning tasks (He et al., 2016), their excellent performance has been achieved at the expense of a very high computational and parameter complexity.
For instance, AlexNet (Krizhevsky et al., 2012) requires over 800 × 10 6 multiply-accumulates (MACs) per image and has 60 million parameters, while Deepface (Taigman et al., 2014) requires over 500 × 10 6 MACs/image and involves more than 120 million parameters.
DNNs’ enormous computational and parameter complexity leads to high energy consumption (Chen et al., 2017), makes their training via the stochastic gradient descent (SGD) algorithm very slow often requiring hours and days (Goyal et al., 2017), and inhibits their deployment on energy and resource-constrained platforms such as mobile devices and autonomous agents.
A fundamental problem contributing to the high computational and parameter complexity of DNNs is their realization using 32-b ﬂoating-point (FL) arithmetic in GPUs and CPUs.
Reduced-precision representations such as quantized FL (QFL) and ﬁxed-point (FX) have been employed in various combinations to both training and inference.
Many employ FX during inference but train in FL, e.g., fully binarized neural networks (Hubara et al., 2016) use 1-b FX in the forward inference path but the network is trained in 32-b FL.
Similarly, Gupta et al.
(2015) employs 16-b FX for all tensors except for the internal accumulators which use 32-b FL, and 3-level QFL gradients were employed (Wen et al., 2017;
Alistarh et al., 2017) to accelerate training in a distributed setting.
Note that while QFL reduces storage and communication costs, it does not reduce the computational complexity as the arithmetic remains in 32-b FL.
Thus, none of the previous works address the fundamental problem of realizing true ﬁxed-point
DNN training , i.e., an SGD algorithm in which all parameters/variables and all computations are implemented in FX with minimum precision required to guarantee the network’s inference/prediction accuracy and training convergence .
The reasons for this gap are numerous including: 1) quantization
[Figure] [Figure]
2: Back
Propagation
[Figure]
errors propagate to the network output thereby directly affecting its accuracy (Lin et al., 2016); 2) precision requirements of different variables in a network are interdependent and involve hard-toquantify trade-offs (Sakr et al., 2017); 3) proper quantization requires the knowledge of the dynamic range which may not be available (Pascanu et al., 2013); and 4) quantization errors may accumulate during training and can lead to stability issues (Gupta et al., 2015). Our work makes a major advance in closing this gap by proposing a systematic methodology to obtain close-to-minimum per-layer precision requirements of an FX network that guarantees statistical similarity with full precision training.
In particular, we jointly address the challenges of quantization noise, inter-layer and intra-layer precision trade-offs, dynamic range, and stability.
As in (Sakr et al., 2017), we do assume that a fully-trained baseline FL network exists and one can observe its learning behavior.
While, in principle, such assumption requires extra FL computation prior to FX training, it is to be noted that much of training is done in FL anyway.
For instance, FL training is used in order to establish benchmarking baselines such as AlexNet (Krizhevsky et al., 2012), VGG-Net (Simonyan and Zisserman, 2014), and ResNet (He et al., 2016), to name a few.
Even if that is not the case, in practice, this assumption can be accounted for via a warm-up FL training on a small held-out portion of the dataset (Dwork et al., 2015).
Applying our methodology to three benchmarks reveals several lessons.
First and foremost, our work shows that it is possible to FX quantize all variables including back-propagated gradients even though their dynamic range is unknown (Köster et al., 2017).
Second, we ﬁnd that the per-layer weight precision requirements decrease from the input to the output while those of the activation gradients and weight accumulators increase.
Furthermore, the precision requirements for residual networks are found to be uniform across layers.
Finally, hyper-precision reduction techniques such as weight and activation binarization (Hubara et al., 2016) or gradient ternarization (Wen et al., 2017) are not as efﬁcient as our methodology since these do not address the fundamental problem of realizing true ﬁxed-point DNN training.
We demonstrate FX training on three deep learning benchmarks (CIFAR-10, CIFAR-100, SVHN) achieving high ﬁdelity to our FL baseline in that we observe no loss of accuracy higher then 0.56% in all of our experiments.
Our precision assignment is further shown to be within 1-b per-tensor of the minimum.
We show that our precision assignment methodology reduces representational, computational, and communication costs of training by up to 6 × , 8 × , and 4 × , respectively, compared to the FL baseline and related works.
P ROBLEM S ETUP , N OTATION , AND M ETRICS
We consider a L -layer DNN deployed on a M -class classiﬁcation task using the setup in Figure 1.
We denote the precision conﬁguration as the L × 5 matrix C =
( B W l , B A l , B G ( W ) l , B G ( A ) l +1 , B W ( acc ) l ) Ll =
whose l th row consists of the precision (in bits) of weight W l ( B W l ), activation A l ( B A l ), weight gradient G ( W ) l ( B G ( W ) l ), activation gradient G ( A ) l +1 ( B G ( A ) l +1 ), and internal weight accumulator W ( acc ) l ( B W ( acc ) l ) tensors at layer l .
This DNN quantization setup is summarized in Appendix A.
F IXED - POINT C ONSTRAINTS & D EFINITIONS
We present deﬁnitions/constraints related to ﬁxed-point arithmetic based on the design of ﬁxed-point adaptive ﬁlters and signal processing systems (Parhi, 2007):
• A signed ﬁxed-point scalar a with precision B A and binary representation R A
= ( a 0 , a 1 , . .
. , a B A − 1 ) ∈ { 0 , 1 } B A is equal to: a = r A (cid:16) −
a 0 + (cid:80) B
A − 1 i = [Equation] , where r A is the predetermined dynamic range (PDR) of a .
The PDR is constrained to be a constant power of 2 to minimize hardware overhead.
• An unsigned ﬁxed-point scalar a with precision B A and
binary representation R A
= ( a 0 , a 1 , . .
. , a B A − 1 ) ∈ { 0 , 1 } B A is equal to:
a = r A (cid:80) B
A − 1 i = 2 − i a i .
• A ﬁxed-point scalar
a is called normalized if r A = 1 .
• The precision B A is determined as: B A
= log 2 r
A ∆ A + 1 , where ∆ A is the quantization step size which is the value of the least signiﬁcant bit (LSB) .
• An additive model for quantization is assumed: a = ˜ a
+ q a , where a is the ﬁxed-point number obtained by quantizing the ﬂoating-point scalar ˜ a , q a is a random variable uniformly distributed on the interval (cid:2) − ∆
A 2 , ∆ A 2 (cid:3) , and the quantization noise variance is V ar ( q a ) =
∆ 2 A 12 .
The notion of quantization noise is most useful when there is limited knowledge of the distribution of ˜
a . • The relative quantization bias
η A is the offset: η A = | ∆ A − µ A | µ A , where the ﬁrst unbiased quantization level µ A = E (cid:2)
˜ a (cid:12)(cid:12) ˜ a ∈
I 1 (cid:3) and I 1 = (cid:2) ∆
A 2 , 3∆ A 2 (cid:3) .
The notion of quantization bias is useful when there is some knowledge of the distribution of ˜
a . • The reﬂected quantization noise variance from a tensor T to a scalar α = f ( T ) , for an arbitrary function f () , is : V T → α = E T → α ∆ 2 T 12 , where ∆ T is the quantization step of T and E T →
α is the quantization noise gain from T to α .
• The clipping rate β T of a tensor T is the probability: β T =
Pr ( {| t | ≥ r T : t ∈ T } ) , where r T is the PDR of T .
2. C OMPLEXITY M ETRICS
We use a set of metrics inspired by those introduced by Sakr et al.
(2017) which have also been used by Wu et al.
(2018a).
These metrics are algorithmic in nature which makes them easily reproducible.
• Representational Cost for weights ( C W ) and activations ( C A ):
[Equation]
which equals the total number of bits needed to represent the weights, weight gradients, and
internal weight accumulators ( C W
and
those
for activations and
activation gradients (
C A ).
• Computational Cost of training: C M = (cid:80) Ll =1 |
[Equation]
where D l is the dimensionality of the dot product needed to compute one output activation at layer l .
This cost is a measure of the number of 1-b full adders (FAs) utilized for all multiplications in one back-prop iteration.•
Communication Cost : C C =
(cid:80)
Ll =
| W l | B G ( W ) l , which represents cost of communicating weight gradients in a distributed setting (Wen et al., 2017;
Alistarh et al., 2017).
P RECISION A SSIGNMENT M ETHODOLOGY AND A NALYSIS
We aim to obtain a minimal or close-to-minimal precision conﬁguration C o of a FX network such that the mismatch probability p m =
Pr { ˆ Y fl (cid:54) =
ˆ Y fx } between its predicted label ( ˆ Y fx ) and that of an associated FL network ( ˆ Y fl ) is bounded, and the convergence behavior of the two networks is similar.
Hence, we require that: (1) all quantization noise sources in the forward path contribute identically to the mismatch budget p m (Sakr et al., 2017), (2) the gradients be properly clipped in order to limit the dynamic range (Pascanu et al., 2013), (3) the accumulation of quantization noise bias in the weight updates be limited (Gupta et al., 2015), (4) the quantization noise in activation gradients be limited as these are back-propagated to calculate the weight gradients, and (5) the precision of weight accumulators should be set so as to avoid premature stoppage of convergence (Goel and Shanbhag, 1998).
The above insights can be formally described via the following ﬁve quantization criteria.
Criterion 1.
Equalizing Feedforward Quantization Noise (EFQN) Criterion.
The reﬂected quantization noise variances onto the mismatch probability p m from all feedforward weights ( { V W l → p m } Ll =1 ) and activations ( { V A l → p m } Ll =1 ) should be equal:
[Equation]
Criterion 2.
Gradient Clipping (GC) Criterion.
The clipping rates of weight ( { β G ( W ) l } Ll =1 ) and activation ( { β G ( A ) l +1 } Ll =1 ) gradients should be less than a maximum value β 0 :
[Equation]
[Equation]
for l = 1 . . .
L.
Criterion 3.
Relative Quantization Bias (RQB) Criterion.
The relative quantization bias of weight gradients ( { η G ( W ) l } Ll =1 ) should be less than a maximum value η 0 : η G ( W ) l < ηfor l = 1 . . .
L.
Criterion 4.
Back-propagated Quantization Noise (BQN) Criterion.
The reﬂected quantization noise variance V G ( A ) l +1 → Σ l , i.e., the total sum of element-wise variances of G ( W ) l reﬂected from quantizing
G ( A ) l +1 , should be less than V G ( W ) l
[Equation]
l = 1 . . .
L. where Σ l is the total sum of element-wise variances of G ( W ) l .
Criterion 5.
Accumulator Stopping (AS) Criterion.
The quantization noise of the internal accumulator should be zero, equivalently:
[Equation]
where V W ( acc ) l → Σ ( acc ) l is the reﬂected quantization noise variance from W ( acc ) l to Σ ( acc ) l , its total sum of element-wise variances.
Further explanations and motivations behind the above criteria are presented in
Appendix B.
The following claim ensures the satisﬁability of the above criteria.
This leads to closed form expressions for the precision requirements we are seeking and completes our methodology.
The validity of the claim is proved in Appendix C.
Claim 1.
Satisﬁability of Quantization Criteria.
The ﬁve quantization criteria (EFQN, GC, RQB,
BQN, AS) are satisﬁed if:
• The precisions B W l and B A l are set as follows: B W l = rnd (cid:32) log(cid:32)(cid:114)
E W l → p m E (min) (cid:33)(cid:33)
[Equation]
for l = 1 . . .
L , where rnd () denotes the rounding operation, E W l
→ p m and E A l → p m are the weight and activation quantization noise gains at layer l , respectively, B (min) is a reference minimum precision, and E (min) =
min (cid:16) { E W l → p m } L l =1 , { E A l → p m } L l =1 (cid:17) .
• The weight and activation gradients PDRs are lower bounded as follows:
[Equation]
where σ (max) G ( W ) l and σ (max) G ( A )
l +1 are the largest recorded estimates of the weight and activation gradients standard deviations σ G ( W ) l and σ G ( A ) l +1 , respectively.
• The weight and activation gradients quantization step sizes are upper bounded as follows:
[Equation]
where σ (min) G ( W ) l is the smallest recorded estimate of σ G ( W ) l
and λ (
[Equation]
is the largest singular value of the square-Jacobian (Jacobian matrix with squared entries) of G ( W ) l with respect to G ( A ) l +1 .
• The accumulator PDR and step size satisfy:
[Equation]
where γ (min) is the smallest value of the learning rate used during training.
Practical considerations: Note that one of the 2 L feedforward precisions will equal B (min) .
The formulas to compute the quantization noise gains are given in Appendix C and require only one forward-backward pass on an estimation set.
We would like the EFQN criterion to hold upon convergence; hence, (1) is computed using the converged model from the FL baseline.
For backward signals, setting the values of PDR and LSB is sufﬁcient to determine the precision using the identity
B A
= log 2 r
A ∆ A + 1 , as explained in Section 2.1.
As per Claim 1, estimates of the second order statistics, e.g., σ G ( W ) l and σ G ( A ) l +1 , of the gradient tensors, are required.
These are obtained via tensor spatial averaging, so that one estimate per tensor is required, and updated in a moving window fashion, as is done for normalization parameters in BatchNorm (Ioffe and Szegedy, 2015).
Furthermore, it might seem that computing the Jacobian in (3) is a difﬁcult task; however, the values of its elements are already computed by the back-prop algorithm, requiring no additional computations (see Appendix
C).
Thus, the Jacobians (at different layers) are also estimated during training.
Due to the typical very large size of modern neural networks, we average the Jacobians spatially, i.e., the activations are aggregated across channels and mini-batches while weights are aggregated across ﬁlters.
This is again inspired by the work on Batch Normalization (Ioffe and Szegedy, 2015) and makes the probed
Jacobians much smaller.
N UMERICAL R ESULTS
We conduct numerical simulations in order to illustrate the validity of the predicted precision conﬁguration C o and investigate its minimality and beneﬁts.
We employ three deep learning benchmarking datasets: CIFAR-10, CIFAR-100 (Krizhevsky and Hinton, 2009), and SVHN (Netzer et al., 2011).
All experiments were done using a Pascal P100 NVIDIA GPU.
We train the following networks:
• CIFAR-10 ConvNet: a 9-layer convolutional neural network trained on the CIFAR-10 dataset described as 2 × (64 C 3) − MP 2 − 2 × (128 C 3) − MP 2 − 2 × (256 C 3) − 2 × (512 FC ) −
where C 3 denotes 3 × 3 convolutions, MP 2 denotes 2 × 2 max pooling operation, and FC denotes fully connected layers.
• SVHN ConvNet: the same network as the CIFAR-10 ConvNet, but trained on the SVHN dataset.
• CIFAR-10 ResNet: a wide deep residual network (Zagoruyko and Komodakis, 2016) with ResNet20 architecture but having 8 times as many channels per layer compared to (He et al., 2016).
• CIFAR-100 ResNet: same network as CIFAR-10 ResNet save for the last layer to match the number of classes (100) in CIFAR-100.
A step by step description of the application of our method to the above four networks is provided in
Appendix E. We hope the inclusion of these steps would: (1) clarify any ambiguity the reader may have from the previous section and (2) facilitate the reproduction of our results. {+9 Layer Depth 
 # o f b i t s C+}
o =(10.1,5.1,9.0,7.1,16.3)
{+CIFAR-10 ConvNet (a)        9 Layer Depth 
 o f b i t s+} C o =(8.3,4.6,9.2,8.4,17.8) SVHN ConvNet (b) 1 2 3 4 5 6 7 8 9 10111213141516171819202122 Layer Depth 0123456789101112131415161718 # o f b i t s C o =(13.5,6.4,11.6,10.2,13.9) CIFAR-10 ResNet (
[Figure]
1 2 3 4 5 6 7 8 9 10111213141516171819202122 Layer Depth 0123456789101112131415161718 # o f b i t s
C o =(13.7,6.1,12.3,10.3,14.1) CIFAR-100 ResNet
[Figure]
4. P RECISION C ONFIGURATION C o & C ONVERGENCE
The precision conﬁguration C o , with target p m ≤ 1% , β 0 ≤ 5% , and η 0 ≤ 1% , via our proposed method is depicted in Figure 2 for each of the four networks considered.
We observe that C o is dependent on the network type .
Indeed, the precisions of the two ConvNets follow similar trends as do those the two ResNets.
Furthermore, the following observations are made for the ConvNets:
• weight precision B W l decreases as depth increases .
This is consistent with the observation that weight perturbations in the earlier layers are the most destructive (Raghu et al., 2017).
• the precisions of activation gradients ( B G ( A ) l ) and internal weight accumulators ( B W ( acc ) l ) increases as depth increases which we interpret as follows: (1) the back-propagation of gradients is the dual of the forward-propagation of activations, and (2) accumulators store the most information as their precision is the highest.
• the precisions of the weight gradients ( B G ( W ) l ) and activations ( B A l ) are relatively constant across layers .
Interestingly, for ResNets, the precision is mostly uniform across the layers.
Furthermore, the gap between B W ( acc ) l and the other precisions is not as pronounced as in the case of ConvNets.
This suggests that information is spread equally among all signals which we speculate is due to the shortcut connections preventing the shattering of information (Balduzzi et al., 2017).
FX training curves in Figure 3 indicate that C o leads to convergence and consistently track FL curves with close ﬁdelity .
This validates our analysis and justiﬁes the choice of C o .
[Figure]
4. N EAR M INIMALITY OF C o
To determine that C o is a close-to-minimal precision assignment
[Figure]
we compare it with:
(a) C +
=
C o + 1 L × 5 , and (b) C − 1 =
C o − 1 L × 5 , where 1 L × 5 is an L × 5 matrix with each entry equal to 1 3 , i.e., we perturb C o by 1-b in either direction.
Figure 3 also contains the convergence curves for the two new conﬁgurations.
As shown, C − 1 always results in a noticeable gap compared to C o for both the loss function (except for the CIFAR-10 ResNet) and the test error.
Furthermore, C +1 offers no observable improvements over C o (except for the test error of CIFAR-10 ConvNet).
These results support our contention that C o is close-to-minimal in that increasing the precision above C o leads to diminishing returns while reducing precision below C o leads to a noticeable degradation in accuracy.
Additional experimental results provided in Appendix D support our contention regarding the near minimality of C o .
Furthermore, by studying the impact of quantizing speciﬁc tensors we determine that that the accuracy is most sensitive to the precision assigned to weights and activation gradients.
4. C OMPLEXITY VS . A CCURACY
We would like to quantify the reduction in training cost and expense in terms of accuracy resulting from our proposed method and compare them with those of other methods.
Importantly, for a fair comparison, the same network architecture and training procedure are used.
We report C W , C A , C M ,
C C , and test error, for each of the four networks considered for the following training methods:
• baseline FL training and FX training using C o , • binarized network (BN) training, where feedforward weights and activations are binary (constrained to ± 1 ) while gradients and accumulators are in ﬂoating-point and activation gradients are back- [Table] propagated via the straight through estimator (Bengio et al., 2013) as was done in (Hubara et al., 2016), • ﬁxed-point training with stochastic quantization (SQ).
As was done in (Gupta et al., 2015), we quantize feedforward weights and activations as well as all gradients, but accumulators are kept in ﬂoating-point.
The precision conﬁguration (excluding accumulators) is inherited from C o
(hence we determine exactly how much stochastic quantization helps), • training with ternarized gradients (TG) as was done in TernGrad (Wen et al., 2017).
All computations are done in ﬂoating-point but weight gradients are ternarized according to the instantaneous tensor spatial standard deviations {− 2 .
5 σ, 0 , 2 . 5 σ } as was suggested by Wen et al.
To compute costs, we assume all weight gradients use two bits although they are not really ﬁxed-point and do require computation of 32-b ﬂoating-point scalars for every tensor.
The comparison is presented in Table 1.
The ﬁrst observation is a massive complexity reduction compared to FL.
For instance, for the CIFAR-10 ConvNet, the complexity reduction is 2 .
6 × ( = 148 / 56 . 5 ), 5 .
5 × ( = 9 . 3 / 1 . 7 ), 7 . 9 × ( = 94 . 4 / 11 . 9 ), and 3 .
5 × ( = 49 / 14 ) for C W , C A , C M , and C C , respectively.
Similar trends are observed for the other four networks.
Such complexity reduction comes at the expense of no more than 0.56% increase in test error.
For the CIFAR-100 network, the accuracy when training in ﬁxed-point is even better than that of the baseline.
The representational and communication costs of BN is signiﬁcantly greater than that of FX because the gradients and accumulators are kept in full precision, which masks the beneﬁts of binarizing feedforward tensors.
However, beneﬁts are noticeable when considering the computational cost which is lowest as binarization eliminates multiplications.
Furthermore, binarization causes a severe accuracy drop for the ConvNets but surprisingly not for the ResNets.
We speculate that this is due to the high dimensional geometry of ResNets (Anderson and Berg, 2017).
As for SQ, since C o was inherited, all costs are identical to FX, save for C W which is larger due to full precision accumulators.
Furthermore, SQ has a positive effect only on the CIFAR-10 ConvNet where it clearly acted as a regularizer.
TG does not provide complexity reductions in terms of representational and computational costs which is expected as it only compresses weight gradients.
Additionally, the resulting accuracy is slightly worse than that of all other considered schemes, including FX.
Naturally, it has the lowest communication cost as weight gradients are quantized to just 2-b.
D ISCUSSION 5. R ELATED W ORKS
Many works have addressed the general problem of reduced precision/complexity deep learning.
Reducing the complexity of inference (forward path): several research efforts have addressed the problem of realizing a DNN’s inference path in FX.
For instance, the works in (Lin et al., 2016;
Sakr et al., 2017) address the problem of precision assignment.
While Lin et al.
(2016) proposed a non-uniform precision assignment using the signal-to-quantization-noise ratio (SQNR) metric,
Sakr et al.
(2017) analytically quantiﬁed the trade-off between activation and weight precisions while providing minimal precision requirements of the inference path computations that bounds the probability p m of a mismatch between predicted labels of the FX and its FL counterpart.
An orthogonal approach which can be applied on top of quantization is pruning (Han et al., 2015).
While signiﬁcant inference efﬁciency can be achieved, this approach incurs a substantial training overhead.
A subset of the FX training problem was addressed in binary weighted neural networks (Courbariaux et al., 2015; Rastegari et al., 2016) and fully binarized neural networks (Hubara et al., 2016), where direct training of neural networks with pre-determined precisions in the inference path was explored with the feedback path computations being done in 32-b FL.
Reducing the complexity of training (backward path): ﬁnite-precision training was explored in (Gupta et al., 2015) which employed stochastic quantization in order to counter quantization bias accumulation in the weight updates.
This was done by quantizing all tensors to 16-b FX, except for the internal accumulators which were stored in a 32-b ﬂoating-point format.
An important distinction our work makes is the circumvention of the overhead of implementing stochastic quantization (Hubara et al., 2016).
Similarly, DoReFa-Net (Zhou et al., 2016) stores internal weight representations in 32-b FL, but quantizes the remaining tensors more aggressively.
Thus arises the need to re-scale and re-compute in ﬂoating-point format, which our work avoids.
Finally, Köster et al.
(2017) suggests a new number format – Flexpoint – and were able to train neural networks using slightly 16-b per tensor element, with 5 shared exponent bits and a per-tensor dynamic range tracking algorithm.
Such tracking causes a hardware overhead bypassed by our work since the arithmetic is purely FX.
Augmenting Flexpoint with stochastic quantization effectively results in WAGE (Wu et al., 2018b), and enables integer quantization of each tensor.
As seen above, none of the prior works address the problem of predicting precision requirements of all training signals.
Furthermore, the choice of precision is made in an ad-hoc manner.
In contrast, we propose a systematic methodology to determine close-to-minimal precision requirements for FX-only training of deep neural networks.
5. C ONCLUSION
In this paper, we have presented a study of precision requirements in a typical back-propagation based training procedure of neural networks.
Using a set of quantization criteria, we have presented a precision assignment methodology for which FX training is made statistically similar to the FL baseline, known to converge a priori.
We realized FX training of four networks on the CIFAR-10,
CIFAR-100, and SVHN datasets and quantiﬁed the associated complexity reduction gains in terms costs of training.
We also showed that our precision assignment is nearly minimal.
The presented work relies on the statistics of all tensors being quantized during training .
This necessitates an initial baseline run in ﬂoating-point which can be costly.
An open problem is to predict a suitable precision conﬁguration by only observing the data statistics and the network architecture.
Future work can leverage the analysis presented in this paper to enhance the effectiveness of other network complexity reduction approaches.
For instance, weight pruning can be viewed as a coarse quantization process (quantize to zero) and thus can potentially be done in a targeted manner by leveraging the information provided by noise gains.
Furthermore, parameter sharing and clustering can be viewed as a form of vector quantization which presents yet another opportunity to leverage our method for complexity reduction. A CKNOWLEDGMENT
This work was supported in part by C-BRIC, one of six centers in JUMP, a Semiconductor Research
Corporation (SRC) program sponsored by DARPA.
Supplementary Material A S UMMARY OF Q UANTIZATION S ETUP
The quantization setup depicted in Figure 1 is summarized as follows:
• Feedforward computation at layer l :
[Equation]
where f l () is the function implemented at layer l , A l ( A l +1 ) is the activation tensor at layer l ( l + 1 ) quantized to a normalized unsigned ﬁxed-point format with precision B A l ( B A l +1 ), and W l is the weight tensor at layer l quantized to a normalized signed ﬁxed-point format with precision
B W l .
We further assume the use of a ReLU-like activation function with a clipping level of 2 and a max-norm constraint on the weights which are clipped between [ − 1 , 1] at every iteration.
• Back-propagation of activation gradients at layer l :
[Equation]
where g l () ( A ) is the function that back-propagates the activation gradients at layer l , G ( A ) l ( G ( A ) l +1 ) is the activation gradient tensor at layer l ( l + 1 ) quantized to a signed ﬁxed-point format with precision B G ( A ) l
[Equation]
• Back-propagation of weight
gradient tensor G ( W ) l at layer l :
[Equation]
where g ( W ) l () is the function that back-propagates the weight gradients at layer l , and G ( W ) l is quantized to a signed ﬁxed-point format with precision B G ( W ) l .
• Internal weight accumulator update at layer l :
[Equation]
where U () is the update function, γ is the learning rate, and W ( acc ) l is the internal weight accumulator tensor at layer l quantized to signed ﬁxed-point
B F URTHER E XPLANATIONS AND M OTIVATIONS BEHIND Q UANTIZATION C RITERIA
Criterion 1 (EFQN) is used to ensure that all feedforward quantization noise sources contribute equally to the p m budget.
Indeed, if one of the 2 L reﬂected quantization noise variances from the feedforward tensors onto p m , say V W i
→ p m for i ∈ { 1 , . . .
, L } , largely dominates all others, it would imply that all tensors but W i are overly quantized.
It would therefore be necessary to either increase the precision of W i or decrease the precisions of all other tensors.
The application of Criterion(EFQN) through the closed form expression (1) in Claim 1 solves this issue avoiding the need for a trial-and-error approach.
Because FX numbers require a constant PDR, clipping of gradients is needed since their dynamic range is arbitrary.
Ideally, a very small PDR would be preferred in order to obtain quantization steps of small magnitude, and hence less quantization noise.
We can draw parallels from signal processing theory, where it is known that for a given quantizer, the signal-to-quantization-noise ratio (SQNR) is equal to SQNR ( dB ) = 6 B +4 .
78 − PAR where PAR is the peak-to-average ratio, proportional to the PDR.
Thus, we would like to reduce the PDR as much as possible in order to increase the SQNR for a given precision.
However, this comes at the risk of overﬂows (due to clipping).
Criterion(GC) addresses this trade-off between quantization noise and overﬂow errors.
Since the back-propagation training procedure is an iterative one, it is important to ensure that any form of bias does not corrupt the weight update accumulation in a positive feedback manner.
FX quantization, being a uniform one, is likely to induce such bias when quantized quantities, most notable gradients, are not uniformly distributed.
Criterion 3 (RQB) addresses this issue by using η as proxy to this bias accumulation a function of quantization step size and ensuring that its worst case value is small in magnitude.
Criterion 4 (BQN) is in fact an extension of Criterion 1 (EFQN), but for the back-propagation phase.
Indeed, once the precision (and hence quantization noise) of weight gradients is set as per Criterion 3 (RQB), it is needed to ensure that the quantization noise source at the activation gradients would not contribute more noise to the updates.
This criterion sets the quantization step of the activation gradients.
Criterion 5 (AS) ties together feedforward and gradient precisions through the weight accumulators.
It is required to increment/decrement the feedforward weights whenever the accumulated updates cross-over the weight quantization threshold.
This is used to set the PDR of the weight accumulators.
Furthermore, since the precision of weight gradients has already been designed to account for quantization noise (through Criteria 2-4), the criterion requires that the accumulators do not cause additional noise.
C P ROOF OF C LAIM
The validity of Claim 1 is derived from the following ﬁve lemmas.
Note that each lemma addresses the satisﬁability of one of the ﬁve quantization criteria presented in the main text and corresponds to part of Claim 1.
Lemma 1.
The EFQN criterion holds if the precisions B W l and B A l are set as follows:
[Equation]
for l = 1 . . .
L , where rnd () denotes the rounding operation, B (min) is a reference minimum precision, and E (min) is given by:
[Equation]
Proof.
By deﬁnition of the reﬂected quantization noise variance [Equation] the EFQN [Equation]
by deﬁnition
[Equation]
is satisﬁed if:
[Equation]
where the quantization noise gains are given by:
[Equation]

[Equation]

[Equation]
(cid:54)
[Equation]
(cid:80) a
[Equation]
(cid:12)(cid:12)(cid:12)(cid:12)
[Equation]
[Equation] ) ∂a (cid:12)(cid:12)(cid:12)(cid:12) [Equation]   (6) for l = 1 . . .
L , where { Z i } Mi =1 are the soft outputs and Z ˆ Y
fl is the soft output corresponding to ˆ Y fl .
The expressions for these quantization gains are obtained by linearly expanding (across layers) those used in (Sakr et al., 2017).
Note that a second order upper bound is used as a surrogate expression for p m .
From the deﬁnition of quantization step size, the above is equivalent to:
[Equation]
Let E (min) be as deﬁned in (5):
[Equation]
[Equation]
We can divide each term by E (min) :
[Equation]
where each term is positive, so that we can take square roots and logarithms such that:
[Equation]
Thus we equate all of the above to a reference precision B (min) yielding:
[Equation]
for l = 1 . . .
L .
Note that because E (min) is the least quantization noise gain, it is equal to one of the above quantization noise gains so that the corresponding precision actually equates B (min) .
As precisions must be integer valued, each of B (min) , { B W l } Ll =1 , and { B A l } Ll =1 have to be integers, and thus a rounding operation is to be applied on all logarithm terms.
Doing so results in (1) from Lemma 1 which completes this proof.
Lemma 2.
The GC criterion holds for β 0 = 5% provided the weight and activation gradients pre-deﬁned dynamic ranges (PDRs) are lower bounded as follows:
[Equation]
for l = 1 . . . L where σ (max) G ( W ) l and σ (max) G ( A ) l +1 are the largest ever recorded estimates of the weight and activation gradients standard deviations σ G ( W ) l and σ G ( A ) l +1 , respectively.
Proof.
Let us consider the case of weight gradients.
The GC criterion, by deﬁnition requires:
[Equation]
Typically, weight gradients are obtained by computing the derivatives of a loss function with respect to a mini-batch.
By linearity of derivatives, weight gradients are themselves averages of instantaneous derivatives and are hence expected to follow a Gaussian distribution by application of the Central
Limit Theorem.
Furthermore, the gradient mean was estimated during baseline training and was found to oscillate around zero.
Thus
[Equation]
where we used the fact that a Gaussian distribution is symmetric and Q () is the elementary Q-function, which is a decreasing function.
Thus, in the worst case, we have:
[Equation]
Hence, for a PDR as suggested by the lower bound in (2):
[Equation]
in Lemma 2, we obtain the upper bound:
[Equation]
0 .which means the GC criterion holds and completes the proof.
For activation gradients, the same reasoning applies, but the choice of a larger PDR in (2):
[Equation]
than for weight gradients is due to the fact that the true dynamic range of the activation gradients is larger than the value indicated by the second moment.
This stems from the use of activation functions such as ReLU which make the activation gradients sparse.
We also recommend increasing the PDR even more when using regularizers that sparsify gradients such as Dropout (Srivastava et al., 2014) or
Maxout (Goodfellow et al., 2013).
Lemma 3.
The RQB criterion holds for η 0 = 1% provided the weight gradient quantization step size is upper bounded as follows:
[Equation]
where σ (min) G ( W ) l is the smallest ever recorded estimate of σ G ( W ) l .
Proof.
For the Gaussian distributed (see proof of Lemma 2) weight gradient at layer l , the true mean conditioned on the ﬁrst non-zero quantization region is given by:
[Equation]
where σ G ( W ) l is the standard deviation of G ( W ) l .
By substituting ∆ G ( W ) l = σ G ( W ) linto the above expression of µ G ( W ) l and plugging in the deﬁnition of relative quantization bias, we obtain:
[Equation]
Hence, this choice of the quantization step satisﬁes the RQB.
In order to ensure the RQB holds throughout training, σ (min) G ( W ) l is used in Lemma 3.
This completes the proof.
Lemma 4.
The BQN criterion holds provided the activation gradient quantization step size is upper bounded as follows:
[Equation]

 [Equation] for l = 1 . . . L where λ (max) G ( A ) l +1 → G ( W ) l , the largest singular value of the square-Jacobian (Jacobian matrix with squared entries) of G ( W ) l with respect to G ( A ) l +1 .
Proof.
Let us unroll G ( W ) l and G ( A ) l +1 to vectors of size (cid:12)(cid:12) (cid:12) G ( W ) l (cid:12)(cid:12) (cid:12) and (cid:12)(cid:12) (cid:12)
G ( A ) l +1 (cid:12)(cid:12) (cid:12) , respectively.
The elementwise quantization noise variance of each weight gradient is
[Equation]
G
[Equation]
Therefore we have:
[Equation]
[Equation]
The reﬂected quantization noise variance from an activation gradient g a ∈ G ( A ) l +1 onto a weight gradient g w ∈ G ( W ) l is
[Equation]
12 , where cross products of quantization noise are neglected (Sakr et al., 2017).
Hence, the reﬂected quantization noise variance element-wise from G ( A ) l +1 onto G ( W ) l is given by:
[Equation]
where J G ( A ) l +1 → G ( W ) l is the square-Jacobian of G ( W ) l with respect to G ( A ) l +1 and 1 denotes the all one vector with size denoted by its subscript.
Hence, we have:
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
(cid:13)(cid:13)(cid:13)(cid:13)
[Equation]
(cid:114)(cid:12)(cid:12)(cid:12)
[Equation]
[Table]
[Equation]
(cid:12)(cid:12)(cid:12)
[Equation]
12 , where we used the Cauchy-Schwarz inequality and the spectral norm of a matrix.
Next we set this upper bound on V G ( A ) l +
→ Σ l to be less than the value of V G ( W ) l → Σ l determined above.
This condition, by deﬁnition, is enough to satisfy the BQN criterion.
Rearranging terms yields Lemma 4 which completes the proof.
In the main text, it was menitoned that each entry in the Jacobian matrix above is already computed by the back-propagation algorithm.
We now explain how.
Let us denote the instantaneous loss function being minimized by ξ .
Note that each entry of J G ( A ) l +1 → G ( W ) l is of the form (cid:12)(cid:12)(cid:12) ∂g w ∂g (0) a (cid:12)(cid:12)(cid:12) 2 where g w = ∂ξ∂w with w ∈ W l and g (0) a = ∂ξ∂a (0) with a (
) ∈
A l +1 .
The back-propagation algorithm computes g w using the chain rule as follows:
[Equation]
In particular, note that g (0) a appears only once in the summation above and is multiplied by ∂a (0) ∂w .
Thus ∂g w ∂g ( [Equation] = ∂a (0) ∂w .
This establishes that each entry of the Jacobian matrix is already computed via the back-propagation algorithm.
Lemma 5.
The AS criterion holds provided the accumulator PDR and quantization step size satisfy:
[Equation]
= 1 . . .
L where γ (min) is the smallest value of the learning rate used during training.
Proof.
The lower bound on the PDR of the weight accumulator, given by
[Equation]
for l = 1 . . .
L, ensures that updates are able to cross over the feedforward weight quantization threshold so that it can be updated.
Additionally, the lower bound on the quantization step size, given by
[Equation]
for l = 1 . . .
L , simply ensures that the internal weight accumulator overlaps with the least signiﬁcant part of the representation of the weight gradient multiplied by the learning rate.
Thus, the quantization noise of the internal accumulator is zero, or equivalently,
[Equation]
which, by deﬁnition, is enough for the AS criterion to hold.
Note that this criterion applies to the
Vanilla-SGD learning rule (which was used in our experiments).
Future work includes extending this criterion to other learning rules such as momentum and ADAM.
We close this appendix by discussing the approximation made by invoking the Central Limit Theorem (CLT) in the proofs of Lemmas 2 & 3.
This approximation was made because, typically, a backpropagation iteration computes gradients of a loss function being averaged over a mini-batch of samples.
By linearity of derivatives, the gradients themselves are averages, which warrants the invocation of the CLT.
However, the CLT is an asymptotic result which might be imprecise for a ﬁnite number of samples.
In typical training of neural networks, the number of samples, or mini-batch size, is in the range of hundreds or thousands (Goyal et al., 2017).
It is therefore important to quantify the preciseness, or lack thereof, of the CLT approximation.
On way to do so is via the Berry-Essen
Theorem which considers the average of n independent, identically distributed random variables with ﬁnite absolute third moment ρ and standard deviation σ .
The worst case deviation of the cumulative distribution of the true average from the of the approximated Gaussian random variable (via the CLT), also known as the Kolmogorov-Smirnov distance, KS , is upper bounded as follows:
KS <
Cρ √ nσ 3 , where C < 0 .
4785 (Tyurin, 2010).
Observe that the quantity ρσ 3 is data dependent.
To estimate this quantity, we performed a forward-backward pass for all training samples at the start of each epoch for our four networks considered.
The statistics ρ and σ were estimated by spatial (over tensors) and sample (over training samples) averages.
The maximum value of the ratio ρσ 3 for all gradient tensors was found to be 2.8097.
The mini-batch size we used in all our experiments was 256.
Hence, we claim that the CLT approximation in Lemmas 2 & 3 is valid in our context up to a worst case
Kolmogorov-Smirnov distance of KS < 0 .
4785 × 2 .
8097 √= 0 . 084 .
[Figure]
l a t i v e T e s t
E rr o r
[Figure]
e v i a t
i [Figure] [Figure] D A DDITIONAL RESULTS ON THE M INIMALITY AND S ENSITIVITY OF C o
The minimality experiments in the main paper only consider a full 1-b perturbation to the full precision conﬁguration matrix.
We further investigate the minimality of C o and its sensitivity to precision perturbation per tenor type.
The results of this investigation are presented in Fig.
First, we consider random fractional precision perturbations, meaning perturbations to the precision conﬁguration matrix where only a random fraction p of the 5 L precision assignments is incremented or decremented.
{+A fractional precision perturbation of 1 (-1) corresponds to C +
+}
( C − 1 ).
A fractional precision perturbation of 0.5 (-0.5) means that a randomly chosen half of the precision assignments is incremented (decremented).
Figure 4 (a) shows the relative test error deviation compared to the test error associated with C o for various fractional precision perturbations.
The error deviation is taken in a relative fashion to account for the variability of the different networks’ accuracies.
For instance, an absolute 1% difference in accuracy on a network trained on SVHN is signiﬁcantly more severe than one on a network trained on CIFAR-100.
It is observed that for negative precision perturbations the variation in test error is more important than for the case of positive perturbations.
This is further encouraging evidence that C o is nearly minimal, in that a negative perturbation causes signiﬁcant accuracy degradation while a positive one offers diminishing returns.
It is also interesting to study which of the 5 L tensor types is most sensitive to precision reduction.
To do so, we perform a similar experiment whereby we selectively decrement the precision of all tensors belonging to the same type (weights, activations, weight gradients, activation gradients, weight accumulators).
The results of this experiment are found in Fig.
4 (b).
It is found that the most sensitive tensor types are weights and activation gradients while the least sensitive ones are activations and weight gradients.
This is an interesting ﬁnding raising further evidence that there exists some form of duality between the forward propagation of activations and back propagation of derivatives as far as numerical precision is concerned.
E I LLUSTRATION OF M ETHODOLOGY U SAGE
We illustrate a step by step description of the application of our precision assignment methodology to the four networks we report results on.
E. CIFAR-10 C ONV N ET
Feedforward Precisions: The ﬁrst step in our methodology consists of setting the feedforward precisions B W l and B
A l .
As per Claim 1, this requires using (1).
To do so, it is ﬁrst needed to compute the quantization noise gains using (6).
Using the converged weights from the baseline run we obtain:
Layer Index l
[Equation] 1.52E [Equation] 1.24E+ 4.21E+ 3.57E+ 2.35E+
[Equation] 5.51E+ 3.27E+ 5.15E+ 6.60E+ 7.78E+
Layer Index l
E [Equation] 5.61E+ 5.97E+ 3.23E+ 8.66E+ E
[Equation] m 7.49E+ 6.32E+ 2.37E+ 9.47E+
And therefore, E (min) = 94 .
7 and the feedforward precisions should be set according to (1) as follows:
Layer Index l
B W l 7+ B (min) 7+ B (min) 8+ B (min) 8+ B (min) 7+ B (min)
B A l 4+ B (min) 1+ B (min) 1+ B (min) 1+ B (min) 2+ B (min)
Layer Index l
B W l 6+ B (min) 5+ B (min) 4+ B (min) 3+ B (min)
B A l 1+ B (min) 1+ B (min)[-1+ B (min) 
-]
[Equation]
The value of B (min) is swept and p m i evaluated on the validation set.
It is found that the smallest value of B (min) resulting in p m < 1% is equal to 4 bits.
Hence the feedforward precisions are set as follows and as illustrated in Figure 2:
Layer Index l
B W l
B A l
Gradient Precisions: The second step of the methodology is to determine the precisions of weight
B G ( W ) l and activation B G ( A ) l +1 gradients.
As per Claim 1, an important statistic is the spatial variance of the gradient tensors.
We estimate these variances via moving window averages, where at each iteration, the running variance estimate ˆ σ 2 is updated using the instantaneous variance ˜ σ 2 as follows:
[Equation]
where θ is the running average factor, chosen to be 0.1.
The running variance estimate of each gradient tensor is dumped every epoch.
Using the maximum recorded estimate and (2) we compute the PDRs of the gradient tensors (as a reminder, the PDR is forced to be a power of 2):
Layer Index l     r G ( W ) l 5.00E1.25E1.25E1.25E6.25Er G ( A ) l + 4.88E9.77E9.77E1.95E7.81ELayer Index l    r G ( W ) l 3.13E3.13E1.56E1.25Er G ( A ) l + 1.56E7.81E7.81E3.13EFurthermore, using the minimum recorded estimates of the weight gradient spatial variances and (3) we compute the values of the quantization step sizes of the weight tensors:
[Table]
Hence the weight gradients precisions B G ( W ) l are set as follows and as illustrated in Figure 2:
Layer Index l
[Table]
In order to compute the activation gradients precisions, (3) dictates that we need the values of largest singular values of the of the square-Jacobians of G ( W ) l with respect to G ( A ) l +1 for l = 1 . . .
L .
The square Jacobians matrices are estimated in a moving window fashion as for the variances above.
However, instead of updating a matrix every iteration, the updates are done every ﬁrst batch of every epoch.
The following are the maximum recorded singluar values:
[Table] [Table]
28E
[Table] [Table] [Table]
08E
[Table]
[Table]
37E
[Table]
1.26E+ 3.51E+
Using the above values and (3) we obtain the values of the quantization step sizes for the activation gradients:
Layer Index l
[Table] [Table]
10E
[Table]
05E [Table] [Table] 63E
[Table]
1.53E
[Table]
[Table] 53E [Table] Index l
[Table]
Hence the activation gradients precisions B G ( A ) l +1 are set as follows and as illustrated in Figure 2:
Layer Index l
B G ( A ) l +
Internal Weight Accumulators Precisions: By application of (4), we use the above results to obtain the internal weight accumulator precisions.
The only additional information needed is the value of the smallest learning rate value used in the training, which in our case is 0.0001.
We obtain the following precisions which are illustrated in Figure
Layer Index l
B [Table]
[Equation]
[Table]
l
E. SVHN C ONV N ET
Feedforward Precisions: The quantization noise gains are used to obtain values for the precisions as a function of B (min) as summarized below:
[Table]
The value of B (min) is again swept
[Table]
and it is found that the p m < 1% for B (min) = 3 .
The feedforward precisions are therefore set as follows and as illustrated in Figure 2:
[Table]
Gradient Precisions: The spatial variance of the gradient tensors is used to determine the PDRs and the quantization step sizes of weight gradients.
The singular values of the square-Jacobians are needed to determine the quantization step sizes of activation gradients.
They were computed as follows:
Layer Index l     r G ( W ) l 6.25E1.56E1.56E1.56E1.56E- ∆ G ( W ) l 2.44E6.10E6.10E6.10E6.10Er G ( A ) l + 4.88E4.88E9.77E1.95E3.91Eλ (max) G ( A ) l +1 → G ( W ) l 5.13E+ 1.48E+ 3.25E+ 1.37E+ 8.84E+ ∆ G ( A ) l + 3.05E9.54E9.54E9.54E1.91ELayer Index l
r G ( W ) l 7.81E3.91E3.91E1.56E- ∆ G ( W ) l 3.05E1.53E7.63E6.10Er G ( A
[Table]
l + 1.56E3.91E3.91E3.13Eλ (max)
[Table]
[Table]
+
[Table]
( W ) l 2.20E+ 9.58E+ 1.78E+ 1.71E+
∆ G ( A ) l + 1.91E9.54E9.54E7.63EHence the gradients precisions are set as follows and as illustrated in Figure 2:
Layer Index l
B G ( W ) l
B [Equation]
Internal Weight Accumulators Precisions: The smallest learning rate value for this network is 0.001 which results in the following precisions for the internal weight accumulators as illustrated in
Figure 2:
Layer Index l
[Table]
E.
CIFAR-10 R ES N ET
Feedforward Precisions: The quantization noise gains are used to obtain values for the precisions as a function of B (min) as summarized below:
[Table]
[-A l 3+ B (min) 
-]
) 11+ B (min) 10+ B (min) 10+ B (min)
E A l → p m 1.13E8.51E6.57E1.29E6.51E2.16EB
A l 4+ B (min)
+ B (min) 3+ B (min) 4+ B (min) 3+ B (min) 2+ B (min)
Layer Index l
E W l → p m 1.41E+ 1.30E+ 1.08E+ 8.31E+
B W l 9+ B (min) 7+ B (min) 11+ B (min) 11+ B (min)
E A l → p m 4.80E7.82EB A l 1+ B (min)
+ B (min)
Note that for weights, layer depths 21 and 22 correspond to the strided convolutions in the shortcut connections of residual blocks 4 and 7, respectively.
The value of B (min) is again swept, and it is found that the p m < 1% for B (min)
= 3 .
The feedforward precisions are therefore set as follows and as illustrated in Figure 2:
Layer Index l
B W l
B A l
Layer Index l
B W l
B A l
Gradient Precisions: The spatial variance of the gradient tensors is used to determine the PDRs and the quantization step sizes of weight gradients.
The singular values of the square-Jacobians are needed to determine the quantization step sizes of activation gradients.
They were computed as follows:
[Table]
Hence the gradients precisions are set as follows and as illustrated in Figure 2:
[Table]
B G ( W ) l
B G ( A ) l +
Layer Index l
B G ( W ) l
B G ( A ) l +
Internal Weight Accumulators Precisions: The smallest learning rate value for this network is 0.001 which results in the following precisions for the internal weight accumulators as illustrated in
Figure 2:
B W ( Acc ) l
Layer Index l
B W ( Acc ) l
E. CIFAR-100 R ES N ET
Feedforward Precisions: The quantization noise gains are used to obtain values for the precisions as a function of B (min) as summarized below:
Layer Index l
[Table] 2.32E [Table] 8.23E
[Table]
1.18E
[Table] 1.28E [Table] [Table]
70E [Table] 2.78E [Table]
[Table] 10+ [Table] min) 9+ B
[Table] min) 10+ B [Table]
min) 10+ B [Table] min) 10+ B [Table]
min) 10+ B [Table] E [Table]
1.42E
[Table]
7.84E
[Table] [Table] 52E [Table]
1.46E [Table] 7.68E [Table]
7.40E
[Table] B [-(min) 
-][Table] 5+
[Table] ) 4+ B [Table] min) 4+ B (min) 3+ B (min) 3+ B (min) 3+ B (min)
Layer Index l
[Table]
[Table]
[Table]
80E
[Table]
[Table] 29E [Table] 9.20E
[Table]
9.81E
[Table]
1.41E
[Table]
[Table]
10+
[Table]
min) 11+ B
[Table]
min) 11+ B
[Table]
min) 11+ B
[Table]
min) 11+ B
[Table]
min) 11+ B
[Table]
min)
[Table]
7.52E
[Table]
8.70E
[Table]
1.38E
[Table]
2.49E
[Table]
2.11E
[Table]
1.51E
[Table]
B
[Table]
3+
[Table]
min) 3+
[Table]
min) 3+
[Table]
(min) 4+
[Table]
min
[Table]
3+ [Table] min) 3+ [Table]
min)
Layer Index l
[Table]
7.67E
[Table]
[Table]
40E
[Table]
1.13E+ 1.09E+ 5.35E+ 3.97E+
B W l 11+ B (min) 11+ B (min) 11+ B (min) 11+ B (min) 11+ B (min) 11+ B (min)
E A l → p m 1.54E1.09E1.93E2.36E1.27E3.01EB
A l 3+ B (min)
+ B (min) 3+ B (min) 4+ B (min) 3+ B (min) 2+ B (min)
Layer Index l
E W l → p m 8.35E+ 2.30E+ 6.78E+ 6.03E+
B W l 9+ B (min) 7+ B (min) 11+ B (min) 11+ B (min)
E A l → p m 2.01E1.80EB
A l 2+ B (min)
+ B (min)
The value of B (min) is again swept, and it is found that the p m < 1% for B (min)
= 3 .
The feedforward precisions are therefore set as follows and as illustrated in Figure 2:
Layer Index l
B W l
B A l
Layer Index l
B W l
B A l
Gradient Precisions: The spatial variance of the gradient tensors is used to determine the PDRs and the quantization step sizes of weight gradients.
The singular values of the square-Jacobians are needed to determine the quantization step sizes of activation gradients.
They were computed as follows:
[Table]
Hence the gradients precisions are set as follows and as illustrated in Figure 2:
[Table]
B G ( W ) l
B G ( A ) l +
Layer Index l
B G ( W ) l
B G ( A ) l +
Internal Weight Accumulators Precisions: The smallest learning rate value for this network is 0.001 which results in the following precisions for the internal weight accumulators as illustrated in
Figure 2:
B W ( Acc ) l
Layer Index l
B W ( Acc ) l
[-A fractional precision perturbation of 1 (-1) corresponds to C +
-]