Skip to content

Commit

Permalink
Try schema v3
Browse files Browse the repository at this point in the history
  • Loading branch information
huydhn committed Dec 17, 2024
1 parent d3cc496 commit 9b24c0a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 57 deletions.
92 changes: 35 additions & 57 deletions .github/workflows/_linux-benchmark-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,81 +15,59 @@ on:
required: false
description: |
HF auth token to avoid rate limits when downloading models or datasets from hub
AWS_ACCESS_KEY_ID:
required: true
description: |
AWS access token for S3 uploading
AWS_SECRET_ACCESS_KEY:
required: true
description: |
AWS secret access key for S3 uploading
jobs:
# Run a specific userbenchmark with given arguments
# Need to pass in userbenchmark name and arguments
benchmark:
# Don't run on forked repos
if: github.repository_owner == 'pytorch'
runs-on: linux.aws.a100
timeout-minutes: 1440 # 24 hours
timeout-minutes: 1440
environment: docker-s3-upload
env:
BASE_CONDA_ENV: "torchbench"
CONDA_ENV: "userbenchmark"
SETUP_SCRIPT: "/workspace/setup_instance.sh"
OUTPUT_DIR: '.userbenchmark'
HUGGING_FACE_HUB_TOKEN: ${{ secrets.HUGGING_FACE_HUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout TorchBench
uses: actions/checkout@v3
with:
path: benchmark

- name: Remove result if it already exists
if: always()
run: |
# remove old results if exists
if [ -d benchmark-output ]; then rm -Rf benchmark-output; fi
pushd benchmark
if [ -d .userbenchmark ]; then rm -Rf .userbenchmark; fi
- name: Clone and setup conda env
shell: bash
working-directory: benchmark
run: |
CONDA_ENV=${BASE_CONDA_ENV} . "${SETUP_SCRIPT}"
conda create --name "${CONDA_ENV}" --clone "${BASE_CONDA_ENV}"
set -eux
if [[ -d "${OUTPUT_DIR}" ]]; then
rm -rf "${OUTPUT_DIR}"
fi
- name: Setup miniconda
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
with:
python-version: "3.9"

- name: Install benchmark
shell: bash
working-directory: benchmark
run: |
. "${SETUP_SCRIPT}"
pushd benchmark
python install.py
set -eux
${CONDA_RUN} python install.py
- name: Run benchmark
shell: bash
working-directory: benchmark
run: |
. "${SETUP_SCRIPT}"
pushd benchmark
python run_benchmark.py ${{ inputs.userbenchmark }} ${{ inputs.userbenchmark-run-args }}
- name: Copy benchmark logs
if: always()
run: |
pushd benchmark
cp -r ./.userbenchmark/${{ inputs.userbenchmark }} ../benchmark-output
- name: Upload benchmark result to GH Actions Artifact
uses: actions/upload-artifact@v3
if: always()
set -eux
${CONDA_RUN} python run_benchmark.py ${{ inputs.userbenchmark }} ${{ inputs.userbenchmark-run-args }}
# DEBUG
ls -laR "${OUTPUT_DIR}"
- name: Upload the benchmark results to OSS benchmark database for the dashboard
uses: pytorch/test-infra/.github/actions/upload-benchmark-results@main
with:
name: ${{ inputs.userbenchmark }} benchmarking result
path: benchmark-output/
- name: Copy artifact and upload to Amazon S3
env:
WORKFLOW_RUN_ID: ${{ github.run_id }}
WORKFLOW_RUN_ATTEMPT: ${{ github.run_attempt }}
run: |
. "${SETUP_SCRIPT}"
pushd benchmark
# Upload the result json to Amazon S3
python ./scripts/userbenchmark/upload_s3_csv.py --s3-prefix torchbench-csv --userbenchmark ${{ inputs.userbenchmark }} \
--upload-path ../benchmark-output --match-filename "^${{ inputs.userbenchmark }}.*\.csv"
- name: Clean up Conda env
if: always()
run: |
. "${SETUP_SCRIPT}"
conda deactivate && conda deactivate
conda remove -n "${CONDA_ENV}" --all
benchmark-results-dir: ${{ env.OUTPUT_DIR }}
dry-run: true # DEBUG: TO BE REMOVED
schema-version: v3
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/torchao.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Torchao nightly workflow (A100)
on:
# DEBUG
pull_request:
workflow_dispatch:
schedule:
- cron: '00 18 * * *' # run at 6:00 PM UTC, K8s containers will roll out at 12PM EST
Expand Down
1 change: 1 addition & 0 deletions userbenchmark/torchao/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def _get_ci_args(
f"--{experiment}",
"--output",
f"{str(OUTPUT_DIR.joinpath(output_file_name).resolve())}",
"--only hf_T5", # DEBUG: TO BE REMOVED
]
return ci_args

Expand Down

0 comments on commit 9b24c0a

Please sign in to comment.