From 8415e1f62a0feb26ae6b1be4089fd4f7ac055dbb Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 15 Jun 2025 18:59:19 -0700 Subject: [PATCH 01/11] update docker images to ubuntu 2404 Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/Dockerfile.devel | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index 818262ae7..5935264ce 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -12,8 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -ARG UBUNTU_VER=22.04 -FROM ubuntu:${UBUNTU_VER} as devel +ARG UBUNTU_VER=24.04 +FROM ubuntu:${UBUNTU_VER} # See http://bugs.python.org/issue19846 ENV LANG C.UTF-8 @@ -21,13 +21,9 @@ ENV LANG C.UTF-8 RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ python3 \ python3-pip \ - python3-dev \ - python3-distutils \ autoconf \ build-essential \ git \ - libgl1-mesa-glx \ - libglib2.0-0 \ numactl \ time \ wget \ @@ -45,8 +41,8 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \ USER hostuser -RUN python -m pip install --no-cache-dir --upgrade pip -RUN python -m pip install --no-cache-dir setuptools +RUN pip config set global.break-system-packages true +RUN pip install --no-cache-dir --upgrade pip setuptools RUN pip list From e915e65631d69f99ec350b6b7c351e362e414323 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 15 Jun 2025 19:11:29 -0700 Subject: [PATCH 02/11] fix Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/Dockerfile.devel | 2 +- .azure-pipelines/template/ut-template.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index 5935264ce..7ea6bae30 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -42,7 +42,7 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \ USER hostuser RUN pip config set global.break-system-packages true -RUN pip install --no-cache-dir --upgrade pip setuptools +RUN pip install pip setuptools==69.5.1 RUN pip list diff --git a/.azure-pipelines/template/ut-template.yml b/.azure-pipelines/template/ut-template.yml index 9a18eea29..e2b134643 100644 --- a/.azure-pipelines/template/ut-template.yml +++ b/.azure-pipelines/template/ut-template.yml @@ -26,7 +26,7 @@ steps: parameters: dockerConfigName: ${{ parameters.dockerConfigName }} repoName: "auto-round" - repoTag: "py310" + repoTag: "py312" dockerFileName: "Dockerfile" containerName: ${{ parameters.utContainerName }} repo: ${{ parameters.repo }} From f2216596f3b15a683d171def08361bba2a125e5d Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 15 Jun 2025 20:15:47 -0700 Subject: [PATCH 03/11] fix Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/Dockerfile.devel | 3 ++- .azure-pipelines/scripts/ut/run_ut.sh | 2 +- .azure-pipelines/template/ut-template.yml | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index 7ea6bae30..fe05b7362 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -42,7 +42,8 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \ USER hostuser RUN pip config set global.break-system-packages true -RUN pip install pip setuptools==69.5.1 +RUN python -m pip install --no-cache-dir --upgrade pip +RUN python -m pip install --no-cache-dir setuptools==69.5.1 RUN pip list diff --git a/.azure-pipelines/scripts/ut/run_ut.sh b/.azure-pipelines/scripts/ut/run_ut.sh index 2a192dbb8..693a769c5 100644 --- a/.azure-pipelines/scripts/ut/run_ut.sh +++ b/.azure-pipelines/scripts/ut/run_ut.sh @@ -8,7 +8,7 @@ pip install pytest-cov pytest-html pip install -r /auto-round/test/test_cpu/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu pip list # install latest gguf for ut test -git clone https://github.com/ggml-org/llama.cpp.git && cd llama.cpp/gguf-py && pip install . +pip install 'git+https://github.com/ggml-org/llama.cpp.git#subdirectory=gguf-py' echo "##[endgroup]" pip list diff --git a/.azure-pipelines/template/ut-template.yml b/.azure-pipelines/template/ut-template.yml index e2b134643..980975f8c 100644 --- a/.azure-pipelines/template/ut-template.yml +++ b/.azure-pipelines/template/ut-template.yml @@ -35,9 +35,10 @@ steps: - ${{ if eq(parameters.imageSource, 'build') }}: - script: | docker exec ${{ parameters.utContainerName }} bash -c "cd /auto-round \ - && pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu \ + && pip install torch==2.7.1 --index-url https://download.pytorch.org/whl/cpu \ && pip install intel-extension-for-pytorch==2.7.0 \ - && pip install .[cpu] \ + && pip install -r requirements-cpu.txt \ + && pip install . \ && pip list" displayName: "Env Setup" From 17fe301ea0667076e404d40c34a81d9415bb24a3 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 15 Jun 2025 20:19:30 -0700 Subject: [PATCH 04/11] fix Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/Dockerfile.devel | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index fe05b7362..7ea6bae30 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -42,8 +42,7 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \ USER hostuser RUN pip config set global.break-system-packages true -RUN python -m pip install --no-cache-dir --upgrade pip -RUN python -m pip install --no-cache-dir setuptools==69.5.1 +RUN pip install pip setuptools==69.5.1 RUN pip list From d654f9fb3793680cb7e515146514f22e2cd58a7f Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 15 Jun 2025 20:26:34 -0700 Subject: [PATCH 05/11] fix Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/Dockerfile.devel | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index 7ea6bae30..e50ffc6b7 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -41,9 +41,8 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \ USER hostuser +ENV PATH="/home/hostuser/.local/bin:$PATH" RUN pip config set global.break-system-packages true -RUN pip install pip setuptools==69.5.1 - RUN pip list WORKDIR / From 9033047d7a252f74aaf05c0a35f595328887ce49 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 17 Aug 2025 21:08:35 -0700 Subject: [PATCH 06/11] upgrade torch to 2.8.0 Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/DockerfileCodeScan.devel | 6 +++--- .azure-pipelines/scripts/ut/run_ut.sh | 2 +- .azure-pipelines/template/ut-template.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/docker/DockerfileCodeScan.devel b/.azure-pipelines/docker/DockerfileCodeScan.devel index 7eba9068d..11c184ca0 100644 --- a/.azure-pipelines/docker/DockerfileCodeScan.devel +++ b/.azure-pipelines/docker/DockerfileCodeScan.devel @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG UBUNTU_VER=22.04 +ARG UBUNTU_VER=24.04 FROM ubuntu:${UBUNTU_VER} as devel # See http://bugs.python.org/issue19846 @@ -24,8 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ aspell-en \ python3 \ python3-pip \ - python3-dev \ - python3-distutils \ autoconf \ build-essential \ wget @@ -40,6 +38,8 @@ RUN groupadd -g ${GROUP_ID} hostgroup && \ USER hostuser +ENV PATH="/home/hostuser/.local/bin:$PATH" +RUN pip config set global.break-system-packages true RUN python -m pip install --no-cache-dir pylint==2.12.1\ bandit diff --git a/.azure-pipelines/scripts/ut/run_ut.sh b/.azure-pipelines/scripts/ut/run_ut.sh index 693a769c5..2a192dbb8 100644 --- a/.azure-pipelines/scripts/ut/run_ut.sh +++ b/.azure-pipelines/scripts/ut/run_ut.sh @@ -8,7 +8,7 @@ pip install pytest-cov pytest-html pip install -r /auto-round/test/test_cpu/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu pip list # install latest gguf for ut test -pip install 'git+https://github.com/ggml-org/llama.cpp.git#subdirectory=gguf-py' +git clone https://github.com/ggml-org/llama.cpp.git && cd llama.cpp/gguf-py && pip install . echo "##[endgroup]" pip list diff --git a/.azure-pipelines/template/ut-template.yml b/.azure-pipelines/template/ut-template.yml index 5a5f41c64..d9a88568b 100644 --- a/.azure-pipelines/template/ut-template.yml +++ b/.azure-pipelines/template/ut-template.yml @@ -35,8 +35,8 @@ steps: - ${{ if eq(parameters.imageSource, 'build') }}: - script: | docker exec ${{ parameters.utContainerName }} bash -c "cd /auto-round \ - && pip install torch==2.7.1 torchvision --index-url https://download.pytorch.org/whl/cpu \ - && pip install intel-extension-for-pytorch==2.7.0 \ + && pip install torch==2.8.0 torchvision --index-url https://download.pytorch.org/whl/cpu \ + && pip install intel-extension-for-pytorch==2.8.0 \ && pip install -r requirements-cpu.txt \ && pip install . \ && pip list" From 69fae86834f9e8ecf36ffe0222a6054099243d70 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 17 Aug 2025 21:15:14 -0700 Subject: [PATCH 07/11] fix pylint Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/DockerfileCodeScan.devel | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azure-pipelines/docker/DockerfileCodeScan.devel b/.azure-pipelines/docker/DockerfileCodeScan.devel index 11c184ca0..acf0cad76 100644 --- a/.azure-pipelines/docker/DockerfileCodeScan.devel +++ b/.azure-pipelines/docker/DockerfileCodeScan.devel @@ -40,7 +40,6 @@ USER hostuser ENV PATH="/home/hostuser/.local/bin:$PATH" RUN pip config set global.break-system-packages true -RUN python -m pip install --no-cache-dir pylint==2.12.1\ - bandit +RUN python -m pip install --no-cache-dir pylint bandit WORKDIR / From da0f3000715f77e45b073e0a8a9839b628543f4c Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 17 Aug 2025 23:01:53 -0700 Subject: [PATCH 08/11] add libomp-dev Signed-off-by: Sun, Xuehao --- .azure-pipelines/docker/Dockerfile.devel | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index e50ffc6b7..df09c18d4 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -24,6 +24,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ autoconf \ build-essential \ git \ + libomp-dev \ numactl \ time \ wget \ From feefa6d2dac9c18ec3c7fe6aa8eecdcfe449e1f7 Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Sun, 17 Aug 2025 23:14:47 -0700 Subject: [PATCH 09/11] add python3.12-dev Signed-off-by: Sun, Xuehao --- .azure-pipelines/code-scan.yml | 3 +++ .azure-pipelines/docker/Dockerfile.devel | 1 + .azure-pipelines/unit-test-hpu.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/.azure-pipelines/code-scan.yml b/.azure-pipelines/code-scan.yml index 43dac1db6..7e2f24002 100644 --- a/.azure-pipelines/code-scan.yml +++ b/.azure-pipelines/code-scan.yml @@ -9,8 +9,11 @@ pr: paths: include: - auto_round + - auto_round_extension - setup.py - requirements.txt + - requirements-cpu.txt + - requirements-lib.txt - .azure-pipelines/code-scan.yml - .azure-pipelines/scripts/codeScan diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.devel index df09c18d4..e5f204241 100644 --- a/.azure-pipelines/docker/Dockerfile.devel +++ b/.azure-pipelines/docker/Dockerfile.devel @@ -21,6 +21,7 @@ ENV LANG C.UTF-8 RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ python3 \ python3-pip \ + python3.12-dev \ autoconf \ build-essential \ git \ diff --git a/.azure-pipelines/unit-test-hpu.yml b/.azure-pipelines/unit-test-hpu.yml index 8eb4c6999..f2446b817 100644 --- a/.azure-pipelines/unit-test-hpu.yml +++ b/.azure-pipelines/unit-test-hpu.yml @@ -9,6 +9,7 @@ pr: paths: include: - auto_round + - auto_round_extension - test/test*hpu*' - setup.py - requirements-lib.txt From 8d87282a07a0897dfdc5c99d12637b08822becde Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Fri, 22 Aug 2025 10:26:39 +0800 Subject: [PATCH 10/11] fix Signed-off-by: Sun, Xuehao --- auto_round/export/export_to_itrex/model_wrapper.py | 4 ++-- auto_round/wrapper.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/auto_round/export/export_to_itrex/model_wrapper.py b/auto_round/export/export_to_itrex/model_wrapper.py index 0d736b0b1..d6120cd72 100644 --- a/auto_round/export/export_to_itrex/model_wrapper.py +++ b/auto_round/export/export_to_itrex/model_wrapper.py @@ -349,10 +349,10 @@ def forward(self, input): self.weight = weight input = input.type(self.weight.dtype) logger.debug(f"Calculating {self}") - return F.linear(input, self.weight, self.bias) + return F.linear(input, self.weight, self.bias) # pylint: disable=E1102 else: input = input.type(weight.dtype) - return F.linear(input, weight, self.bias) + return F.linear(input, weight, self.bias) # pylint: disable=E1102 def extra_repr(self) -> str: tmp_str = "in_features={}, out_features={}, bits={}, group_size={}, bias={}".format( diff --git a/auto_round/wrapper.py b/auto_round/wrapper.py index c3dfc0765..91c2970f1 100644 --- a/auto_round/wrapper.py +++ b/auto_round/wrapper.py @@ -365,7 +365,7 @@ def linear_forward(self, x, weight, bias): Returns: torch.Tensor: Output tensor after applying the linear layer. """ - return F.linear(x, weight, bias) + return F.linear(x, weight, bias) # pylint: disable=E1102 def conv1d_forward(self, x, weight, bias): """Performs the forward pass for a Conv1D layer. From eaf737b034fa1937e21c8a195e2026a1f13a82ed Mon Sep 17 00:00:00 2001 From: "Sun, Xuehao" Date: Fri, 12 Sep 2025 10:57:55 +0800 Subject: [PATCH 11/11] update habana version Signed-off-by: Sun, Xuehao --- .azure-pipelines/template/docker-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/template/docker-template.yml b/.azure-pipelines/template/docker-template.yml index 96a078a4b..9d18d7f5d 100644 --- a/.azure-pipelines/template/docker-template.yml +++ b/.azure-pipelines/template/docker-template.yml @@ -74,7 +74,7 @@ steps: - ${{ if eq(parameters.imageSource, 'pull') }}: - script: | - docker pull vault.habana.ai/gaudi-docker/1.21.0/ubuntu22.04/habanalabs/pytorch-installer-2.6.0:latest + docker pull vault.habana.ai/gaudi-docker/1.22.0/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest displayName: "Pull habana docker image" - script: | @@ -95,7 +95,7 @@ steps: else docker run -dit --disable-content-trust --privileged --name=${{ parameters.containerName }} --shm-size="2g" \ --runtime=habana -e HABANA_VISIBLE_DEVICES=all -e OMPI_MCA_btl_vader_single_copy_mechanism=none --cap-add=sys_nice --net=host --ipc=host \ - -v ${BUILD_SOURCESDIRECTORY}:/auto-round vault.habana.ai/gaudi-docker/1.21.0/ubuntu22.04/habanalabs/pytorch-installer-2.6.0:latest + -v ${BUILD_SOURCESDIRECTORY}:/auto-round vault.habana.ai/gaudi-docker/1.22.0/ubuntu24.04/habanalabs/pytorch-installer-2.7.1:latest docker exec ${{ parameters.containerName }} bash -c "ln -sf \$(which python3) /usr/bin/python" fi echo "Show the container list after docker run ... "