Skip to content
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

Add nightly benchmark and trigger in keyword #740

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
58 changes: 58 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Run Benchmark
on:
# run every day at 2:15am
schedule:
- cron: '15 02 * * *'
pull_request:

Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: If you want to tigger in keyword, you can rely on issue_comment

Reference: https://github.com/orgs/community/discussions/25389


jobs:
benchmark:
if: ${{ (github.repository_owner == 'pytorch' && contains(github.event.pull_request.body, 'RUN_BENCHMARK')) || github.event_name == 'schedule' }}
# Replace this by the custom AWS machine we will create instead
runs-on: ubuntu-latest
steps:
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64
- name: Get PyTorch Channel
shell: bash
run: |
if [[ "${{ github.base_ref }}" == release/* ]] || [[ "${{ github.ref }}" == refs/heads/release/* ]] || [[ "${{ github.ref }}" == refs/tags/v* ]]; then
PT_CHANNEL="https://download.pytorch.org/whl/test/cpu/torch_test.html"
else
PT_CHANNEL="https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html"
fi
echo "::set-output name=value::$PT_CHANNEL"
id: pytorch_channel
- name: Setup additional system libraries
run: |
sudo add-apt-repository multiverse
sudo apt update
sudo apt install rar unrar libssl-dev libcurl4-openssl-dev zlib1g-dev
- name: Check out source repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: |
pip3 install -r requirements.txt
pip3 install --pre torch torchvision -f "${{ steps.pytorch_channel.outputs.value }}"
pip3 install cmake ninja
echo "/home/runner/.local/bin" >> $GITHUB_PATH
- name: Build TorchData
run: |
python setup.py install
env:
BUILD_S3: 1
- name: Install test requirements
run: pip3 install -r test/requirements.txt
- name: Run Benchmarks
run: python benchmarks/torchvision_classification/train.py > results.txt
- name: Save benchmark artifacts
uses: actions/upload-artifact@v2
with:
name: Benchmark artifact
path: results.txt