Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run rust benchmark and generate report #2964

Merged
merged 12 commits into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/rust-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Rust Benchmark

on:
workflow_dispatch:
schedule:
- cron: "0 9 * * *" # 9AM UTC = 2AM PST
pull_request:
paths:
- ".github/workflows/rust-benchmark.yml"

permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

env:
# This env var is used by Swatinem/rust-cache@v2 for the cache
# key, so we set it to make sure it is always consistent.
CARGO_TERM_COLOR: always
# Disable full debug symbol generation to speed up CI build and keep memory down
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1 -C target-cpu=native"
RUST_BACKTRACE: "1"
# according to: https://matklad.github.io/2021/09/04/fast-rust-builds.html
# CI builds are faster with incremental disabled.
CARGO_INCREMENTAL: "0"
CARGO_BUILD_JOBS: "4"

jobs:
Benchmark:
runs-on: [self-hosted, linux, x64]
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run linalg benchmarks
working-directory: ./rust/lance-linalg
run: |
# TODO: a few benchmarks are failing. Re-enable everything once they are fixed.
cargo bench --features "fp16kernels" --bench l2 --bench cosine --bench dot --bench kmeans --bench norm_l2 -- --output-format bencher | tee -a ../../output.txt
- name: Run index benchmarks
working-directory: ./rust/lance-index
run: |
# TODO: a few benchmarks are failing. Re-enable everything once they are fixed.
cargo bench --bench sq --bench hnsw --bench inverted --bench pq_dist_table --bench pq_assignment -- --output-format bencher | tee -a ../../output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Lance Rust Benchmarks
tool: "cargo"
output-file-path: output.txt
# Access token to deploy GitHub Pages branch
github-token: ${{ secrets.BENCHMARK_PUSH }}
# Push and deploy GitHub pages branch automatically
auto-push: true
gh-repository: "github.com/lancedb/lance-benchmark-results"