PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度
Add Dockerfile with torch installed, enhance image build logic to check for changes (#1811)
chen, suyue694ad39a57fc
diff --git a/.azure-pipelines/docker/Dockerfile.devel b/.azure-pipelines/docker/Dockerfile.develindex 8fa3e1879..f80c19a8a 100644--- a/.azure-pipelines/docker/Dockerfile.devel+++ b/.azure-pipelines/docker/Dockerfile.devel@@ -48,5 +48,6 @@ ENV UV_NO_PROGRESS=1 \RUN uv venv --python=3.12 /home/hostuser/.venvRUN which python && python --version+RUN uv pip install torch==2.11.0 torchvision==0.26.0 --extra-index-url https://download.pytorch.org/whl/cpuWORKDIR /home/hostuserdiff --git a/.azure-pipelines/docker/Dockerfile_xpu.devel b/.azure-pipelines/docker/Dockerfile_xpu.develindex e0d41ad13..3f58171fb 100644--- a/.azure-pipelines/docker/Dockerfile_xpu.devel+++ b/.azure-pipelines/docker/Dockerfile_xpu.devel@@ -48,5 +48,6 @@ ENV UV_NO_PROGRESS=1 \RUN uv venv --python=3.12 /home/hostuser/.venvRUN which python && python --version+RUN uv pip install torch==2.11.0 torchvision==0.26.0 --extra-index-url https://download.pytorch.org/whl/xpuWORKDIR /home/hostuserdiff --git a/.azure-pipelines/template/docker-template.yml b/.azure-pipelines/template/docker-template.ymlindex 4f4d5c06e..693d6f9e2 100644--- a/.azure-pipelines/template/docker-template.yml+++ b/.azure-pipelines/template/docker-template.yml@@ -61,17 +61,28 @@ steps:- ${{ if eq(parameters.imageSource, 'build') }}:- script: |+ set -eo pipefail+docker image prune -fIMAGE="${{ parameters.repoName }}:${{ parameters.repoTag }}"+ DOCKERFILE="${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/${{parameters.dockerFileName}}.devel"+ CURRENT_HASH=$(md5sum "$DOCKERFILE" | awk '{print $1}')+ NEED_BUILD=falseif [[ ! $(docker image ls --format '{{.Repository}}:{{.Tag}}' | grep -Fx "$IMAGE") ]]; then+ NEED_BUILD=true+ else+ EXISTING_HASH=$(docker inspect --format='{{index .Config.Labels "dockerfile.hash"}}' "$IMAGE" 2>/dev/null || echo "")+ if [[ "$CURRENT_HASH" != "$EXISTING_HASH" ]]; then+ echo "Dockerfile changed (old=$EXISTING_HASH, new=$CURRENT_HASH), rebuilding image..."+ NEED_BUILD=true+ fi+ fi+ if [[ "$NEED_BUILD" == "true" ]]; thendocker build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) \- -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/${{parameters.dockerFileName}}.devel -t $IMAGE .+ --label "dockerfile.hash=$CURRENT_HASH" \+ -f "$DOCKERFILE" -t $IMAGE .fidocker images | grep -i ${{ parameters.repoName }}- if [[ $? -ne 0 ]]; then- echo "NO Such Repo"- exit 1- fidisplayName: "Build develop docker image"- ${{ if eq(parameters.imageSource, 'pull') }}: