Skip to content

Commit

Permalink
ci: fuse runtime lib
Browse files Browse the repository at this point in the history
Signed-off-by: thxCode <thxcode0824@gmail.com>
  • Loading branch information
thxCode committed Sep 27, 2024
1 parent ef42f27 commit e13b575
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 8 deletions.
61 changes: 54 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e13b575

Please sign in to comment.