Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench_runner/scripts/run_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 4 additions & 0 deletions bench_runner/scripts/should_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 6 additions & 18 deletions bench_runner/templates/_benchmark.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand All @@ -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
Expand Down Expand Up @@ -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' }}
Expand All @@ -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' }}
Expand Down Expand Up @@ -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' }}
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bench_runner/templates/_pystats.src.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down