Open markshannon opened 1 year ago
Note that the above API is just the initial version to support our work on speeding up Python 3.13. It will probably need to be extended to support PyTorch Dynamo and other users of PEP 523 that cannot use PEP 669, but that is for another issue.
Is documenting these planned for 3.13?
Since we are removing them in 3.14, probably not.
Since we are removing them in 3.14, probably not.
If possible, I would like to backport https://github.com/python/cpython/pull/120643 to Python 3.13, to solve a C99 compatibility issue.
We need an API for optimizers to be plugged in to CPython.
The proposed model is that of client server, where the VM is the client and the optimizer is the server. The optimizer registers with the VM, then VM calls the optimizer when hotspots are detected.
The API:
The semantics of a
PyExecutorObject
is that upon return from itsexecute
function, the VM state will have advancedN
instructions. WhereN
is a non-negative integer.Full discussion here: https://github.com/faster-cpython/ideas/discussions/380
This is not a replacement for PEP 523. That will need a PEP. We should get this working first, before we consider replacing PEP 523.
Linked PRs