From e41e774e29ab3be800105e25e192598e4999d79e Mon Sep 17 00:00:00 2001 From: Matt Page Date: Fri, 10 Jan 2025 17:34:04 -0800 Subject: [PATCH] Update workflows Ran `python -m bench_runner install` per the instructions in https://github.com/facebookexperimental/free-threading-benchmarking/actions/runs/12719884309/job/35460764633?pr=15 --- .github/workflows/_benchmark.yml | 39 ++++++++++++++++++++++++-------- .github/workflows/_notify.yml | 10 ++++++-- .github/workflows/_pystats.yml | 15 +++++++++--- .github/workflows/benchmark.yml | 16 ++++++++++--- 4 files changed, 63 insertions(+), 17 deletions(-) diff --git a/.github/workflows/_benchmark.yml b/.github/workflows/_benchmark.yml index 535e6bfa..ef6aa801 100644 --- a/.github/workflows/_benchmark.yml +++ b/.github/workflows/_benchmark.yml @@ -41,6 +41,10 @@ on: description: free threading type: boolean default: false + clang: + description: build with latest clang + type: boolean + default: false workflow_dispatch: inputs: fork: @@ -62,9 +66,6 @@ on: benchmarks: description: Benchmarks to run (comma-separated; empty runs all benchmarks) type: string - pgo: - description: Build with PGO - type: boolean force: description: Rerun and replace results if commit already exists type: boolean @@ -84,6 +85,10 @@ on: description: free threading type: boolean default: false + clang: + description: build with latest clang + type: boolean + default: false jobs: benchmark-linux-x86_64-linux: runs-on: [self-hosted, linux, bare-metal, linux-x86_64-linux] @@ -122,7 +127,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 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} >> $GITHUB_OUTPUT + venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang == true && 'clang' || '' }} >> $GITHUB_OUTPUT - name: Checkout python-macrobenchmarks uses: actions/checkout@v4 if: ${{ steps.should_run.outputs.should_run != 'false' }} @@ -139,12 +144,19 @@ jobs: repository: mdboom/pyperformance path: pyperformance ref: ${{ env.PYPERFORMANCE_HASH }} + - name: Build with clang + if: ${{ inputs.clang }} + run: | + echo "CC=`which clang-19`" >> $GITHUB_ENV + echo "LLVM_AR=`which llvm-ar-19`" >> $GITHUB_ENV + echo "LLVM_PROFDATA=`which llvm-profdata-19`" >> $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.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} make ${{ runner.arch == 'ARM64' && '-j' || '-j4' }} + ./python -VV - name: Install pyperformance if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | @@ -161,7 +173,7 @@ jobs: if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | rm -rf ~/.debug/* - venv/bin/python -m bench_runner run_benchmarks ${{ inputs.perf && 'perf' || 'benchmark' }} cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} --run_id ${{ github.run_id }} + venv/bin/python -m bench_runner run_benchmarks ${{ inputs.perf && 'perf' || 'benchmark' }} cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang == true && 'clang' || '' }} --run_id ${{ github.run_id }} # Pull again, since another job may have committed results in the meantime - name: Pull benchmarking if: ${{ steps.should_run.outputs.should_run != 'false' && !inputs.perf }} @@ -195,7 +207,8 @@ jobs: if: ${{ (inputs.machine == 'linux-x86_64-linux' || inputs.machine == 'all') }} env: flags: ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && - 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} + 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang + == true && 'clang' || '' }} benchmark-linux-x86_64-vultr: runs-on: [self-hosted, linux, bare-metal, linux-x86_64-vultr] timeout-minutes: 1440 @@ -233,7 +246,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 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} >> $GITHUB_OUTPUT + venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.machine }} false ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang == true && 'clang' || '' }} >> $GITHUB_OUTPUT - name: Checkout python-macrobenchmarks uses: actions/checkout@v4 if: ${{ steps.should_run.outputs.should_run != 'false' }} @@ -250,12 +263,19 @@ jobs: repository: mdboom/pyperformance path: pyperformance ref: ${{ env.PYPERFORMANCE_HASH }} + - name: Build with clang + if: ${{ inputs.clang }} + run: | + echo "CC=`which clang-19`" >> $GITHUB_ENV + echo "LLVM_AR=`which llvm-ar-19`" >> $GITHUB_ENV + echo "LLVM_PROFDATA=`which llvm-profdata-19`" >> $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.tier2 == true && '--enable-experimental-jit=interpreter' || '' }} ${{ inputs.jit == true && '--enable-experimental-jit=yes' || '' }} ${{ inputs.nogil == true && '--disable-gil' || '' }} make ${{ runner.arch == 'ARM64' && '-j' || '-j4' }} + ./python -VV - name: Install pyperformance if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | @@ -272,7 +292,7 @@ jobs: if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | rm -rf ~/.debug/* - venv/bin/python -m bench_runner run_benchmarks ${{ inputs.perf && 'perf' || 'benchmark' }} cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} --run_id ${{ github.run_id }} + venv/bin/python -m bench_runner run_benchmarks ${{ inputs.perf && 'perf' || 'benchmark' }} cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang == true && 'clang' || '' }} --run_id ${{ github.run_id }} # Pull again, since another job may have committed results in the meantime - name: Pull benchmarking if: ${{ steps.should_run.outputs.should_run != 'false' && !inputs.perf }} @@ -306,4 +326,5 @@ jobs: if: ${{ (inputs.machine == 'linux-x86_64-vultr' || inputs.machine == 'all') }} env: flags: ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && - 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} + 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang + == true && 'clang' || '' }} diff --git a/.github/workflows/_notify.yml b/.github/workflows/_notify.yml index 8dc24273..a537d7cc 100644 --- a/.github/workflows/_notify.yml +++ b/.github/workflows/_notify.yml @@ -30,6 +30,10 @@ on: description: free threading type: boolean default: false + clang: + description: build with latest clang + type: boolean + default: false jobs: notify: runs-on: ubuntu-latest @@ -52,9 +56,11 @@ jobs: run: python -m bench_runner notify --fork ${{ inputs.fork }} --ref ${{ inputs.ref }} --head ${{ inputs.head }} --date ${{ inputs.date }} --version ${{ inputs.version }} --flags ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == - true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} + true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang + == true && 'clang' || '' }} env: GH_TOKEN: ${{ github.token }} env: flags: ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && - 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} + 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang + == true && 'clang' || '' }} diff --git a/.github/workflows/_pystats.yml b/.github/workflows/_pystats.yml index 015eb33e..85c76beb 100644 --- a/.github/workflows/_pystats.yml +++ b/.github/workflows/_pystats.yml @@ -37,6 +37,10 @@ on: description: free threading type: boolean default: false + clang: + description: build with latest clang + type: boolean + default: false workflow_call: inputs: fork: @@ -70,6 +74,10 @@ on: description: free threading type: boolean default: false + clang: + description: build with latest clang + type: boolean + default: false jobs: collect-stats: runs-on: [self-hosted, linux, cloud] @@ -100,7 +108,7 @@ jobs: if: ${{ always() }} id: should_run run: | - venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} all true ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} >> $GITHUB_OUTPUT + venv/bin/python -m bench_runner should_run ${{ inputs.force }} ${{ inputs.fork }} ${{ inputs.ref }} all true ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang == true && 'clang' || '' }} >> $GITHUB_OUTPUT - name: Checkout python-macrobenchmarks uses: actions/checkout@v4 if: ${{ steps.should_run.outputs.should_run != 'false' }} @@ -137,7 +145,7 @@ jobs: - name: Running pyperformance if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | - venv/bin/python -m bench_runner run_benchmarks pystats cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} --run_id ${{ github.run_id }} ${{ inputs.individual == true && '--individual' || '' }} + venv/bin/python -m bench_runner run_benchmarks pystats cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang == true && 'clang' || '' }} --run_id ${{ github.run_id }} ${{ inputs.individual == true && '--individual' || '' }} - name: Pull benchmarking if: ${{ steps.should_run.outputs.should_run != 'false' }} run: | @@ -153,4 +161,5 @@ jobs: add: results env: flags: ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && - 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} + 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang + == true && 'clang' || '' }} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c1b043df..8d424534 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -6,7 +6,7 @@ env: name: benchmark run-name: benchmarking ${{ inputs.fork }}/${{ inputs.ref }} ${{ inputs.tier2 == true && 'T2' || '' }} ${{ inputs.jit == true && 'JIT' || '' }} ${{ inputs.nogil == true - && 'NOGIL' || '' }} + && 'NOGIL' || '' }} ${{ inputs.clang == true && 'CLANG' || '' }} on: workflow_dispatch: inputs: @@ -48,6 +48,10 @@ on: description: free threading type: boolean default: false + clang: + description: build with latest clang + type: boolean + default: false jobs: # Determine the base commit of the selected commit. The output is passed to # the `base` job below. If the data already exists for this commit, it will be @@ -84,12 +88,13 @@ jobs: - name: Determine base id: base run: | - python -m bench_runner get_merge_base ${{ inputs.benchmark_base }} ${{ inputs.machine }} ${{ inputs.pystats }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} >> $GITHUB_OUTPUT + python -m bench_runner get_merge_base ${{ inputs.benchmark_base }} ${{ inputs.machine }} ${{ inputs.pystats }} ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang == true && 'clang' || '' }} >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT env: flags: ${{ inputs.tier2 == true && 'tier2' || '' }},${{ inputs.jit == true && - 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }} + 'jit' || '' }},${{ inputs.nogil == true && 'nogil' || '' }},${{ inputs.clang + == true && 'clang' || '' }} head: uses: ./.github/workflows/_benchmark.yml with: @@ -103,6 +108,7 @@ jobs: tier2: ${{ inputs.tier2 }} jit: ${{ inputs.jit }} nogil: ${{ inputs.nogil }} + clang: ${{ inputs.clang }} secrets: inherit base: @@ -120,6 +126,7 @@ jobs: tier2: ${{ inputs.tier2 }} jit: ${{ inputs.jit }} nogil: ${{ inputs.nogil }} + clang: ${{ inputs.clang }} secrets: inherit pystats-head: @@ -134,6 +141,7 @@ jobs: tier2: ${{ inputs.tier2 }} jit: ${{ inputs.jit }} nogil: ${{ inputs.nogil }} + clang: ${{ inputs.clang }} secrets: inherit pystats-base: @@ -150,6 +158,7 @@ jobs: tier2: ${{ inputs.tier2 }} jit: ${{ inputs.jit }} nogil: ${{ inputs.nogil }} + clang: ${{ inputs.clang }} secrets: inherit generate: @@ -175,4 +184,5 @@ jobs: tier2: ${{ inputs.tier2 }} jit: ${{ inputs.jit }} nogil: ${{ inputs.nogil }} + clang: ${{ inputs.clang }} secrets: inherit