Skip to content

Commit 7198c26

Browse files
committed
Add JIT to daily runs and reschedule the upload
1 parent 71dd85d commit 7198c26

File tree

2 files changed

+48
-43
lines changed

2 files changed

+48
-43
lines changed

.claude/settings.local.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/daily-benchmark.yml

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@ name: Daily Memory Tracker Benchmark
22

33
on:
44
schedule:
5-
# Run daily at 02:00 UTC
6-
- cron: '0 2 * * *'
5+
# Run daily at 23:00 UTC (EOD) to pick up all commits from the day
6+
- cron: '0 23 * * *'
77
workflow_dispatch:
88
inputs:
99
target_date:
1010
description: 'Date to get commits from (YYYY-MM-DD, defaults to today)'
1111
required: false
1212
type: string
13-
binary_id:
14-
description: 'Binary ID to use for benchmarking'
15-
required: false
16-
default: 'default'
1713
environment_id:
1814
description: 'Environment ID'
1915
required: false
20-
default: 'gcc-11'
16+
default: 'gh_actions'
2117
server_url:
2218
description: 'Memory tracker server URL'
2319
required: false
@@ -26,6 +22,10 @@ on:
2622
description: 'CPython repository URL'
2723
required: false
2824
default: 'https://github.com/python/cpython.git'
25+
llvm:
26+
description: 'LLVM version to use for JIT builds'
27+
required: false
28+
default: '18'
2929

3030
jobs:
3131
get-daily-commits:
@@ -75,15 +75,30 @@ jobs:
7575
echo "$COMMITS"
7676
fi
7777
78-
benchmark-commits:
78+
benchmark-builds:
7979
needs: get-daily-commits
8080
if: needs.get-daily-commits.outputs.commit-count > 0
8181
runs-on: ubuntu-latest
8282
strategy:
8383
matrix:
84-
commit: ${{ fromJson(needs.get-daily-commits.outputs.commits) }}
84+
build_config:
85+
- binary_id: 'default'
86+
configure_flags: '-C'
87+
description: 'Default build'
88+
install_deps: 'standard'
89+
- binary_id: 'debug'
90+
configure_flags: '--with-pydebug'
91+
description: 'Debug build'
92+
install_deps: 'standard'
93+
- binary_id: 'jit'
94+
configure_flags: '--enable-experimental-jit'
95+
description: 'JIT build'
96+
install_deps: 'jit'
97+
- binary_id: 'nogil'
98+
configure_flags: '--disable-gil'
99+
description: 'Free-threaded build'
100+
install_deps: 'standard'
85101
fail-fast: false
86-
max-parallel: 3
87102

88103
steps:
89104
- name: Checkout memory tracker
@@ -110,6 +125,11 @@ jobs:
110125
# Install CPython dependencies using their script
111126
cd cpython
112127
sudo .github/workflows/posix-deps-apt.sh
128+
129+
# Install JIT dependencies if needed
130+
if [ "${{ matrix.build_config.install_deps }}" = "jit" ]; then
131+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ github.event.inputs.llvm || '18' }}
132+
fi
113133
114134
# Install Memray dependencies
115135
sudo apt-get install -y \
@@ -118,31 +138,37 @@ jobs:
118138
libunwind-dev \
119139
liblz4-dev
120140
121-
- name: Run memory benchmark for commit
141+
- name: Run memory benchmark for commit range - ${{ matrix.build_config.description }}
122142
env:
123143
MEMORY_TRACKER_TOKEN: ${{ secrets.MEMORY_TRACKER_TOKEN }}
124144
run: |
125-
COMMIT="${{ matrix.commit }}"
145+
if [ "${{ matrix.build_config.install_deps }}" = "jit" ]; then
146+
export PATH="$(llvm-config-${{ github.event.inputs.llvm || '18' }} --bindir):$PATH"
147+
fi
148+
149+
# Pass the entire commit range to the worker
150+
COMMITS="${{ needs.get-daily-commits.outputs.commits }}"
126151
127-
# Build command for single commit
128-
CMD="memory-tracker benchmark '$COMMIT'"
152+
# Build command for commit range
153+
CMD="memory-tracker benchmark-range '$COMMITS'"
129154
CMD="$CMD --repo-path ./cpython"
130-
CMD="$CMD --binary-id '${{ github.event.inputs.binary_id || 'default' }}'"
131-
CMD="$CMD --environment-id '${{ github.event.inputs.environment_id || 'gcc-11' }}'"
155+
CMD="$CMD --binary-id '${{ matrix.build_config.binary_id }}'"
156+
CMD="$CMD --environment-id '${{ github.event.inputs.environment_id || 'gh_actions' }}'"
132157
CMD="$CMD --api-base '${{ github.event.inputs.server_url || 'https://memory.python.org' }}'"
133158
CMD="$CMD --output-dir ./benchmark_results"
159+
CMD="$CMD --configure-flags='${{ matrix.build_config.configure_flags }}'"
134160
CMD="$CMD --force"
135161
CMD="$CMD -vv"
136162
137-
echo "Running benchmark for commit: $COMMIT"
163+
echo "Running ${{ matrix.build_config.description }} benchmark for commit range with ${{ needs.get-daily-commits.outputs.commit-count }} commits"
138164
echo "Command: $CMD"
139165
eval $CMD
140166
141167
- name: Upload benchmark results (if failed)
142168
if: failure()
143169
uses: actions/upload-artifact@v4
144170
with:
145-
name: benchmark-logs-${{ matrix.commit }}
171+
name: benchmark-logs-${{ matrix.build_config.binary_id }}
146172
path: |
147173
*.log
148174
./benchmark_results/
@@ -152,12 +178,12 @@ jobs:
152178
if: success()
153179
uses: actions/upload-artifact@v4
154180
with:
155-
name: benchmark-results-${{ matrix.commit }}
181+
name: benchmark-results-${{ matrix.build_config.binary_id }}
156182
path: ./benchmark_results/
157183
retention-days: 30
158184

159185
summary:
160-
needs: [get-daily-commits, benchmark-commits]
186+
needs: [get-daily-commits, benchmark-builds]
161187
if: always()
162188
runs-on: ubuntu-latest
163189

@@ -170,5 +196,6 @@ jobs:
170196
if [ "${{ needs.get-daily-commits.outputs.commit-count }}" = "0" ]; then
171197
echo "No commits found for the target date"
172198
else
173-
echo "Benchmark jobs completed with status: ${{ needs.benchmark-commits.result }}"
199+
echo "Benchmark jobs completed with status: ${{ needs.benchmark-builds.result }}"
200+
echo "Binary types benchmarked: default, debug, jit, nogil"
174201
fi

0 commit comments

Comments
 (0)