From 7f503064ddff93af8c4535f71f7102ff5268acaa Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Tue, 16 Aug 2022 15:44:37 -0700 Subject: [PATCH 1/3] Add nightly benchmark and trigger in keyword --- .github/workflows/benchmark.yml | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 000000000..0cc3a3d45 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,63 @@ +name: Run Benchmark +on: + # run every day at 2:15am + schedule: + - cron: '15 02 * * *' + pull_request: + + +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 + if: startsWith( matrix.os, 'ubuntu' ) + run: | + sudo add-apt-repository multiverse + sudo apt update + sudo apt install rar unrar libssl-dev libcurl4-openssl-dev zlib1g-dev + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - 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 -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 \ No newline at end of file From 4067b0f4e34ad15a7049c172457c1f1afc2c94f3 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Tue, 16 Aug 2022 15:47:15 -0700 Subject: [PATCH 2/3] Update benchmark.yml --- .github/workflows/benchmark.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 0cc3a3d45..3584f5b11 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -28,15 +28,10 @@ jobs: echo "::set-output name=value::$PT_CHANNEL" id: pytorch_channel - name: Setup additional system libraries - if: startsWith( matrix.os, 'ubuntu' ) run: | sudo add-apt-repository multiverse sudo apt update sudo apt install rar unrar libssl-dev libcurl4-openssl-dev zlib1g-dev - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - name: Check out source repository uses: actions/checkout@v2 with: @@ -60,4 +55,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: Benchmark artifact - path: results.txt \ No newline at end of file + path: results.txt From 3222b80a2292e4f1cc19ea2204b18dadb1c1baa3 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Tue, 16 Aug 2022 15:56:00 -0700 Subject: [PATCH 3/3] Update benchmark.yml --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 3584f5b11..a4a7b5afd 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -39,7 +39,7 @@ jobs: - name: Install dependencies run: | pip3 install -r requirements.txt - pip3 install --pre torch -f "${{ steps.pytorch_channel.outputs.value }}" + 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