From e13b575980cd62afec5259c9001ccd77261ff580 Mon Sep 17 00:00:00 2001 From: thxCode Date: Fri, 27 Sep 2024 22:34:53 +0800 Subject: [PATCH] ci: fuse runtime lib Signed-off-by: thxCode --- .github/workflows/ci.yml | 61 +++++++++++++++++++++++++++++++++++----- README.md | 11 +++++++- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c48919..2b6643f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -395,6 +395,17 @@ jobs: ldd --version # NB(thxCode): ldd is not available on arm64 mocked by QEMU, # see https://github.com/multiarch/qemu-user-static/issues/172. + echo "***** BEFORE *****" + ldd_output=\$(ldd ${{ github.workspace }}/build/bin/llama-box || echo "") + echo "\${ldd_output}" + library_paths=\$(echo "\${ldd_output}" | grep -Eo '=> [^ ]+' | sed 's/=> //') + for library_path in \${library_paths}; do + if [[ -f \${library_path} ]] && [[ \${library_path} == /opt/rocm/lib/* ]]; then + cp \${library_path} ${{ github.workspace }}/build/bin/ || true + fi + done + echo "***** AFTER *****" + export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin:\${LD_LIBRARY_PATH}" ldd ${{ github.workspace }}/build/bin/llama-box || true else exit 1 @@ -540,13 +551,21 @@ jobs: ldd --version # NB(thxCode): ldd is not available on arm64 mocked by QEMU, # see https://github.com/multiarch/qemu-user-static/issues/172. + echo "***** BEFORE *****" + ldd_output=\$(ldd ${{ github.workspace }}/build/bin/llama-box || echo "") + echo "\${ldd_output}" + library_paths=\$(echo "\${ldd_output}" | grep -Eo '=> [^ ]+' | sed 's/=> //') + for library_path in \${library_paths}; do + if [[ -f \${library_path} ]] && [[ \${library_path} == /usr/local/cuda/lib64/* ]]; then + cp \${library_path} ${{ github.workspace }}/build/bin/ || true + fi + done + echo "***** AFTER *****" + export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin:\${LD_LIBRARY_PATH}" ldd ${{ github.workspace }}/build/bin/llama-box || true else exit 1 fi - cp /usr/local/cuda/lib64/libcudart.so.12 ${{ github.workspace }}/build/bin/ - cp /usr/local/cuda/lib64/libcublas.so.12 ${{ github.workspace }}/build/bin/ - cp /usr/local/cuda/lib64/libcublasLt.so.12 ${{ github.workspace }}/build/bin/ EOF chmod +x /tmp/entrypoint.sh cat /tmp/entrypoint.sh @@ -657,6 +676,17 @@ jobs: ldd --version # NB(thxCode): ldd is not available on arm64 mocked by QEMU, # see https://github.com/multiarch/qemu-user-static/issues/172. + echo "***** BEFORE *****" + ldd_output=\$(ldd ${{ github.workspace }}/build/bin/llama-box || echo "") + echo "\${ldd_output}" + library_paths=\$(echo "\${ldd_output}" | grep -Eo '=> [^ ]+' | sed 's/=> //') + for library_path in \${library_paths}; do + if [[ -f \${library_path} ]] && [[ \${library_path} == /opt/intel/oneapi/* ]]; then + cp \${library_path} ${{ github.workspace }}/build/bin/ || true + fi + done + echo "***** AFTER *****" + export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin:\${LD_LIBRARY_PATH}" ldd ${{ github.workspace }}/build/bin/llama-box || true else exit 1 @@ -745,11 +775,11 @@ jobs: elif [ "\${ID}" = "openEuler" ]; then yum update -y \ && yum install -y gcc gcc-c++ gcc-toolset-10-gcc* - gcc --version yum update -y \ && yum install -y gcc-toolset-10-libstdc++-static make ccache curl git export PATH="/opt/openEuler/gcc-toolset-10/root/usr/bin/:\${PATH}" && \ export LD_LIBRARY_PATH="/opt/openEuler/gcc-toolset-10/root/usr/lib64/:\${LD_LIBRARY_PATH}" + gcc --version else echo "Unsupport distribution: \${ID}" exit 1 @@ -774,6 +804,17 @@ jobs: ldd --version # NB(thxCode): ldd is not available on arm64 mocked by QEMU, # see https://github.com/multiarch/qemu-user-static/issues/172. + echo "***** BEFORE *****" + ldd_output=\$(ldd ${{ github.workspace }}/build/bin/llama-box || echo "") + echo "\${ldd_output}" + library_paths=\$(echo "\${ldd_output}" | grep -Eo '=> [^ ]+' | sed 's/=> //') + for library_path in \${library_paths}; do + if [[ -f \${library_path} ]] && [[ \${library_path} == /usr/local/Ascend/ascend-toolkit/latest/lib64/* ]]; then + cp \${library_path} ${{ github.workspace }}/build/bin/ || true + fi + done + echo "***** AFTER *****" + export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin:\${LD_LIBRARY_PATH}" ldd ${{ github.workspace }}/build/bin/llama-box || true else exit 1 @@ -875,6 +916,12 @@ jobs: ldd --version # NB(thxCode): ldd is not available on arm64 mocked by QEMU, # see https://github.com/multiarch/qemu-user-static/issues/172. + echo "***** BEFORE *****" + ldd ${{ github.workspace }}/build/bin/llama-box || true + cp /usr/local/musa/lib/libmusart.so.*.0 ${{ github.workspace }}/build/bin/ + cp /usr/local/musa/lib/libmublas.so ${{ github.workspace }}/build/bin/ + echo "***** AFTER *****" + export LD_LIBRARY_PATH="${{ github.workspace }}/build/bin:\${LD_LIBRARY_PATH}" ldd ${{ github.workspace }}/build/bin/llama-box || true else exit 1 @@ -1217,9 +1264,9 @@ jobs: } else { exit 1 } - Copy-Item -Path "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_sycl_blas*.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore - Copy-Item -Path "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_core*.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore - Copy-Item -Path "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_tbb_thread*.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore + Copy-Item -Path "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_sycl_blas.*.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore + Copy-Item -Path "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_core.*.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore + Copy-Item -Path "${env:ONEAPI_ROOT}\mkl\latest\bin\mkl_tbb_thread.*.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore Copy-Item -Path "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_win_proxy_loader.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore Copy-Item -Path "${env:ONEAPI_ROOT}\compiler\latest\bin\pi_level_zero.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore Copy-Item -Path "${env:ONEAPI_ROOT}\compiler\latest\bin\sycl7.dll" -Destination "${{ github.workspace }}\build\bin\" -Force -ErrorAction Ignore diff --git a/README.md b/README.md index 36f3492..4fd7430 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,16 @@ LLaMA Box supports the following platforms. > - **"NVIDIA CUDA 12.4"**, **"AMD ROCm/HIP 6.1"** and _"AVX2"_ Linux releases are built on CentOS 7 (glibc 2.17), except _"Advanced SIMD (NEON)"_ which is built on RockyLinux 8 (glibc 2.28). > - **"Intel oneAPI 2024.2"** and **"Moore Threads MUSA 1.5"** Linux releases are built on Ubuntu 20.04 (glibc 2.31). -> - **"Huawei Ascend CANN 8.0"** Linux releases have built on Ubuntu 20.04 (glibc 2.31) and OpenEuler 20.03 (glibc 2.28). +> - **"Huawei Ascend CANN 8.0"** Linux releases have built on Ubuntu 20.04 (glibc 2.31) and OpenEuler 20.03 (glibc + 2.28). + +> [!IMPORTANT] +> Partial Linux asset might contain the backend toolkit (some dynamic link libraries) and the `llama-box` binary. In an +> environment without the backend toolkit installed, you can set `LD_LIBRARY_PATH` to point to the unpacked directory +> to +> start `llama-box`, for example `LD_LIBRARY_PATH="$(pwd):${LD_LIBRARY_PATH}" ./llama-box --help`. If your environment +> already has the backend toolkit installed, you can directly use the `llama-box` binary and ignore these dynamic link +> libraries. ## Examples