arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.08731cs.PFcs.LG
收藏

单线程JPEG解码器基准测试误评了ML数据加载器

Choosing a JPEG Decoder for PyTorch DataLoaders: Workload-Specific Throughput on Four CPUs

Ternaus;Independent Researcher(独立研究者)

Vladimir Iglovikov, Dmitry Kosarevsky

AI总结:

本文通过评估不同Python可访问的JPEG解码路径在五种匹配的16核Google Cloud CPU上的表现,发现单线程基准测试无法准确评价ML数据加载器的性能,揭示了不同架构和解码器在多线程工作负载下的差异。

摘要:

JPEG解码是常规的机器学习基础设施,但Python解码器的选择通常基于单进程、单线程的微观基准测试。我们通过在五种匹配的16核Google Cloud CPU(Intel Emerald Rapids,AMD Zen 4,AMD Zen 5,ARM Neoverse V2和ARM Neoverse N1)上审计十三种Python可访问的JPEG解码路径,验证了这一评估假设。ImageNet验证是工作负载,而不是新的数据集贡献:每次运行都从内存中解码完整的50,000张图像分割,并报告所有解码器的单线程吞吐量,对于符合条件的解码器,在工人数量{0,2,4,8}时报告PyTorch DataLoader吞吐量以及解码器跳过行为。评估协议改变了支持的结论。在Neoverse V2上,imageio在单线程吞吐量中排名第九,但进入与torchvision并列的DataLoader层级;在Zen 4上,torchvision从第七名的单线程提升到最高测量的DataLoader层级;在Neoverse N1上,imagecodecs是单线程领导者,但在峰值DataLoader吞吐量中排名第五。我们还发现Zen 4和Zen 5之间的工人数量结论不同,TensorFlow在单线程ARM上有较大的惩罚,严格的原生JPEG解码器/包装器拒绝了相同的罕见ImageNet JPEG。对于PyTorch DataLoader工作负载,torchvision和simplejpeg形成了最强的零跳过层级:torchvision具有最高的平均归一化吞吐量,而simplejpeg具有最高的最低吞吐量。OpenCV在每种测试的CPU上仍然是一个稳健的通用备用选项,超过平台本地胜者的90%。我们发布了原始JSON,生成的表格/图表以及一个可执行的本地/云基准框架。

英文摘要:

A JPEG decoder benchmark can combine worker counts, CPUs, and datasets in one large result matrix. We simplify that comparison by fixing a PyTorch DataLoader at eight workers and asking one question: how much faster is each decoder than Pillow on the same CPU and JPEG workload? We benchmark 12 Python decoders on four 16-vCPU Google Cloud platforms and two workloads from the Forchheim Image Database. The first contains 324 large camera originals. The second contains 1,668 originals and copies processed by social media services. Every decoder-CPU-workload setting has five isolated repetitions. JPEG bytes reside in memory, and each timed decode returns a complete three-channel RGB array. The workload changes the practical result. On camera originals, the geometric mean across CPUs ranges from 1.00 to 1.09 times Pillow. On the mixed workload, simplejpeg, imagecodecs, and turbojpeg reach 1.39 - 1.40 Pillow. The exact leader still changes by CPU. We therefore recommend comparing decoders on representative JPEGs, while using the fixed eight-worker results as a compact starting point. Full worker curves and absolute throughput tables are in the appendix.

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

↑