Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 10 additions & 3 deletions .github/scripts/bisect/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly DETECTOR="${WORKSPACE_DIR}/.ci/bisect/regression_detector.py"
readonly DETECTOR="${WORKSPACE_DIR}/.github/scripts/bisect/regression_detector.py"

required_envs=(
WORKSPACE_DIR
Expand All @@ -15,6 +15,7 @@ required_envs=(
CUDA_HOME
FUNCTIONAL
REPRO_CMDLINE
USE_UV
)

for env_name in "${required_envs[@]}"; do
Expand All @@ -24,6 +25,11 @@ for env_name in "${required_envs[@]}"; do
fi
done

if [ ! -e ${DETECTOR} ]; then
echo "Missing detector script: ${DETECTOR}."
exit 1
fi

checkout_pytorch_commit() {
local repo_dir="$1"
local commit="$2"
Expand All @@ -47,14 +53,15 @@ bash ${tritonparse_dir}/bisect/scripts/prepare_build_pytorch.sh
BASELINE_LOG="${LOG_DIR}/baseline.log"
checkout_pytorch_commit "${PYTORCH_SRC_DIR}" "${GOOD_COMMIT}"
bash ${tritonparse_dir}/bisect/scripts/build_pytorch.sh
cd ${PYTORCH_SRC_DIR}
eval ${REPRO_CMDLINE} 2>&1 | tee "${BASELINE_LOG}"

# step 3: build and run the bad commit
checkout_pytorch_commit "${PYTORCH_SRC_DIR}" "${BAD_COMMIT}"
bash ${tritonparse_dir}/bisect/scripts/build_pytorch.sh
# allow the regression detector to exit with error code
set +e
BASELINE_LOG="${BASELINE_LOG}" python ./.ci/bisect/regression_detector.py
BASELINE_LOG="${BASELINE_LOG}" python "${DETECTOR}"
PREFLIGHT_RC=$?
set -e

Expand All @@ -70,7 +77,7 @@ elif [ ${PREFLIGHT_RC} -ne 1 ] && [ ${FUNCTIONAL} -ne 1 ]; then
fi

# kick off the bisect!
BASELINE_LOG="${BASELINE_LOG}" USE_UV=0 \
BASELINE_LOG="${BASELINE_LOG}" USE_UV="${USE_UV}" \
tritonparseoss bisect \
--no-tui \
--target torch \
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/pytorch-bisect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ jobs:
name: Run PyTorch Bisect
runs-on: ${{ inputs.runner }}
env:
USE_UV: '1'
WORKSPACE_DIR: ${{ github.workspace }}
GOOD_COMMIT: ${{ inputs.good_commit }}
BAD_COMMIT: ${{ inputs.bad_commit }}
REPRO_CMDLINE: ${{ inputs.repro_cmdline }}
REGRESSION_THRESHOLD: ${{ inputs.regression_threshold }}
PYTORCH_REPO: pytorch/pytorch
FUNCTIONAL: ${{ inputs.type == 'functional' && '1' || '0' }}
REPRO_CMDLINE: ${{ inputs.command_arguments }}
CUDA_HOME: ${{ github.workspace }}/torch-benchmarks/cuda
CUDA_VERSION: "13.0"
permissions:
id-token: write
contents: read
Expand All @@ -69,7 +71,7 @@ jobs:
with:
repository: pytorch-labs/tritonparse
path: torch-benchmarks/tritonparse
ref: xz9/add-torch-bisect
ref: xz9/fix-bisect
fetch-depth: 0

- name: Checkout PyTorch
Expand All @@ -80,6 +82,13 @@ jobs:
submodules: recursive
fetch-depth: 0

- name: Checkout torchbench
uses: actions/checkout@v4
with:
repository: pytorch/benchmark
path: torch-benchmarks/benchmark
fetch-depth: 0

- name: Checkout torchvision
uses: actions/checkout@v4
with:
Expand Down
Loading