Skip to content

Commit c4b7e20

Browse files
Update torch to 2.11.0 and remove code-scan (#2444)
Signed-off-by: Sun, Xuehao <xuehao.sun@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent acda521 commit c4b7e20

23 files changed

Lines changed: 90 additions & 397 deletions

.azure-pipelines/code-scan.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.azure-pipelines/docker/DockerfileCodeScan.devel

Lines changed: 0 additions & 40 deletions
This file was deleted.

.azure-pipelines/docker/ubuntu-2404.devel

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ FROM ubuntu:${UBUNTU_VER}
1919
ENV LANG C.UTF-8
2020

2121
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
22-
python3 \
23-
python3-pip \
24-
python3.12-dev \
25-
autoconf \
2622
build-essential \
27-
cmake \
23+
ca-certificates \
2824
git \
2925
libomp-dev \
3026
numactl \
@@ -34,7 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
3430
jq \
3531
vim
3632

37-
RUN ln -sf $(which python3) /usr/bin/python
33+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
3834

3935
ARG USER_ID=1000
4036
ARG GROUP_ID=1000
@@ -44,10 +40,15 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \
4440

4541
USER hostuser
4642

47-
ENV PATH="/home/hostuser/.local/bin:$PATH"
48-
RUN pip config set global.break-system-packages true
49-
RUN pip install pip packaging --upgrade
50-
RUN pip install --no-cache-dir setuptools
51-
RUN pip list
43+
ENV PATH="/home/hostuser/.venv/bin:$PATH"
44+
ENV VIRTUAL_ENV="/home/hostuser/.venv"
45+
ENV UV_NO_PROGRESS=1 \
46+
UV_LINK_MODE=copy \
47+
TZ='Asia/Shanghai' \
48+
TQDM_MININTERVAL=120 \
49+
HF_HUB_DISABLE_PROGRESS_BARS=1
50+
51+
RUN uv venv --python=3.12 /home/hostuser/.venv
52+
RUN which python && python --version
5253

5354
WORKDIR /

.azure-pipelines/model-test-3x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ stages:
8787
cd ${OUT_SCRIPT_PATH}
8888
mkdir generated
8989
mkdir last_generated
90-
pip install requests
90+
pip install requests uv
9191
python -u collect_log_all.py --logs_dir $(OUT_SCRIPT_PATH) --output_dir generated --build_id=$(Build.BuildId)
9292
displayName: "Collect all logs"
9393
- task: DownloadPipelineArtifact@2

.azure-pipelines/scripts/codeScan/bandit/bandit.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

.azure-pipelines/scripts/codeScan/pydocstyle/pydocstyle.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

.azure-pipelines/scripts/codeScan/pydocstyle/scan_path.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

.azure-pipelines/scripts/install_nc.sh

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,41 @@ set -x
33
echo -e "##[group]Install Neural Compressor ... "
44
cd /neural-compressor
55

6+
if ! command -v uv &> /dev/null; then
7+
pip install uv
8+
export UV_SYSTEM_PYTHON=1
9+
fi
10+
611
if [[ $1 = *"3x_pt"* ]]; then
7-
pip install --no-cache-dir -r requirements_pt.txt
12+
uv pip install --no-cache-dir -r requirements_pt.txt
813
if [[ $1 = *"hpu"* ]]; then
9-
pip uninstall neural_compressor_3x_pt -y || true
14+
uv pip uninstall neural_compressor_3x_pt -y || true
1015
elif [[ $1 = *"xpu"* ]]; then
1116
echo -e "\n Install torch XPU ... "
12-
pip install torch==2.9.1 torchvision --index-url https://download.pytorch.org/whl/xpu
13-
pip install auto-round-lib==0.10.2.1 # mapping torch and auto-round version
17+
uv pip install torch==2.11.0 torchvision --index-url https://download.pytorch.org/whl/xpu
18+
uv pip install torch==2.11.0 auto-round-lib # mapping torch and auto-round version
1419
else
1520
echo -e "\n Install torch CPU ... "
16-
pip install torch==2.9.1 torchvision --index-url https://download.pytorch.org/whl/cpu
17-
pip install auto-round-lib==0.10.2.1 # mapping torch and auto-round version
21+
uv pip install torch==2.11.0 torchvision --index-url https://download.pytorch.org/whl/cpu
22+
uv pip install torch==2.11.0 auto-round-lib # mapping torch and auto-round version
1823
fi
1924
python setup.py pt bdist_wheel
20-
pip install --no-deps dist/neural_compressor*.whl --force-reinstall
25+
uv pip install --no-deps dist/neural_compressor*.whl --force-reinstall
2126
elif [[ $1 = *"3x_tf"* ]]; then
22-
pip install tensorflow==2.19.0
23-
python -m pip install --no-cache-dir -r requirements_tf.txt
27+
uv pip install tensorflow==2.19.0
28+
uv pip install --no-cache-dir -r requirements_tf.txt
2429
python setup.py tf bdist_wheel
25-
pip install dist/neural_compressor*.whl --force-reinstall
30+
uv pip install dist/neural_compressor*.whl --force-reinstall
2631
elif [[ $1 = *"3x_jax"* ]]; then
27-
python -m pip install --no-cache-dir -r requirements_jax.txt
32+
uv pip install --no-cache-dir -r requirements_jax.txt
2833
python setup.py jax bdist_wheel
29-
pip install dist/neural_compressor*.whl --force-reinstall
34+
uv pip install dist/neural_compressor*.whl --force-reinstall
3035
else
3136
python setup.py bdist_wheel
32-
pip install dist/neural_compressor*.whl --force-reinstall
37+
uv pip install dist/neural_compressor*.whl --force-reinstall
3338
fi
3439

35-
echo "##[endgroup]"
36-
3740
echo -e "\n pip list after install Neural Compressor ... "
38-
pip list
41+
uv pip list
42+
43+
echo "##[endgroup]"

.azure-pipelines/scripts/models/env_setup.sh

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,11 @@ bash /neural-compressor/.azure-pipelines/scripts/install_nc.sh ${inc_new_api}
6969
cd ${WORK_SOURCE_DIR}/${model_src_dir}
7070

7171
if [[ "${fwk_ver}" != "latest" ]]; then
72-
pip install ruamel.yaml==0.17.40
73-
pip install psutil
74-
pip install protobuf==4.23.4
75-
if [[ "${framework}" == "pytorch" ]]; then
76-
pip install torch==${fwk_ver} --index-url https://download.pytorch.org/whl/cpu
77-
pip install torchvision==${torch_vision_ver} --index-url https://download.pytorch.org/whl/cpu
78-
elif [[ "${framework}" == "onnxrt" ]]; then
79-
pip install onnx==1.15.0
80-
pip install onnxruntime==${fwk_ver}
81-
fi
72+
uv pip install ruamel.yaml==0.17.40
73+
uv pip install psutil
74+
uv pip install protobuf==4.23.4
75+
uv pip install torch==${fwk_ver} --index-url https://download.pytorch.org/whl/cpu
76+
uv pip install torchvision==${torch_vision_ver} --index-url https://download.pytorch.org/whl/cpu
8277
fi
8378

8479
if [ -f "requirements.txt" ]; then
@@ -91,11 +86,11 @@ if [ -f "requirements.txt" ]; then
9186
fi
9287
n=0
9388
until [ "$n" -ge 5 ]; do
94-
python -m pip install -r requirements.txt && break
89+
uv pip install -r requirements.txt && break
9590
n=$((n + 1))
9691
sleep 5
9792
done
98-
pip list
93+
uv pip list
9994
else
10095
$BOLD_RED && echo "Not found requirements.txt file." && $RESET
10196
fi

.azure-pipelines/scripts/models/run_pytorch_models_trigger.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ FRAMEWORK="pytorch"
4646
source /neural-compressor/.azure-pipelines/scripts/fwk_version.sh 'latest'
4747
if [[ "${inc_new_api}" == "3x"* ]]; then
4848
FRAMEWORK_VERSION="latest"
49-
export LD_LIBRARY_PATH=${HOME}/.local/lib/:$LD_LIBRARY_PATH
49+
export LD_LIBRARY_PATH=${HOME}/.venv/lib/:$LD_LIBRARY_PATH
5050
else
5151
FRAMEWORK_VERSION=${pytorch_version}
5252
TORCH_VISION_VERSION=${torchvision_version}

0 commit comments

Comments
 (0)