Skip to content

Commit 99a90f7

Browse files
Copy and paste benchmarks before and after gh-pages deployment (#909)
## Summary <!--- This is a required section; please describe the main purpose of this proposed code change. ---> Copy the benchmark data from gh-pages before every mkdocs deployment and paste it after the deployment. This helps in keeping the benchmark data after every mkdocs deployment. Fixes: #875 <!--- ## 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 9743e50 commit 99a90f7

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

.github/workflows/docs.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ permissions:
1111
contents: write
1212
jobs:
1313
deploy:
14-
if: False
1514
runs-on: ubuntu-latest
1615
steps:
1716
- uses: actions/checkout@v4
@@ -30,4 +29,36 @@ jobs:
3029
restore-keys: |
3130
mkdocs-material-
3231
- run: pip install mkdocs-material mkdocstrings[python]
33-
- run: mkdocs gh-deploy --force
32+
# ====== Backup the benchmarks from gh-pages ======
33+
# This is necessary because the benchmarks are not included in the documentation build process.
34+
# So we need to backup the benchmarks from gh-pages and restore them after the documentation is built.
35+
- name: Backup benchmarks from gh-pages
36+
run: |
37+
git fetch origin gh-pages
38+
# create worktree bound to local gh-pages, tracking origin/gh-pages
39+
git branch -f gh-pages origin/gh-pages || true
40+
mkdir -p ghp && git worktree add ghp gh-pages || true
41+
if [ -d ghp/benchmarks ]; then
42+
tar -C ghp -czf /tmp/benchmarks.tgz benchmarks
43+
fi
44+
# IMPORTANT: remove worktree so gh-pages isn't checked out anywhere
45+
git worktree remove ghp --force || true
46+
echo "Backed up benchmarks from gh-pages"
47+
# ====== Deploy the documentation ======
48+
- name: Deploy documentation
49+
run: mkdocs gh-deploy --force
50+
# ====== Restore the benchmarks onto gh-pages ======
51+
# This is necessary because the benchmarks are not included in the documentation build process.
52+
# So we need to restore the benchmarks onto gh-pages after the documentation is built.
53+
- name: Restore benchmarks onto gh-pages
54+
run: |
55+
# Refresh remote tracking and recreate a clean worktree
56+
git fetch origin gh-pages
57+
git worktree add -B gh-pages ghp origin/gh-pages
58+
if [ -f /tmp/benchmarks.tgz ]; then
59+
tar -C ghp -xzf /tmp/benchmarks.tgz
60+
git -C ghp add -A
61+
git -C ghp commit -m "Restore benchmarks after gh-deploy" || echo "No changes"
62+
git -C ghp push origin gh-pages
63+
fi
64+
git worktree remove ghp --force || true

docs/acknowledgement.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
We referenced or used the following projects:
1010

1111

12-
1312
| # | Project | Description | Location | License |
1413
|---|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
1514
| 1 | [Unsloth](https://github.com/unslothai/unsloth/blob/fd753fed99ed5f10ef8a9b7139588d9de9ddecfb/unsloth/kernels/utils.py#L43) | `calculate_settings` to determine block size and warp; We reuse it for Norm and MLP | [Liger Kernel Utils](https://github.com/linkedin/Liger-Kernel/blob/e249eee723978bf8610ff1ea2297d048a2417e20/src/liger_kernel/ops/utils.py#L23) | [Apache](https://github.com/unslothai/unsloth/blob/fd753fed99ed5f10ef8a9b7139588d9de9ddecfb/LICENSE) |

0 commit comments

Comments
 (0)