Skip to content

Commit d81c736

Browse files
FindHaometa-codesync[bot]
authored andcommitted
Clean build environment before each bisect step (PR-55)
Summary: Add build environment cleanup before building Triton to ensure a clean state for each bisect step. This prevents stale artifacts and package conflicts from affecting bisect results. Changes: 1. Clean build directories - Remove $TRITON_DIR/build (compiled artifacts) - Remove $TRITON_DIR/python/triton.egg-info (package metadata) 2. Uninstall existing triton packages - Remove 'triton' and 'pytorch-triton' packages before build - Prevents conflicts with PyTorch built-in triton - Supports both pip and uv (USE_UV=1) This ensures each bisect step starts with a clean build environment, preventing issues where: - Incremental builds fail due to stale artifacts - Old triton versions interfere with newly built versions - PyTorch's built-in triton causes version conflicts Reviewed By: wychi Differential Revision: D91072543 fbshipit-source-id: b5ba62a316a6a223f7a75aba69c01080d832e226
1 parent dffa180 commit d81c736

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

tritonparse/bisect/scripts/bisect_triton.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,21 @@ fi
182182

183183
echo "" | log_output
184184

185+
# Clean build directory to avoid stale artifacts from previous commits
186+
echo "Cleaning build directory..." | log_output
187+
rm -rf "$TRITON_DIR/build"
188+
rm -rf "$TRITON_DIR/python/triton.egg-info"
189+
echo "" | log_output
190+
191+
# Uninstall any existing triton to avoid conflicts with PyTorch built-in
192+
echo "Uninstalling existing triton packages..." | log_output
193+
if [[ "$USE_UV" == "1" ]]; then
194+
uv pip uninstall -y triton pytorch-triton 2>&1 | log_output || true
195+
else
196+
pip uninstall -y triton pytorch-triton 2>&1 | log_output || true
197+
fi
198+
echo "" | log_output
199+
185200
# Build Triton
186201
echo "Building Triton..." | log_output
187202
BUILD_START=$(date +%s)

0 commit comments

Comments
 (0)