Declared the Py_MOD_GIL_NOT_USED slot in Triton static extension build under free-threaded CPython 3.13t (PEP 703), eliminating GIL reactivation warnings and preserving multi-threaded GPU compilation throughput across CUDA and ROCm.
Role
Category
AI Infrastructure & Compilers
Engineering discipline
MERGED UPSTREAM

Patrick Ribbsaeter · Independent open-source contribution
Engineering objective
In CPython 3.13t free-threaded builds (PEP 703), extension modules compiled with nanobind without explicit GIL slot declarations trigger runtime GIL reactivation warnings, degrading GPU compilation throughput in multi-threaded workflows.
Constraints
Approach
Audited Triton nanobind static extension definitions in python/src/interpreter.cc and python/src/llvm.cc.
Explicitly declared the Py_MOD_GIL_NOT_USED slot in the module definition structure under Py_GIL_DISABLED.
Validated multi-threaded kernel compilation scaling without GIL re-acquisition penalties.
Verified zero compiler regressions across upstream test matrices.
Technical validation
Observable engineering evidence. Discipline: MERGED UPSTREAM
Merged PR
PR #12221 · Merged Upstream
CI Status
100% Checks Green
Runtime Target
Python 3.13t / PEP 703
Framework
Nanobind & C++20
Test Battery
CUDA & ROCm Matrix
Public evidence
Outcome
Eliminated GIL reactivation warnings on free-threaded Python 3.13t runs
Unblocked true multi-threaded GPU kernel compilation pipelines
Achieved 100% green CI on first submission to triton-lang/triton
Technologies
Explore Engineering Systems
Have an ambitious AI system to build?
I work across AI architecture, product engineering, private inference, automation, SaaS infrastructure, and production hardening.