Skip to content

Update benchmark.yaml #27

Update benchmark.yaml

Update benchmark.yaml #27

Workflow file for this run

name: Benchmark and Publish
on:
push:
branches:
- stwo-backend
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
benchmark:
name: Run Benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Rust
uses: moonrepo/setup-rust@v0
with:
channel: stable
cache-target: release
- name: Clean Previous Benchmark Data
run: |
if [ -d ./target/criterion ]; then
rm -rf ./target/criterion
fi
- name: Cache Benchmark Data
uses: actions/cache@v3
id: cache-bench
with:
path: ./target/criterion
key: ${{ runner.os }}-bench-${{ github.sha }}
restore-keys: |
${{ runner.os }}-bench-
- name: Run Benchmarks
run: cargo bench --bench tensor_ops
- name: Prepare Benchmark Results
run: |
# Create a shorter path structure
mkdir -p processed_benchmarks
cp -r target/criterion/* processed_benchmarks/
# Rename long directories to shorter versions if needed
cd processed_benchmarks
if [ -d "TensorAdd_verification" ]; then
mv "TensorAdd_verification" "verify"
fi
if [ -d "TensorAdd_proving" ]; then
mv "TensorAdd_proving" "prove"
fi
if [ -d "TensorAdd_tracing" ]; then
mv "TensorAdd_tracing" "trace"
fi
- name: Process Benchmark Results
uses: joshua-auchincloss/criterion-pages@v1
with:
path: "./processed_benchmarks"
config: |
{
"title": "LuminAIR Benchmark, by Giza",
"header": "Performance Metrics on supported operators",
"description": "Performance benchmarks for tensor operators (stwo-backend support)"
"css": {
"footer": {
"display": "none"
}
}
}
- name: Setup GitHub Pages
uses: actions/configure-pages@v3
- name: Upload Benchmark Artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./processed_benchmarks"
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: benchmark
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy Benchmark Results
id: deployment
uses: actions/deploy-pages@v2