TorchBench V2 bisection #583
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TorchBench V2 bisection | |
on: | |
workflow_dispatch: | |
inputs: | |
issue_name: | |
description: "Bisection Issue Name" | |
required: true | |
default: "example-issue" | |
jobs: | |
bisection: | |
environment: docker-s3-upload | |
env: | |
CONDA_ENV_NAME: "bisection-ci-v2" | |
BISECT_DIR: ".torchbench/v2-bisection-ci" | |
BISECT_BRANCH: "v2.0" | |
SETUP_SCRIPT: "/data/nvme/bin/setup_instance.sh" | |
if: ${{ github.repository_owner == 'pytorch' }} | |
runs-on: [self-hosted, bm-runner] | |
timeout-minutes: 2880 # 48 hours | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: v2.0 | |
- name: Create conda environment | |
run: | | |
set -x | |
python3 ./utils/python_utils.py --create-conda-env ${CONDA_ENV_NAME} | |
. activate "${CONDA_ENV_NAME}" | |
. "${SETUP_SCRIPT}" | |
python utils/cuda_utils.py --install-torch-build-deps | |
python utils/cuda_utils.py --install-torchbench-deps | |
- name: Bisection | |
run: | | |
. activate "${CONDA_ENV_NAME}" | |
. "${SETUP_SCRIPT}" | |
export BISECT_ISSUE="${{ github.event.inputs.issue_name }}" | |
export BISECT_BASE="${HOME}/${BISECT_DIR}/${BISECT_ISSUE}" | |
export TORCHBENCH_SRC_DIR="${PWD}" | |
bash ./.github/scripts/run-bisection.sh | |
# Update the result json symbolic link | |
ln -sf "${BISECT_BASE}/gh${GITHUB_RUN_ID}/result.json" "${BISECT_BASE}/result.json" | |
- name: Analyze bisection result | |
run: | | |
. activate "${CONDA_ENV_NAME}" | |
. "${SETUP_SCRIPT}" | |
export BISECT_ISSUE="${{ github.event.inputs.issue_name }}" | |
export BISECT_BASE="${HOME}/${BISECT_DIR}/${BISECT_ISSUE}" | |
python ./.github/scripts/bmutils/analyze-bisection-result.py --bisection-root "${BISECT_BASE}" --gh-workflow-id "${GITHUB_RUN_ID}" | |
cp -r "${BISECT_BASE}" ./bisection-result | |
- name: Create the github issue | |
if: env.TORCHBENCH_PERF_BISECTION_NONEMPTY_SIGNAL | |
uses: peter-evans/create-issue-from-file@v4 | |
with: | |
title: V2 Performance Signal Detected by TorchBench CI on ${{ env.TORCHBENCH_PERF_BISECTION_NONEMPTY_SIGNAL }} | |
content-filepath: ./bisection-result/gh-issue.md | |
token: ${{ secrets.TORCHBENCH_ACCESS_TOKEN }} | |
labels: | | |
torchbench-perf-report | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Bisection result | |
path: bisection-result/ | |
- name: Remove conda environment | |
run: | | |
conda env remove --name "$BISECT_CONDA_ENV" |