From 4c86955a41f8d49d6c3719b61a0607aae7c866f8 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 27 Jun 2025 13:06:09 -0400 Subject: [PATCH 1/4] Add support for JIT binaries --- backend/scripts/populate_binaries.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/scripts/populate_binaries.py b/backend/scripts/populate_binaries.py index 4011053..facb239 100644 --- a/backend/scripts/populate_binaries.py +++ b/backend/scripts/populate_binaries.py @@ -110,6 +110,15 @@ def get_standard_binaries(): "icon": "search", "display_order": 7, }, + { + "id": "jit", + "name": "JIT Build", + "flags": ["--enable-experimental-jit=yes"], + "description": "Just-In-Time compilation enabled.", + "color": "#fc03df", + "icon": "zap", + "display_order": 8, + }, ] From 121e1f6832cfd14f9d659fdeee90975b5e04d7c0 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 27 Jun 2025 13:40:58 -0400 Subject: [PATCH 2/4] Update backend/scripts/populate_binaries.py Co-authored-by: Brandt Bucher --- backend/scripts/populate_binaries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/scripts/populate_binaries.py b/backend/scripts/populate_binaries.py index facb239..6ed7bb5 100644 --- a/backend/scripts/populate_binaries.py +++ b/backend/scripts/populate_binaries.py @@ -113,7 +113,7 @@ def get_standard_binaries(): { "id": "jit", "name": "JIT Build", - "flags": ["--enable-experimental-jit=yes"], + "flags": ["--enable-experimental-jit"], "description": "Just-In-Time compilation enabled.", "color": "#fc03df", "icon": "zap", From 598302b7b4dfaecc2f0945b8c2d335128c3da6fa Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 27 Jun 2025 13:46:45 -0400 Subject: [PATCH 3/4] Add LLVM to the environment --- .github/workflows/benchmark.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index f412573..f4a44a4 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -31,6 +31,10 @@ on: description: 'Make flags for CPython build' required: false default: '-j' + llvm: + description: 'LLVM version to use' + required: false + default: '19' jobs: benchmark: @@ -61,8 +65,11 @@ jobs: # Install CPython dependencies using their script cd cpython sudo .github/workflows/posix-deps-apt.sh - - # Install Memray dependencies + + # Install JIT dependencies + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ inputs.llvm }} + + # Install Memray dependencies sudo apt-get install -y \ python3-dev \ libdebuginfod-dev \ @@ -73,6 +80,8 @@ jobs: env: MEMORY_TRACKER_TOKEN: ${{ secrets.MEMORY_TRACKER_TOKEN }} run: | + export PATH="$(llvm-config-${{ inputs.llvm }} --bindir):$PATH" + # Build command with conditional flags CMD="memory-tracker benchmark '${{ github.event.inputs.commit_range }}'" CMD="$CMD --repo-path ./cpython" From 232158f071a224924c08e676529f302338681340 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Fri, 27 Jun 2025 14:06:46 -0400 Subject: [PATCH 4/4] Only install LLVM for JIT builds --- .github/workflows/benchmark.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index f4a44a4..0664116 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -67,7 +67,9 @@ jobs: sudo .github/workflows/posix-deps-apt.sh # Install JIT dependencies - sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ inputs.llvm }} + if [ "${{ inputs.binary_id }}" = "jit" ]; then + sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ inputs.llvm }} + fi # Install Memray dependencies sudo apt-get install -y \ @@ -80,7 +82,9 @@ jobs: env: MEMORY_TRACKER_TOKEN: ${{ secrets.MEMORY_TRACKER_TOKEN }} run: | - export PATH="$(llvm-config-${{ inputs.llvm }} --bindir):$PATH" + if [ "${{ inputs.binary_id }}" = "jit" ]; then + export PATH="$(llvm-config-${{ inputs.llvm }} --bindir):$PATH" + fi # Build command with conditional flags CMD="memory-tracker benchmark '${{ github.event.inputs.commit_range }}'"