Skip to content

Commit d26ab28

Browse files
Revert "Setup TorchBench in Docker (pytorch#158613)"
This reverts commit d72ebef. Reverted pytorch#158613 on behalf of https://github.com/XuehaiPan due to checkout_install_torchbench function is removed but still referenced in trunk ([comment](pytorch#158613 (comment)))
1 parent 1cffb21 commit d26ab28

File tree

8 files changed

+47
-40
lines changed

8 files changed

+47
-40
lines changed

.ci/docker/common/install_inductor_benchmark_deps.sh

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,11 @@ function install_timm() {
1515
commit=$(get_pinned_commit timm)
1616

1717
pip_install "git+https://github.com/huggingface/pytorch-image-models@${commit}"
18-
}
19-
20-
function install_torchbench() {
21-
local commit
22-
commit=$(get_pinned_commit torchbench)
23-
git clone https://github.com/pytorch/benchmark torchbench
24-
pushd torchbench
25-
git checkout "$commit"
26-
27-
python install.py --continue_on_fail
28-
29-
# TODO (huydhn): transformers-4.44.2 added by https://github.com/pytorch/benchmark/pull/2488
30-
# is regressing speedup metric. This needs to be investigated further
31-
pip install transformers==4.38.1
32-
33-
echo "Print all dependencies after TorchBench is installed"
34-
python -mpip freeze
35-
popd
36-
37-
chown -R jenkins torchbench
18+
# Clean up
19+
conda_run pip uninstall -y torch torchvision triton
3820
}
3921

4022
# Pango is needed for weasyprint which is needed for doctr
4123
conda_install pango
42-
43-
# Stable packages are ok here, just to satisfy TorchBench check
44-
pip_install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
45-
46-
install_torchbench
4724
install_huggingface
4825
install_timm
49-
50-
# Clean up
51-
conda_run pip uninstall -y torch torchvision torchaudio triton

.ci/docker/requirements-ci.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ pwlf==2.2.1
361361
#Pinned versions: 2.2.1
362362
#test that import: test_sac_estimator.py
363363

364+
364365
# To build PyTorch itself
365366
pyyaml
366367
pyzstd

.ci/docker/ubuntu-rocm/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ COPY ./common/install_inductor_benchmark_deps.sh install_inductor_benchmark_deps
9898
COPY ./common/common_utils.sh common_utils.sh
9999
COPY ci_commit_pins/huggingface.txt huggingface.txt
100100
COPY ci_commit_pins/timm.txt timm.txt
101-
COPY ci_commit_pins/torchbench.txt torchbench.txt
102101
RUN if [ -n "${INDUCTOR_BENCHMARKS}" ]; then bash ./install_inductor_benchmark_deps.sh; fi
103-
RUN rm install_inductor_benchmark_deps.sh common_utils.sh timm.txt huggingface.txt torchbench.txt
102+
RUN rm install_inductor_benchmark_deps.sh common_utils.sh timm.txt huggingface.txt
104103

105104
# (optional) Install non-default Ninja version
106105
ARG NINJA_VERSION

.ci/docker/ubuntu/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ COPY ./common/install_inductor_benchmark_deps.sh install_inductor_benchmark_deps
9898
COPY ./common/common_utils.sh common_utils.sh
9999
COPY ci_commit_pins/huggingface.txt huggingface.txt
100100
COPY ci_commit_pins/timm.txt timm.txt
101-
COPY ci_commit_pins/torchbench.txt torchbench.txt
102101
RUN if [ -n "${INDUCTOR_BENCHMARKS}" ]; then bash ./install_inductor_benchmark_deps.sh; fi
103-
RUN rm install_inductor_benchmark_deps.sh common_utils.sh timm.txt huggingface.txt torchbench.txt
102+
RUN rm install_inductor_benchmark_deps.sh common_utils.sh timm.txt huggingface.txt
104103

105104
ARG TRITON
106105
ARG TRITON_CPU

.ci/pytorch/common_utils.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ function install_torchrec_and_fbgemm() {
229229

230230
pip_install tabulate # needed for newer fbgemm
231231
pip_install patchelf # needed for rocm fbgemm
232+
pushd /tmp
232233

233234
local wheel_dir=dist/fbgemm_gpu
234235
local found_whl=0
@@ -263,6 +264,7 @@ function install_torchrec_and_fbgemm() {
263264
done
264265

265266
rm -rf fbgemm
267+
popd
266268
else
267269
pip_build_and_install "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}" dist/torchrec
268270
pip_build_and_install "git+https://github.com/pytorch/FBGEMM.git@${fbgemm_commit}#subdirectory=fbgemm_gpu" dist/fbgemm_gpu
@@ -281,6 +283,30 @@ function clone_pytorch_xla() {
281283
fi
282284
}
283285

286+
function checkout_install_torchbench() {
287+
local commit
288+
commit=$(get_pinned_commit torchbench)
289+
git clone https://github.com/pytorch/benchmark torchbench
290+
pushd torchbench
291+
git checkout "$commit"
292+
293+
if [ "$1" ]; then
294+
python install.py --continue_on_fail models "$@"
295+
else
296+
# Occasionally the installation may fail on one model but it is ok to continue
297+
# to install and test other models
298+
python install.py --continue_on_fail
299+
fi
300+
301+
# TODO (huydhn): transformers-4.44.2 added by https://github.com/pytorch/benchmark/pull/2488
302+
# is regressing speedup metric. This needs to be investigated further
303+
pip install transformers==4.38.1
304+
305+
echo "Print all dependencies after TorchBench is installed"
306+
python -mpip freeze
307+
popd
308+
}
309+
284310
function install_torchao() {
285311
local commit
286312
commit=$(get_pinned_commit torchao)

.ci/pytorch/test.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,11 +1662,13 @@ elif [[ "${TEST_CONFIG}" == *timm* ]]; then
16621662
elif [[ "${TEST_CONFIG}" == cachebench ]]; then
16631663
install_torchaudio
16641664
install_torchvision
1665-
PYTHONPATH=/torchbench test_cachebench
1665+
checkout_install_torchbench nanogpt BERT_pytorch resnet50 hf_T5 llama moco
1666+
PYTHONPATH=$(pwd)/torchbench test_cachebench
16661667
elif [[ "${TEST_CONFIG}" == verify_cachebench ]]; then
16671668
install_torchaudio
16681669
install_torchvision
1669-
PYTHONPATH=/torchbench test_verify_cachebench
1670+
checkout_install_torchbench nanogpt
1671+
PYTHONPATH=$(pwd)/torchbench test_verify_cachebench
16701672
elif [[ "${TEST_CONFIG}" == *torchbench* ]]; then
16711673
install_torchaudio
16721674
install_torchvision
@@ -1675,22 +1677,28 @@ elif [[ "${TEST_CONFIG}" == *torchbench* ]]; then
16751677
# https://github.com/opencv/opencv-python/issues/885
16761678
pip_install opencv-python==4.8.0.74
16771679
if [[ "${TEST_CONFIG}" == *inductor_torchbench_smoketest_perf* ]]; then
1678-
PYTHONPATH=/torchbench test_inductor_torchbench_smoketest_perf
1680+
checkout_install_torchbench hf_Bert hf_Albert timm_vision_transformer
1681+
PYTHONPATH=$(pwd)/torchbench test_inductor_torchbench_smoketest_perf
16791682
elif [[ "${TEST_CONFIG}" == *inductor_torchbench_cpu_smoketest_perf* ]]; then
1680-
PYTHONPATH=/torchbench test_inductor_torchbench_cpu_smoketest_perf
1683+
checkout_install_torchbench timm_vision_transformer phlippe_densenet basic_gnn_edgecnn \
1684+
llama_v2_7b_16h resnet50 timm_efficientnet mobilenet_v3_large timm_resnest \
1685+
functorch_maml_omniglot yolov3 mobilenet_v2 resnext50_32x4d densenet121 mnasnet1_0
1686+
PYTHONPATH=$(pwd)/torchbench test_inductor_torchbench_cpu_smoketest_perf
16811687
elif [[ "${TEST_CONFIG}" == *torchbench_gcp_smoketest* ]]; then
1682-
TORCHBENCHPATH=/torchbench test_torchbench_gcp_smoketest
1688+
checkout_install_torchbench
1689+
TORCHBENCHPATH=$(pwd)/torchbench test_torchbench_gcp_smoketest
16831690
else
1691+
checkout_install_torchbench
16841692
# Do this after checkout_install_torchbench to ensure we clobber any
16851693
# nightlies that torchbench may pull in
16861694
if [[ "${TEST_CONFIG}" != *cpu* ]]; then
16871695
install_torchrec_and_fbgemm
16881696
fi
1689-
PYTHONPATH=/torchbench test_dynamo_benchmark torchbench "$id"
1697+
PYTHONPATH=$(pwd)/torchbench test_dynamo_benchmark torchbench "$id"
16901698
fi
16911699
elif [[ "${TEST_CONFIG}" == *inductor_cpp_wrapper* ]]; then
16921700
install_torchvision
1693-
PYTHONPATH=/torchbench test_inductor_cpp_wrapper_shard "$SHARD_NUMBER"
1701+
PYTHONPATH=$(pwd)/torchbench test_inductor_cpp_wrapper_shard "$SHARD_NUMBER"
16941702
if [[ "$SHARD_NUMBER" -eq "1" ]]; then
16951703
test_inductor_aoti
16961704
fi
File renamed without changes.

.github/workflows/trunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ jobs:
206206
with:
207207
runner_prefix: "${{ needs.get-label-type.outputs.label-type }}"
208208
build-environment: linux-jammy-py3.9-gcc11
209-
docker-image-name: ci-image:pytorch-linux-jammy-py3.9-gcc11-inductor-benchmarks
209+
docker-image-name: ci-image:pytorch-linux-jammy-py3.9-gcc11
210210
test-matrix: |
211211
{ include: [
212212
{ config: "verify_cachebench", shard: 1, num_shards: 1, runner: "${{ needs.get-label-type.outputs.label-type }}linux.2xlarge" },

0 commit comments

Comments
 (0)