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.
翻译:数字稳定性是可靠的科学计算的关键要求。然而,尽管Python在数据科学中非常普遍,分析大型 Python 程序仍具有挑战性,因为缺乏可用于该语言的可缩放的数字分析工具。为了填补这一空白,我们开发了PyTracer, 是一个用于量化 Python 应用中数字不稳定性的剖析器。 PyTracer 透明仪器 Python 代码, 用来生成数字痕量, 并在一个Plotly 仪表板中以可视方式显示它们。 我们设计了 PyTracer, 以对数字噪音模型进行认知, 通过Monte-Carlo Airthmatic, 随机循环, 随机数据穿透, 或为特定应用程序结构化的噪音进行工具评估。 我们通过测试SciPython 和 Sikit-learn 两个主要 Python 图书馆的关键功能的数值稳定性来说明 Python 。 通过这些评估, 我们演示了 PyTracer 是一个可扩展、自动和通用框架, 用于在 Python 中进行数字分析。