GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-124855: Fix jit perf (and lejit) by Fidget-Spinner · Pull Request #126166 · python/cpython

gh-124855: Fix jit perf (and lejit) #126166

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.

Sign up for GitHub

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

Closed
Fidget-Spinner wants to merge 8 commits into python:main from Fidget-Spinner:fix-jit-perf

Uh oh!

There was an error while loading. Please reload this page.

Closed

gh-124855: Fix jit perf (and lejit) #126166

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
8 commits
Select commit Hold shift + click to select a range
1f1b554
Fix failing tier 2 interpreter tests on main
Fidget-Spinner Oct 30, 2024
636975d
Update jit.yml
Fidget-Spinner Oct 30, 2024
e1cb96f
fix failing test
Fidget-Spinner Oct 30, 2024
8ed27a0
Fix tests
pablogsal Oct 30, 2024
f6e6745
fix
pablogsal Oct 30, 2024
c1a2ba4
fix
Fidget-Spinner Oct 30, 2024
491e161
woops
Fidget-Spinner Oct 30, 2024
329ad20
try fix for Windows?
Fidget-Spinner Oct 30, 2024
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

2 changes: 2 additions & 0 deletions 2 .github/workflows/jit.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- '**jit**'
- 'Python/bytecodes.c'
- 'Python/optimizer*.c'
- 'Python/pylifecycle.c'
- '!Python/perf_jit_trampoline.c'
- '!**/*.md'
- '!**/*.ini'
Expand All @@ -13,6 +14,7 @@ on:
- '**jit**'
- 'Python/bytecodes.c'
- 'Python/optimizer*.c'
- 'Python/pylifecycle.c'
- '!Python/perf_jit_trampoline.c'
- '!**/*.md'
- '!**/*.ini'
Expand Down
7 changes: 6 additions & 1 deletion 7 Lib/test/test_embed.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1780,8 +1780,13 @@ def test_initconfig_api(self):
'perf_profiling': 2,
}
config_dev_mode(preconfig, config)
is_using_jit = "_Py_JIT" in (sysconfig.get_config_var('PY_CORE_CFLAGS') or '')
if is_using_jit:
stderr = "<sys>:0: RuntimeWarning: JIT deactivated as perf profiling support is active"
else:
stderr = ""
self.check_all_configs("test_initconfig_api", config, preconfig,
api=API_ISOLATED)
api=API_ISOLATED, env={'PYTHON_JIT': '0'}, stderr=stderr)

def test_initconfig_get_api(self):
self.run_embedded_interpreter("test_initconfig_get_api")
Expand Down
6 changes: 3 additions & 3 deletions 6 Lib/test/test_perf_profiler.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ def test_sys_api_with_existing_trampoline(self):
sys.activate_stack_trampoline("perf")
sys.activate_stack_trampoline("perf")
"""
assert_python_ok("-c", code)
assert_python_ok("-c", code, PYTHON_JIT="0")

def test_sys_api_with_invalid_trampoline(self):
code = """if 1:
import sys
sys.activate_stack_trampoline("invalid")
"""
rc, out, err = assert_python_failure("-c", code)
rc, out, err = assert_python_failure("-c", code, PYTHON_JIT="0")
self.assertIn("invalid backend: invalid", err.decode())

def test_sys_api_get_status(self):
Expand All @@ -228,7 +228,7 @@ def test_sys_api_get_status(self):
sys.deactivate_stack_trampoline()
assert sys.is_stack_trampoline_active() is False
"""
assert_python_ok("-c", code)
assert_python_ok("-c", code, PYTHON_JIT="0")


def is_unwinding_reliable_with_frame_pointers():
Expand Down
5 changes: 4 additions & 1 deletion 5 Python/pylifecycle.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -1310,12 +1310,15 @@ init_interp_main(PyThreadState *tstate)
enabled = *env != '0';
}
if (enabled) {
#ifdef _Py_JIT
if (config->perf_profiling > 0) {
(void)PyErr_WarnEx(
PyExc_RuntimeWarning,
"JIT deactivated as perf profiling support is active",
0);
} else {
} else
#endif
{
PyObject *opt = _PyOptimizer_NewUOpOptimizer();
if (opt == NULL) {
return _PyStatus_ERR("can't initialize optimizer");
Expand Down
1 change: 1 addition & 0 deletions 1 Python/sysmodule.c
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2290,6 +2290,7 @@ sys_activate_stack_trampoline_impl(PyObject *module, const char *backend)
#ifdef _Py_JIT
_PyOptimizerObject* optimizer = _Py_GetOptimizer();
if (optimizer != NULL) {
Py_DECREF(optimizer);
PyErr_SetString(PyExc_ValueError, "Cannot activate the perf trampoline if the JIT is active");
return NULL;
}
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.