From f7a5dfc438943918e7cdeb6bb859a638842dc02f Mon Sep 17 00:00:00 2001 From: xiangyang-95 Date: Mon, 17 Jun 2024 11:54:05 +0800 Subject: [PATCH 1/4] doc: add Intel MKL compilation in README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b937881..382de96 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,12 @@ 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 + 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** From cbeca004c8fde8436ebd0315cb4e8e07b906da9b Mon Sep 17 00:00:00 2001 From: xiangyang-95 Date: Mon, 17 Jun 2024 11:57:17 +0800 Subject: [PATCH 2/4] doc: add export environment --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 382de96..838e582 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ If you don't have git, you can download the source code as a file archive from [ - **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" ``` From 89b42ab9549bd0729bf3c3449883643a6b62d5be Mon Sep 17 00:00:00 2001 From: xiangyang-95 Date: Mon, 17 Jun 2024 12:11:17 +0800 Subject: [PATCH 3/4] ci: add docker image for oneapi runner and add workflow in build.yml --- ...ons-runner-ubuntu-oneapi-2024-1.dockerfile | 87 +++++++++++++++++++ .github/workflows/build.yml | 8 ++ 2 files changed, 95 insertions(+) create mode 100644 .github/runners/actions-runner-ubuntu-oneapi-2024-1.dockerfile 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 6aa697b..c8e9d52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,6 +91,14 @@ jobs: vulkan: true sccache: false sccache-conf-path: "" + - os: "linux" + name: "amd64-intel-mkl" + runs-on: "ubuntu-22-04-oneapi-2024-1" + cmake-flags: "-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=Intel10_64lp -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_NATIVE=ON" + run-e2e: false + vulkan: false + sccache: false + sccache-conf-path: "" - os: "linux" name: "amd64-cuda-11-7" runs-on: "ubuntu-18-04-cuda-11-7" From 1b53c305f98c3407f62a6db9c1aedde3ba315595 Mon Sep 17 00:00:00 2001 From: xiangyang-95 Date: Mon, 17 Jun 2024 12:12:57 +0800 Subject: [PATCH 4/4] fix: following naming format --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c8e9d52..388b73c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,7 +92,7 @@ jobs: sccache: false sccache-conf-path: "" - os: "linux" - name: "amd64-intel-mkl" + name: "amd64-mkl-2024-1" runs-on: "ubuntu-22-04-oneapi-2024-1" cmake-flags: "-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=Intel10_64lp -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_NATIVE=ON" run-e2e: false