-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker for code-generation (#444)
Signed-off-by: changwangss <chang1.wang@intel.com> Signed-off-by: Wenxin Zhang <wenxin.zhang@intel.com> Co-authored-by: Wenxin Zhang <wenxin.zhang@intel.com>
- Loading branch information
1 parent
01a809d
commit dd38290
Showing
5 changed files
with
71 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
ARG IMAGE_NAME=ubuntu | ||
ARG IMAGE_TAG=22.04 | ||
FROM ${IMAGE_NAME}:${IMAGE_TAG} as base | ||
|
||
FROM base as itrex-base | ||
|
||
ARG PYTHON=python3.10 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ | ||
libgl1-mesa-glx \ | ||
libglib2.0-0 \ | ||
${PYTHON} \ | ||
python3-pip && \ | ||
apt-get clean autoclean && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN ln -sf $(which ${PYTHON}) /usr/bin/python | ||
|
||
RUN ${PYTHON} -m pip install -U pip | ||
|
||
FROM itrex-base as devel | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
ENV LANG C.UTF-8 | ||
ARG PYTHON=python3.10 | ||
|
||
RUN mkdir -p /app/intel-extension-for-transformers | ||
WORKDIR /app/intel-extension-for-transformers | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ | ||
autoconf \ | ||
build-essential \ | ||
ca-certificates \ | ||
cmake \ | ||
git \ | ||
${PYTHON}-dev && \ | ||
apt-get clean autoclean && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY . /app/intel-extension-for-transformers | ||
|
||
RUN ${PYTHON} -m pip install -r requirements.txt --no-cache-dir -f https://download.pytorch.org/whl/cpu/torch_stable.html | ||
|
||
RUN ${PYTHON} -m pip install torch==2.1.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html | ||
|
||
RUN ${PYTHON} -m pip install -r examples/huggingface/pytorch/code-generation/quantization/requirements.txt --no-cache-dir | ||
|
||
RUN ${PYTHON} -m pip install /app/intel-extension-for-transformers/intel_extension_for_pytorch-2.1.0-cp310-cp310-manylinux2014_x86_64.whl | ||
|
||
RUN ${PYTHON} -m pip install intel_extension_for_transformers | ||
FROM itrex-base as prod | ||
|
||
ARG PYTHON=python3.10 | ||
|
||
COPY --from=devel /usr/local/lib/${PYTHON}/dist-packages /usr/local/lib/${PYTHON}/dist-packages | ||
COPY --from=devel /usr/local/bin /usr/local/bin | ||
COPY --from=devel /usr/bin /usr/bin | ||
COPY --from=devel /app/intel-extension-for-transformers/examples/huggingface/pytorch/code-generation/quantization /app/intel-extension-for-transformers/examples/huggingface/pytorch/code-generation/quantization | ||
|
||
WORKDIR /app/intel-extension-for-transformers/examples/huggingface/pytorch/code-generation/quantization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters