PyTracer:自动剖析 Python 中的数值不稳定性
PyTracer: Automatically profiling numerical instabilities in Python
AI总结:
本文提出 PyTracer,通过透明插桩生成并可视化数值轨迹,支持多种噪声模型,实现对 Python 程序数值不稳定性的自动、可扩展剖析。
摘要:
数值稳定性是可靠科学计算的一项关键要求。然而,尽管 Python 在数据科学中无处不在,但由于该语言缺乏可扩展的数值分析工具,分析大型 Python 程序仍然具有挑战性。为填补这一空白,我们开发了 PyTracer,这是一个用于量化 Python 应用程序中数值不稳定性的剖析器。PyTracer 透明地对 Python 代码进行插桩,以生成数值轨迹,并在 Plotly 仪表板中交互式地可视化这些轨迹。我们将 PyTracer 设计为与数值噪声模型无关,从而允许通过 Monte-Carlo Arithmetic、随机舍入、随机数据扰动或面向特定应用的结构化噪声来评估工具。我们通过测试 SciPy 和 Scikit-learn 中关键函数的数值稳定性来说明 PyTracer 的能力,这两个库是数学建模中占主导地位的 Python 库。通过这些评估,我们证明 PyTracer 是一个用于 Python 数值剖析的可扩展、自动且通用的框架。
英文摘要:
Numerical stability is a crucial requirement of reliable scientific computing. However, despite the pervasiveness of Python in data science, analyzing large Python programs remains challenging due to the lack of scalable numerical analysis tools available for this language. To fill this gap, we developed PyTracer, a profiler to quantify numerical instability in Python applications. PyTracer transparently instruments Python code to produce numerical traces and visualize them interactively in a Plotly dashboard. We designed PyTracer to be agnostic to numerical noise model, allowing for tool evaluation through Monte-Carlo Arithmetic, random rounding, random data perturbation, or structured noise for a particular application. We illustrate PyTracer's capabilities by testing the numerical stability of key functions in both SciPy and Scikit-learn, two dominant Python libraries for mathematical modeling. Through these evaluations, we demonstrate PyTracer as a scalable, automatic, and generic framework for numerical profiling in Python.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。