Skip to content

fix(open-llm): disable broken open-llm scrapper #9

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

Merged
merged 1 commit into from
Dec 13, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_cpu_onnxruntime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Benchmark CPU Onnxruntime
on:
workflow_dispatch:
schedule:
- cron: "0 12 * * *"
- cron: "0 12 * * 3"
pull_request:

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_cuda_pytorch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Benchmark CUDA PyTorch
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * *"
- cron: "0 3 * * 0"
pull_request:

concurrency:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,5 @@ wip/
*.csv
optimum-benchmark/

*.egg-info/
*.egg-info/
data/
28 changes: 17 additions & 11 deletions llm_perf/update_llm_perf_leaderboard.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
from glob import glob
import os

import pandas as pd
from huggingface_hub import create_repo, snapshot_download, upload_file, repo_exists
Expand All @@ -15,8 +16,12 @@
MAIN_REPO_ID = "optimum-benchmark/llm-perf-leaderboard"
PERF_REPO_ID = "optimum-benchmark/llm-perf-{backend}-{hardware}-{subset}-{machine}"

PERF_DF = "perf-df-{backend}-{hardware}-{subset}-{machine}.csv"
LLM_DF = "llm-df.csv"
DATA_DIR = "data"
PERF_DF = os.path.join(DATA_DIR, "perf-df-{backend}-{hardware}-{subset}-{machine}.csv")
LLM_DF = os.path.join(DATA_DIR, "llm-df.csv")

# Create data directory if it doesn't exist
os.makedirs(DATA_DIR, exist_ok=True)


def patch_json(file):
Expand Down Expand Up @@ -104,6 +109,7 @@ def update_perf_dfs():
"""
Update the performance dataframes for all machines
"""

hardware_configs = load_hardware_configs("llm_perf/hardware.yaml")

for hardware_config in hardware_configs:
Expand All @@ -130,18 +136,18 @@ def update_perf_dfs():
print(f"Dataset exists: {url} but could not be processed")


scrapping_script = """
git clone https://github.com/Weyaxi/scrape-open-llm-leaderboard.git
pip install -r scrape-open-llm-leaderboard/requirements.txt -q
python scrape-open-llm-leaderboard/main.py
rm -rf scrape-open-llm-leaderboard
"""


def update_llm_df():
"""
Scrape the open-llm-leaderboard and update the leaderboard dataframe
"""

scrapping_script = """
git clone https://github.com/Weyaxi/scrape-open-llm-leaderboard.git
pip install -r scrape-open-llm-leaderboard/requirements.txt -q
python scrape-open-llm-leaderboard/main.py
rm -rf scrape-open-llm-leaderboard
"""

subprocess.run(scrapping_script, shell=True)
create_repo(repo_id=MAIN_REPO_ID, repo_type=REPO_TYPE, exist_ok=True, private=False)
upload_file(
Expand All @@ -153,7 +159,7 @@ def update_llm_df():


def update_llm_perf_leaderboard():
update_llm_df()
# update_llm_df() # TO FIX: open-llm scraper is broken otherwise use https://huggingface.co/datasets/open-llm-leaderboard/contents directly
update_perf_dfs()


Expand Down
Loading