{'fraction_non_alphanumeric': 0.028844158539116, 'fraction_numerical': 0.016299119017525326, 'mean_word_length': 4.659229208924949, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Training for Speech Recognition on Coprocessors

Automatic Speech Recognition (ASR) has increased in popularity in recent years. The evolution of processor and storage technologies has enabled more advanced ASR mechanisms, fueling the development of virtual assistants such as Amazon Alexa, Apple Siri, Microsoft Cortana, and Google Home. The interest in such assistants, in turn, has amplified the novel developments in ASR research. However, despite this popularity, there has not been a detailed training efficiency analysis of modern ASR systems. This mainly stems from: the proprietary nature of many modern applications that depend on ASR, like the ones listed above; the relatively expensive co-processor hardware that is used to accelerate ASR by big vendors to enable such applications; and the absence of well-established benchmarks. The goal of this paper is to address the latter two of these challenges. The paper first describes an ASR model, based on a deep neural network inspired by recent work in this domain, and our experiences building it. Then we evaluate this model on three CPU-GPU co-processor platforms that represent different budget categories. Our results demonstrate that utilizing hardware acceleration yields good results even without high-end equipment. While the most expensive platform (10X price of the least expensive one) converges to the initial accuracy target 10-30% and 60-70% faster than the other two, the differences among the platforms almost disappear at slightly higher accuracy targets. In addition, our results further highlight both the difficulty of evaluating ASR systems due to the complex, long, and resource intensive nature of the model training in this domain, and the importance of establishing benchmarks for ASR.


INTRODUCTION
Automatic Speech Recognition (ASR) has been an active research area for decades [18,19,43,55]. Its popularity and complexity keep increasing as a result of the popularity of various virtual assistants [7,24,36,49]. Earlier approaches to ASR were based on statistical models such as the Gaussian Mixture Model -Hidden Markov Model (GMM-HMM) [55, p. 19]. However, in recent years, the emergence of neural networks has also influenced ASR [6,11,27].
The computational requirements for the training and inference of such neural networks are immense [20,46]. Most calculations in neural network models are independent matrix operations. Therefore, they are a natural fit for hardware acceleration on specialized multithreaded hardware such as GPUs [42,50]. Any performance improvement through such hardware acceleration is significant for researchers or developers trying to enhance their machine learning models as they have to experiment with several different hyperparameters before deciding on the final set of hyperparameters.
To determine better software and hardware setups for any application domain, benchmarks are essential. Despite its popularity, ASR is under-studied when it comes to established benchmarks and benchmarking. There have been benchmarking studies of different machine learning and deep learning platforms [32,46] without focusing on ASR. A prominent benchmarking framework for machine learning is MLPerf [3], which has a benchmark for ASR under development that has not been released yet. ASR differs from these existing machine learning and neural network benchmark domains due to its requirement of a more complex model training and larger space consumption of the dataset and the model. QuTiBench [12] and DeepBench [1] are recent works that also incorporate benchmarking the training of deep neural networks for ASR in addition to the other domains. They are complementary to this paper as the former is still quite new and in its early stages, and the latter focuses more on individual operations rather than more complex end-to-end model training. Our goal in this paper, instead, is to have a more in-depth understanding of ASR by focusing on the ASR task of converting speech to text and utilization of CPU-GPU co-processors while training a neural network model for this task. Our contributions are as follows: • We discuss our experience with building a well-established acoustic model that converts speech to text based on a deep neural network inspired by recent work [6,11,27]. We use the training of this model as a benchmarking tool while analyzing acoustic model training behavior on different types of hardware platforms. • We evaluate three CPU-GPU co-processor platforms that represent three budget categories for training this model: a low-budget platform built by us via repurposing a crypto mining rig, and two more expensive platforms that represent different generations of commodity coprocessor server hardware (a recent previous generation and a modern high-end one). • We take Time-to-Accuracy (TTA) as the primary metric in this evaluation in order to emphasize both training efficiency and model accuracy. The results demonstrate that utilizing hardware acceleration yields good results even without high-end co-processors. The most expensive platform (10X price of the least expensive one) converges to the initial accuracy target 10-30% faster than the platform that is 2X the price of least expensive one and 60-70% faster than the least expensive platform. However, the differences among the platforms almost disappear at slightly higher accuracy targets, which take roughly a couple of days to reach.
Our overall experience also highlights that it is extremely difficult to establish ASR models that both perform well in terms of accuracy and are hardware-conscious while training. While co-processors are becoming more widely available to everyone, it increases the opportunities for accelerating not only ASR but also other neural network training. With this development, how to better utilize the co-processors to get the best price/performance ratio is unclear. Our results emphasize that this ratio can indeed be very poor in practice for acoustic model training. Therefore, it is highly important to have well-established benchmarks in this domain and other similarly complex domains to be able to characterize the performance behavior of both high-end and low-budget platforms. The rest of the paper is organized as follows. Section 2 introduces terminology related to ASR and gives an overview of our end-to-end system that converts speech to text. 1 Section 3 surveys related work that inspired this system and recent work on benchmarking machine learning models. Section 4 presents the experimental setup, including model parameters and methodology, as well as the implementation details for efficient model training using the TensorFlow framework. Section 5 discusses the results of the experimental evaluation on three co-processors. Finally, Section 6 provides a summary of the paper, discussion of results, and conclusion.

SPEECH-TO-TEXT
Speech has three main properties that express the difficulty of converting it to text as defined in [54] and illustrated by Figure 1. Types of speech utterance characterizes the pauses between the words and the coherence of the utterances. It goes from isolated words, which has only a single word at a time with long pauses between the words, to spontaneous speech, which is natural speech with falsestarts, mispronunciations, and no pauses between the words. Speaker model characterizes the number and variation of speakers and the setting of the recording. It goes from speaker dependent, where a specific speaker and a specific setting are required, to speaker independent, where a large number of different speakers are recorded in a wide range of different settings. Vocabulary characterizes the number of different words and phrases. It goes from a single word to out-of-vocabulary, which includes unknown words. The further to the right in Figure 1 a speech dataset is, the more difficult it is to convert the speech to text. The dataset chosen in this paper falls toward the right-hand side of this scale as described in Section 4.3. In addition to the speech properties, the recording can be more or less noisy. Noise is all the sounds captured in the recording that is not created by the voice speaking.
The process of converting speech to text is composed of two broad components as Figure 2 illustrates [55, p. 4]: Feature Extraction (FE) and Acoustic Model (AM). Extracting features from audio in FE before training the acoustic model enables performance optimizations in AM. It is also common to add a Language Model (LM) trained separately on text data to improve the output of AM [6,11,13,26,27,34]. Among these components, AM takes the longest time in an end-toend system for ASR that converts speech to text since it contains the training of the machine learning model. On the hardware platforms used in this paper (Section 4.2), FE takes a few hours whereas training the AM takes several days. Therefore, this paper focuses on AM when benchmarking the different hardware platforms. The rest of this section provides details about FE and AM components in our system.

Feature Extraction
The Feature Extraction (FE) takes sound as input, extracts important information from audio, and returns windows of features. The windows are also sometimes called frames, and these are sampled based on window width and stride size. A typical starting feature is calculated using a Short-Time Fourier Transform (STFT) on the framed parts of a sound file [30, p. 41]. The STFT takes the sound from the Time Domain to the Frequency Domain [33, p. 16]. The Time Domain represents sound as an amplitude over time, whereas the Frequency Domain represents sound as intensities over different frequencies for each frame of the sound. The STFT returns a magnitude spectrogram, which is divided into Hertz frequencies. This representation can be converted to Melscale giving us the features referred to as Mel frequencies [30, pp. 53 -56]. The logarithm of the Mel frequencies produces Log Mel frequencies (middle plot in Figure 3). Finally, the Log Mel Frequencies can be used to calculate the Mel-Frequency Cepstral Coefficients (MFCC) by applying a Discrete Cosine Transform (DCT) [30, p. 55] (bottom plot in Figure 3). FE can happen in different ways even if the same type of feature extraction is performed because of the different ways the windows can be sampled and the number of features extracted from each window. Depending on the parameters chosen, the features have different levels of details. For instance, Chiu et al. [15] use 80 Log Mel features with 25ms windows and 10ms stride, whereas Chan et al. [13] use 40 Log Mel features with only 10ms windows. In this paper, 80 Log Mel features are combined with 13 MFCC features with a 10ms stride. We pick a window size of 512 samples corresponding to 32ms with a sampling frequency of 16kHz. There are many more features that could be explored [30, pp. 40 -50]. The features chosen in this paper and their calculated values are based on a combination of an empirical analysis of the dataset and the wisdom learned from related work [13,15,21,27,41,47].

Acoustic Model
The Acoustic Model (AM) takes the features from FE as input and generates a probability distribution over the dictionary [55, p. 4]. In recent years, AM has been based on neural networks and several combinations of different neural network layers have been explored [6,11,13,27,55]. The commonly used layers are Feed-Forward Neural Network (FFNN), Convolutional Neural Network (CNN), and Long Short-Term Memory (LSTM). The model used in this paper is inspired by Baidu Research's Deep Speech 2 system [6], which uses 1-3 CNNs as the first layers followed by 1-7 LSTM layers, and ending with a single FFNN. Figure 4 gives an overview of the model this paper uses, where the number of CNN, LSTM, and FNNN layers are 1, 5, and 1, respectively that is the chosen settings for this paper. The following subsections first describe these layers and then other important components of the acoustic model we built.

Neural Network
Layers. An FFNN can be seen as a directed acyclic graph, where the nodes are functions and the output of each function is a directed edge. The nodes are organized in layers, where each layer represents a matrix multiplication of the input with a weight matrix for that layer. This weight matrix is also called a kernel. The FFNN we use in this paper is based on tf.contrib.slim.fully_connected from TensorFlow.
A CNN slides a kernel over the input doing matrix multiplications for each step. A CNN depends on the kernel width, which is the number of input elements included in each computation step, and stride, which is the number of inputs the kernel is slided over between each step. A CNN can be used to do computations on values from different time steps. The convolution used in this paper is tf.nn.conv1d from TensorFlow, which conducts a one-dimensional convolution on a three-dimensional input. This means that a convolution is done on the time-dimension of an input consisting of features, time, and batch.
An LSTM applies a function to all elements of an input sequence of arbitrary length while transferring information from one time-step to the next. This property makes it ideal for processing time series data such as audio. The size of an LSTM refers to the number of hidden states transferred between the time-steps. Increasing the size of an LSTM increases the capacity of the internal state, which improves the model's ability to fit to the training dataset. The LSTM in this paper is based on tf.nn.rnn_cell.LSTMCell, combined with tf.nn.dynamic_rnn from TensorFlow. Ten-sorFlow also has a GPU-optimized LSTM version called tf.contrib.cudnn_rnn.CudnnLSTM, but this implementation did not improve performance when adding the activation function and batch normalizations between LSTM layers.
The weights of the layers are initialized using Xavier Initialization, which scales all weights to a uniform distribution within a range [22]. The Xavier Initialization is done using tf.contrib.layers.xavier_initializer from Ten-sorFlow since it achieved good results.

CTC Loss & Beam
Search. The output of the FFNN is processed differently during training and evaluation. During training, a loss value has to be calculated for each element of the batch to determine how to fit the model to the training data. During evaluation, the model has already been adapted to the training data and the output of the FFNN should instead be converted to specific characters representing the output sentence of the model.
The loss function used depends on the problem domain. In ASR a common function is Connectionist Temporal Classification (CTC) [6,11,23,25]. CTC converts the output of the FFNN to probabilities over the alphabet and aligns it to the label sequence. Given the input sequence of probabilities generated by the CTC denoted Y and the label sequence l, the CTC loss is the sum of the probability of different alignments of l in the probability sequence Y . When evaluating a model, the output probabilities have to be evaluated efficiently to produce the characters of the output sentence. This is done with Beam Search, which is a modified Breadth First Search (BFS) with a specified search width that limits the search through the tree. Beam Search is not guaranteed to find an optimal solution, but it is more efficient than BFS. The efficiency depends on the search width. Beam Search can be improved by combining it with a Prefix Tree and a Language Model as presented by Scheidl et al. [44,45]. This version of Beam Search constrains its search to words in a dictionary while simultaneously allowing arbitrary non-word characters between words in the dictionary. In this paper, we adopt the implementation from Scheidl et al. and build the dictionary from the words in our training dataset. This limits the variation of words in the dictionary compared to the alternative which is to build the dictionary from a separate dataset with a greater variation of words. This alternative has been done by related work and relevant datasets for building a dictionary have been provided by LibriSpeech [40].

Optimization
Algorithm. An optimization algorithm in machine learning defines how to adapt the model weights to reduce the loss of the model for the given training set. We use AdaDelta [56] which is able to both increase and decrease the learning rate during training. This property also implicitly removes the need of specifying initial learning rates. AdaDelta is also used by Bahdanau et al. [10]. The implementation of AdaDelta is from tf.train.AdadeltaOptimizer in TensorFlow.

Regularization.
A model needs to not only fit to the training dataset, but also generalize to previously unseen data. The error calculated on the training set is training error and the error calculated on the test set is test error or generalization error. Regularization aims to reduce the gap between the training and test error [23, pp. 107-108]. One of the most important regularization strategies is dropout, where some of the units in the neural network are randomly dropped during training [48]. We use this strategy in all of the layers of our model since it reduces the test error which improves the test accuracy of the model.

Batch Normalization.
Batch Normalization is applied between each layer of the model [29] [23, pp. 313-317]. This technique helps the layers train more efficiently and independently of each other.
A general normalization is done with the following equation [29]: β . To prevent division by zero in the case where the variance equals zero, the small non-zero value δ is added in the denominator.
i . The normalized dimensions will have a mean of zero and a variance of approximately 1 [29].

RELATED WORK
We mention related work throughout the paper wherever it is necessary. This section, in particular, details the work that inspired the system described in Section 2.2, and recent efforts on establishing benchmarks and analyzing machine learning models.

Speech to Text Models Based on Neural Networks
Baidu Research's Silicon Valley AI Lab is a large research group that among other fields also does research on building end-to-end deep learning models for speech recognition [6,11,27]. Their earlier major work, Deep Speech 1 [27], is one of the preliminary works that uses neural networks for the whole speech to text learning pipeline in contrast to prior work that used neural networks in a limited part of the whole pipeline. Deep Speech 1 is also the foundation of Mozilla's open-source TensorFlow speech recognition implementation [37]. Deep Speech 2 [6] is a followup to Deep Speech 1. It experiments with several convolution layers and up to 7 layers of LSTM and bidirectional LSTM. Furthermore, it introduces GPU-optimized implementations of CTC loss and efficient gradient sharing among GPUs, which improves latency and throughput. However, the impact of these optimizations on the training time are not based on TTA, but on the time to go through an epoch and the time spent on individual operations such as their implementation of the all-reduce algorithm. This approach to evaluating performance has been criticized in DawnBench [17], because it does not make a strong link across end-to-end training efficiency, hardware utilization, and statistical performance.
Another followup work from the same research group [11] investigates the impact of different transducers on the ASR systems. The models presented in Deep Speech 1 & 2 are based on CTC, and this work compares these approaches to an RNN-Transducer and an attention model. The conclusion is that both RNN-Transducers and attention models outperform the CTC-based model if the models are allowed to look at the entire input (meaning both forward and backward model parts). The paper also shows that the CTC forwardonly models have better results than their forward-only RNNtransducer and attention models. We choose to work with a CTC-based model instead of RNN-Transducers and attention models in order to avoid the need for the entire input for one classification.
While the main inspiration for our acoustic model comes from the work of Baidu Research mentioned above, there have been other proposals for neural network models for speech recognition, which we also take influence from, such as LAS from Google [13,26].

Benchmarking Machine Learning Models
There have been several benchmarking studies in the recent years focusing on machine learning and deep learning. Shi et al. [46] analyze popular deep learning frameworks, such as TensorFlow and Torch. They take training time per mini-batch as the main metric. As mentioned earlier, this is problematic as it does not account for the total training time of the model in different frameworks. DawnBench [17] treats training time per mini-batch as a proxy metric rather than a main one. Instead, DawnBench measures end-to-end performance of training and inference. It focuses on the time to accuracy and throughput of models as mini-batch size, optimization algorithm, number of GPUs, etc. varies. These metrics are also adopted by MLPerf [3], which is the most popular benchmarking framework for machine learning today. Liu et al. [32] also adopts the metrics from DawnBench and experiment with image recognition models with the default configurations of the different deep learning frameworks. However, none of these works have focused on ASR so far. MLPerf has plans for releasing a benchmark for ASR in the near future. QuTiBench [12] and DeepBench [1] describe benchmarks for different deep neural network training domains including ASR. DeepBench focuses on individual operations rather than end-to-end training, while QuTiBench focuses on end-to-end training. We focus on end-to-end training as well and specifically focus on its performance on CPU-GPU co-processors.

EXPERIMENTAL METHODOLOGY
There are different dimensions to analyze when it comes to any benchmarking and workload characterization study. Our goal in this paper is to analyze the behavior of training a state-of-the-art acoustic model for ASR on different types of co-processor hardware. We focus on the acoustic model as its training is the major component in an end-to-end system for ASR (as Section 2 also mentions). We target CPU-GPU co-processors as training of neural network models is a natural fit for hardware acceleration on GPUs because of the independent matrix operations that are embarrassingly parallel and such co-processors are heavily utilized for this purpose in the cloud today [20,42,50].
In our evaluation, we would like to answer the following couple of questions: • Does one depend on expensive high-end co-processor infrastructure for efficient ASR? • How does the training of an established acoustic model utilize CPU-GPU co-processors?
To be able to answer these questions, we choose Time-to-Accuracy (TTA) as our main metric (Section 4.1), establish three CPU-GPU co-processor platforms that represent different budget categories (Section 4.2), use a dataset that has difficult characteristics based on the scale in Figure 1 (Section 4.3), and optimize the training parameters and setup on the co-processors being used to be fair to each hardware platform and avoid misleading conclusions (Section 4.4).

Metrics
We focus on several metrics in our evaluation: accuracy, timeto-accuracy, throughput, and utilization. These metrics are chosen to assess different aspects of the acoustic model and hardware platforms. We pick time-to-accuracy as the primary metric since it covers both the accuracy and efficiency of training. The following subsections describe each metric in further detail.
4.1.1 Accuracy. As Section 2 explains, the ASR system we build aims at converting speech to text. Therefore, the input while evaluating the trained acoustic model is sound files with speech and the output is the text version of what is being said in those sound files. The accuracy of this output is measured in Word Error Rate (WER) and Character Error Rate (CER).
As Equation (2) shows, WER definition is based on edit distance or, more specifically, Levenshtein distance e(x, y). It is the sum of insertions I , deletions D, and substitutions S needed to convert the output sentence x to the target sentence y. An insertion is a word added to the output. A deletion is a word removed from the output. A substitution is a word replaced with another word. Finally, W refers to the number of words in the target sentence y. We use the Python package Jiwer [53] to calculate WER in this paper.
As Equation (3) shows, the definition of CER is similar to WER. The only difference is that the denominator is the maximum number of characters in either the output sentence x or the target sentence y.
4.1.2 Time-to-Accuracy. Time-to-Accuracy (TTA) is the primary metric in this evaluation in order to emphasize training of a model with high accuracy in a short amount of time (as also used by [16,31]). TTA is the time it takes to train a model to a target median accuracy over the last t epochs. An epoch is an iteration of the entire training dataset during the training phase of the model. The accuracy of a single epoch is the accuracy (as defined by Section 4.1.1) of a single iteration over the entire validation dataset during the evaluation phase of the model after that particular epoch. The median accuracy is the middle value in the sorted list of accuracies from the last t epochs. The reason for considering the accuracy of several epochs in TTA is to make sure that the accuracy reached is persistent.
To calculate TT A(a, e), where a is the median accuracy target and e is the number of epochs, a and e needs to be determined. We set e to three and a to different values depending on the specific accuracy metric used (WER or CER). The TT A(a, e) is measured in minutes from the creation of the model until the accuracy target is reached.

Throughput.
The throughput is defined as elements processed per second E ps . If t is the time it takes for a batch to be processed in seconds, and b is the number of elements processed in that batch, then elements per second is:

Hardware
We use three hardware platforms for this study: Sys1$, Sys2$, Sys10$. They represent three budget categories in terms of (c) Sys10$ Figure 5: Overview of the co-processors used (left to right, from least expensive to most expensive). co-processor hardware. Table 1 gives the cost breakdown for these co-processors, Figure 5 illustrates their topology, and the following subsections describe them in more detail. We name them based on their relative total costs, i.e., Sys2$ and Sys10$ are roughly 2X and 10X the cost of Sys1$, respectively.

System Description Cost
4.2.1 Sys1$. The first hardware platform is Sys1$, which is a low-cost CPU-GPU co-processor designed to minimize the cost of a multi-GPU platform. Figure 5a visualizes Sys1$. It has 4 Nvidia RTX 2070 at 1.7GHz with 8GB memory each, an Intel i7 6700k desktop processor with 4 cores (8 logical cores with hyperthreading) at 4 GHz with 16GB memory, and a low-cost crypto mining rig motherboard ASRock H110 Pro BTC+ [8]. The storage device, which keeps the datasets, model checkpoints, and OS (Ubuntu 18.04 LTS), is a Micron M600 512GB SATA SSD connected through SATA3. The limitation of this platform is mainly twofold. (1) It has significantly smaller CPU and GPU memory compared to the other platforms. (2) Three of the GPUs are connected using PCIe 2.0 x1 to the CPU, while the other one is connected using PCIe 3.0 x16. This creates an asymmetry across the GPUs (as shown in Figure 8a).
This particular platform is built by us. Our goal was to build a low-cost platform inspired by cryptocurrency mining specifically repurposed for machine learning, and understand the relative effectiveness of such a hardware platform in comparison to more expensive hardware utilized by public cloud providers.

Sys2$.
The second hardware platform is Sys2$, which Figure 5b visualizes. It has 4 Nvidia GTX 1080 Ti with 11GB memory each and two 6-core (12 logical cores with hyperthreading) Intel Xeon E5-2630 v2 processors clocked at 2.6 GHz and 128GB RAM in total. Each processor has two GPUs attached via PCIe 3.0 x16. The OS is Centos 7 and installed on a locally-attached HDD, whereas the rest of the storage needs (the model checkpoints and datasets) are handled via shared storage connected through 1G ethernet. This increases the startup time by a few seconds when a previous model has to be loaded, but during active training phase the storage is able to keep up with the processing without being bottlenecked by the storage.
Sys2$ platform resembles more what one would find as part of commodity cloud offerings. However, the hardware components are slightly older. The CPUs are based on the Ivy Bridge microarchitecture, while the GPUs are based on the Pascal microarchitecture. Therefore, one can view Sys2$ as representative of the previous generation's high-end commodity co-processor.

Sys10$.
The third hardware platform is Sys10$, which Figure 5c visualizes. It has 2 Nvidia Tesla V100 GPUs with 32GB memory each and two 12-core (24 logical cores with hyperthreading) Intel Xeon Gold 6136 processors at 3.0 GHz and 192GB RAM in total. The storage is split between a locally-attached SSD and shared storage connected via In-finiBand. Similarly to Sys2$, The OS is Centos 7 and is on locally-attached SSD, and the rest of the storage needs (the model checkpoints and datasets) are kept on shared storage. Unlike Sys2$, the remote storage does not cause a slow down during initialization thanks to InfiniBand.
Sys10$ is composed of the newest microarchitecture technology, i.e., Intel's Skylake microarchitecture and Nvidia's Volta microarchitecture. Therefore, it represents the modern high-end co-processor.

Data
We use the LibriSpeech dataset [39,40], which falls toward the right-hand side of Figure 1. It is a difficult dataset because it contains continuous speech that uses a large vocabulary with different styles of speech and a large number of speakers. It is a dataset created from the LibriVox project, which is a collection of audiobooks read by different speakers [2]. LibriSpeech contains 1000 hours of speech and is split into multiple parts. The training data is split into three parts: 100 and 360 hours of clean speech, and 500 hours of other speech that is more noisy. In this paper, we train on the combination of these three parts. Both the validation and test sets are split into two parts, a clean and other set, with each combination containing around 5 hours speech.
For all experiments, we remove all elements above 16700 ms, since the time duration of the files greatly impacts the time it takes for an inference. This results in usage of 95% of the validation and test data, and 99% of the training data. This decision is reasonable since it is not the aim to compete in accuracy but to have enough data to verify generalization of the models.

Training
This section details our default training setup, which is the basis for the experiments in Section 5.

Framework and Parameters.
The training of the acoustic model is done using TensorFlow version 1.14 following TensorFlow's guides for efficient training [51]. First, we extract features from the original sound files and store them in compressed TFRecord files before training [52]. The movement of data is based on TensorFlow's abstraction called tf.data.Dataset. This abstraction creates parallel readers that read records from local disk or shared storage. The readers shuffle, batch and pad elements to supply a buffer. The elements are padded to a fixed length of 1670 samples, which gives a maximum training sample sound length of 16.7 seconds. The loader fills a buffer containing batches ready to train on. Sys1$  96  24  8  40  Sys2$  240  60  16  100  Sys10$  300  150 16 100 Table 2: Default parameters for batch size (number of elements), number of readers, and buffer size (number of batches) for each hardware platform.

Platform Total Batch Readers Buffer Batch per GPU
The parameters for batch and buffer sizes as well as the number of readers are set to the identified optimal parameters based on preliminary experiments, which Table 2 displays. The buffer and batch sizes are different for the different platforms because of the varying memory capacities. The main memory consumption during model training increases proportionally to the batch and buffer sizes. Therefore, this limits the values for batch and buffer sizes on Sys1$, which has smaller memory both on CPU and GPUs. The number of parallel readers was increased until there was no throughput improvements. Increasing the number of parallel readers to a higher value than the number of logical threads on Sys1$ leads to diminishing returns. On the other platforms, the number of readers do not improve throughput when increased beyond 16 threads. The reason for this is that the buffer is filled faster than the model is able to process the elements when increasing the number of readers beyond 16.
Each element in the buffer is an entire batch comprised of multiple elements. The batch is split into subsets depending on the number of GPUs in use to exploit data parallelism, e.g. a batch of ten elements is split into two subsets of five elements when using two GPUs. The subsets are each an input to a distinct GPU that contains a copy of the acoustic model described in Section 2.2.
The model parameters are located on the first GPU indexed as 0, from which they are also updated and distributed. Due to the main memory constraints on Sys1$, it is better to allocate the model's parameters directly on a GPU rather than in main memory of the CPU. This is fair to all platforms since all of them have similar PCIe 3 16x connection to the first GPU. This also enables better utilization of the potential direct connections among the GPUs on the platforms instead of necessitating communication with the CPU.
For each experiment, the batch size is estimated and set to a value that maximizes memory usage on the GPUs (see Table 2). This maximization of memory is not done on Sys1$ because increasing the batch size to the memory limit of 160 reduces the throughput. When this value is reduced to 96 a higher throughput is achieved. Each training step requires a distribution of the model parameters to the GPUs, which slows down the throughput. Large batch sizes help to reduce the amount of time used for distributing the model parameters since it changes the relative amount of model parameters and training data [55, p. 118]. However, there is a regularizing effect of having small batches that improves test accuracy.
The model parameters are with floating-point 32-bit precision, but it is possible for both Sys1$ and Sys10$, to take advantage of 16-bit precision because of their newer GPU microarchitecture. Using 16-bit or mixed precision [35] increase arithmetic operation efficiency and reduce memory footprint on the GPUs, thereby reducing the training time. This is not done because Sys2$ does not support this optimization, and would default to 32-bit precision. Further work would be to explore the gains of 16-bit precision, and potentially going even further with quantized neural networks [28] that utilize 8-bit values which have recently shown great promise without significant loss in accuracies [12].

The
States of Training. The training is conducted while monitoring loss, CER, WER, and output sentences. Calculating the loss, CER, and WER (as defined in Section 2.2.2 and Section 4.1.1) requires evaluation of the model using the validation set. This means that the training and evaluation needs to happen simultaneously. Figure 6 illustrates the training process in the form of a state machine. The transition between the states includes the iteration interval that triggers the state transition. The initial state is training, where the model is fitted to the training data by continuously iterating through different batches. Once the training iterates through 50 batches, we switch to   Figure 6 represents this action. Swapping the model has significant influence on the throughput, and is further analyzed in Section 5.
There are alternatives to avoid model swapping during the training process. An alternative is to always allocate memory on the GPUs for a process that evaluates the model whenever a checkpoint is saved (as adopted by Mozilla Deep Speech implementation [37]). The drawback of this alternative approach is that allocating memory for the evaluation limits the available memory for the model training. This is especially an obstacle when training on a platform like Sys1$ because the memory is already quite limited. Another alternative is to avoid the interleaving of the training and evaluation on the same platform by training and evaluating on separate machines. This would require more complex and expensive hardware setup in addition to the more complicated management of the dataflow across machines.
For the evaluation phase, there is a tradeoff between the beam width selected for decoding the resulting sentence (Section 2.2.2) and the accuracy achieved (Section 4.1.1). Table 3 shows how the evaluation time and accuracy change as the beam width increases, based on measurements done using a single GPU on Sys10$. Based on these results, the beam width is set to 256 while training to reduce the evaluation time. For the final validation once training is stopped, the beam width is also set to 256 for consistency.

4.4.3
The Model. The model has the same parameters for the different platforms except the differences mentioned in  work (Section 3.1), but still contains the same building blocks and overall topology ( Figure 4). The input features for the model is the concatenation of the Log Mel spectrogram of 80 dimensions and the 13 dimensions of MFCC, giving a 93-dimensional input feature per 10 ms time-step. The CNN has a kernel size of 11 x 93 x 600 which means it takes all the input features of 11 consecutive timesteps, and produce a 600-dimensional output feature. The CNN is applied with a stride of 2, and the CNN is only applied to valid inputs. This means that the model cannot take inputs shorter than 11 time-steps. The application of stride and valid requirements reduce the number of time-steps in the output of the CNN according to the following formula assuming that x is the input size in the time dimension, y is the output size after CNN, c w is convolution width that is 11 in our case, c s is the stride and x > c w .
Following the CNN is the LSTMs that have size 800. The first LSTM layer takes the 600-dimensional input and all subsequent layers take the 800-dimensional output from the previous LSTM layer. The output of the fifth layer is passed to a feed-forward layer that transforms the output to character probability distributions of dimension 30, which represent {space, a, b, ... , z, ', separation character, blank character}. The separation character is used in cases where the word contains double letters, such as the word "cool", having the output "co_ol", where "_" is used to represent the separation character. Between each layer, batch normalization and a dropout of 5% are applied.

RESULTS
This section splits the results into three parts: (1) loss values, accuracy, and TTA, (2) hardware utilization and throughput, and (3) a comparison of the platforms with the same batch size. Figure 7a has the CTC loss values over time for the three hardware setups. The CTC loss axis is logarithmic to better represent the nuances over time. The loss values have been smoothed by applying a 1-dimensional Gaussian filter from SciPy with a kernel standard deviation of 10 because the actual loss value oscillates throughout training. Looking at Figure 7a, it can be observed that on all hardware setups, the training loss is reduced over time which means that the model is able to adapt to the training data. Sys10$ has the fastest convergence, Sys2$ has the second fastest convergence, and Sys1$ has the slowest convergence. This result corresponds to the costs of the three platforms with Sys10$ having the highest cost and Sys1$ having the lowest cost. All three executions stay above a loss value of 10 and they are stopped within approximately 3400 minutes which is equivalent to two days and 8 hours.

Loss, Accuracy, & TTA
The accuracy of the clean validation set over time is shown in Figure 7b and  Table 4 reports the specific TTA values, where N A represents the case, where the specified accuracy level is not reached.
The initial 1000 minutes of the CER has a development similar to the training loss, where Sys10$ converges quicker than Sys2$, which in turn converges quicker than Sys1$. This situation is in effect at both TTA(10) and TTA (8), but it is subsequently turned upside down. Sys2$ surpasses Sys10$ , and it is later surpassed by Sys1$. Sys2$ and Sys1$ reache TTA (7) approximately at the same time step, while Sys10$ never reaches this CER, which is denoted by N A in Table 4. This demonstrates the effect of large batch sizes. The large batch size of Sys10$ improves the pace of the convergence initially, but ends up impeding the accuracy of the model. Similar results of reduced statistical efficiency with larger batch sizes were also identified in [31]. The reduced statistical efficiency stems from the higher generalization error of models trained with large batch sizes, which is a problem known for many years [23]. Figure 7c has a similar development with TTA(20) being reached first by Sys10$ and TTA(20.2) and TTA (19.2) reached by the two other co-processors first. The general level of WER is higher than CER, but the relative accuracies of the different platforms are similar.
The accuracies described above are calculated on the validation dataset, but when reporting the actual accuracy of the model, it has to be calculated on the separate test dataset.     Table 5 reports the accuracies with the test dataset. The evaluation is done on both the clean and the other dataset and the table also includes the accuracy results of the validation set, which is referred to as Val. The accuracies reported in related work is also included in the table for comparison. We include the results from Deep Speech 2 [6], because the model is similar to our work, and the results from Lüscher et al. [34], because it represents the state-of-the-art accuracy for this specific dataset. The model in our work is similar to Deep Speech 2, but it diverges in two ways which results in shorter training time and lower accuracy: (1) CNN output size is 600 in our system and 1280 in Deep Speech 2, and (2) LSTM size is 800 in our system and 1510 in Deep Speech 2. By reducing the sizes of the model layers, accuracy is traded for faster computation.
Quoting Baidu [6] commenting on the model size of Deep Speech 2: "Training a single model at these scales requires tens of exaFLOPs that would require 3-6 weeks to execute on a single GPU." This was in late 2015 and their model was trained on 8-16 unspecified GPUs that are older GPU versions than the Nvidia Tesla V100 GPUs used by Sys10$ in this project.
The accuracy of Lüscher et al. [34] is better than our accuracy and even better than Deep Speech 2. The difference is that Lüscher et al. base their model on the attention-based architecture, which is also found in [13] and originates from [9]. The attention-based model clearly performs better, but it requires longer training time, especially with the model parameters used for their specific solution. A scaled down version of an attention-based architecture would also have been appropriate for this paper. Figure 8 shows the utilization of the three platforms over a 25 second interval. The solid line represents the utilization of the CPU over the last 0.03 seconds, while the dashed lines are the GPUs' utilization. The horizontal axis is time in seconds, and the vertical axis is the utilization percentage of the corresponding GPU and CPU. The CPU utilization is the average across all cores for the specific training process.

Utilization & Throughput
Looking at the utilization of Sys10$ in Figure 8c, three phases of utilization during a single batch processing can be observed. The first utilization phase is represented by a spike on the CPU when the training data and model is transferred to the GPU. These spikes are most visible in Figure 8c at 4, 8, and 17 seconds, but are also present at 13 and 23 seconds. The second utilization phase happens on the GPUs when they are using the acoustic model to infer results from the input data. This is seen in Figure 8c where the GPUs are capped at 100% utilization just after the CPU spikes. The last phase is where the model is collected, gradients are summed, and the model is updated. This is seen as a small bump on the CPU utilization after the utilization of the GPUs are reduced. After completion of the three phases, the entire process is repeated. Sys2$'s utilization is shown in Figure 8b. The spikes are wider in this graph, indicating a longer startup for each iteration as expected due to the slower CPU and main memory (as explained in Section 4.2.2). This gives a clearer view of the 0% utilization of the GPUs while transferring the data. This 0% utilization is also present in fig. 8c but it is less visible in that figure due to the shorter duration. Looking at fig. 8b, it is observed that the GPU utilization is capped at around 75%. The model and batch size use all of the available memory on the GPUs, but the cores are not fully utilized. This means that neither the model size nor the batch size can be further increased to fully utilize the cores because the allocated memory would exceed the memory limit.
The utilization phases appear in both Figure 8c and Figure 8b, but Figure 8a has a slightly different pattern. GPU 1 is connected using PCIe 3 x16 and the rest of the GPUs are connected with PCIe 2 x1. GPU 1 is highly utilized in the beginning of each batch iteration and then quickly drops in utilization. On the other hand, GPU 2, GPU 3, and GPU 4 have moderate utilization before being fully utilized around the time GPU 1 is done with its batch. This utilization difference is caused by the different connection types between the graphics cards. When GPU 1 finishes earlier, it waits for the three other GPUs to finish. During this time, the GPU almost goes to 0% utilization.
To prevent this low utilization of the GPU with the current heterogenous connections, the training could be based on asynchronous SGD (A-SGD) [14] rather than synchronous SGD (S-SGD). In S-SGD, all GPUs have a consistent view of the model and each GPU has to wait for all other GPUs to produce their partial gradients so that the partial gradients can be aggregated and the model updated before starting the next iteration. In A-SGD, each GPU immediately starts the next iteration after its partial gradient is added to the accumulated gradient [31]. Another difference in Figure 8a compared to the other platforms is the CPU utilization. The CPU has fewer logical cores compared to the CPUs in the other systems. This means that the CPU is generally more utilized which gives less visible spikes, but the spikes are still noticeable at 1, 6, 10, 16, and 22 seconds.
Looking at Figure 9, it is seen that the three systems follow the same pattern as in the utilization figures. Sys10$ has better utilization and throughput than Sys2$ , which has better utilization and throughput than Sys1$. The throughput oscillates greatly, but the minimum and maximum goes to the same levels over time for the respective systems. The low points of the throughput occurs every time the training model is replaced by the evaluation model, which was explained in Section 4.4. The throughput is reduced by approximately 30-50% on all systems during this swap.
Comparing the utilization and throughput figures to the accuracy development in Figure 7, it is evident that the highly utilized, high throughput systems achieves lower accuracies eventually. The throughput and utilization analyses represent the hardware efficiency, whereas Figure 7b and Figure 7c represent the training efficiency. This means that Sys10$ has high hardware efficiency but low training efficiency, and Sys1$ has low hardware efficiency but high training efficiency. This demonstrates the point that when training machine learning models, the training efficiency is more important than the hardware efficiency.
The utilization and throughput analyses and following optimizations are however not purposeless, since they can be used to identify bottlenecks as was done with GPU 1 of Sys1$ with PCIe 3 connection. This kind of analysis makes it possible to improve the overall efficiency using the current hardware setup by for instance changing from an S-SGD to an A-SGD.

Parameter Equality Analysis
To confirm that the achieved accuracy from Sys1$ can be achieved on the other platforms, the parameters used when training on Sys1$ is applied to the training on Sys10$ and Sys2$. The batch size is reduced to the same value with the difference that Sys10$ has two GPUs on which the batch is split unlike Sys1$ and Sys2$ that have four. We also chose to reduce the beam width to 64 while evaluating thereby reducing overall training time. The change in beam width only reduces accuracy without effecting the convergence.
The reduction in batch size impedes the throughput as seen in Figure 10. It shows that the total throughput is reduced to half on both Sys10$ and Sys2$ compared to their previous throughput seen in Figure 9. The utilization of the GPUs on HPC is also found to be reduced, going from 76% utilization to 67% on average. It is also clear that Sys2$ and Sys1$ have the same performance in throughput and therefore should converge similarly, which they do, while Sys10$ converges faster than the other two systems due to its higher throughput.
The TTA values achieved by the models with these reduced batch sizes can be seen in Table 6. The results show that the accuracy of the model is able to reach the same level on Sys10$ as on Sys1$, but with a better TTA on Sys10$.

SUMMARY & CONCLUSION
This paper studied the behavior of the training of an acoustic model for ASR on different types of CPU-GPU co-processor hardware that fall into different price categories. The acoustic model was based on state-of-the-art proposals that use deep   Table 6: TTA values expressed in minutes and relative time to Sys1$ for WER and CER of the different platforms with reduced batch sizes.
neural networks for this purpose. Our goal was to observe the impact of higher-end processors in comparison with lower-end ones in this problem domain. By focusing on timeto-accuracy as the main metric, we observed that utilizing hardware acceleration yields good results even without highend equipment. The low-budget Sys1$ achieved a WER, CER, and TTA lower than the high-end Sys10$, even though the throughput of Sys1$ was lower. This result is caused by the low batch size used in Sys1$, which improves the training efficiency of the model. When using the same batch size on all hardware platforms, the throughput of Sys1$ and Sys2$ are similar, but the throughput of Sys10$ is still higher. The accuracy of Sys1$ and Sys2$ are similar in this case and Sys10$ achieves an even better accuracy, but Sys10$ and Sys2$ are underutilized.
The latest generations of co-processor hardware, such as the one evaluated as Sys10$, offer a huge computation and acceleration power. Such co-processors are becoming more and more widely available to the end-users. The embarrassingly parallel nature of most neural network tasks make them great for exploiting these types of hardware. However, there is no free lunch, especially for the more complex application domains like ASR. One has to pay attention to design both a statistically accurate model and a hardware-conscious one based on the available processing units in order to avoid wasting hardware resources.
Going forward, we have various options to investigate. There is already well-established frameworks (TensorFlow, Torch, etc.) for crafting neural networks and work on providing hardware-conscious libraries for data scientists [4,5]. We need to invest further in these frameworks and libraries, and understand their behavior on different types of processing units in more detail. It is unreasonable to expect every data scientist crafting models based on neural networks for a specific problem to be hardware gurus. However, it is also unreasonable to underutilize extremely powerful hardware. Furthermore, similarly to the research on co-locating different tasks on cloud, we should also investigate ways to colocate different types of model training to exploit idle-sitting hardware resources without breaking the performance of individual training processes.