Skip to content

Commit 73e07ba

Browse files
committed
update
1 parent f1ee631 commit 73e07ba

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

.github/workflows/benchmark.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,26 +49,26 @@ jobs:
4949
HF_TOKEN: ${{ secrets.DIFFUSERS_HF_HUB_READ_TOKEN }}
5050
run: |
5151
cd benchmarks && python run_all.py
52-
mkdir $BASE_PATH && mv *.csv $BASE_PATH
5352
5453
- name: Push results to the Hub
5554
env:
5655
HF_TOKEN: ${{ secrets.DIFFUSERS_BOT_TOKEN }}
57-
run:
58-
cd benchmarks && cp $BASE_PATH/collated_results.csv . && python push_results.py
56+
run: |
57+
cd benchmarks && python push_results.py
58+
mkdir $BASE_PATH && cp *.csv $BASE_PATH
5959
6060
- name: Test suite reports artifacts
6161
if: ${{ always() }}
6262
uses: actions/upload-artifact@v4
6363
with:
6464
name: benchmark_test_reports
65-
path: benchmarks/benchmark_outputs
65+
path: benchmarks/$BASE_PATH
6666

6767
# TODO: enable this once the connection problem has been resolved.
6868
# - name: Update benchmarking results to DB
6969
# env:
7070
# PGDATABASE: metrics
71-
# PGHOST: ${{ secrets.DIFFUSERS_BENCHMARKS_PGHOST }} # TODO
71+
# PGHOST: ${{ secrets.DIFFUSERS_BENCHMARKS_PGHOST }}
7272
# PGUSER: transformers_benchmarks
7373
# PGPASSWORD: ${{ secrets.DIFFUSERS_BENCHMARKS_PGPASSWORD }}
7474
# run: cd benchmarks && python populate_into_db.py

benchmarks/benchmarking_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import gc
22
import inspect
3-
import logging as std_logging
3+
import logging
44
import os
55
import queue
66
import threading
@@ -13,12 +13,11 @@
1313
import torch.utils.benchmark as benchmark
1414

1515
from diffusers.models.modeling_utils import ModelMixin
16-
from diffusers.utils import logging
1716
from diffusers.utils.testing_utils import require_torch_gpu, torch_device
1817

1918

20-
std_logging.basicConfig(level=std_logging.INFO, format="%(asctime)s %(levelname)s %(name)s: %(message)s")
21-
logger = logging.get_logger(__name__)
19+
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s: %(message)s")
20+
logger = logging.getLogger(__name__)
2221

2322

2423
def benchmark_fn(f, *args, **kwargs):

benchmarks/populate_into_db.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import psycopg2.extras
88

99

10-
# FINAL_CSV_FILENAME = "benchmark_outputs/collated_results.csv"
10+
FINAL_CSV_FILENAME = "collated_results.csv"
1111
# https://github.com/huggingface/transformers/blob/593e29c5e2a9b17baec010e8dc7c1431fed6e841/benchmark/init_db.sql#L27
1212
TABLE_NAME = "model_measurements"
1313

@@ -24,8 +24,7 @@
2424
raise
2525
cur = conn.cursor()
2626

27-
# df = pd.read_csv(FINAL_CSV_FILENAME)
28-
df = pd.read_csv("collated_results.csv")
27+
df = pd.read_csv(FINAL_CSV_FILENAME)
2928

3029
# Helper to cast values (or None) given a dtype
3130
def _cast_value(val, dtype: str):

benchmarks/run_all.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import glob
2-
import logging as std_logging
2+
import logging
33
import os
44
import subprocess
55

66
import pandas as pd
77

8-
from diffusers.utils import logging
98

10-
11-
std_logging.basicConfig(level=std_logging.INFO, format="%(asctime)s %(levelname)s %(name)s: %(message)s")
12-
logger = logging.get_logger(__name__)
9+
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s: %(message)s")
10+
logger = logging.getLogger(__name__)
1311

1412
PATTERN = "benchmarking_*.py"
1513
FINAL_CSV_FILENAME = "collated_results.py"

0 commit comments

Comments
 (0)