-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set enable-experimental-jit=yes-off
on Python 3.13 / Linux
#538
Conversation
x86_64-apple-darwin / 3.14 / freethreaded+pgo+lto
|
aarch64-apple-darwin / 3.13 / freethreaded+pgo+lto
|
Looks like 3.13 fails missing Clang 18 and 3.14 fails due to use of undeclared label. |
Thanks! To clarify, these are free-threading + JIT? |
I assume you can't use Clang 18 to build it on 3.13? As a quick hack, replacing |
All the failures I linked happened to be the free-threaded builds, but you can see non-freethreaded failures too. I started copying failures then realized all of the relevant builds had failed.
I think it'd be a pain to have a separate toolchain for it, yeah.
I'll try that. Thanks! |
That got us to a new failure on macOS, e.g., aarch64-apple-darwin / 3.13 / pgo+lto
|
But hey the 3.13 Linux jobs pass now! |
I'd like to merge this so I'm going to turn the jit off on 3.14 and macOS — we can revisit those later. |
Weird. Are you using Apple Clang, or a separate LLVM install? It should be the latter. The JIT files are compiled separately from the main build system. If you're modifying search paths in any way, you might have to add similar compiler options here: https://github.com/python/cpython/blob/fda056e64bdfcac3dd3d13eebda0a24994d83cb8/Tools/jit/_targets.py#L108-L144 Or, if they're target-specific, you can add them to the |
For the missing label, what tags are you building here (and what configure options)? Want to see if I can reproduce. |
Oh, it looks like you're also building the tail-calling interpreter too? That's likely the problem. You'll want to patch in https://github.com/python/cpython/pull/129820/files#diff-45baf725df91ed7826458cda8a17c2b4a2e5296504de1ed6a1c5a9ebe6390a47, where that was fixed. The JIT and tail-calling didn't work together before that. |
(But thanks for stress-testing us with your bleeding-edge free-threaded tail-calling JIT builds, haha.) |
Thanks for following up! I'll see if python/cpython#129820 fixes the 3.14 builds — I believe that addresses your missing label question.
Separate. python-build-standalone/pythonbuild/downloads.py Lines 194 to 206 in 1ab3596
That's helpful! I'll look into the search paths and report back. |
enable-experimental-jit=yes-off
on Python 3.13+enable-experimental-jit=yes-off
on Python 3.13 / Linux
Tested on Linux
|
Mind sharing |
@brandtbucher yeah np, just took this from the report asking for the feature as a quick test #535 import time
import sys
def short_calcul(n):
result = 0
for i in range(1, n+1):
result += i
return result
def long_calcul(num):
result = 0
for i in range(num):
result += short_calcul(i) - short_calcul(i)
return result
number = 1000
time_total = 8
for _ in range(10):
long_calcul(number)
n_test = 10
assert short_calcul(n_test) == n_test * (n_test + 1) // 2
assert long_calcul(number) == 0
t_start = time.perf_counter()
long_calcul(number)
t_1_long_calcul = time.perf_counter() - t_start
number_long_calcul = int(time_total / t_1_long_calcul)
t_start = time.perf_counter()
for _ in range(number_long_calcul):
long_calcul(number)
t_tot = time.perf_counter() - t_start
print(sys.version)
print(f"Number of long_calcul per second: {number_long_calcul/t_tot:.2f}") Nothing special about it otherwise. |
Thanks for this feature! I noticed that this isn't available on arm64 linux. Are there any plans on building with this enabled on that platform? |
See #535
This builds the JIT, but disables it by default. Users can opt-in to enable it at runtime.
3.14 and macOS support will follow, there are some hiccups there.