2024-01-28 22:48:48 -04:00
|
|
|
name: JIT
|
|
|
|
on:
|
|
|
|
pull_request:
|
2024-01-31 15:51:18 -04:00
|
|
|
paths:
|
|
|
|
- '**jit**'
|
|
|
|
- 'Python/bytecodes.c'
|
2024-02-15 02:01:24 -04:00
|
|
|
- 'Python/optimizer*.c'
|
2024-05-19 09:59:12 -03:00
|
|
|
- '!Python/perf_jit_trampoline.c'
|
|
|
|
- '!**/*.md'
|
|
|
|
- '!**/*.ini'
|
2024-01-28 22:48:48 -04:00
|
|
|
push:
|
2024-01-31 15:51:18 -04:00
|
|
|
paths:
|
|
|
|
- '**jit**'
|
|
|
|
- 'Python/bytecodes.c'
|
2024-02-15 02:01:24 -04:00
|
|
|
- 'Python/optimizer*.c'
|
2024-05-19 09:59:12 -03:00
|
|
|
- '!Python/perf_jit_trampoline.c'
|
|
|
|
- '!**/*.md'
|
|
|
|
- '!**/*.ini'
|
2024-01-28 22:48:48 -04:00
|
|
|
workflow_dispatch:
|
2024-01-31 15:51:18 -04:00
|
|
|
|
2024-04-22 18:31:01 -03:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2024-01-31 15:51:18 -04:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2024-01-28 22:48:48 -04:00
|
|
|
jobs:
|
2024-05-24 00:13:41 -03:00
|
|
|
interpreter:
|
|
|
|
name: Interpreter (Debug)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 90
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build tier two interpreter
|
|
|
|
run: |
|
|
|
|
./configure --enable-experimental-jit=interpreter --with-pydebug
|
|
|
|
make all --jobs 4
|
|
|
|
- name: Test tier two interpreter
|
|
|
|
run: |
|
|
|
|
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
|
2024-01-28 22:48:48 -04:00
|
|
|
jit:
|
|
|
|
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
|
2024-05-24 00:13:41 -03:00
|
|
|
needs: interpreter
|
2024-01-28 22:48:48 -04:00
|
|
|
runs-on: ${{ matrix.runner }}
|
2024-05-06 20:21:39 -03:00
|
|
|
timeout-minutes: 90
|
2024-01-28 22:48:48 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- i686-pc-windows-msvc/msvc
|
|
|
|
- x86_64-pc-windows-msvc/msvc
|
2024-03-04 14:16:56 -04:00
|
|
|
- aarch64-pc-windows-msvc/msvc
|
2024-01-28 22:48:48 -04:00
|
|
|
- x86_64-apple-darwin/clang
|
2024-01-30 18:08:53 -04:00
|
|
|
- aarch64-apple-darwin/clang
|
2024-01-28 22:48:48 -04:00
|
|
|
- x86_64-unknown-linux-gnu/gcc
|
|
|
|
- x86_64-unknown-linux-gnu/clang
|
|
|
|
- aarch64-unknown-linux-gnu/gcc
|
|
|
|
- aarch64-unknown-linux-gnu/clang
|
|
|
|
debug:
|
|
|
|
- true
|
|
|
|
- false
|
|
|
|
llvm:
|
2024-04-29 18:09:16 -03:00
|
|
|
- 18
|
2024-01-28 22:48:48 -04:00
|
|
|
include:
|
|
|
|
- target: i686-pc-windows-msvc/msvc
|
|
|
|
architecture: Win32
|
|
|
|
runner: windows-latest
|
|
|
|
compiler: msvc
|
|
|
|
- target: x86_64-pc-windows-msvc/msvc
|
|
|
|
architecture: x64
|
|
|
|
runner: windows-latest
|
|
|
|
compiler: msvc
|
2024-03-04 14:16:56 -04:00
|
|
|
- target: aarch64-pc-windows-msvc/msvc
|
|
|
|
architecture: ARM64
|
|
|
|
runner: windows-latest
|
|
|
|
compiler: msvc
|
2024-01-28 22:48:48 -04:00
|
|
|
- target: x86_64-apple-darwin/clang
|
|
|
|
architecture: x86_64
|
2024-01-30 18:08:53 -04:00
|
|
|
runner: macos-13
|
|
|
|
compiler: clang
|
|
|
|
- target: aarch64-apple-darwin/clang
|
|
|
|
architecture: aarch64
|
|
|
|
runner: macos-14
|
2024-01-28 22:48:48 -04:00
|
|
|
compiler: clang
|
|
|
|
- target: x86_64-unknown-linux-gnu/gcc
|
|
|
|
architecture: x86_64
|
|
|
|
runner: ubuntu-latest
|
|
|
|
compiler: gcc
|
|
|
|
- target: x86_64-unknown-linux-gnu/clang
|
|
|
|
architecture: x86_64
|
|
|
|
runner: ubuntu-latest
|
|
|
|
compiler: clang
|
|
|
|
- target: aarch64-unknown-linux-gnu/gcc
|
|
|
|
architecture: aarch64
|
|
|
|
runner: ubuntu-latest
|
|
|
|
compiler: gcc
|
|
|
|
- target: aarch64-unknown-linux-gnu/clang
|
|
|
|
architecture: aarch64
|
|
|
|
runner: ubuntu-latest
|
|
|
|
compiler: clang
|
|
|
|
env:
|
|
|
|
CC: ${{ matrix.compiler }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: '3.11'
|
|
|
|
|
2024-03-04 14:16:56 -04:00
|
|
|
- name: Native Windows
|
|
|
|
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
|
2024-01-28 22:48:48 -04:00
|
|
|
run: |
|
2024-04-29 18:09:16 -03:00
|
|
|
choco upgrade llvm -y
|
2024-01-28 22:48:48 -04:00
|
|
|
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
|
|
|
|
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
|
2024-05-03 20:10:02 -03:00
|
|
|
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
|
2024-01-28 22:48:48 -04:00
|
|
|
|
2024-03-04 14:16:56 -04:00
|
|
|
# No PGO or tests (yet):
|
|
|
|
- name: Emulated Windows
|
|
|
|
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
|
|
|
|
run: |
|
2024-04-29 18:09:16 -03:00
|
|
|
choco upgrade llvm -y
|
2024-03-04 14:16:56 -04:00
|
|
|
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
|
|
|
|
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
|
|
|
|
|
|
|
|
- name: Native macOS
|
2024-01-28 22:48:48 -04:00
|
|
|
if: runner.os == 'macOS'
|
|
|
|
run: |
|
2024-04-29 18:09:16 -03:00
|
|
|
brew update
|
2024-01-28 22:48:48 -04:00
|
|
|
brew install llvm@${{ matrix.llvm }}
|
2024-03-18 06:49:45 -03:00
|
|
|
SDKROOT="$(xcrun --show-sdk-path)" \
|
|
|
|
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
|
2024-01-30 18:08:53 -04:00
|
|
|
make all --jobs 4
|
2024-05-03 16:07:10 -03:00
|
|
|
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
|
2024-01-28 22:48:48 -04:00
|
|
|
|
2024-04-29 18:09:16 -03:00
|
|
|
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
|
2024-01-28 22:48:48 -04:00
|
|
|
- name: Native Linux
|
|
|
|
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
|
|
|
|
run: |
|
|
|
|
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
|
|
|
|
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
|
2024-04-29 18:09:16 -03:00
|
|
|
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations' }}
|
2024-01-28 22:48:48 -04:00
|
|
|
make all --jobs 4
|
2024-05-03 16:07:10 -03:00
|
|
|
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
|
2024-01-30 18:08:53 -04:00
|
|
|
|
2024-04-29 18:09:16 -03:00
|
|
|
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
|
2024-01-28 22:48:48 -04:00
|
|
|
- name: Emulated Linux
|
|
|
|
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
|
2024-05-03 16:07:10 -03:00
|
|
|
# The --ignorefile on ./python -m test is used to exclude tests known to fail when running on an emulated Linux.
|
2024-01-28 22:48:48 -04:00
|
|
|
run: |
|
|
|
|
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
|
|
|
|
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
|
|
|
|
./configure --prefix="$(pwd)/../build"
|
|
|
|
make install --jobs 4
|
|
|
|
make clean --jobs 4
|
|
|
|
export HOST=${{ matrix.architecture }}-linux-gnu
|
|
|
|
sudo apt install --yes "gcc-$HOST" qemu-user
|
|
|
|
${{ !matrix.debug && matrix.compiler == 'clang' && './configure --enable-optimizations' || '' }}
|
|
|
|
${{ !matrix.debug && matrix.compiler == 'clang' && 'make profile-run-stamp --jobs 4' || '' }}
|
|
|
|
export QEMU_LD_PREFIX="/usr/$HOST"
|
2024-03-18 06:49:45 -03:00
|
|
|
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
|
|
|
|
CPP="$CC --preprocess" \
|
|
|
|
HOSTRUNNER=qemu-${{ matrix.architecture }} \
|
2024-04-29 18:09:16 -03:00
|
|
|
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations ' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
|
2024-01-28 22:48:48 -04:00
|
|
|
make all --jobs 4
|
2024-05-03 16:07:10 -03:00
|
|
|
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
|
2024-05-21 12:00:52 -03:00
|
|
|
|
|
|
|
jit-with-disabled-gil:
|
|
|
|
name: Free-Threaded (Debug)
|
2024-05-24 00:13:41 -03:00
|
|
|
needs: interpreter
|
2024-05-21 12:00:52 -03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: '3.11'
|
|
|
|
- name: Build with JIT enabled and GIL disabled
|
|
|
|
run: |
|
|
|
|
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 18
|
|
|
|
export PATH="$(llvm-config-18 --bindir):$PATH"
|
|
|
|
./configure --enable-experimental-jit --with-pydebug --disable-gil
|
|
|
|
make all --jobs 4
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
|