Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 24 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
OUTPUT_FILENAME: benchmark.csv
GENERATED_CSV: benchmark/data/all_benchmark_data.csv


steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -52,9 +51,15 @@ jobs:
pip install modal
pip install pandas

# - name: Run benchmarks on GPU
# run: |
# modal run dev.modal.benchmarks
# Delete previous benchmark results.
- name: Remove previous benchmark data
run: |
rm -f benchmark/data/all_benchmark_data.csv


- name: Run benchmarks on GPU
run: |
modal run dev.modal.benchmarks

# Step 5: Checkout gh-pages branch in a subfolderAdd commentMore actions
- name: Checkout gh-pages
Expand All @@ -69,6 +74,21 @@ jobs:
mkdir -p gh-pages/${OUTPUT_DIR}/${{ steps.get_hash.outputs.hash }}
cp ${GENERATED_CSV} gh-pages/${OUTPUT_DIR}/${{ steps.get_hash.outputs.hash }}/${OUTPUT_FILENAME}

# Step 7: Append commit hash to commits.txt if not already present
- name: Update commits.txt
run: |
cd gh-pages
echo "commits.txt file path: ${OUTPUT_DIR}/commits.txt"

# Create file if it doesn't exist
mkdir -p ${OUTPUT_DIR}
touch ${OUTPUT_DIR}/commits.txt

# Append only if not already present
if ! grep -q "${{ steps.get_hash.outputs.hash }}" ${OUTPUT_DIR}/commits.txt; then
echo "${{ steps.get_hash.outputs.hash }}" >> ${OUTPUT_DIR}/commits.txt
fi

# Step 7: Commit and push
- name: Commit and push to gh-pages
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ on:
push:
branches:
- main

env:
ENABLE_DEPLOY: false

permissions:
contents: write
jobs:
deploy:
if: env.ENABLE_DEPLOY == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion dev/modal/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
repo = image.add_local_dir(ROOT_PATH, remote_path=REMOTE_ROOT_PATH)


@app.function(gpu="A10G", image=repo, timeout=60 * 45)
@app.function(gpu="H100", image=repo, timeout=60 * 45)
def liger_benchmarks():
import subprocess

Expand All @@ -25,3 +25,4 @@ def liger_benchmarks():
cwd=REMOTE_ROOT_PATH,
)
subprocess.run(["python benchmark/scripts/benchmark_kto_loss.py"], check=True, shell=True, cwd=REMOTE_ROOT_PATH)
subprocess.run(["python benchmark/scripts/benchmark_cpo_loss.py"], check=True, shell=True, cwd=REMOTE_ROOT_PATH)