Skip to content

Commit

Permalink
starting 3.12 compat, enable test_interpreter CI run for 3.12 (#767)
Browse files Browse the repository at this point in the history
t-vi authored Jul 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 6032e4c commit 6fe3b0c
Showing 4 changed files with 396 additions and 85 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ jobs:
requires: ["latest", "nightly"] # , 'oldest'
include:
- { os: "ubuntu-22.04", python-version: "3.11", requires: "latest" }
- { os: "ubuntu-22.04", python-version: "3.12", requires: "latest" }

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 35
@@ -104,7 +105,7 @@ jobs:
--durations=250
- name: Testing just a few
if: matrix.python-version == '3.11'
if: matrix.python-version == '3.11' || matrix.python-version == '3.12'
#continue-on-error: true
run: |
python -m pytest \
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ def _load_readme_description(path_dir: str, homepage: str, version: str) -> str:
include_package_data=True,
zip_safe=False,
keywords=["deep learning", "AI"],
python_requires=">=3.10, <3.12",
python_requires=">=3.10, <3.13",
setup_requires=["wheel"],
install_requires=_load_requirements(_PATH_REQUIRES, file_name="base.txt"),
extras_require=_prepare_extras(),
464 changes: 382 additions & 82 deletions thunder/core/interpreter.py

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion thunder/tests/test_interpreter.py
Original file line number Diff line number Diff line change
@@ -2119,7 +2119,13 @@ def test_list_to_tuple(jit):
def ltt():
return (*[1, 2, 3],)

assert any(i.opname == "LIST_TO_TUPLE" for i in dis.get_instructions(ltt))
if sys.version_info >= (3, 12):
assert any(
(i.opname == "CALL_INTRINSIC_1" and i.argrepr == "INTRINSIC_LIST_TO_TUPLE")
for i in dis.get_instructions(ltt)
)
else:
assert any(i.opname == "LIST_TO_TUPLE" for i in dis.get_instructions(ltt))
assert jit(ltt)() == ltt()


@@ -2744,6 +2750,10 @@ def foo(x):
jfn()


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="Python 3.12 code.InteractiveInterpreter().runsource does not use the displayhook as before",
)
def test_displayhook(jit):
from contextlib import redirect_stdout
import io

0 comments on commit 6fe3b0c

Please sign in to comment.