Skip to content

Replace condition with compute type #64

Replace condition with compute type

Replace condition with compute type #64

Workflow file for this run

name: Benchmarks
on:
push:
branches: ["main"]
paths-ignore:
- "README.md"
- "benches"
pull_request:
branches: ["main"]
paths-ignore:
- "README.md"
- "benches"
env:
CARGO_TERM_COLOR: always
jobs:
# benchmark-16CPU-32GB:
# runs-on: [self-hosted, 16CPU, 32GB]
# steps:
# - uses: actions/checkout@v2
# - name: Run Benchmarks on 16CPU-32GB
# uses: ./.github/actions/bench
# with:
# cpu-label: "16CPU"
# mem-label: "32GB"
# token: ${{ secrets.GITHUB_TOKEN }}
benchmark-cuda:
runs-on: [self-hosted, CUDA]
steps:
- uses: actions/checkout@v2
- name: Run CUDA Benchmarks
uses: ./.github/actions/bench
with:
cpu-label: "16CPU"
mem-label: "32GB"
compute-type: "CUDA"
token: ${{ secrets.GITHUB_TOKEN }}
benchmark-m1:
runs-on: [self-hosted, M1]
steps:
- uses: actions/checkout@v2
- name: Run Benchmarks on M1
uses: ./.github/actions/bench
with:
cpu-label: "10CPU"
compute-type: "Metal"
mem-label: "32GB"
token: ${{ secrets.GITHUB_TOKEN }}
benchmark-64CPU-128GB:
runs-on: [self-hosted, 64CPU, 128GB]
steps:
- uses: actions/checkout@v2
- name: Run Benchmarks on 64CPU-128GB
uses: ./.github/actions/bench
with:
cpu-label: "64CPU"
mem-label: "128GB"
token: ${{ secrets.GITHUB_TOKEN }}
commit-benchmarks:
needs: [benchmark-cuda, benchmark-m1, benchmark-64CPU-128GB]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: inference-labs-inc/chainBench
token: ${{ secrets.ORG_TOKEN }}
path: temp_repo
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Aggregate Benchmarks and Commit
run: |
# Start the JSON object
echo "{" > temp_repo/src/fixtures/benchmarks.json
# Initialize a variable to handle comma placement
first_entry=true
ls
find . | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"
for file in benchmarks/*.json; do
if [ -s "$file" ]; then # Check if file is not empty
filename=$(basename "$file" .json)
if [ "$first_entry" = true ]; then
first_entry=false
else
# Add a comma to separate entries if this isn't the first entry
echo "," >> temp_repo/src/fixtures/benchmarks.json
fi
# Append the file content as a JSON entry
echo "\"$filename\": $(cat $file)" >> temp_repo/src/fixtures/benchmarks.json
fi
done
# Close the JSON entries and add the meta entry
if [ "$first_entry" = false ]; then
echo "," >> temp_repo/src/fixtures/benchmarks.json # Add comma before meta if there were any entries
fi
echo "\"meta\": {\"lastUpdated\": \"$(date +"%Y-%m-%dT%H:%M:%S%z")\"}" >> temp_repo/src/fixtures/benchmarks.json
echo "}" >> temp_repo/src/fixtures/benchmarks.json # Close the JSON object
jq '.' temp_repo/src/fixtures/benchmarks.json
cd temp_repo
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git add src/fixtures/benchmarks.json
git commit -m "Update aggregated benchmarks with metadata"
git push
env:
GITHUB_TOKEN: ${{ secrets.ORG_TOKEN }}