The neural transducer is an end-to-end model for automatic speech recognition (ASR). While the model is well-suited for streaming ASR, the training process remains challenging. During training, the memory requirements may quickly exceed the capacity of state-of-the-art GPUs, limiting batch size and sequence lengths. In this work, we analyze the time and space complexity of a typical transducer training setup. We propose a memory-efficient training method that computes the transducer loss and gradients sample by sample. We present optimizations to increase the efficiency and parallelism of the sample-wise method. In a set of thorough benchmarks, we show that our sample-wise method significantly reduces memory usage, and performs at competitive speed when compared to the default batched computation. As a highlight, we manage to compute the transducer loss and gradients for a batch size of 1024, and audio length of 40 seconds, using only 6 GB of memory.
translated by 谷歌翻译
基于变压器的神经模型在许多AI应用中使用。培训这些模型很昂贵,因为它需要大量的GPU资源和较长的持续时间。这是具有挑战性的,因为诸如句子之类的典型数据具有可变的长度,而变压器的计算模式比卷积神经网络更为复杂。现有系统要么仅专注于模型推理,要么仅针对BERT样编码器模型进行优化。在本文中,我们提出了LightSeq2,该系统是为GPU上的一般变压器模型加速培训的系统。我们提出了一系列针对变压器模型的特定计算流量和内存访问模式量身定制的GPU优化技术。 LightSeq2支持许多模型体系结构,包括BERT(仅编码),GPT(仅解码器),变压器(编码器编码器)和视觉变压器。我们对各种模型和基准测试的实验表明,LightSeq2始终比不同GPU上的先前系统更快(1.4-3.5倍)。特别是,与大型公共机器翻译基准(WMT14英语 - 德国人)上的现有系统相比,它获得了308%的培训速度。
translated by 谷歌翻译
语音识别的RNN-TransDucer(RNN-T)框架一直在越来越受欢迎,尤其是用于实时部署的ASR系统,因为它将高精度与自然流识别结合在一起。RNN-T的缺点之一是其损耗函数相对较慢,并且可以使用大量内存。在词汇大小较大的情况下,使用RNN-T损失的过多GPU记忆使用可能会使使用RNN-T损失是不切实际的:例如,对于基于中文的ASR而言。我们介绍了一种方法,用于更快,更快的记忆效率RNN-T损失计算。我们首先使用在编码器和解码器嵌入式中线性的简单木器网络获得RNN-T递归的修剪边界;我们可以在不使用很多内存的情况下对此进行评估。然后,我们使用那些修剪界限来评估完整的非线性木匠网络。
translated by 谷歌翻译
现代消费电子设备已为其主要功能采用了深度学习的情报服务。供应商最近开始在设备上执行情报服务,以在设备中保存个人数据,降低网络和云成本。我们发现了通过使用用户数据更新神经网络的情况,而无需将数据暴露在设备中:设备培训。例如,我们可能会添加一个新课程,我的狗Alpha用于机器人真空吸尘器,适应用户口音的语音识别,让文本到语音说话,好像用户会说话。但是,目标设备的资源限制遇到了重大困难。我们建议NNTrainer,这是一个轻巧的设备培训框架。我们描述了NNTrainer实施的神经网络的优化技术,这些技术与传统一起评估。评估表明,NNTrainer可以将内存消耗降低至1/28,而不会恶化准确性或训练时间,并有效地个性化了对设备上的应用程序。 NNTrainer是跨平台和实用的开源软件,该软件正在作者隶属关系中部署到数百万个设备。
translated by 谷歌翻译
预训练的模型(PTM)正在革新人工智能(AI)技术。但是,PTM培训的硬件要求非常高,使其成为一小部分人的游戏。因此,我们提出了Patrickstar系统,以降低PTM的硬件要求,并使所有人都可以使用。 Patrickstar使用CPU-GPU异质存储空间来存储模型数据。与现有作品不同,我们在内存块中组织模型数据,并在异质内存中动态分配它们。在热身迭代中收集的运行时内存统计的指导下,块在异质内存中有效地精心策划,并生成较低的CPU-GPU数据传输量和较高的带宽利用率。与零冗余优化器的共生,Patrickstar量表在多个节点上均为多个GPU。 %使用数据并行性。该系统可以在更大的型号和较大的批次大小上训练任务,这是现有工程无法完成的。实验结果表明,Patrickstar扩展了模型量表2.27和2.5倍,并且始终显示出更高的执行速度。 Patricstar还成功地在32 GPU集群上成功运行了175B GPT3培训任务。我们的代码可在https://github.com/tencent/patrickstar上公开获取。
translated by 谷歌翻译
We introduce Breadth-First Pipeline Parallelism, a novel training schedule which optimizes the combination of pipeline and data parallelism. Breadth-First Pipeline Parallelism lowers training time, cost and memory usage by combining a high GPU utilization with a small batch size per GPU, and by making use of fully sharded data parallelism. Experimentally, we observed increases of up to 53% in training speed.
translated by 谷歌翻译
We study the problem of efficient generative inference for Transformer models, in one of its most challenging settings: large deep models, with tight latency targets and long sequence lengths. Better understanding of the engineering tradeoffs for inference for large Transformer-based models is important as use cases of these models are growing rapidly throughout application areas. We develop a simple analytical model for inference efficiency to select the best multi-dimensional partitioning techniques optimized for TPU v4 slices based on the application requirements. We combine these with a suite of low-level optimizations to achieve a new Pareto frontier on the latency and model FLOPS utilization (MFU) tradeoffs on 500B+ parameter models that outperforms the FasterTransformer suite of benchmarks. We further show that with appropriate partitioning, the lower memory requirements of multiquery attention (i.e. multiple query heads share single key/value head) enables scaling up to 32x larger context lengths. Finally, we achieve a low-batch-size latency of 29ms per token during generation (using int8 weight quantization) and a 76% MFU during large-batch-size processing of input tokens, while supporting a long 2048-token context length on the PaLM 540B parameter model.
translated by 谷歌翻译
Large deep learning models offer significant accuracy gains, but training billions to trillions of parameters is challenging. Existing solutions such as data and model parallelisms exhibit fundamental limitations to fit these models into limited device memory, while obtaining computation, communication and development efficiency. We develop a novel solution, Zero Redundancy Optimizer (ZeRO), to optimize memory, vastly improving training speed while increasing the model size that can be efficiently trained. ZeRO eliminates memory redundancies in data-and model-parallel training while retaining low communication volume and high computational granularity, allowing us to scale the model size proportional to the number of devices with sustained high efficiency. Our analysis on memory requirements and communication volume demonstrates: ZeRO has the potential to scale beyond 1 Trillion parameters using today's hardware.We implement and evaluate ZeRO: it trains large models of over 100B parameter with super-linear speedup on 400 GPUs, achieving throughput of 15 Petaflops. This represents an 8x increase in model size and 10x increase in achievable performance over state-of-the-art. In terms of usability, ZeRO can train large models of up to 13B parameters (e.g., larger than Megatron GPT 8.3B and T5 11B) without requiring model parallelism which is harder for scientists to apply. Last but not the least, researchers have used the system breakthroughs of ZeRO to create the world's largest language model (17B parameters) with record breaking accuracy.
translated by 谷歌翻译
我们呈现GSPMD,一种用于公共机器学习计算的自动,基于编译的并行化系统。它允许用户以与单个设备的方式相同的方式编写程序,然后通过关于如何分发Tensors的一些注释来提供提示,基于哪个GSPMD将并行化计算。其分区的表示简单尚不一般,允许它在各种模型上表达并行性的不同或混合范式。GSPMD基于有限的用户注释为每个运算符的分区Inventing,使得缩放现有的单设备程序方便。它解决了生产使用的几种技术挑战,允许GSPMD实现50%至62%的计算利用率,用于高达2048个云TPUv3核心,适用于高达1万亿参数的模型。
translated by 谷歌翻译
准确的蛋白质结构预测可以显着加速生命科学的发展。 Alphafold2的准确性是边界端到端结构预测系统,已经接近实验确定技术的准确性。由于复杂的模型体系结构和大量的内存消耗,因此需要大量的计算资源和时间来实施从头开始实施Alphafold2的训练和推断。对于大多数个人和机构来说,运行原始AlphaFold2的成本都是昂贵的。因此,降低这一成本可以加速生命科学的发展。我们使用PaddlePaddle(即HelixFold)实现Alphafold2,以提高训练和推理速度并减少记忆消耗。操作员融合,张量融合和混合并行性计算改善了性能,而通过重新计算,BFLOAT16和内存读/写入/编写就场,内存进行了优化。与原始的Alphafold2(由JAX实施)和OpenFold(由Pytorch实施)相比,HelixFold仅需7.5天即可完成完整的端到端培训,并且在使用Hybrid ParalleleSism时只需要5.3天,而Alphafold2和OpenFold都可以使用11个。天。 Helixfold节省了1倍的训练时间。我们验证了HelixFold的准确性可能与CASP14和CAMAO数据集上的Alphafold2相当。 HelixFold的代码可免费下载:https://github.com/paddlepaddle/paddlehelix/paddlehelix/tree/dev/dev/pprotein_folding/helixfold,我们还在https://paddlehelix.baidu.com/com上提供稳定的Web服务。应用程序/药物/蛋白质/预测。
translated by 谷歌翻译
变形金刚是今天最重要的机器学习工作负载之一。培训是一个非常计算密集的任务,通常需要几天或几周,并且对优化变压器进行了重大关注。尽管如此,现有的实现不会有效地利用GPU。我们发现数据移动是培训时的关键瓶颈。由于Amdahl的法律和大规模改进的计算性能,培训现已成为记忆束缚。此外,现有框架使用次优数据布局。使用这些洞察力,我们提供了一个用于全局优化变压器数据移动的配方。我们将数据移动降低到22.91%,总体上实现了在训练伯特编码器层和1.19x的整个伯特的最先进框架上的1.30倍的性能改进。我们的方法更广泛地适用于优化深神经网络,并深入了解如何解决新兴的性能瓶颈。
translated by 谷歌翻译
变压器模型的成功将深度学习模型量表推向了数十亿个参数。但是,由于单个GPU的内存资源有限,因此仍然缺乏选择最佳并行策略的最佳实践,因为它需要深度学习和并行计算方面的域专业知识。巨大的AI系统通过引入统一的界面来解决上述挑战,以将模型培训的顺序代码扩展到分布式环境。它支持并行训练方法,例如数据,管道,张量和序列并行性,以及与零冗余优化器集成的异质训练方法。与基线系统相比,巨大的AI可以实现大型型号的训练速度的2.76倍。
translated by 谷歌翻译
ALPA通过生成统一数据,操作员和管道并行性的执行计划来自动对大型深度学习(DL)模型的模型平行训练。现有的模型并行训练系统要求用户手动创建并行化计划,或者自动从有限的模型并行性配置中生成一个计划。它们不足以在分布式计算设备上扩展复杂的DL模型。 ALPA通过将并行性视为两个层次级别来分配大型DL模型的训练:操作员和操作员并行性。基于它,ALPA构建了一个新的分层空间,用于大规模的模型并行执行计划。 ALPA设计了许多汇编,以在每个并行性级别自动得出有效的并行执行计划。 ALPA实现了有效的运行时,以在分布式计算设备上协调两级并行执行。我们的评估表明,ALPA生成的并行化计划,即使在其设计的型号上,也可以匹配或超过手动模型并联训练系统。与专业系统不同,ALPA还推广到具有异质体系结构和模型的模型,而没有手动设计的计划。 ALPA的源代码可在https://github.com/alpa-projects/alpa上公开获得
translated by 谷歌翻译
The recent breakthroughs in machine learning (ML) and deep learning (DL) have enabled many new capabilities across plenty of application domains. While most existing machine learning models require large memory and computing power, efforts have been made to deploy some models on resource-constrained devices as well. There are several systems that perform inference on the device, while direct training on the device still remains a challenge. On-device training, however, is attracting more and more interest because: (1) it enables training models on local data without needing to share data over the cloud, thus enabling privacy preserving computation by design; (2) models can be refined on devices to provide personalized services and cope with model drift in order to adapt to the changes of the real-world environment; and (3) it enables the deployment of models in remote, hardly accessible locations or places without stable internet connectivity. We summarize and analyze the-state-of-art systems research to provide the first survey of on-device training from a systems perspective.
translated by 谷歌翻译
TensorFlow和Pytorch之类的软件包旨在支持线性代数操作,它们的速度和可用性决定了它们的成功。但是,通过优先考虑速度,他们经常忽略内存需求。结果,由于内存溢出,在软件设计方面方便的内存密集型算法的实现通常无法解决大问题。记忆效率的解决方案需要在计算框架之外具有重要逻辑的复杂编程方法。这会损害这种算法的采用和使用。为了解决这个问题,我们开发了一个XLA编译器扩展程序,该扩展程序根据用户指定的内存限制来调整算法的计算数据流表示。我们表明,K-Nearest邻居和稀疏的高斯过程回归方法可以在单个设备上以更大的规模运行,而标准实现将失败。我们的方法可以更好地利用硬件资源。我们认为,进一步专注于在编译器级别上删除内存约束将扩大未来可以开发的机器学习方法的范围。
translated by 谷歌翻译
深度学习领域目睹了对极端计算和内存密集型神经网络的显着转变。这些较新的较大模型使研究人员能够推进各种领域的最先进的工具。这种现象刺激了在更多的硬件加速器上产生了针对神经网络的分布式训练的算法。在本文中,我们讨论并比较了当前的最先进的框架,以实现大规模的分布式深度学习。首先,我们调查分布式学习中的当前实践,并确定所使用的不同类型的并行性。然后,我们提出了对大型图像和语言培训任务的性能进行了经验结果。此外,我们解决了他们的统计效率和内存消耗行为。根据我们的结果,我们讨论了阻碍性能的每个框架的算法和实现部分。
translated by 谷歌翻译
在过去的十年中,深度神经网络(DNNS)的规模成倍增长,只剩下那些具有大量基于数据中心的资源的人具有开发和培训此类模型的能力。对于可能只有有限的资源(例如,单个多GPU服务器)的研究人员的长尾巴的主要挑战之一是GPU内存能力与模型大小相比。问题是如此严重,以至于训练大规模DNN模型的内存需求通常可以超过单个服务器上所有可用GPU的总容量;这个问题只会随着不断增长的模型大小的趋势而变得更糟。当前依赖于虚拟化GPU内存的解决方案(通过向CPU内存交换/从CPU内存)会产生过多的交换开销。在本文中,我们提出了一个新的培训框架,和谐和倡导者,重新思考了DNN框架如何安排计算并移动数据以在单个商品服务器上有效地推动培训大规模模型的边界。在各种大型DNN模型中,Harmony能够将交换负载最多减少两个数量级,并在具有虚拟化内存的高度优化基线上获得高达7.6倍的训练吞吐量加速。
translated by 谷歌翻译
激活函数是元素的数学函数,在深神经网络(DNN)中起着至关重要的作用。已经提出了许多新颖和复杂的激活功能来提高DNN的准确性,但在训练过程中还可以通过反向传播消耗大量记忆。在这项研究中,我们提出了嵌套的正向自动分化(正向AD),专门针对用于记忆效率的DNN训练的元素激活函数。我们在两个广泛使用的深度学习框架(Tensorflow和Pytorch)中部署了嵌套的AD,分别支持静态和动态计算图。我们的评估表明,在相同的记忆降低率下,嵌套的前AD嵌套将记忆足迹降低到1.97倍,比基线模型降低了20%。
translated by 谷歌翻译
模型大小的范围不断增加,并且持续改进性能使大型模型时代的到来的到来。在本报告中,我们通过潜入培训目标和培训方法来探讨大型模型培训如何运作。具体而言,培训目标描述了如何利用Web规模数据来开发基于自我监督的学习以及基于分布式培训的培训方法,开发出极强的大型模型,描述了如何使大型模型培训成为现实。我们将现有的培训方法总结为三个主要类别:训练并行性,节省记忆技术和模型稀疏设计。训练并行性可以根据发生的并行性维度分类为数据,管道和张量并行性。节省记忆的技术是正交的,并且与训练并行性互补。和模型稀疏设计以恒定的计算成本进一步扩大模型大小。在https://github.com/qhliu26/bm-training提供了不断更新的大型模型培训清单。
translated by 谷歌翻译
Embedded and IoT devices, largely powered by microcontroller units (MCUs), could be made more intelligent by leveraging on-device deep learning. One of the main challenges of neural network inference on an MCU is the extremely limited amount of read-write on-chip memory (SRAM, < 512 kB). SRAM is consumed by the neural network layer (operator) input and output buffers, which, traditionally, must be in memory (materialised) for an operator to execute. We discuss a novel execution paradigm for microcontroller deep learning, which modifies the execution of neural networks to avoid materialising full buffers in memory, drastically reducing SRAM usage with no computation overhead. This is achieved by exploiting the properties of operators, which can consume/produce a fraction of their input/output at a time. We describe a partial execution compiler, Pex, which produces memory-efficient execution schedules automatically by identifying subgraphs of operators whose execution can be split along the feature ("channel") dimension. Memory usage is reduced further by targeting memory bottlenecks with structured pruning, leading to the co-design of the network architecture and its execution schedule. Our evaluation of image and audio classification models: (a) establishes state-of-the-art performance in low SRAM usage regimes for considered tasks with up to +2.9% accuracy increase; (b) finds that a 4x memory reduction is possible by applying partial execution alone, or up to 10.5x when using the compiler-pruning co-design, while maintaining the classification accuracy compared to prior work; (c) uses the recovered SRAM to process higher resolution inputs instead, increasing accuracy by up to +3.9% on Visual Wake Words.
translated by 谷歌翻译