We present SPDL (Scalable and Performant Data Loading), an open-source, framework-agnostic library designed for efficiently loading array data to GPU. Data loading is often a bottleneck in AI applications, and is challenging to optimize because it requires coordination of network calls, CPU-bound tasks, and GPU device transfer. On top of that, Python's GIL (Global Interpreter Lock) makes it difficult to gain performance improvement from multi-threading. We found that when data preprocessing functions release the GIL entirely, it is possible to execute them concurrently in a thread pool, thereby improving the workflow performance. Our benchmark shows that compared to the PyTorch DataLoader, SPDL can iterate through the ImageNet dataset 74% faster while using 38% less CPU and 50GB less memory. When training ViT-B/16 model, SPDL can send data to the GPU at a speed that does not starve the training. Additionally, when using SPDL on Python 3.13t, without changing any code, the throughput is further by improved by 33%, thanks to the disabled GIL. SPDL can improve the performance of current AI model training, and receives further performance improvements when Free-Threaded Python is adopted in production systems. SPDL is available at https://github.com/facebookresearch/spdl.


翻译:本文介绍SPDL(可扩展高性能数据加载库),这是一个开源、框架无关的库,专为高效向GPU加载数组数据而设计。数据加载常成为AI应用中的性能瓶颈,其优化具有挑战性,因为它需要协调网络调用、CPU密集型任务和GPU设备传输。此外,Python的全局解释器锁使得难以通过多线程获得性能提升。我们发现,当数据预处理函数完全释放GIL时,可以在线程池中并发执行这些函数,从而提升工作流性能。基准测试表明:与PyTorch DataLoader相比,SPDL遍历ImageNet数据集的速度提升74%,同时减少38%的CPU占用和50GB内存消耗。在训练ViT-B/16模型时,SPDL能以不拖慢训练节奏的速度向GPU输送数据。此外,在Python 3.13t上使用SPDL时,无需修改任何代码即可因GIL禁用而额外获得33%的吞吐量提升。SPDL能够提升现有AI模型训练的性能,并在生产系统采用无锁线程Python时获得进一步的性能增益。SPDL代码库位于https://github.com/facebookresearch/spdl。

0
下载
关闭预览

相关内容

【MIT博士论文】数据高效强化学习,176页pdf
专知会员服务
90+阅读 · 2022年7月11日
【MIT博士论文】数据高效强化学习,176页pdf
吐血整理!140种Python标准库、第三方库和外部工具都有了
炼数成金订阅号
16+阅读 · 2019年7月30日
谷歌推出新型数据增强算法:AutoAugment
论智
20+阅读 · 2018年6月6日
最全数据科学学习资源:Python、线性代数、机器学习...
人工智能头条
12+阅读 · 2018年5月14日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 3月2日
Arxiv
0+阅读 · 2月27日
VIP会员
最新内容
面向具身智能与机器人仿真的三维生成:综述
专知会员服务
0+阅读 · 43分钟前
《新兴技术武器化及其对全球风险的影响》
专知会员服务
8+阅读 · 4月29日
《帕兰泰尔平台介绍:信息分析平台》
专知会员服务
21+阅读 · 4月29日
相关VIP内容
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员