[CPU] Build CPU wheels on Ubuntu 22.04 with AMX-FP8 support (#58515)
Signed-off-by: zhejiangxiaomai <zhenhui.zhao@intel.com> Signed-off-by: jiang1.li <jiang1.li@intel.com> Co-authored-by: jiang1.li <jiang1.li@intel.com>
This commit is contained in:
co-authored by
jiang1.li
parent
53d2e16a97
commit
5eaa50f151
+31
-3
@@ -27,7 +27,7 @@
|
|||||||
# cache mounts (ccache, cargo registry) aren't exported by `--cache-to
|
# cache mounts (ccache, cargo registry) aren't exported by `--cache-to
|
||||||
# type=registry`, so they don't survive a build landing on a different/fresh
|
# type=registry`, so they don't survive a build landing on a different/fresh
|
||||||
# builder. sccache's cache lives in S3 instead, so it does.
|
# builder. sccache's cache lives in S3 instead, so it does.
|
||||||
FROM ubuntu:25.04 AS base
|
FROM ubuntu:22.04 AS base
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
@@ -52,11 +52,38 @@ RUN if [ "$USE_SCCACHE" = "1" ]; then \
|
|||||||
&& rm -rf sccache.tar.gz sccache-v0.8.1-${SCCACHE_ARCH}-unknown-linux-musl; \
|
&& rm -rf sccache.tar.gz sccache-v0.8.1-${SCCACHE_ARCH}-unknown-linux-musl; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
######################### BINUTILS BUILD IMAGE #########################
|
||||||
|
# Build a newer GNU assembler for the AMX-FP8 instruction set.
|
||||||
|
FROM base AS binutils-build
|
||||||
|
|
||||||
|
ARG BINUTILS_VERSION=2.47
|
||||||
|
|
||||||
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
|
apt-get update -y \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
bison \
|
||||||
|
build-essential \
|
||||||
|
flex \
|
||||||
|
texinfo \
|
||||||
|
xz-utils \
|
||||||
|
&& curl -fsSLO "https://sourceware.org/pub/binutils/releases/binutils-${BINUTILS_VERSION}.tar.xz" \
|
||||||
|
&& tar -xf "binutils-${BINUTILS_VERSION}.tar.xz" \
|
||||||
|
&& mkdir binutils-build \
|
||||||
|
&& cd binutils-build \
|
||||||
|
&& "../binutils-${BINUTILS_VERSION}/configure" --prefix=/opt/binutils --disable-nls --disable-werror \
|
||||||
|
&& make -j"$(nproc)" \
|
||||||
|
&& make install \
|
||||||
|
&& cd .. \
|
||||||
|
&& rm -rf binutils-build "/binutils-${BINUTILS_VERSION}" "binutils-${BINUTILS_VERSION}.tar.xz"
|
||||||
|
|
||||||
######################### COMMON BASE IMAGE #########################
|
######################### COMMON BASE IMAGE #########################
|
||||||
FROM base AS base-common
|
FROM base AS base-common
|
||||||
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
COPY --from=binutils-build /opt/binutils /opt/binutils
|
||||||
|
|
||||||
ARG PYTHON_VERSION=3.12
|
ARG PYTHON_VERSION=3.12
|
||||||
|
|
||||||
ARG max_jobs=32
|
ARG max_jobs=32
|
||||||
@@ -93,7 +120,8 @@ ENV CC=/usr/bin/gcc-15 CXX=/usr/bin/g++-15
|
|||||||
ENV CCACHE_DIR=/root/.cache/ccache
|
ENV CCACHE_DIR=/root/.cache/ccache
|
||||||
ENV CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
ENV CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||||
|
|
||||||
ENV PATH="/root/.local/bin:$PATH"
|
ENV PATH="/opt/binutils/bin:/root/.local/bin:$PATH"
|
||||||
|
ENV COMPILER_PATH="/opt/binutils/bin"
|
||||||
ENV VIRTUAL_ENV="/opt/venv"
|
ENV VIRTUAL_ENV="/opt/venv"
|
||||||
ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
|
ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
|
||||||
RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
|
RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
|
||||||
@@ -168,7 +196,7 @@ RUN apt-get update -y \
|
|||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
COPY requirements/build/rust.txt requirements/build/rust.txt
|
COPY requirements/build/rust.txt requirements/build/rust.txt
|
||||||
RUN python3 -m pip install --break-system-packages --no-cache-dir -r requirements/build/rust.txt
|
RUN python3 -m pip install --no-cache-dir -r requirements/build/rust.txt
|
||||||
|
|
||||||
ARG USE_SCCACHE
|
ARG USE_SCCACHE
|
||||||
ARG SCCACHE_ENDPOINT
|
ARG SCCACHE_ENDPOINT
|
||||||
|
|||||||
Reference in New Issue
Block a user