Skip to content

Commit

Permalink
Codspeed setup
Browse files Browse the repository at this point in the history
  • Loading branch information
haoshan98 committed Dec 18, 2023
1 parent 24fc0b2 commit 3172445
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: codspeed-benchmarks

on:
# Run on pushes to the main branch
push:
branches:
- "master" # or "main"
# Run on pull requests
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# ...
# Setup your environment here:
# - Configure your Python/Rust/Node version
# - Install your dependencies
# - Build your benchmarks (if using a compiled language)
# ...
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
miniconda-version: latest

- name: Create Conda environment
run: conda env create -n bchmark

- name: Activate Conda environment
run: conda activate bchmark

- name: Install project dependencies
run: pip install -e . && pip install pytest

- name: Run benchmarks
uses: CodSpeedHQ/action@v2
with:
token: ${{ secrets.codspeed_token }}
run: "pytest tests/kernels/test_layernorm.py"
1 change: 1 addition & 0 deletions tests/kernels/test_layernorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SEEDS = [0]


@pytest.mark.benchmark
@pytest.mark.parametrize("num_tokens", NUM_TOKENS)
@pytest.mark.parametrize("hidden_size", HIDDEN_SIZES)
@pytest.mark.parametrize("add_residual", ADD_RESIDUAL)
Expand Down

0 comments on commit 3172445

Please sign in to comment.