Skip to content

Miscellaneous fixes #2192

Miscellaneous fixes

Miscellaneous fixes #2192

# Copyright 2020-2024, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
name: Linux benchmarks / LLVM 17.0
permissions: read-all
on:
pull_request_target:
branches: ['main']
push:
branches:
- 'main'
- '**test_bench**'
workflow_dispatch:
env:
LLVM_VERSION: "17.0"
LLVM_REPO: https://github.com/ispc/ispc.dependencies
LLVM_TAR: llvm-17.0.6-ubuntu18.04-Release+Asserts-x86.arm.wasm.tar.xz
jobs:
linux-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
.github/workflows/scripts/install-build-deps.sh
- name: Check environment
env:
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}
run: |
[ -z "$CALCITE_TOKEN" ] && echo "CALCITE_TOKEN is empty" && exit 1 || echo "CALCITE_TOKEN is NOT empty"
which -a clang
cat /proc/cpuinfo
- name: Build package
run: |
echo PATH=$PATH
cmake -B build -DISPC_PREPARE_PACKAGE=ON -DISPC_INCLUDE_BENCHMARKS=ON -DBENCHMARK_ENABLE_INSTALL=ON -DISPC_PACKAGE_NAME=ispc-trunk-linux
cmake --build build --target package -j4
- name: Sanity testing (make check-all, make test)
run: |
cd build
bin/check_isa
bin/ispc --support-matrix
make check-all
make ispc_benchmarks && make test
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: ispc_llvm17_linux_bench
path: build/ispc-trunk-linux.tar.gz
benchmarks:
continue-on-error: true
runs-on: [self-hosted, linux, bench]
needs: linux-build
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: ispc_llvm17_linux_bench
- name: Install dependencies and unpack artifacts
run: |
tar xvf ispc-trunk-linux.tar.gz
echo "${GITHUB_WORKSPACE}/ispc-trunk-linux/bin" >> $GITHUB_PATH
echo "LLVM_HOME=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "ISPC_HOME=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- name: Check environment
run: cat /proc/cpuinfo
- name: Tune system for benchmarking
run: curl http://$StabilizerServer:7373/acquire
if: always()
- name: Running benchmarks
run: |
mkdir -p out
export LD_LIBRARY_PATH=../lib
for exec in $(find . -type f -perm -u+x); do $exec --benchmark_out=out/$(basename $exec).json $BENCH_SETTINGS ; done
working-directory: ispc-trunk-linux/benchmarks/
env:
BENCH_SETTINGS: '--benchmark_repetitions=10'
- name: Reset system performance
run: curl http://$StabilizerServer:7373/release
if: always()
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: ispc_llvm17_linux_bench_results
path: ispc-trunk-linux/benchmarks/out/*.json
- name: Clean self-hosted runner
run: rm -rf ${GITHUB_WORKSPACE:?}/* ${HOME:?}/*
if: always()
calcite:
continue-on-error: true
needs: benchmarks
runs-on: ubuntu-20.04
env:
CALCITE_CLI: '@siliceum/calcite-cli@0.7.2'
steps:
- uses: actions/checkout@v4
- name: Download benchmarks results
uses: actions/download-artifact@v4
with:
name: ispc_llvm17_linux_bench_results
- name: Upload bench datasets to calcite
working-directory: .calcite
run: |
npx ${{env.CALCITE_CLI}} upload calcite.config.js
env:
BENCH_OUTPUT_FILES: ${{github.workspace}}
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}
- name: Trigger calcite workflow (main)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && success()
working-directory: .calcite
run: npx ${{env.CALCITE_CLI}} trigger ${{github.event.before}} -tt push_main
env:
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}
# Unused for now, until we have tokenless / new token management (never triggered since using pull_request_target)
- name: Trigger calcite workflow (PR)
if: github.event_name == 'pull_request' && success()
working-directory: .calcite
run: npx ${{env.CALCITE_CLI}} trigger $(git cat-file -p HEAD | awk 'NR > 1 {if(/^parent/){print $2;}{exit}}') -tt pullrequest
env:
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}