Skip to content

Commit 177864d

Browse files
authored
[torch-bisect] fix repro cmdline bug and enhance with more cases (#172)
1 parent bf88db8 commit 177864d

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

.github/scripts/bisect/run.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euo pipefail
44

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

88
required_envs=(
99
WORKSPACE_DIR
@@ -15,6 +15,7 @@ required_envs=(
1515
CUDA_HOME
1616
FUNCTIONAL
1717
REPRO_CMDLINE
18+
USE_UV
1819
)
1920

2021
for env_name in "${required_envs[@]}"; do
@@ -24,6 +25,11 @@ for env_name in "${required_envs[@]}"; do
2425
fi
2526
done
2627

28+
if [ ! -e ${DETECTOR} ]; then
29+
echo "Missing detector script: ${DETECTOR}."
30+
exit 1
31+
fi
32+
2733
checkout_pytorch_commit() {
2834
local repo_dir="$1"
2935
local commit="$2"
@@ -47,14 +53,15 @@ bash ${tritonparse_dir}/bisect/scripts/prepare_build_pytorch.sh
4753
BASELINE_LOG="${LOG_DIR}/baseline.log"
4854
checkout_pytorch_commit "${PYTORCH_SRC_DIR}" "${GOOD_COMMIT}"
4955
bash ${tritonparse_dir}/bisect/scripts/build_pytorch.sh
56+
cd ${PYTORCH_SRC_DIR}
5057
eval ${REPRO_CMDLINE} 2>&1 | tee "${BASELINE_LOG}"
5158

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

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

7279
# kick off the bisect!
73-
BASELINE_LOG="${BASELINE_LOG}" USE_UV=0 \
80+
BASELINE_LOG="${BASELINE_LOG}" USE_UV="${USE_UV}" \
7481
tritonparseoss bisect \
7582
--no-tui \
7683
--target torch \

.github/workflows/pytorch-bisect.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@ jobs:
4949
name: Run PyTorch Bisect
5050
runs-on: ${{ inputs.runner }}
5151
env:
52+
USE_UV: '1'
5253
WORKSPACE_DIR: ${{ github.workspace }}
5354
GOOD_COMMIT: ${{ inputs.good_commit }}
5455
BAD_COMMIT: ${{ inputs.bad_commit }}
56+
REPRO_CMDLINE: ${{ inputs.repro_cmdline }}
5557
REGRESSION_THRESHOLD: ${{ inputs.regression_threshold }}
5658
PYTORCH_REPO: pytorch/pytorch
5759
FUNCTIONAL: ${{ inputs.type == 'functional' && '1' || '0' }}
58-
REPRO_CMDLINE: ${{ inputs.command_arguments }}
5960
CUDA_HOME: ${{ github.workspace }}/torch-benchmarks/cuda
61+
CUDA_VERSION: "13.0"
6062
permissions:
6163
id-token: write
6264
contents: read
@@ -69,7 +71,7 @@ jobs:
6971
with:
7072
repository: pytorch-labs/tritonparse
7173
path: torch-benchmarks/tritonparse
72-
ref: xz9/add-torch-bisect
74+
ref: xz9/fix-bisect
7375
fetch-depth: 0
7476

7577
- name: Checkout PyTorch
@@ -80,6 +82,13 @@ jobs:
8082
submodules: recursive
8183
fetch-depth: 0
8284

85+
- name: Checkout torchbench
86+
uses: actions/checkout@v4
87+
with:
88+
repository: pytorch/benchmark
89+
path: torch-benchmarks/benchmark
90+
fetch-depth: 0
91+
8392
- name: Checkout torchvision
8493
uses: actions/checkout@v4
8594
with:

0 commit comments

Comments
 (0)