The programming world is abuzz with excitement as Python introduces a groundbreaking change aimed at enhancing multi-flow and parallelism in program implementation. In a major development, the main branch of Python has implemented code that shows great promise in this regard.
The newly added code allows for the disconnection of the Global Interpreter Lock (GIL), a crucial component in CPYTHON, the standard version of Python. The GIL has long been seen as a hindrance to effective multi-flow code execution, as it prevented multiple flows from executing instructions simultaneously.
This limitation was particularly problematic in tasks that are computationally intensive and in the field of artificial intelligence, where the demand for multi-threading is high. DeepMind, for example, highlighted the desire to use up to 100 threads per process in many applications but was constrained by the GIL.
The proposed changes in PEP 703 (Python Enhancement Proposal) make the GIL optional in CPYTHON and have been endorsed by leading authorities for implementation in version 3.13. It is emphasized that the changes will be introduced gradually with a rollback option in case of significant issues.
It is expected that disabling the GIL may lead to errors in existing code, as seen during thorough testing with the GIL turned off. Efforts are underway to support extensions that require the GIL, offering developers new opportunities without compromising performance significantly.
This innovation holds great promise as the GIL’s removal can greatly enhance AI model work efficiency and improve the multi-flow nature of the code. The release of Python 3.13 is scheduled for October 1, 2024.