arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.16146cs.DBcs.PL
收藏

Dias:Pandas 代码的动态重写

Dias: Dynamic Rewriting of Pandas Code

Stefanos Baziotis, Daniel Kang, Charith Mendis

AI总结:

本文提出 Dias 系统,通过动态前提检查与即时程序重写技术优化 pandas 即席 EDA 工作负载,在单个单元和整个 notebook 上分别实现最高 57 倍和 3.6 倍加速。

摘要:

近年来,诸如 pandas 之类的 dataframe 库迅速流行。由于其灵活性,它们越来越多地被用于即席探索性数据分析(EDA)工作负载。这些工作负载多种多样,包括可以跨库或使用纯 Python 编写的自定义函数。可用于加速 EDA 工作负载的大多数系统都专注于批量并行工作负载,这些工作负载包含截然不同的计算模式,并且通常局限于单一库内。因此,由于其昂贵的优化技术,这些系统可能为即席 EDA 工作负载引入过高的开销。相反,我们认为程序重写是一种轻量级技术,可以提供显著的加速,同时避免性能下降。我们在 Dias 中实现了我们的技术,Dias 会重写 notebook 单元,使其对即席 EDA 工作负载更加高效。我们在 Dias 中开发了高效重写技术,包括对重写正确性前提条件的动态检查,以及面向 notebook 环境的即时重写。我们表明,与 pandas 相比,Dias 可以将单个单元重写为快 57$\ imes$,与 modin 等优化系统相比则快 1909$\ imes$。此外,与 pandas 相比,Dias 可以将整个 notebook 加速最多 3.6$\ imes$,与 modin 相比则加速最多 26.4$\ imes$。

英文摘要:

In recent years, dataframe libraries, such as pandas have exploded in popularity. Due to their flexibility, they are increasingly used in ad-hoc exploratory data analysis (EDA) workloads. These workloads are diverse, including custom functions which can span libraries or be written in pure Python. The majority of systems available to accelerate EDA workloads focus on bulk-parallel workloads, which contain vastly different computational patterns, typically within a single library. As a result, they can introduce excessive overheads for ad-hoc EDA workloads due to their expensive optimization techniques. Instead, we identify program rewriting as a lightweight technique which can offer substantial speedups while also avoiding slowdowns. We implemented our techniques in Dias, which rewrites notebook cells to be more efficient for ad-hoc EDA workloads. We develop techniques for efficient rewrites in Dias, including dynamic checking of preconditions under which rewrites are correct and just-in-time rewrites for notebook environments. We show that Dias can rewrite individual cells to be 57$\times$ faster compared to pandas and 1909$\times$ faster compared to optimized systems such as modin. Furthermore, Dias can accelerate whole notebooks by up to 3.6$\times$ compared to pandas and 26.4$\times$ compared to modin.

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

↑