Python JIT 项目被要求暂停开发
Python JIT project was asked to pause development

原始链接: https://discuss.python.org/t/an-announcement-from-the-steering-council-regarding-the-jit-project/107638

Python 指导委员会已要求将 CPython 中实验性的 JIT 编译器从非正式状态转变为通过标准追踪 PEP 正式支持的功能。 委员会在肯定贡献者出色工作的同时指出,关于长期维护、安全性、工具支持以及对下游打包者影响等关键问题仍未得到解决。因此,委员会实施了临时冻结:在 PEP 被接受之前,主分支不得合并任何新的 JIT 功能或优化。但漏洞修复和安全补丁仍可继续。 拟议的 PEP 必须明确维护计划、与现有工具(如调试器和性能分析器)的兼容性保证、成功指标,以及其与第三方 JIT 的关系。委员会建议 PEP 应优先构建灵活的 JIT 基础设施,而非偏向某一种特定的实现。 社区有六个月的时间提交并解决该 PEP。如果在此期间内没有提案被通过,JIT 代码将从主存储库中移除。此举旨在为如此重要技术范畴的项目提供必要的清晰度和承诺。

Python 指导委员会已要求暂停实验性 CPython 即时(JIT)编译器的开发。若要继续推进,开发人员必须起草一份正式的“标准跟踪 PEP”(Python 增强提案),详细说明该项目的长期维护承诺、性能保证以及对分发者的影响,以供社区和委员会审议。 这一公告在 Hacker News 社区引发了褒贬不一的反应。一些评论者对突然叫停感到沮丧,指出该项目近期展示的性能提升终于达到甚至超过了默认解释器;而另一些人则认为,具有如此重大影响的实验性功能不应过早合并到主代码库中。此外,还有人将其与 Ruby 的 YJIT 进行对比,质疑为何 Python 尽管拥有巨大的工业应用规模,但在 JIT 集成方面却落后于其他语言。该项目的未来现取决于能否成功起草并获批一项新提案,将 JIT 从一项实验性功能转变为 CPython 核心且受支持的组件。
相关文章

原文

We would like to take a moment to talk about the experimental just-in-time compiler in CPython, and the path we think it should take from here.

Over the past several years, several core developers and contributors have been building a JIT compiler in the main branch of CPython. We want to begin by thanking them. This has been hard, deeply technical work that has been done with great care, and the recent performance improvements are real and encouraging. None of what follows is a criticism of that effort or of the people behind it. Quite the opposite. It is precisely because the project has been underway for so long, undergoing several re-architectures, that we think now is a good time to re-evaluate the JIT’s informal status in the project.

When the JIT was originally merged into main, it entered as an experiment, and the only enhancement proposal written about it, PEP 744, is Informational. That PEP did valuable work in explaining the initial design and even sketched the criteria under which the JIT might become a permanent feature, including questions it explicitly left open: committed long-term maintainers, a security review, debugging and out-of-process tooling support, the guarantees the runtime would make, and the obligations the JIT would place on redistributors and downstream packagers. There has also been a fair amount of back and forth over the years, on that PEP and elsewhere, and we acknowledge that a good deal of useful communication has happened along the way. We want to be clear that we are not implying that the authors have intentionally bypassed the formal process. The responsibility is a shared one, ourselves included: collectively we (the Steering Council) have not been as strict about following the process as a change of this complexity and reach deserves. Those open questions in PEP 744 (and more) are exactly the kinds of commitments that the community should weigh and agree to through the PEP process, and they have not yet been settled.

For that reason, the Steering Council is formally requesting a Standards Track PEP be authored that the community can discuss and the Steering Council can formally accept (or reject), making the case for the JIT as a supported, non-experimental part of CPython: its guarantees, its maintenance commitments, and its impact on redistributors.

Until such a PEP is accepted, we ask that no new development on the JIT land on main, including new features, optimizations, and performance work. Bugfixes and security fixes may of course continue as normal; the request is specifically that no further new JIT functionality be added until a PEP has been accepted.

While the intent is not to call for competing proposals, we believe that now is a good time to discuss and propose alternative proposals as well. We believe this approach is also consistent with our previous long-standing view that experiments should not be done on the main branch of CPython without a backing PEP.

For example, rather than proposing one single concrete JIT implementation, it may make more sense for the PEP to describe a JIT infrastructure that can support multiple implementation strategies. Since many different and promising JIT tracing approaches continue to be proposed, we believe the infrastructure should make it easy to experiment with and evaluate those approaches within CPython rather than be highly coupled with a single strategy.

We would like the PEP to address at least the following points:

  • Maintenance is a real concern for a subsystem of this size and complexity, and the PEP should set out a clear plan for how the JIT will be sustained and maintained over the long term and how it will impact maintainers and contributors that don’t directly contribute to the JIT.

  • How it will keep compatibility with existing CPython features and tooling. How the JIT interacts with, and what it guarantees for, the capabilities CPython already supports. This includes things such as free-threading, profilers, and debuggers, but the PEP should treat this broadly and with nuance rather than as a fixed checklist.

  • Clear, measurable success metrics and timelines. What the project is aiming for and by when, for example performance targets, platform coverage, and memory overhead.

  • Relationship to other JIT compilers. Whether the design is intended to provide general infrastructure that other efforts could build on, and whether it is expected to be compatible or incompatible with third-party JIT implementations such as CinderX, Numba, and PyTorch or any other 3rd party JIT.

  • Whether the current JIT architecture is considered stable, or likely to change further.

This list is not exhaustive. It is meant to be indicative of the kinds of questions we want the PEP to engage with, and we expect further points to be added as the community discussion evolves.

We are setting a window of six months for a PEP to be submitted and resolved. If no such PEP is accepted within that window, the JIT code must be removed from the main branch and development must be continued outside the main Python repository.

We know this asks something of the people who have invested years in this work, and we don’t take that lightly. We see this not as winding the project down but as giving it, and the community, the clarity and the explicit commitment that a change of this magnitude to CPython’s runtime deserves.

Thank you for your understanding, and for everything you’ve built so far.

— The Python Steering Council

联系我们 contact @ memedata.com