Skip to content

Commit

Permalink
collect and combine results csvs
Browse files Browse the repository at this point in the history
  • Loading branch information
yourbuddyconner committed Sep 19, 2024
1 parent 36f0245 commit 2ec6caf
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/adhoc-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,53 @@ jobs:
await new Promise(resolve => setTimeout(resolve, checkInterval));
}
- name: Download benchmark results
uses: actions/download-artifact@v3
with:
name: benchmark-results-${{ matrix.instance_type }}-${{ env.TRIGGERED_RUN_ID }}
path: ./benchmark-results-${{ matrix.instance_type }}

- name: Process benchmark results
run: |
echo "Results for ${{ matrix.instance_type }}:"
cat ./benchmark-results-${{ matrix.instance_type }}/*.csv
- name: Stop EC2 runner
if: always()
uses: xJonathanLEI/ec2-github-runner@main
with:
mode: stop
github-token: ${{ secrets.GH_PAT }}
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}

combine-results:
needs: run-benchmarks
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3

- name: Combine CSV files
run: |
echo "Combining CSV files:"
# Get the header from the first CSV file
head -n 1 $(ls benchmark-results-*/*.csv | head -n 1) > combined_results.csv
# Append data from all CSV files, skipping the header
for file in benchmark-results-*/*.csv; do
tail -n +2 "$file" >> combined_results.csv
done
cat combined_results.csv
- name: Upload combined results
uses: actions/upload-artifact@v2
with:
name: combined-benchmark-results
path: combined_results.csv

- name: Create summary
run: |
echo "## Benchmark Results Summary" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
cat combined_results.csv >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
13 changes: 12 additions & 1 deletion .github/workflows/run-on-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,16 @@ jobs:
run: |
docker build -t zkvm-perf --platform linux/amd64 -f Dockerfile.gpu .
- name: Make benchmarks directory
run: mkdir -p benchmarks

- name: Run benchmark
run: |
docker run ${{ inputs.enable_gpu == 'true' && '--gpus all' || '' }} --platform linux/amd64 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${{ github.workspace }}/benchmarks:/usr/src/app/benchmarks \
-e RUST_BACKTRACE=full \
-e INSTANCE_TYPE=${{ inputs.instance_type }} \
--network host \
zkvm-perf \
python3 sweep.py \
Expand All @@ -82,10 +86,17 @@ jobs:
--hashfns ${{ fromJson(env.ADDITIONAL_PARAMS).hashfns }} \
--shard-sizes ${{ fromJson(env.ADDITIONAL_PARAMS).shard_sizes }}
- name: Add instance type to CSV
run: |
for file in ${{ github.workspace }}/benchmarks/*.csv; do
sed -i '1s/^/instance_type,/' "$file"
sed -i "2,\$s/^/${{ inputs.instance_type }},/" "$file"
done
- name: Upload benchmark results
uses: actions/upload-artifact@v3
with:
name: benchmark-results-${{ inputs.instance_type }}
name: benchmark-results-${{ inputs.instance_type }}-${{ github.run_id }}
path: ${{ github.workspace }}/benchmarks/*.csv

- name: Print Results
Expand Down

0 comments on commit 2ec6caf

Please sign in to comment.