Skip to content

Commit bcf5063

Browse files
ethanwee1jithunnair-amd
authored andcommitted
[CI] Removing --user flag from all pip install commands (pytorch#154900)
Related to pytorch#148335 python virtualenv doesn't support using `--user` flag: ``` ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv. + python3 -m pip install --progress-bar off --user ninja==1.10.2 ``` Pull Request resolved: pytorch#154900 Approved by: https://github.com/jeffdaily Co-authored-by: Jithun Nair <[email protected]>
1 parent 6b2bef1 commit bcf5063

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.ci/caffe2/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/common.sh"
55

66
if [[ ${BUILD_ENVIRONMENT} == *onnx* ]]; then
77
pip install click mock tabulate networkx==2.0
8-
pip -q install --user "file:///var/lib/jenkins/workspace/third_party/onnx#egg=onnx"
8+
pip -q install "file:///var/lib/jenkins/workspace/third_party/onnx#egg=onnx"
99
fi
1010

1111
# Skip tests in environments where they are not built/applicable
@@ -147,8 +147,8 @@ export DNNL_MAX_CPU_ISA=AVX2
147147
if [[ "${SHARD_NUMBER:-1}" == "1" ]]; then
148148
# TODO([email protected]) remove this when the linked issue resolved.
149149
# py is temporary until https://github.com/Teemu/pytest-sugar/issues/241 is fixed
150-
pip install --user py==1.11.0
151-
pip install --user pytest-sugar
150+
pip install py==1.11.0
151+
pip install pytest-sugar
152152
# NB: Warnings are disabled because they make it harder to see what
153153
# the actual erroring test is
154154
"$PYTHON" \

.ci/onnx/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ git config --global --add safe.directory /var/lib/jenkins/workspace
1919

2020
if [[ "$BUILD_ENVIRONMENT" == *onnx* ]]; then
2121
# TODO: This can be removed later once vision is also part of the Docker image
22-
pip install -q --user --no-use-pep517 "git+https://github.com/pytorch/vision.git@$(cat .github/ci_commit_pins/vision.txt)"
22+
pip install -q --no-use-pep517 "git+https://github.com/pytorch/vision.git@$(cat .github/ci_commit_pins/vision.txt)"
2323
# JIT C++ extensions require ninja, so put it into PATH.
2424
export PATH="/var/lib/jenkins/.local/bin:$PATH"
2525
# NB: ONNX test is fast (~15m) so it's ok to retry it few more times to avoid any flaky issue, we

.ci/pytorch/common_utils.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ function install_torchaudio() {
127127
if [[ "$1" == "cuda" ]]; then
128128
# TODO: This is better to be passed as a parameter from _linux-test workflow
129129
# so that it can be consistent with what is set in build
130-
TORCH_CUDA_ARCH_LIST="8.0;8.6" pip_install --no-use-pep517 --user "git+https://github.com/pytorch/audio.git@${commit}"
130+
TORCH_CUDA_ARCH_LIST="8.0;8.6" pip_install --no-use-pep517 "git+https://github.com/pytorch/audio.git@${commit}"
131131
else
132-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/audio.git@${commit}"
132+
pip_install --no-use-pep517 "git+https://github.com/pytorch/audio.git@${commit}"
133133
fi
134134

135135
}
@@ -139,8 +139,8 @@ function install_torchtext() {
139139
local text_commit
140140
data_commit=$(get_pinned_commit data)
141141
text_commit=$(get_pinned_commit text)
142-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/data.git@${data_commit}"
143-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/text.git@${text_commit}"
142+
pip_install --no-use-pep517 "git+https://github.com/pytorch/data.git@${data_commit}"
143+
pip_install --no-use-pep517 "git+https://github.com/pytorch/text.git@${text_commit}"
144144
}
145145

146146
function install_torchvision() {
@@ -153,7 +153,7 @@ function install_torchvision() {
153153
echo 'char* dlerror(void) { return "";}'|gcc -fpic -shared -o "${HOME}/dlerror.so" -x c -
154154
LD_PRELOAD=${orig_preload}:${HOME}/dlerror.so
155155
fi
156-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/vision.git@${commit}"
156+
pip_install --no-use-pep517 "git+https://github.com/pytorch/vision.git@${commit}"
157157
if [ -n "${LD_PRELOAD}" ]; then
158158
LD_PRELOAD=${orig_preload}
159159
fi
@@ -173,7 +173,7 @@ function install_torchrec_and_fbgemm() {
173173

174174
if [[ "$BUILD_ENVIRONMENT" == *rocm* ]] ; then
175175
# install torchrec first because it installs fbgemm nightly on top of rocm fbgemm
176-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}"
176+
pip_install --no-use-pep517 "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}"
177177
pip_uninstall fbgemm-gpu-nightly
178178

179179
pip_install tabulate # needed for newer fbgemm
@@ -190,8 +190,8 @@ function install_torchrec_and_fbgemm() {
190190
rm -rf fbgemm
191191
else
192192
# See https://github.com/pytorch/pytorch/issues/106971
193-
CUDA_PATH=/usr/local/cuda-12.1 pip_install --no-use-pep517 --user "git+https://github.com/pytorch/FBGEMM.git@${fbgemm_commit}#egg=fbgemm-gpu&subdirectory=fbgemm_gpu"
194-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}"
193+
CUDA_PATH=/usr/local/cuda-12.1 pip_install --no-use-pep517 "git+https://github.com/pytorch/FBGEMM.git@${fbgemm_commit}#egg=fbgemm-gpu&subdirectory=fbgemm_gpu"
194+
pip_install --no-use-pep517 "git+https://github.com/pytorch/torchrec.git@${torchrec_commit}"
195195
fi
196196
}
197197

@@ -234,7 +234,7 @@ function checkout_install_torchbench() {
234234
function install_torchao() {
235235
local commit
236236
commit=$(get_pinned_commit torchao)
237-
pip_install --no-use-pep517 --user "git+https://github.com/pytorch/ao.git@${commit}"
237+
pip_install --no-use-pep517 "git+https://github.com/pytorch/ao.git@${commit}"
238238
}
239239

240240
function print_sccache_stats() {

.ci/pytorch/test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fi
201201

202202
if [[ "$BUILD_ENVIRONMENT" != *-bazel-* ]] ; then
203203
# JIT C++ extensions require ninja.
204-
pip_install --user "ninja==1.10.2"
204+
pip_install "ninja==1.10.2"
205205
# ninja is installed in $HOME/.local/bin, e.g., /var/lib/jenkins/.local/bin for CI user jenkins
206206
# but this script should be runnable by any user, including root
207207
export PATH="$HOME/.local/bin:$PATH"
@@ -496,7 +496,7 @@ DYNAMO_BENCHMARK_FLAGS=()
496496

497497
pr_time_benchmarks() {
498498

499-
pip_install --user "fbscribelogger"
499+
pip_install "fbscribelogger"
500500

501501
TEST_REPORTS_DIR=$(pwd)/test/test-reports
502502
mkdir -p "$TEST_REPORTS_DIR"
@@ -1471,8 +1471,8 @@ test_bazel() {
14711471

14721472
test_benchmarks() {
14731473
if [[ "$BUILD_ENVIRONMENT" == *cuda* && $TEST_CONFIG != *nogpu* ]]; then
1474-
pip_install --user "pytest-benchmark==3.2.3"
1475-
pip_install --user "requests"
1474+
pip_install "pytest-benchmark==3.2.3"
1475+
pip_install "requests"
14761476
BENCHMARK_DATA="benchmarks/.data"
14771477
mkdir -p ${BENCHMARK_DATA}
14781478
pytest benchmarks/fastrnns/test_bench.py --benchmark-sort=Name --benchmark-json=${BENCHMARK_DATA}/fastrnns_default.json --fuser=default --executor=default

0 commit comments

Comments
 (0)