diff --git a/.github/runners/actions-runner-ubuntu-oneapi-2024-1.dockerfile b/.github/runners/actions-runner-ubuntu-oneapi-2024-1.dockerfile new file mode 100644 index 0000000..5edd699 --- /dev/null +++ b/.github/runners/actions-runner-ubuntu-oneapi-2024-1.dockerfile @@ -0,0 +1,87 @@ +# Use Intel OneAPI 2024.1 devel image with ubuntu 22.04 OS +FROM intel/oneapi-basekit:2024.1.0-devel-ubuntu22.04 + +ARG RUNNER_VERSION=2.311.0 +# Docker and Docker Compose arguments + +# Use 1001 and 121 for compatibility with GitHub-hosted runners +ARG RUNNER_UID=1000 +ARG DOCKER_GID=1001 + +ENV DEBIAN_FRONTEND=noninteractive + +# Install necessary packages +RUN apt-get update -y \ + && apt-get install -y software-properties-common \ + && add-apt-repository -y ppa:git-core/ppa \ + && apt-get update -y \ + && apt-get install -y --no-install-recommends \ + build-essential \ + curl \ + ca-certificates \ + dnsutils \ + ftp \ + git \ + uuid-dev \ + iproute2 \ + iputils-ping \ + jq \ + libunwind8 \ + locales \ + netcat \ + openssh-client \ + parallel \ + python3-pip \ + rsync \ + shellcheck \ + sudo \ + telnet \ + time \ + tzdata \ + unzip \ + upx \ + wget \ + lsb-release \ + openssl \ + manpages-dev \ + zip \ + zstd \ + && ln -sf /usr/bin/python3 /usr/bin/python \ + && ln -sf /usr/bin/pip3 /usr/bin/pip \ + && rm -rf /var/lib/apt/lists/* + +# Update alternatives for GCC and related tools +RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \ + --slave /usr/bin/g++ g++ /usr/bin/g++-11 \ + --slave /usr/bin/gcov gcov /usr/bin/gcov-11 \ + --slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \ + --slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11 && \ + update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-11 110 + +# Download latest git-lfs version +RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ + apt-get install -y --no-install-recommends git-lfs + +RUN adduser --disabled-password --gecos "" --uid $RUNNER_UID runner \ + && groupadd docker --gid $DOCKER_GID \ + && usermod -aG sudo runner \ + && usermod -aG docker runner \ + && echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \ + && echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers + +ENV HOME=/home/runner + +# cd into the user directory, download and unzip the github actions runner +RUN cd /home/runner && mkdir actions-runner && cd actions-runner \ + && curl -O -L https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \ + && tar xzf ./actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz + +RUN chown -R runner:runner /home/runner && /home/runner/actions-runner/bin/installdependencies.sh + +ADD start.sh start.sh + +RUN chmod +x start.sh + +USER runner + +ENTRYPOINT ["./start.sh"] \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2afbd94..e16f0a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,6 +91,14 @@ jobs: vulkan: true sccache: true sccache-conf-path: "/tmp/sccache.conf" + - os: "linux" + name: "amd64-mkl-2024-1" + runs-on: "ubuntu-22-04-oneapi-2024-1" + cmake-flags: "-DLLAMA_NATIVE=ON -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=Intel10_64lp -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx" + run-e2e: false + vulkan: false + sccache: false + sccache-conf-path: "/tmp/sccache.conf" - os: "linux" name: "amd64-avx2-cuda-11-7" runs-on: "ubuntu-20-04-cuda-11-7" diff --git a/README.md b/README.md index b937881..838e582 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,13 @@ If you don't have git, you can download the source code as a file archive from [ make build-example-server CMAKE_EXTRA_FLAGS="-DLLAMA_CUDA=ON" ``` +- **On Linux with Intel oneMKL:** + + ```bash + source /opt/intel/oneapi/setvars.sh + make build-example-server CMAKE_EXTRA_FLAGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=Intel10_64lp -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_NATIVE=ON" + ``` + # Quickstart **Step 1: Downloading a Model**