arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.13450cs.DC
收藏

依赖型GPU内核的细粒度同步框架

A Framework for Fine-Grained Synchronization of Dependent GPU Kernels

Abhinav Jangda, Saeed Maleki, Maryam Mehri Dehnavi, Madan Musuvathi, Olli Saarikivi

AI总结:

提出cuSync框架,通过瓦片级细粒度同步策略并发执行依赖内核的独立瓦片,提升GPU利用率,将四种ML模型推理时间最高降低14-22%。

摘要:

机器学习(ML)模型执行多种并行计算,包括通用矩阵乘法、卷积、Dropout等。这些计算通常在图形处理器(GPUs)上执行,将计算划分为称为瓦片的独立处理块。由于瓦片数量通常多于GPU的执行单元,瓦片在一个或多个波次中在所有执行单元上执行。然而,瓦片数量并不总是执行单元数量的整数倍,因此在最终波次中执行的瓦片可能无法充分利用GPU。为解决此问题,我们提出cuSync,一个使用用户定义的细粒度同步策略来同步依赖内核以提高GPU利用率的框架。cuSync同步瓦片而非内核,允许并发执行依赖内核的独立瓦片。我们还提出一个编译器,基于内核间依赖关系生成多样的细粒度同步策略。实验发现,使用cuSync同步CUDA内核,在多个批大小下,将四个流行ML模型的推理时间分别降低:MegatronLM GPT-3最高15%,LLaMA最高14%,ResNet-38最高22%,VGG-19最高16%。

英文摘要:

Machine Learning (ML) models execute several parallel computations including Generalized Matrix Multiplication, Convolution, Dropout, etc. These computations are commonly executed on Graphics Processing Units (GPUs), by dividing the computation into independent processing blocks, known as tiles. Since the number of tiles are usually higher than the execution units of a GPU, tiles are executed on all execution units in one or more waves. However, the number of tiles is not always a multiple of the number of execution units. Thus, tiles executed in the final wave can under-utilize the GPU. To address this issue, we present cuSync, a framework for synchronizing dependent kernels using a user-defined fine-grained synchronization policy to improve the GPU utilization. cuSync synchronizes tiles instead of kernels, which allows executing independent tiles of dependent kernels concurrently. We also present a compiler to generate diverse fine-grained synchronization policies based on dependencies between kernels. Our experiments found that synchronizing CUDA kernels using cuSync reduces the inference times of four popular ML models: MegatronLM GPT-3 by up to 15%, LLaMA by up to 14%, ResNet-38 by up to 22%, and VGG-19 by up to 16% over several batch sizes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑