2024-01-28 07:55:31 +00:00
|
|
|
ARG ONEAPI_VERSION=2024.0.1-devel-ubuntu22.04
|
|
|
|
|
2024-02-02 07:56:31 +00:00
|
|
|
FROM intel/oneapi-basekit:$ONEAPI_VERSION as build
|
2024-01-28 07:55:31 +00:00
|
|
|
|
2024-02-02 07:56:31 +00:00
|
|
|
ARG LLAMA_SYCL_F16=OFF
|
2024-01-28 07:55:31 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y git
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN mkdir build && \
|
|
|
|
cd build && \
|
2024-02-02 07:56:31 +00:00
|
|
|
if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
|
|
|
|
echo "LLAMA_SYCL_F16 is set" && \
|
|
|
|
export OPT_SYCL_F16="-DLLAMA_SYCL_F16=ON"; \
|
|
|
|
fi && \
|
|
|
|
cmake .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \
|
|
|
|
cmake --build . --config Release --target server
|
|
|
|
|
|
|
|
FROM intel/oneapi-basekit:$ONEAPI_VERSION as runtime
|
2024-01-28 07:55:31 +00:00
|
|
|
|
|
|
|
COPY --from=build /app/build/bin/server /server
|
|
|
|
|
|
|
|
ENV LC_ALL=C.utf8
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/server" ]
|