Skip to content

Commit 268f7dd

Browse files
authored
[CI] Update python to 3.12 and torch to 2.8.0 (#741)
1 parent 05cab09 commit 268f7dd

File tree

14 files changed

+32
-33
lines changed

14 files changed

+32
-33
lines changed

.azure-pipelines/code-scan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ pr:
99
paths:
1010
include:
1111
- auto_round
12+
- auto_round_extension
1213
- setup.py
1314
- requirements.txt
15+
- requirements-cpu.txt
16+
- requirements-lib.txt
1417
- .azure-pipelines/code-scan.yml
1518
- .azure-pipelines/scripts/codeScan
1619

.azure-pipelines/docker/Dockerfile.devel

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,20 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
ARG UBUNTU_VER=22.04
16-
FROM ubuntu:${UBUNTU_VER} as devel
15+
ARG UBUNTU_VER=24.04
16+
FROM ubuntu:${UBUNTU_VER}
1717

1818
# See http://bugs.python.org/issue19846
1919
ENV LANG C.UTF-8
2020

2121
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
2222
python3 \
2323
python3-pip \
24-
python3-dev \
25-
python3-distutils \
24+
python3.12-dev \
2625
autoconf \
2726
build-essential \
2827
git \
29-
libgl1-mesa-glx \
30-
libglib2.0-0 \
28+
libomp-dev \
3129
numactl \
3230
time \
3331
wget \
@@ -45,10 +43,9 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \
4543

4644
USER hostuser
4745

48-
ENV PATH="/home/hostuser/.local/bin:${PATH}"
49-
RUN python -m pip install --no-cache-dir --upgrade pip
50-
RUN python -m pip install --no-cache-dir setuptools
51-
46+
ENV PATH="/home/hostuser/.local/bin:$PATH"
47+
RUN pip config set global.break-system-packages true
48+
RUN python -m pip install --no-cache-dir --upgrade pip setuptools
5249
RUN pip list
5350

5451
WORKDIR /

.azure-pipelines/docker/DockerfileCodeScan.devel

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
ARG UBUNTU_VER=22.04
16+
ARG UBUNTU_VER=24.04
1717
FROM ubuntu:${UBUNTU_VER} as devel
1818

1919
# See http://bugs.python.org/issue19846
@@ -24,8 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
2424
aspell-en \
2525
python3 \
2626
python3-pip \
27-
python3-dev \
28-
python3-distutils \
2927
autoconf \
3028
build-essential \
3129
wget
@@ -40,9 +38,8 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \
4038

4139
USER hostuser
4240

43-
ENV PATH="/home/hostuser/.local/bin:${PATH}"
44-
RUN python -m pip install --no-cache-dir --upgrade pip
45-
RUN python -m pip install --no-cache-dir pylint==2.12.1\
46-
bandit
41+
ENV PATH="/home/hostuser/.local/bin:$PATH"
42+
RUN pip config set global.break-system-packages true
43+
RUN python -m pip install --no-cache-dir pylint bandit
4744

4845
WORKDIR /

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo "[DEBUG] list pipdeptree..."
2323
pip install pipdeptree
2424
pipdeptree
2525

26-
python -m pylint -f json --disable=R,C,W,E1129 --enable=line-too-long --max-line-length=120 --extension-pkg-whitelist=numpy --ignored-classes=TensorProto,NodeProto \
26+
python -m pylint -f json --disable=R,C,W,E0606,E1129 --enable=line-too-long --max-line-length=120 --extension-pkg-whitelist=numpy --ignored-classes=TensorProto,NodeProto \
2727
--ignored-modules=tensorflow,keras,torch,torch.quantization,torch.tensor,torchvision,fairseq,mxnet,onnx,onnxruntime,intel_extension_for_pytorch,intel_extension_for_tensorflow,torchinfo,horovod,transformers,deepspeed,deepspeed.module_inject \
2828
/auto-round/${scan_module} > $log_dir/pylint.json
2929

.azure-pipelines/scripts/ut/run_ut_cuda.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function create_conda_env() {
3636
fi
3737
uv pip install -v --no-build-isolation .
3838
uv pip install pytest-cov pytest-html cmake==4.0.2
39+
uv pip install torch==2.8.0 torchvision
3940
}
4041

4142
function print_test_results_table() {
@@ -107,7 +108,7 @@ function run_unit_test() {
107108
local auto_round_path=$(python -c 'import auto_round; print(auto_round.__path__[0])')
108109

109110
# run unit tests individually with separate logs
110-
for test_file in $(find . -name "test_*.py"); do
111+
for test_file in $(find . -name "test_*.py" ! -name "test_*vlms.py" | sort); do
111112
local test_basename=$(basename ${test_file} .py)
112113
local ut_log_name=${LOG_DIR}/unittest_cuda_${test_basename}.log
113114
echo "Running ${test_file}..."

.azure-pipelines/template/docker-template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ steps:
7474
7575
- ${{ if eq(parameters.imageSource, 'pull') }}:
7676
- script: |
77-
docker pull vault.habana.ai/gaudi-docker/1.21.0/ubuntu22.04/habanalabs/pytorch-installer-2.6.0:latest
77+
docker pull vault.habana.ai/gaudi-docker/1.22.1/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest
7878
displayName: "Pull habana docker image"
7979
8080
- script: |
@@ -95,7 +95,7 @@ steps:
9595
else
9696
docker run -dit --disable-content-trust --privileged --name=${{ parameters.containerName }} --shm-size="2g" \
9797
--runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host \
98-
-v ${BUILD_SOURCESDIRECTORY}:/auto-round vault.habana.ai/gaudi-docker/1.21.0/ubuntu22.04/habanalabs/pytorch-installer-2.6.0:latest
98+
-v ${BUILD_SOURCESDIRECTORY}:/auto-round vault.habana.ai/gaudi-docker/1.22.1/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest
9999
docker exec ${{ parameters.containerName }} bash -c "ln -sf \$(which python3) /usr/bin/python"
100100
fi
101101
echo "Show the container list after docker run ... "

.azure-pipelines/template/ut-template.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ steps:
2626
parameters:
2727
dockerConfigName: ${{ parameters.dockerConfigName }}
2828
repoName: "auto-round"
29-
repoTag: "py310"
29+
repoTag: "py312"
3030
dockerFileName: "Dockerfile"
3131
containerName: ${{ parameters.utContainerName }}
3232
repo: ${{ parameters.repo }}
@@ -35,9 +35,10 @@ steps:
3535
- ${{ if eq(parameters.imageSource, 'build') }}:
3636
- script: |
3737
docker exec ${{ parameters.utContainerName }} bash -c "cd /auto-round \
38-
&& pip install torch==2.7.1 torchvision --index-url https://download.pytorch.org/whl/cpu \
39-
&& pip install intel-extension-for-pytorch==2.7.0 \
40-
&& pip install .[cpu] \
38+
&& pip install torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/cpu \
39+
&& pip install intel-extension-for-pytorch==2.8.0 \
40+
&& pip install -r requirements-cpu.txt \
41+
&& pip install . \
4142
&& pip list"
4243
displayName: "Env Setup"
4344

.azure-pipelines/unit-test-hpu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pr:
99
paths:
1010
include:
1111
- auto_round
12+
- auto_round_extension
1213
- test/test*hpu*'
1314
- setup.py
1415
- requirements-lib.txt

.azure-pipelines/unit-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ stages:
9292
echo "--- collect logs ---"
9393
docker exec collectLogs bash -c "cd /auto-round \
9494
&& pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu \
95-
&& pip install -r requirements-cpu.txt \
96-
&& pip install --no-build-isolation . \
95+
&& pip install . \
9796
&& pip list"
9897
docker exec collectLogs /bin/bash +x -c "cd /auto-round/.azure-pipelines/scripts \
9998
&& bash ut/collect_log.sh"

auto_round/compressors/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def _adjust_torch_compile(self, enable_torch_compile: bool) -> None:
595595
):
596596
logger.info(
597597
"'enable_torch_compile' is set to `False` by default. "
598-
"Enabling it can reduce tuning cost by 20%, but it might throw an exception."
598+
"Enabling it can reduce tuning cost by 20%%, but it might throw an exception."
599599
)
600600

601601
if (self.data_type.startswith("fp") or self.act_data_type.startswith("fp")) and self.enable_torch_compile:

0 commit comments

Comments
 (0)