|
20 | 20 | '**/*.swift', |
21 | 21 | '**/*.m', |
22 | 22 | '**/*.metal', |
23 | | - '**/*.comp' |
| 23 | + '**/*.comp', |
| 24 | + '**/*.glsl' |
24 | 25 | ] |
25 | 26 |
|
26 | 27 | pull_request: |
|
40 | 41 | '**/*.swift', |
41 | 42 | '**/*.m', |
42 | 43 | '**/*.metal', |
43 | | - '**/*.comp' |
| 44 | + '**/*.comp', |
| 45 | + '**/*.glsl' |
44 | 46 | ] |
45 | 47 |
|
46 | 48 | concurrency: |
@@ -1400,25 +1402,54 @@ jobs: |
1400 | 1402 | chip_type: ['910b', '310p'] |
1401 | 1403 | build: ['Release'] |
1402 | 1404 | 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' }} |
1404 | 1405 | steps: |
1405 | 1406 | - name: Checkout |
1406 | 1407 | uses: actions/checkout@v4 |
| 1408 | + with: |
| 1409 | + fetch-depth: 0 |
1407 | 1410 |
|
1408 | | - - name: Dependencies |
1409 | | - run: | |
1410 | | - yum update -y |
1411 | | - yum install -y git gcc gcc-c++ make cmake libcurl-devel |
| 1411 | + - name: Free up disk space |
| 1412 | + |
| 1413 | + with: |
| 1414 | + tool-cache: true |
1412 | 1415 |
|
1413 | | - - name: Build |
| 1416 | + - name: Set container image |
| 1417 | + id: cann-image |
1414 | 1418 | run: | |
1415 | | - export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} |
| 1419 | + image="ascendai/cann:${{ matrix.chip_type == '910b' && '8.3.rc2-910b-openeuler24.03-py3.11' || '8.3.rc2-310p-openeuler24.03-py3.11' }}" |
| 1420 | + echo "image=${image}" >> "${GITHUB_OUTPUT}" |
1416 | 1421 |
|
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) |
| 1422 | + - name: Pull container image |
| 1423 | + run: docker pull "${{ steps.cann-image.outputs.image }}" |
| 1424 | + |
| 1425 | + - name: Build |
| 1426 | + env: |
| 1427 | + BUILD_TYPE: ${{ matrix.build }} |
| 1428 | + SOC_TYPE: ascend${{ matrix.chip_type }} |
| 1429 | + run: | |
| 1430 | + HOST_UID=$(id -u) |
| 1431 | + HOST_GID=$(id -g) |
| 1432 | +
|
| 1433 | + docker run --rm \ |
| 1434 | + -v "${PWD}:/workspace" \ |
| 1435 | + -w /workspace \ |
| 1436 | + -e SOC_TYPE=${SOC_TYPE} \ |
| 1437 | + -e BUILD_TYPE=${BUILD_TYPE} \ |
| 1438 | + "${{ steps.cann-image.outputs.image }}" \ |
| 1439 | + bash -lc ' |
| 1440 | + set -e |
| 1441 | + yum install -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs git gcc gcc-c++ make cmake libcurl-devel |
| 1442 | + yum clean all && rm -rf /var/cache/yum |
| 1443 | + git config --global --add safe.directory "/workspace" |
| 1444 | + export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} |
| 1445 | + cmake -S . -B build \ |
| 1446 | + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ |
| 1447 | + -DGGML_CANN=on \ |
| 1448 | + -DSOC_TYPE=${SOC_TYPE} |
| 1449 | + cmake --build build -j $(nproc) |
| 1450 | +
|
| 1451 | + chown -R '"${HOST_UID}"':'"${HOST_GID}"' /workspace/build |
| 1452 | + ' |
1422 | 1453 |
|
1423 | 1454 | # TODO: simplify the following workflows using a matrix |
1424 | 1455 | # TODO: run lighter CI on PRs and the full CI only on master (if needed) |
|
0 commit comments