Efficient Neural Audio Synthesis

Nal Kalchbrenner, Erich Elsen, Karen Simonyan, Seb Noury, Norman Casagrande, Edward Lockhart, Florian Stimberg, Aaron van den Oord, Sander Dieleman, Koray Kavukcuoglu

Introduction

Sequential generative models achieve state-of-the-art performance in a variety of domains including natural language (Wu et al., 2016; Vaswani et al., 2017), natural images (van den Oord et al., 2016b; Reed et al., 2017) and videos (Kalchbrenner et al., 2017) and speech and music (van den Oord et al., 2016a; Mehri et al., 2016; Simon & Oore, 2017; Engel et al., 2017). The models learn the joint probability of the data by factorizing the distribution into a product of conditional probabilities over each sample. This structure lets the models allot significant capacity to estimate each conditional factor, makes them robust during training and easy to evaluate. The ordering encoded in the structure also makes the sampling process strictly serial: a sample can be generated only after samples on which it depends have been produced in accordance with the ordering. The serial aspect of the sampling process can make it slow and impractical to use these models to generate high-dimensional data like speech and video.

Our goal is to increase the efficiency of sampling from sequential models without compromising their quality. The time T(u)T(\mathbf{u}) that the sampling process takes is the product of the number of samples in the target u\mathbf{u} (e.g. the number of audio samples in a spoken utterance or the number of pixels in an image) and the time required to produce each sample. The latter can be decomposed into computation time c(opi)c(op_{i}) and overhead d(opi)d(op_{i}) for each of the NN layers (operations) of the model:

The value of T(u)T(\mathbf{u}) can grow prohibitively large under any of the following conditions: if u|\mathbf{u}| is large as in the case of high-fidelity audio composed of 24,000 16-bit samples per second; if NN is large due to the use of a very deep architecture such as WaveNet (van den Oord et al., 2016a); if c(opi)c(op_{i}) is large due to e.g. especially wide layers or a large number of parameters; or if the overhead d(opi)d(op_{i}) is high due to the cost of launching each individual operation.

With a focus on text-to-speech synthesis, we propose a set of methods to make sampling orders of magnitude faster. We reduce the contributions from each of the factors NN, d(opi)d(op_{i}), c(opi)c(op_{i}), and u|\mathbf{u}| with minimal loss to the quality of the generated output. We benchmark all models on a single-speaker North-American English text-to-speech dataset where the input is composed of predicted linguistic feature vectors and the output is the raw 24 kHz, 16-bit waveform (Section 5). We report the Negative Log-Likelihood (NLL) reached by a model on held-out data, the results of A/B comparison tests between a pair of models as rated by human listeners and Mean Opinion Scores (MOS) for the samples of a model.

We begin by designing a sequence model that requires a low number NN of operations per sample. We make use of the core property of recurrent neural networks (RNN) that a single recurrent layer applied to the previous state can deliver a highly non-linear transformation of the context. The WaveRNN model is a single-layer RNN with a dual softmax layer that is designed to efficiently predict 16-bit raw audio samples. We see that the WaveRNN with 896 units achieves NLL scores comparable to those of the largest WaveNet model, there is no significant difference in audio fidelity according to a A/B comparison test (Table 1), and the MOS is similarly high. The WaveRNN achieves this performance by requiring just N=5N=5 matrix-vector products in sequence for each 16-bit sample; for simplicity we exclude non-linearities and other minor operations from the count NN. This is in contrast with WaveNet that has 30 residual blocks of two layers each requiring a series of N=302=60N=30*2=60 matrix-vector products.

Even with the low NN, the overhead d(opi)d(op_{i}) can still represent a significant bottleneck in a regular implementation of sampling from the WaveRNN. We sidestep the overhead by implementing custom GPU operations (Diamos et al., 2016) for the sampling process. This allows the WaveRNN to generate 96,000 16-bit samples per second on a Nvidia P100 GPU, which corresponds to 4×\times real time of high-fidelity 24kHz 16-bit audio. As a comparison, our best GPU kernel for the WaveNet model runs at roughly 0.3×\times real time on the same platform. Throughput increases with a batch of 4 where the kernels achieve 39,0000 samples per second (a total throughput of 156,000 samples/sec.)

Reducing the number of parameters in the network decreases the amount of computation c(opi)c(op_{i}) required for sampling. With that in mind, we aim at maximizing the performance we can get from a given amount of parameters. (Gordon et al., 2017) also consider the problem of maximizing performance under a given compute budget and solve it with an approach based on neuron pruning. We sparsify the weights in the WaveRNN using the weight pruning techniques of (Narang et al., 2017a; Zhu & Gupta, 2017). For a fixed parameter count, we discover that large sparse WaveRNNs significantly outperform small dense WaveRNNs and that this relationship holds up to high levels of sparsity greater than 96%96\% (Figure 2).

The combination of Sparse WaveRNN’s high quality output, its small number of parameters and the low requirements on memory bandwidth makes the model well-suited for efficient implementations on low-power mobile platforms (such as those found in mobile phones). We implement and benchmark the sparse matrix-vector products and non-linearities used in the WaveRNN on a mobile CPU (Table 2). Even though the amounts of computation and memory bandwidth are, respectively, three and two orders of magnitude smaller on a mobile CPU than on a GPU, our benchmarks on off-the-shelf mobile CPUs indicate that the resources are sufficient for real-time on-device audio synthesis with a high-quality Sparse WaveRNN. To our knowledge, this is the first sequential neural model capable of real-time audio synthesis on a broad set of computing platforms including off-the-shelf mobile CPUs.

Finally, we tackle the contribution from the component u|\mathbf{u}| in Equation 1. Multiple recent approaches have the goal of making sampling from sequential models more parallel (Reed et al., 2017; Gu et al., 2017; van den Oord et al., 2017). However, these models either make local independence assumptions between generated samples undermining the backbone of sequential models, or they require training multiple domain-specific networks with specialized losses that restrict the overall usability of the models.

We propose a generation process based on subscaling. A tensor of scale LL is folded into BB sub-tensors of scale L/BL/B. The BB sub-tensors are generated in order, each conditioned on the previous sub-tensors. Subscaling lets us generate multiple samples at once in a batch. Since the conditioning of the generation of each sub-tensor on previous sub-tensors requires in practice only a relatively small future horizon, the generation of the next sub-tensor may start soon after the start of the generation for the previous sub-tensor. It is possible in principle – although not necessary in practice – to recover distant future and past dependencies beyond the horizon; the precise cost of batched sampling is then just the BB distant dependencies between the samples in the current batch. The Subscale WaveRNN is able to produce B=16B=16 samples per step without loss in audio fidelity as evidenced by A/B comparison tests (Table 1). Batched sampling for the Subscale WaveRNN opens many orthogonal ways of increasing sampling efficiency. Even our regular Tensorflow implementation of the model achieves real-time sampling speed on a Nvidia V100 GPU. A Fused variant of Subscale WaveRNN also gives a sampling speed of 10×10\times real time on a Nvidia P100 GPU using a slight modification of the GPU kernel for WaveRNN-896.

Wave Recurrent Neural Networks

Convolutional sequence models (Kalchbrenner et al., 2016) achieve excellent performance in speech synthesis (Wang et al., 2017), yet their architecture tends to be deep and narrow requiring a long chain of layers to be executed for each sample. We seek an architecture that provides an equally expressive and non-linear transformation of the context, but requires a small number of operations at each step. By having a hidden state that maintains an already compressed representation of the context, an RNN is especially suitable for this purpose as it is able to combine the context with the input within a single transformation. The overall computation in the WaveRNN is as follows (we omit biases for brevity):

where the \star indicates a masked matrix whereby the last coarse input ct\mathbf{c}_{t} is only connected to the fine part of the states ut,rt,et\mathbf{u}_{t},\mathbf{r}_{t},\mathbf{e}_{t} and ht\mathbf{h}_{t} and thus only affects the fine output yf\mathbf{y}_{f}. The coarse and fine parts ct\mathbf{c}_{t} and ft\mathbf{f}_{t} are encoded as scalars in andscaledtotheintervaland scaled to the interval. The matrix R\mathbf{R} formed from the matrices Ru,Rr,Re\mathbf{R}_{u},\mathbf{R}_{r},\mathbf{R}_{e} is computed as a single matrix-vector product to produce the contributions to all three gates ut,rt\mathbf{u}_{t},\mathbf{r}_{t} and et\mathbf{e}_{t} (a variant of the GRU cell as in (Chung et al., 2014; Engel, 2016).) σ\sigma and τ\tau are the standard sigmoid and tanh non-linearities. A possible architectural variant is to have hth_{t} depend only on xt1x_{t-1} and use a fully connected layer followed by summation or concatenation to condition ftf_{t} on ctc_{t}; we found that this version required 20%20\% more parameters and also performed 1-2 centi-nats worse.

We split the state of the RNN in two parts that predict respectively the 8 coarse (or more significant) bits ct\mathbf{c}_{t} and the 8 fine (or least significant) bits ft\mathbf{f}_{t} of the 16-bit audio sample (Figure 1). Each part feeds into a softmax layer over the corresponding 8 bits and the prediction of the 8 fine bits is conditioned on the 8 coarse bits. The resulting Dual Softmax layer allows for efficient prediction of 16-bit samples using two small output spaces (282^{8} values each) instead of a single large output space (with 2162^{16} values). Figure 1 shows this visually. We note that it is possible to train with one softmax over all 2162^{16} values, but that in addition to requiring significantly more parameters, memory and compute, it consistently performs 1-2 centi-nats worse.

The above architecture reduces the number of operations NN that are needed for each step from N=60N=60 for WaveNet with the 16-bit Discretized Logistic Mixture (DLM) output (Salimans et al., 2017) to N=5N=5 for the proposed WaveRNN with the dual softmax. Despite the reduced number of operations NN, a regular implementation of WaveRNN sampling does not directly yield a real-time or faster synthesis. On a GPU the primary hindrance is not the raw FLOPs required for sampling; rather, the difficulties are twofold: limits on the memory bandwidth and the time that it takes to launch each of the NN operations. Regarding the former, a WaveRNN with a state of 896 units (WaveRNN-896) has about 3M parameters. A regular implementation of sampling that calls each WaveRNN operation separately in sequence for each of the 24,000 samples loads all of the WaveRNN parameters from memory into the GPU registers during each step, totalling about 3e6×24e3×4=2883e6\times 24e3\times 4=288 GBytes of required memory bandwidth. This is already more than a third of the memory bandwidth available in an Nvidia P100 GPU, giving by itself an upper bound of 3×3\times real time for a regular implementation of sampling.

The overhead of launching each operation separately on the GPU is even larger. While launching an operation on the GPU has a constant overhead of 5 microseconds, each step requires N=5N=5 such operations, which means the launch overhead alone induces an upper bound of 40,000 samples per second. For the WaveNet architecture, which requires (at least) N=60N=60 operations per sample, the launch overhead induces an upper bound of 3,300 samples per second. This is without considering the time spent on the actual computation of the operations. In practice a regular implementation of sampling in e.g. Tensorflow yields, respectively, about 1600 and 170 samples per second for WaveRNN-896 and for WaveNet.

We reduce both of these factors by implementing the sampling procedure directly as a single persistent GPU operation. The memory bandwidth bottleneck is avoided since the parameters are loaded only once into the GPU registers at the start of sampling and persist in the registers throughout the process. This is possible because the P100 GPU has 3.67M full-precision registers that suffice to store more than 7 million half-precision parameters, i.e. more than twice as many as needed in the WaveRNN-896. The operation launch bottleneck is also avoided, since the entire sampling process for an utterance is executed as a single GPU operation.

A state size of 896 is chosen specifically to fit the P100 GPU which has 56 multi-processors. The minimum numbers of warps that must be assigned to each multi-processor to access the full register file of the GPU is 8. If we assign each warp to a state calculation, then the state size must be a multiple of 568=44856*8=448 and the largest multiple that fits in the available register space is 896.

The resulting GPU kernel for WaveRNN sampling is two orders of magnitude more efficient than the regular sampling implementation, reaching 96,000 samples/second for the WaveRNN-896. The corresponding operation for WaveNet reaches 8,000 samples/second. The new overhead d(op)d(op) is now given by the synchronization of the thousands of cores in the GPU (Xiao & c. Feng, 2010), which takes just 500 nanoseconds per synchronization, instead of the 5 microseconds needed for each operation launch.

Sparse WaveRNN

The WaveRNN architecture dramatically reduces the number of required operations NN and implementing sampling as a single GPU operation eliminates much of the original computation c(opi)c(op_{i}) and overhead d(opi)d(op_{i}) bottlenecks. We next present a technique for reducing directly the amount of computation c(opi)c(op_{i}) required by each operation. Decreasing the number of hidden units will reduce the amount of computation, but this comes with a significant loss in quality (Table 3). Instead, we reduce the number of non-zero weights in the network by sparsifying the weight matrices while retaining a large state size and respective representation capacity. This reduces c(opi)c(op_{i}) since the number of non-zero weights is directly proportional to c(opi)c(op_{i}) (Table 4).

We use a pruning scheme based on the weight magnitude that increases sparsity as training proceeds (Narang et al., 2017a; Zhu & Gupta, 2017). We maintain a binary mask specifying the sparsity pattern of weight matrices. At the beginning of training, the weight matrices are dense. Every 500 steps, the weights within each sparsified layer are sorted by their magnitude and the mask is updated by zeroing out kk weights with the smallest magnitude. The number kk is computed as a fraction zz of the total number of weights, which is gradually increased from to the target sparsity ZZ as a function of the training step tt:

where t0t_{0} is the step at which weight pruning begins and SS is the total number of pruning steps. We use t0=1000t_{0}=1000, S=200kS=200k and train for a total of 500k500k steps for all models. Such a scheme is practical, easy to integrate into existing models, and does not increase the training time. We sparsify the three gate matrices within the GRU cell separately.

2 Structured Sparsity

We need to encode the sparsity mask in a manner that allows for efficient computation. The standard Compressed Sparse Row format uses about the same amount of storage for encoding the sparsity mask as it does for storing the parameters. Unlike hardware-oriented approaches such as Viterbi pruning (Lee et al., 2018), we explore structured sparsity as a means for reducing memory overhead. The structure in the sparsity mask that we consider is in the form of non-overlapping blocks of weights which are pruned or retained together based on the average magnitude of the weights within the block. We find that blocks of m=16m=16 weights lose little performance over unstructured sparsity while reducing the amount of memory needed for storing the sparsity pattern to 1m\frac{1}{m} of that required by an unstructured mask. Besides rectangular 4×44\times 4 blocks that we found to work well (Gray et al., 2017; Narang et al., 2017b), we also adopt blocks of shape m×1m\times 1 that induce an even lower memory bandwidth overhead. In the case of m×1m\times 1 blocks one only needs to retrieve a single activation value from the hidden state to perform the dot product. This is in contrast with the square blocks where for each block one needs to retrieve 44 activation values from the hidden state. We report results for both 16×116\times 1 and 4×44\times 4 blocks. The benchmarks confirm the greater speed of the 16×116\times 1 blocks (Table 4).

3 Sparse WaveRNN Sampling on Mobile CPU

We take advantage of the low computation and memory bandwidth required by Sparse WaveRNN to implement matrix-vector operations necessary for sampling on mobile CPU. To maximize memory utilization, weights are stored in 16-bit floating point and converted to 32-bit floating point before being used in the computation. The activations and the calculations are kept in 32-bit floating point. The low memory overhead afforded by small blocks allows the sparse matrix-vector products to match the performance of dense matrix-vector products with the same parameter count. The number of sequential matrix-vector products per second is thus determined almost entirely by the number of parameters in the network.

Subscale WaveRNN

We have described two ways of reducing sampling time in high-fidelity audio generation: the WaveRNN that reduces NN and d(op)d(op) and the Sparse WaveRNN that reduces NN and c(op)c(op). Lastly we reduce the contribution from the factor u|\mathbf{u}| in Equation 1. This factor depends on the size of the utterance u\mathbf{u} and a direct reduction of the size of u\mathbf{u} itself (such as going from 16 to 8 bits per sample) would negatively affect audio quality. Instead, we propose a method for generating a batch of BB samples per step, instead of just one:

In many cases, the computation time for a batch of BB examples, c(opiB)c(op_{i}^{B}), grows sublinearly in the computation time of a single example c(opi)c(op_{i}) because weights are reused and spare computational capacity is available. The ability to batch samples also makes it possible to generate across multiple processors and have a reduction in total sampling time that is linear in the number of processors.

Previous work on producing more than one sample per step in sequential models has required breaking local dependencies (Reed et al., 2017): two nearby samples that strongly depend on each other are produced independently, possibly conditioned on other samples. We introduce a general method that allows us to trade a small constant number of distant past and future dependencies for the ability to generate batches of BB samples per step.

From the tensor u\mathbf{u} one first extracts a set of BB sub-tensors that have a frequency or scale that is BB times smaller. Each sub-tensor corresponds to a subscale slice of u\mathbf{u} (see Figure 3). If u\mathbf{u} is a 24kHz audio utterance and BB is 16, then each sub-tensor corresponds to a 24/16=1.5 kHz utterance. This is in contrast with a multi-scale scheme where the different subtensors extracted from u\mathbf{u} have increasing scales. Subscaling induces the following ordering on the dependencies of the variables in u\mathbf{u}, which is equivalent to the standard factorization of the joint:

The sample uBi+su_{Bi+s} for a given (i,s)(i,s) depends on all samples uBk+zu_{Bk+z} for z<sz<s and k0k\geq 0. Generation of u\mathbf{u} proceeds as follows: one first generates the first sub-tensor, then the second sub-tensor conditioned on the first one, then the third sub-tensor conditioned on the previous two, etc. The Subscale WaveRNN that generates a given sub-tensor is conditioned on the future context of previous sub-tensors using a masked dilated CNN with relus and the mask applied over past connections instead of future ones. Like the multi-scale scheme, subscale schemes are equally applicable to multi-dimensional tensors.

2 Batched Sampling

In contrast to the multi-scale scheme, subscaling makes it possible to generate BB samples in a single step. In Equation 4.1, for values of k>i+Fk>i+F for some future horizon FF, the dependencies of uBi+su_{Bi+s} on future samples uBk+zu_{Bk+z} with z<sz<s become overwhelmingly weak (Figure 3). The conditioning network itself in the Subscale WaveRNN only sees a finite and usually small number of future samples from the previous sub-tensors. The sampling of a sub-tensor can begin immediately after the first FF samples of the previous sub-tensor have been generated. Because the Subscale WaveRNN is shared across all sub-tensors, it is possible to batch inputs and after BFB*F steps the total batch of the Subscale WaveRNN is BB. Since the value of FF (usually 64 or 128) is relatively small compared to the scale and length of u\mathbf{u}, even for relatively large values of BB such as 16, the total lag of BFB*F steps remains negligible for the total sampling latency. Although the conditioning network needs to be executed for each batch of samples, computing the conditioning network doesn’t affect the factor NN of the Subscale WaveRNN because the network can be executed in parallel for a chosen number LL of future samples. This increases the total sampling lag by BLB*L steps, which even for values of L=100L=100 remains negligible. Due to batched sampling even our regular implementation in Tensorflow achieves just about real-time speed (24,000 samples/second) for a Subscale WaveRNN 16×16\times with 1024 hidden state units.

3 Recovering Future and Past Dependencies

Dropping distant future dependencies for k>i+Fk>i+F allows us in principle also to recover an almost equal number of distant past dependencies. A sub-tensor zz that succeeds the current sub-tensor ss is (zs)(F+1)(z-s)(F+1) steps behind ss, but leaves a trace of distant past samples. During training and sampling these distant past samples can be accessed to condition the generation of the current pass ss. Analogously, a constant number of future distant samples beyond i+Fi+F from sub-tensors previous to ss are also available for additional conditioning. The exact dependency scheme of using subscaling and batched sampling includes these distant dependencies; in practice, however, choosing a larger value FF appears simpler than embedding the distant dependencies.

4 Fused Subscale WaveRNN

We use the scheme behind the Subscale WaveRNN to directly generate more than 16 bits per step in the WaveRNN itself. We take a Subscale WaveRNN 2×2\times model and instead of batching the 2 sub-tensors we split the hidden state of the WaveRNN in two parts. We then use 8 softmaxes of 4 bits each and an FF value of just two. The samples from the sub-tensors are given directly to the WaveRNN as input without using a conditioning network. The resulting Fused Subscale WaveRNN 2×2\times achieves only a small drop in the quality of the output (Table 3), but maps well onto the WaveRNN GPU custom operation. Compared to WaveRNN which runs at 4×4\times real time, this model generates 32 bits per step and requires fewer synchronizations, resulting in a sampling speed of 10×10\times real time. We note that in contrast to the Subscale WaveRNN, because fusion requires splitting the hidden state, audio quality drops quickly for factors beyond 2×2\times in the Fused Subscale WaveRNN.

Experiments

We perform experiments on the text-to-speech synthesis task and report the quality evaluation results as well as the sampling speed of our benchmarks on the corresponding platforms.

Text-to-speech models were trained on a dataset of 44 hours of North American English speech recorded by a professional speaker (van den Oord et al., 2017). The generation is conditioned on conventional linguistic features and predicted pitch information. All compared models synthesize raw audio at 24 kHz in 16-bit format. The evaluation is carried out on a held-out test set where we consider three performance measures: Negative Log-Likelihood of ground-truth audio; MOS between 1 (Bad) and 5 (Excellent) of generated speech utterances according to the subjective quality evaluation by human raters; and the results of direct A/B comparison tests between pairs of models as rated subjectively by humans on a scale between -3 (Much Worse Than) and +3 (Much Better Than).

The WaveRNN models are trained on sequences of 960 audio samples of 16-bit each and full back-propagation-through-time is applied to the models. Table 3 reports the results for various sizes of WaveRNN. The larger WaveRNNs approach the NLL performance of the 60-layer WaveNet model. A human rated A/B comparison test between WaveRNN-896 and WaveNet indicates no significant difference in the quality of the speech produced (Table 1). An additional A/B comparison test between WaveNet and WaveRNN-2048 also shows no significant differences.

The persistent GPU operations that we implement are most efficient for the WaveRNN-896 model, which achieves a NLL of 5.42 and a MOS value of 4.37±0.0734.37\pm 0.073. Samples are generated at 96,000 samples per second for a batch size of 1 and 39,000 samples per second for a batch size of 4.

2 Sparse WaveRNN Quality Evaluation & Speed

Figure 2 illustrates a core point about our investigation into sparse models. We use a dense WaveRNN model with a state size of 224 as a starting point because it is the largest that could be run on many current off the shelf mobile processors. As a second baseline we use a model with a state size of 384 that we estimate to still be out of reach for even the fastest mobile platforms, as the model would require 30 GB/sec of memory bandwidth and no current mobile platform can provide this amount.

Figure 2 shows that if we fix the total parameter count – and keep the corresponding sampling time also the same – then as we increase the degree of sparsity and the resulting size of layers, the fidelity of the models improves. This holds up to high degrees of sparsity >98%>98\%, where the state size hh of the models reaches 2048 hidden units. Higher sparsity monotonically implies lower NLL and in fact higher sparsity levels have larger slopes. This suggests that for a given computational budget at inference time, it is much more efficient to use those parameters to sparsely connect a larger number of neurons in each layer.

In Table 4 and Figure 2 we examine the impact of using block sparsity on NLL and speed, and find that 4×44\times 4 blocks generally yield the best NLL, but 16×116\times 1 blocks have a speed advantage. Surprisingly, both have better NLL than unstructured sparsity at low sparsity levels, but improve more slowly and eventually hit a minimum around 95% while unstructured sparsity continues to improve. We did not explore even higher levels of unstructured sparsity only because investigating extremely high levels of sparsity requires starting with extremely large dense layers making training computationally intensive. Unstructured sparsity is unsurprisingly slower during inference, but depending on the quality trade offs involved in using blocks (which will likely vary from model to model), it might still be preferred.

To obtain an estimate of Sparse WaveRNN sampling speed, we benchmarked all computationally heavy operations (sparse matrix-vector multiplication and non-linearity evaluations) required for producing each audio sample, and used these measurements to derive an estimate of the sampling speed. For example, a sample from a 1024 model requires 3 multiplications of 1024×\times1024 for the GRU gates, two multiplications of 512×\times512 for the projection, two multiplications of 512×\times256 for the logits and evaluating 3072 non-linearities. We add up the time for all of these operations to estimate the upper bound on sampling performance.

We perform our benchmarks on the Snapdragon 808 (SD 808) and Snapdragon 835 (SD 835) mobile CPUs, which are widely available in mobile phones. The two big cores of the SD 808 at 1.8GHz can do 28.8 Gflops/sec and the bandwidth out of the shared L2 cache is 14.4 GB/sec. The SD 835 is faster at 2.35GHz, with 2 cores able to do 37.6 Gflops/sec and pull 18.8 GB/sec from the cache. In practice, the achievable flops are often much lower (geekbench, a, b) and around 14.4 Gflops/sec and 28.2 Gflops/sec for SD 808 and 835 respectively. These numbers suggest that both our dense and sparse implementations are close to the maximum possible performance of the processor (the limiting factor for all kernels is bandwidth and not flops). For comparison, a modern Intel desktop CPU with AVX2 can do over 200 Gflops/sec and get over 200 GB/sec of bandwidth out of the L2 cache with only two cores.

3 Subscale WaveRNN Quality Evaluation

The conditioning network of the Subscale WaveRNN is a masked dilated 1D CNN and has ten layers, convolutional kernels of size 3, 384 convolutional channels, and 768 residual channels. The conditioning CNN has 5 stages of increasing dilation, for a total future horizon of F=128F=128 blocks of 8 or 16 samples each. The Subscale WaveRNNs that we evaluate have 1024 units in their hidden state. We do not use recoverable distant dependencies.

We evaluate the model for two values of BB, 8 and 16. The Subscale WaveRNN with B=8B=8 generates 8 16-bit samples at once at each step, which corresponds to a 3 kHz signal. As shown in Table 3, the Subscale WaveRNN 8×8\times achieves a MOS of 4.39. This is equivalent to the MOS of the baseline WaveRNN-896 and it shows the ability of the Subscale WaveRNN 8×8\times to accurately learn the distribution under the modified dependency scheme. We also evaluate a Subscale WaveRNN with B=16B=16, which generates an interleaving signal at 1.5 kHz. As shown in Table 1, the audio fidelity of the Subscale WaveRNN 16×16\times is not significantly different from that of the WaveRNN-896 and, by transitivity, that of Wavenet 512 (60). This is remarkable as audio generation with sequential models can be extremely sensitive to lost dependencies, especially local ones, and this quality result demonstrates the effectiveness of the subscale dependency scheme to preserve all the local dependencies that are the key to the high performance of sequential models.

The ability to batch computation by a factor of 8 or 16 yields a large amount of flexibility. Batching can increase throughput from a single GPU device increasing the overall sampling speed. In addition, it makes it possible to generate from multiple devices at once, where the generated bits are sent one-way and online from each device to the next. Such a setup gives in principle a linear speed-up over the sampling speed of a single device. If a single pass of Subscale WaveRNN with B=16B=16 runs at 4×4\times real time on a GPU, then on a connected rack of 16 GPUs the Subscale WaveRNN 16×16\times can in principle gain an equivalent linear speed-up for a total sampling speed of 4B=644*B=64 times real time. Subscale WaveRNN can also be combined with Sparse WaveRNN and executed on a multi-core CPU gaining a speed-up proportional to the number of cores available.

Conclusion

We introduced the WaveRNN, a simple and powerful recurrent network for the sequential modeling of high fidelity audio, and we have demonstrated a high performance implementation of this model on GPUs. We have shown that large sparse models have much better quality than small dense models with the same number of parameters and we have written high performance block-sparse matrix-vector product operations to demonstrate that sampling time is proportional to parameter count. We then showed that high fidelity audio generation is now achievable on widely available low-power mobile CPUs. Finally, we introduced the subscale dependency scheme that lets sequential models generate many samples per step while preserving the output quality of the original model. The underlying ideas of the methods we introduce are not specific to audio, and the results of sparse models have implications for inference in all types of neural networks.

References