Skip to content

Commit 7b689f7

Browse files
authored
Adding the benchmark results to gh-pages branch (#747)
## Summary <!--- This is a required section; please describe the main purpose of this proposed code change. ---> This is pr for adding the data generated from the benchmark scripts to the gh-pages branch. It adds in this fashion: latest_main_branch_commit_hash/benchmark.csv. <!--- ## Details This is an optional section; is there anything specific that reviewers should be aware of? ---> ## Testing Done <!--- This is a required section; please describe how this change was tested. ---> <!-- Replace BLANK with your device type. For example, A100-80G-PCIe Complete the following tasks before sending your PR, and replace `[ ]` with `[x]` to indicate you have done them. --> - Hardware Type: <BLANK> - [ ] run `make test` to ensure correctness - [ ] run `make checkstyle` to ensure code style - [ ] run `make test-convergence` to ensure convergence
1 parent a53675d commit 7b689f7

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

.github/workflows/benchmark.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- "src/**"
9+
- "test/**"
10+
- "benchmark/**"
711

812
concurrency:
913
# This causes it to cancel previous in-progress actions on the same PR / branch,
@@ -16,21 +20,59 @@ jobs:
1620
env:
1721
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
1822
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
23+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
24+
GITHUB_USERNAME: linkedin
25+
REPO_NAME: Liger-Kernel
26+
OUTPUT_DIR: benchmarks
27+
OUTPUT_FILENAME: benchmark.csv
28+
GENERATED_CSV: benchmark/data/all_benchmark_data.csv
1929

2030
steps:
2131
- name: Checkout code
2232
uses: actions/checkout@v3
2333

34+
# Get the latest commit hash from main branch
35+
- name: Get commit hash
36+
id: get_hash
37+
run: echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
38+
2439
- name: Set up Python
2540
uses: actions/setup-python@v3
2641
with:
2742
python-version: '3.10'
2843

44+
# Install dependencies
2945
- name: Install dependencies
3046
run: |
3147
python -m pip install --upgrade pip
3248
pip install modal
49+
pip install pandas
50+
51+
# - name: Run benchmarks on GPU
52+
# run: |
53+
# modal run dev.modal.benchmarks
54+
55+
# Step 5: Checkout gh-pages branch in a subfolderAdd commentMore actions
56+
- name: Checkout gh-pages
57+
uses: actions/checkout@v3
58+
with:
59+
ref: gh-pages
60+
path: gh-pages
61+
token: ${{ secrets.GH_TOKEN }}
62+
63+
# Step 6: Copy benchmark CSV to gh-pages directory
64+
- name: Copy generated benchmark to gh-pages
65+
run: |
66+
mkdir -p gh-pages/${OUTPUT_DIR}/${{ steps.get_hash.outputs.hash }}
67+
cp ${GENERATED_CSV} gh-pages/${OUTPUT_DIR}/${{ steps.get_hash.outputs.hash }}/${OUTPUT_FILENAME}
3368
34-
- name: Run benchmarks on GPU
69+
# Step 7: Commit and push
70+
- name: Commit and push to gh-pages
3571
run: |
36-
modal run dev.modal.benchmarks
72+
cd gh-pages
73+
git config user.name "GitHub Action Bot"
74+
git config user.email "[email protected]"
75+
git add .
76+
git commit -m "Add benchmark for commit ${{ steps.get_hash.outputs.hash }}" || echo "No changes to commit"
77+
git push origin gh-pages
78+

0 commit comments

Comments
 (0)