Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

# remember where we started
ROOT="$(pwd)"
MODEL_SPEC=$1

# torchinductor venv
Expand Down Expand Up @@ -29,15 +27,15 @@ pip3 install --force-reinstall torchtext
# pytorch nightly
pip3 install --force-reinstall --pre torch torchvision torchaudio torchrec --extra-index-url https://download.pytorch.org/whl/nightly/cu121
# pytorch source to get torchbench for dynamo
cd /tmp || exit
pushd /tmp || exit
# cleanup old pytorch
rm -rf pytorch
git clone --recursive https://github.com/pytorch/pytorch
cd pytorch || exit
pushd pytorch || exit
# if you are updating an existing checkout
git submodule sync
git submodule update --init --recursive
cd ..
popd || exit

# required packages
# https://github.com/pytorch/benchmark/blob/main/docker/gcp-a100-runner-dind.dockerfile#L17
Expand All @@ -50,19 +48,19 @@ if [ "$MODEL_SPEC" == "torchbench" ] || [ "$MODEL_SPEC" != "all" ]; then
rm -rf benchmark
pip3 install pyyaml
git clone https://github.com/pytorch/benchmark.git
cd benchmark || exit
pushd benchmark || exit
python3 install.py
cd ..
popd || exit
fi

# timm
if [ "$MODEL_SPEC" == "timm_models" ] || [ "$MODEL_SPEC" != "all" ]; then
# clean up old timm
rm -rf pytorch-image-models
git clone https://github.com/huggingface/pytorch-image-models.git
cd pytorch-image-models || exit
pushd pytorch-image-models || exit
pip3 install -e .
cd ..
popd || exit
fi

# clean up cache
Expand All @@ -71,4 +69,4 @@ rm -rf ~/.triton/cache
rm -rf "$TEST_REPORTS_DIR"

# go back to where we started
cd "$ROOT" || exit
popd || exit
7 changes: 2 additions & 5 deletions .github/workflows/torch-inductor/scripts/install_triton.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash

# remember where we started
ROOT="$(pwd)"

# shellcheck source=/dev/null
source /tmp/torchinductor_venv/bin/activate
# shellcheck source=/dev/null
Expand All @@ -12,7 +9,7 @@ source ./.github/workflows/torch-inductor/scripts/common.sh
pip3 install --upgrade cmake ninja lit

# build our own triton and preserve the wheel build for later re-use in this test run.
cd python || exit
pushd python || exit
pip3 uninstall pytorch-triton -y
rm -rf build dist
python3 setup.py bdist_wheel
Expand All @@ -22,4 +19,4 @@ pip3 install dist/triton*.whl
rm -rf ~/.triton/cache

# go back to where we started
cd "$ROOT" || exit
popd || exit
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ pip3 install --upgrade z3-solver

# Install our own triton.
pip3 uninstall pytorch-triton -y
cd $ROOT/python || exit
pushd python || exit
if [ -d "./dist" ]; then
pip3 install dist/triton*.whl
else
rm -rf build
pip3 install -e .
fi

cd "$PYTORCH_DIR" || exit
pushd "$PYTORCH_DIR" || exit
TEST_REPORTS_DIR=$TEST_REPORTS_DIR/acc
mkdir -p "$TEST_REPORTS_DIR"

Expand All @@ -40,7 +40,7 @@ for model in "${MODELS[@]}"; do
--output "$TEST_REPORTS_DIR"/dynamic_shapes_"$model".csv
done

cd "$ROOT" || exit
popd || exit
for model in "${MODELS[@]}"; do
if [ "$model" != "$MODEL_SPEC" ] && [ "$MODEL_SPEC" != "all" ]; then
continue
Expand All @@ -52,4 +52,4 @@ for model in "${MODELS[@]}"; do
done

# go back to where we started
cd "$ROOT" || exit
popd || exit
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source "$INDUCTOR"/scripts/common.sh
sudo nvidia-smi -i 0 -pm 1
sudo nvidia-smi -i 0 --lock-gpu-clocks=1350,1350

cd "$PYTORCH_DIR" || exit
pushd "$PYTORCH_DIR" || exit
TRITON_TEST_REPORTS_DIR=$TEST_REPORTS_DIR/perf
BASE_TEST_REPORTS_DIR=$TEST_REPORTS_DIR/acc
mkdir -p "$TRITON_TEST_REPORTS_DIR"
Expand Down Expand Up @@ -50,7 +50,7 @@ done
# uninstall pytorch-triton
pip3 uninstall pytorch-triton -y

cd "$ROOT" || exit
popd || exit
for model in "${MODELS[@]}"; do
if [ "$model" != "$MODEL_SPEC" ] && [ "$MODEL_SPEC" != "all" ]; then
continue
Expand All @@ -68,4 +68,4 @@ done
sudo nvidia-smi -i 0 -rgc

# go back to where we started
cd "$ROOT" || exit
popd || exit