Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pytorch/benchmark into add_mixtral
Browse files Browse the repository at this point in the history
  • Loading branch information
MaanavD committed Jan 9, 2024
2 parents 8711dd7 + ff42d90 commit 49a885c
Show file tree
Hide file tree
Showing 25 changed files with 763 additions and 223 deletions.
10 changes: 10 additions & 0 deletions .github/scripts/userbenchmark/schedule-benchmarks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
import sys
import os
import subprocess
from pathlib import Path

Expand All @@ -25,6 +26,15 @@ def __exit__(self, exc_type, exc_value, traceback):

def run_userbenchmark(ub_name, dryrun=True):
workdir = REPO_ROOT

# Check if userbenchmark has an installer
candidate_installer_path = os.path.join(workdir, "userbenchmark", ub_name, "install.py")
if os.path.exists(candidate_installer_path):
install_command = [sys.executable, "install.py"]
print(f"Running user benchmark installer: {install_command}")
if not dryrun:
subprocess.check_call(install_command, cwd=Path(candidate_installer_path).parent.resolve())

command = [sys.executable, "run_benchmark.py", ub_name]
print(f"Running user benchmark command: {command}")
if not dryrun:
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/build-nightly-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
# Push the nightly docker daily at 3 PM UTC
- cron: '0 15 * * *'
workflow_dispatch:
inputs:
nightly_date:
description: "PyTorch nightly version"
required: false
env:
WITH_PUSH: "true"
jobs:
Expand All @@ -25,13 +29,19 @@ jobs:
password: ${{ secrets.TORCHBENCH_ACCESS_TOKEN }}
- name: Build TorchBench nightly docker
run: |
export TODAY=$(date +'%Y%m%d')
export DOCKER_TAG=dev${TODAY}
export NIGHTLY_DATE="${{ github.event.inputs.nightly_date }}"
if [ -z "${NIGHTLY_DATE}" ]; then
export TODAY=$(date +'%Y%m%d')
export DOCKER_TAG=dev${TODAY}
else
export DOCKER_TAG=dev${NIGHTLY_DATE}
fi
cd benchmark/docker
full_ref="${{ github.ref }}"
prefix="refs/heads/"
branch_name=${full_ref#$prefix}
docker build . --build-arg TORCHBENCH_BRANCH="${branch_name}" -f torchbench-nightly.dockerfile -t ghcr.io/pytorch/torchbench:${DOCKER_TAG}
docker build . --build-arg TORCHBENCH_BRANCH="${branch_name}" --build-arg FORCE_DATE="${NIGHTLY_DATE}" \
-f torchbench-nightly.dockerfile -t ghcr.io/pytorch/torchbench:${DOCKER_TAG}
docker tag ghcr.io/pytorch/torchbench:${DOCKER_TAG} ghcr.io/pytorch/torchbench:latest
- name: Push docker to remote
if: ${{ env.WITH_PUSH == 'true' }}
Expand Down
Loading

0 comments on commit 49a885c

Please sign in to comment.