echodict/llama.cpp
version https://git-lfs.github.com/spec/v1 oid sha256:cfc44b7ba25614df70e6b65e3341cae0310163bd32fd31a6b928a542df433faf size 30786
0773
1name: CI (cann)2 3on:4 workflow_dispatch: # allows manual triggering5 push:6 branches:7 - master8 paths: [9 '.github/workflows/build-cann.yml',10 '**/CMakeLists.txt',11 '**/.cmake',12 '**/*.h',13 '**/*.hpp',14 '**/*.c',15 '**/*.cpp'16 ]17 18 pull_request:19 types: [opened, synchronize, reopened]20 paths: [21 '.github/workflows/build-cann.yml',22 'ggml/src/ggml-cann/**'23 ]24 25concurrency:26 group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}27 cancel-in-progress: true28 29env:30 GGML_NLOOP: 331 GGML_N_THREADS: 132 LLAMA_LOG_COLORS: 133 LLAMA_LOG_PREFIX: 134 LLAMA_LOG_TIMESTAMPS: 135 36jobs:37 openEuler-latest-cann:38 defaults:39 run:40 shell: bash -el {0}41 strategy:42 matrix:43 arch: [x86, aarch64]44 chip_type: ['910b', '310p']45 build: ['Release']46 use_acl_graph: ['on', 'off']47 exclude:48 # 310P does not support USE_ACL_GRAPH=on49 - chip_type: '310p'50 use_acl_graph: 'on'51 runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}52 steps:53 - name: Checkout54 uses: actions/checkout@v655 with:56 fetch-depth: 057 58 - name: Free up disk space59 uses: ggml-org/free-disk-space@v1.3.160 with:61 tool-cache: true62 63 - name: Set container image64 id: cann-image65 run: |66 image="ascendai/cann:${{ matrix.chip_type == '910b' && '8.5.0-910b-openeuler24.03-py3.11' || '8.5.0-310p-openeuler24.03-py3.11' }}"67 echo "image=${image}" >> "${GITHUB_OUTPUT}"68 69 - name: Pull container image70 run: docker pull "${{ steps.cann-image.outputs.image }}"71 72 - name: Build73 env:74 BUILD_TYPE: ${{ matrix.build }}75 SOC_TYPE: ascend${{ matrix.chip_type }}76 USE_ACL_GRAPH: ${{ matrix.use_acl_graph }}77 run: |78 HOST_UID=$(id -u)79 HOST_GID=$(id -g)80 81 docker run --rm \82 -v "${PWD}:/workspace" \83 -w /workspace \84 -e SOC_TYPE=${SOC_TYPE} \85 -e BUILD_TYPE=${BUILD_TYPE} \86 -e USE_ACL_GRAPH=${USE_ACL_GRAPH} \87 "${{ steps.cann-image.outputs.image }}" \88 bash -lc '89 set -e90 yum install -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs git gcc gcc-c++ make cmake openssl-devel91 yum clean all && rm -rf /var/cache/yum92 git config --global --add safe.directory "/workspace"93 export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}94 cmake -S . -B build \95 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \96 -DGGML_CANN=on \97 -DSOC_TYPE=${SOC_TYPE} \98 -DUSE_ACL_GRAPH=${USE_ACL_GRAPH}99 cmake --build build -j $(nproc)100 101 chown -R '"${HOST_UID}"':'"${HOST_GID}"' /workspace/build102 '103 