Skip to content

Commit a8c7f33

Browse files
authored
ci : change the cann version and the container pull method (#17953)
fix error format Update build.yml Remove unnecessary zip files fix update
1 parent b7f5f46 commit a8c7f33

File tree

3 files changed

+121
-13
lines changed

3 files changed

+121
-13
lines changed

.devops/cann.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Define the CANN base image for easier version updates later
66
ARG CHIP_TYPE=910b
7-
ARG CANN_BASE_IMAGE=quay.io/ascend/cann:8.3.rc1.alpha001-${CHIP_TYPE}-openeuler22.03-py3.11
7+
ARG CANN_BASE_IMAGE=quay.io/ascend/cann:8.3.rc2-${CHIP_TYPE}-openeuler24.03-py3.11
88

99
# ==============================================================================
1010
# BUILD STAGE

.github/workflows/build.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,25 +1400,54 @@ jobs:
14001400
chip_type: ['910b', '310p']
14011401
build: ['Release']
14021402
runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
1403-
container: ascendai/cann:${{ matrix.chip_type == '910b' && '8.3.rc1.alpha001-910b-openeuler22.03-py3.11' || '8.2.rc1-310p-openeuler22.03-py3.11' }}
14041403
steps:
14051404
- name: Checkout
14061405
uses: actions/checkout@v4
1406+
with:
1407+
fetch-depth: 0
14071408

1408-
- name: Dependencies
1409-
run: |
1410-
yum update -y
1411-
yum install -y git gcc gcc-c++ make cmake libcurl-devel
1409+
- name: Free up disk space
1410+
uses: ggml-org/[email protected]
1411+
with:
1412+
tool-cache: true
14121413

1413-
- name: Build
1414+
- name: Set container image
1415+
id: cann-image
14141416
run: |
1415-
export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
1417+
image="ascendai/cann:${{ matrix.chip_type == '910b' && '8.3.rc2-910b-openeuler24.03-py3.11' || '8.3.rc2-310p-openeuler24.03-py3.11' }}"
1418+
echo "image=${image}" >> "${GITHUB_OUTPUT}"
14161419
1417-
cmake -S . -B build \
1418-
-DCMAKE_BUILD_TYPE=${{ matrix.build }} \
1419-
-DGGML_CANN=on \
1420-
-DSOC_TYPE=ascend${{ matrix.chip_type }}
1421-
cmake --build build -j $(nproc)
1420+
- name: Pull container image
1421+
run: docker pull "${{ steps.cann-image.outputs.image }}"
1422+
1423+
- name: Build
1424+
env:
1425+
BUILD_TYPE: ${{ matrix.build }}
1426+
SOC_TYPE: ascend${{ matrix.chip_type }}
1427+
run: |
1428+
HOST_UID=$(id -u)
1429+
HOST_GID=$(id -g)
1430+
1431+
docker run --rm \
1432+
-v "${PWD}:/workspace" \
1433+
-w /workspace \
1434+
-e SOC_TYPE=${SOC_TYPE} \
1435+
-e BUILD_TYPE=${BUILD_TYPE} \
1436+
"${{ steps.cann-image.outputs.image }}" \
1437+
bash -lc '
1438+
set -e
1439+
yum install -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs git gcc gcc-c++ make cmake libcurl-devel
1440+
yum clean all && rm -rf /var/cache/yum
1441+
git config --global --add safe.directory "/workspace"
1442+
export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
1443+
cmake -S . -B build \
1444+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
1445+
-DGGML_CANN=on \
1446+
-DSOC_TYPE=${SOC_TYPE}
1447+
cmake --build build -j $(nproc)
1448+
1449+
chown -R '"${HOST_UID}"':'"${HOST_GID}"' /workspace/build
1450+
'
14221451
14231452
# TODO: simplify the following workflows using a matrix
14241453
# TODO: run lighter CI on PRs and the full CI only on master (if needed)

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,78 @@ jobs:
731731
path: llama-${{ steps.tag.outputs.name }}-xcframework.tar.gz
732732
name: llama-${{ steps.tag.outputs.name }}-xcframework.tar.gz
733733

734+
735+
openEuler-cann:
736+
strategy:
737+
matrix:
738+
arch: [x86, aarch64]
739+
chip_type: ['910b', '310p']
740+
build: ['Release']
741+
runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
742+
steps:
743+
- name: Checkout
744+
uses: actions/checkout@v4
745+
with:
746+
fetch-depth: 0
747+
748+
- name: Free up disk space
749+
uses: ggml-org/[email protected]
750+
with:
751+
tool-cache: true
752+
753+
- name: Set container image
754+
id: cann-image
755+
run: |
756+
image="ascendai/cann:${{ matrix.chip_type == '910b' && '8.3.rc2-910b-openeuler24.03-py3.11' || '8.3.rc2-310p-openeuler24.03-py3.11' }}"
757+
echo "image=${image}" >> "${GITHUB_OUTPUT}"
758+
759+
- name: Pull container image
760+
run: docker pull "${{ steps.cann-image.outputs.image }}"
761+
762+
- name: Build
763+
env:
764+
BUILD_TYPE: ${{ matrix.build }}
765+
SOC_TYPE: ascend${{ matrix.chip_type }}
766+
run: |
767+
HOST_UID=$(id -u)
768+
HOST_GID=$(id -g)
769+
770+
docker run --rm \
771+
-v "${PWD}:/workspace" \
772+
-w /workspace \
773+
-e SOC_TYPE=${SOC_TYPE} \
774+
-e BUILD_TYPE=${BUILD_TYPE} \
775+
"${{ steps.cann-image.outputs.image }}" \
776+
bash -lc '
777+
set -e
778+
yum install -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs git gcc gcc-c++ make cmake libcurl-devel
779+
yum clean all && rm -rf /var/cache/yum
780+
git config --global --add safe.directory "/workspace"
781+
export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH}
782+
cmake -S . -B build \
783+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
784+
-DGGML_CANN=on \
785+
-DSOC_TYPE=${SOC_TYPE}
786+
cmake --build build -j $(nproc)
787+
788+
chown -R '"${HOST_UID}"':'"${HOST_GID}"' /workspace/build
789+
'
790+
791+
- name: Determine tag name
792+
id: tag
793+
uses: ./.github/actions/get-tag-name
794+
795+
- name: Pack artifacts
796+
run: |
797+
cp LICENSE ./build/bin/
798+
tar -czvf llama-${{ steps.tag.outputs.name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .
799+
800+
- name: Upload artifacts (tar)
801+
uses: actions/upload-artifact@v4
802+
with:
803+
path: llama-${{ steps.tag.outputs.name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}.tar.gz
804+
name: llama-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}.tar.gz
805+
734806
release:
735807
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
736808

@@ -752,6 +824,7 @@ jobs:
752824
- macOS-arm64
753825
- macOS-x64
754826
- ios-xcode-build
827+
- openEuler-cann
755828

756829
steps:
757830
- name: Clone
@@ -844,6 +917,12 @@ jobs:
844917
- [Windows x64 (SYCL)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip)
845918
- [Windows x64 (HIP)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-hip-radeon-x64.zip)
846919
920+
**openEuler:**
921+
- [openEuler x86 (310p)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-310p-openEuler-x86.tar.gz)
922+
- [openEuler x86 (910b)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-910b-openEuler-x86.tar.gz)
923+
- [openEuler aarch64 (310p)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-310p-openEuler-aarch64.tar.gz)
924+
- [openEuler aarch64 (910b)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-910b-openEuler-aarch64.tar.gz)
925+
847926
- name: Upload release
848927
id: upload_release
849928
uses: actions/github-script@v3

0 commit comments

Comments
 (0)