Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

1.5 KB
Raw Blame
#
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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=26.04
FROM ubuntu:${UBUNTU_VER}

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

RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
    build-essential \
    ca-certificates \
    git \
    libomp-dev \
    numactl \
    time \
    wget \
    bc \
    jq \
    vim

COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

ARG USER_ID=1000
ARG GROUP_ID=1000

RUN groupadd -g ${GROUP_ID} hostgroup && \
    useradd -m -u ${USER_ID} -g ${GROUP_ID} hostuser

USER hostuser

ENV PATH="/home/hostuser/.venv/bin:$PATH"
ENV VIRTUAL_ENV="/home/hostuser/.venv"
ENV UV_NO_PROGRESS=1 \
    UV_LINK_MODE=copy

RUN uv python install 3.14
RUN uv venv --python=3.14 /home/hostuser/.venv
RUN which python && python --version
RUN uv pip install torch==2.15.0 torchvision==0.29.2 --extra-index-url https://download.pytorch.org/whl/cpu

WORKDIR /home/hostuser