2024-06-12 11:05:35 +02:00
|
|
|
ARG ONEAPI_VERSION=2024.1.1-devel-ubuntu22.04
|
2024-01-23 08:11:39 +01:00
|
|
|
|
2024-02-02 08:56:31 +01:00
|
|
|
FROM intel/oneapi-basekit:$ONEAPI_VERSION as build
|
2024-01-23 08:11:39 +01:00
|
|
|
|
2024-02-02 08:56:31 +01:00
|
|
|
ARG LLAMA_SYCL_F16=OFF
|
2024-01-23 08:11:39 +01:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y git
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2024-04-29 18:02:45 +02:00
|
|
|
RUN if [ "${LLAMA_SYCL_F16}" = "ON" ]; then \
|
2024-02-02 08:56:31 +01:00
|
|
|
echo "LLAMA_SYCL_F16 is set" && \
|
|
|
|
export OPT_SYCL_F16="-DLLAMA_SYCL_F16=ON"; \
|
|
|
|
fi && \
|
2024-04-29 18:02:45 +02:00
|
|
|
cmake -B build -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16} && \
|
|
|
|
cmake --build build --config Release --target main
|
2024-01-23 08:11:39 +01:00
|
|
|
|
2024-02-02 08:56:31 +01:00
|
|
|
FROM intel/oneapi-basekit:$ONEAPI_VERSION as runtime
|
2024-01-23 08:11:39 +01:00
|
|
|
|
|
|
|
COPY --from=build /app/build/bin/main /main
|
|
|
|
|
|
|
|
ENV LC_ALL=C.utf8
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/main" ]
|