diff --git a/bench_runner/scripts/run_benchmarks.py b/bench_runner/scripts/run_benchmarks.py index 5d480ed5..1f15a98d 100644 --- a/bench_runner/scripts/run_benchmarks.py +++ b/bench_runner/scripts/run_benchmarks.py @@ -30,7 +30,7 @@ "GITHUB_REPOSITORY", "faster-cpython/bench_runner" ) # Environment variables that control the execution of CPython -ENV_VARS = ["PYTHON_UOPS"] +ENV_VARS = ["PYTHON_JIT"] class NoBenchmarkError(Exception): diff --git a/bench_runner/scripts/should_run.py b/bench_runner/scripts/should_run.py index bde3fd10..5a4dff16 100644 --- a/bench_runner/scripts/should_run.py +++ b/bench_runner/scripts/should_run.py @@ -30,6 +30,10 @@ def _main( ) sys.exit(1) + if tier2 and jit: + print("Tier 2 interpreter and JIT may not be selected at the same time") + sys.exit(1) + # Now that we've assert we are Python 3.11 or later, we can import # parts of our library. from bench_runner import git diff --git a/bench_runner/templates/_benchmark.src.yml b/bench_runner/templates/_benchmark.src.yml index 884ba52f..8436dd6f 100644 --- a/bench_runner/templates/_benchmark.src.yml +++ b/bench_runner/templates/_benchmark.src.yml @@ -104,7 +104,7 @@ jobs: if: ${{ always() }} id: should_run run: | - venv\Scripts\python.exe -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 }} ${{ inputs.jit }}>> $GITHUB_OUTPUT + venv\Scripts\python.exe -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 }} ${{ inputs.jit }} >> $GITHUB_OUTPUT - name: Checkout python-macrobenchmarks uses: actions/checkout@v4 if: ${{ steps.should_run.outputs.should_run != 'false' }} @@ -119,15 +119,11 @@ jobs: repository: python/pyperformance path: pyperformance ref: ${{ env.PYPERFORMANCE_HASH }} - - name: Enable Tier 2 - if: ${{ inputs.tier2 }} - run: | - echo "PYTHON_UOPS=1" >> $env:GITHUB_ENV - name: Build Python if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | cd cpython - PCbuild\build.bat ($env:BUILD_FLAGS -split ' ') ${{ inputs.pgo == true && '--pgo' || '' }} ${{ inputs.jit == true && '--experimental-jit' || '' }} -c Release + PCbuild\build.bat ($env:BUILD_FLAGS -split ' ') ${{ inputs.pgo == true && '--pgo' || '' }} ${{ inputs.jit == true && '--experimental-jit' || '' }} ${{ inputs.tier2 == true && '--experimental-interpreter' || '' }} -c Release # Copy the build products to a place that libraries can find them. Copy-Item -Path $env:BUILD_DEST -Destination "libs" -Recurse - name: Install pyperformance @@ -188,7 +184,7 @@ jobs: if: ${{ always() }} id: should_run run: | - venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 }} ${{ inputs.jit }}>> $GITHUB_OUTPUT + venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 }} ${{ inputs.jit }} >> $GITHUB_OUTPUT - name: Checkout python-macrobenchmarks uses: actions/checkout@v4 if: ${{ steps.should_run.outputs.should_run != 'false' }} @@ -203,15 +199,11 @@ jobs: repository: python/pyperformance path: pyperformance ref: ${{ env.PYPERFORMANCE_HASH }} - - name: Enable Tier 2 - if: ${{ inputs.tier2 }} - run: | - echo "PYTHON_UOPS=1" >> "$GITHUB_ENV" - name: Build Python if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | cd cpython - ./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=yes' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit' || '' }} + ./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=yes' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} make -j4 - name: Install pyperformance if: ${{ steps.should_run.outputs.should_run != 'false' }} @@ -281,7 +273,7 @@ jobs: if: ${{ always() }} id: should_run run: | - venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.force }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 }} ${{ inputs.jit }}>> $GITHUB_OUTPUT + venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.force }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 }} ${{ inputs.jit }} >> $GITHUB_OUTPUT - name: Checkout python-macrobenchmarks uses: actions/checkout@v4 if: ${{ steps.should_run.outputs.should_run != 'false' }} @@ -300,15 +292,11 @@ jobs: if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | echo "PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig" >> $GITHUB_ENV - - name: Enable Tier 2 - if: ${{ inputs.tier2 }} - run: | - echo "PYTHON_UOPS=1" >> "$GITHUB_ENV" - name: Build Python if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | cd cpython - ./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=yes' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit' || '' }} + ./configure ${{ inputs.pgo == true && '--enable-optimizations --with-lto=yes' || '' }} ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} make -j4 # On macos ARM64, actions/setup-python isn't available, so we rely on a # pre-installed homebrew one, used through a venv diff --git a/bench_runner/templates/_pystats.src.yml b/bench_runner/templates/_pystats.src.yml index dceae3b8..751bc647 100644 --- a/bench_runner/templates/_pystats.src.yml +++ b/bench_runner/templates/_pystats.src.yml @@ -109,7 +109,7 @@ jobs: if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | cd cpython - ./configure --enable-pystats --prefix=$PWD/install ${{ inputs.jit == true && '--enable-experimental-jit' || '' }} + ./configure --enable-pystats --prefix=$PWD/install ${{ inputs.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} make -j4 make install - name: Install pyperformance into the system python