Skip to content

Refactor: Decoupling NPU-related ttshared Pass Patches and Integrating Non-bisheng-compiler Stages into Pybind11 and Stage Consolidation #144

Refactor: Decoupling NPU-related ttshared Pass Patches and Integrating Non-bisheng-compiler Stages into Pybind11 and Stage Consolidation

Refactor: Decoupling NPU-related ttshared Pass Patches and Integrating Non-bisheng-compiler Stages into Pybind11 and Stage Consolidation #144

Workflow file for this run

name: DLCompiler main test ci
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
CI_PATH: "${{ vars.CI_BASE_PATH }}/GitHub/${{ github.repository }}/${GITHUB_RUN_NUMBER}"
THIRD_PARTY_PATH: "${{ vars.CI_BASE_PATH }}/data/DLCompiler/third_party"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
AscendTests:
if: github.repository == 'DeepLink-org/DLCompiler'
runs-on: DLC-60
steps:
- name: Checkout code via SSH
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY_DLC_CI }}
- name: Create custom directory
run: |
set -ex
echo ${{ env.CI_PATH }}
mkdir -p ${{ env.CI_PATH }}
- name: Clean custom directory
run: |
set -ex
if [ -d "${{ env.CI_PATH }}" ]; then
rm -rf ${{ env.CI_PATH }}/*
rm -rf ${{ env.CI_PATH }}/.github
fi
- name: Move code to custom directory
run: |
set -ex
mv $GITHUB_WORKSPACE/* ${{ env.CI_PATH }}/
mv $GITHUB_WORKSPACE/.github ${{ env.CI_PATH }}/
mv $GITHUB_WORKSPACE/.git ${{ env.CI_PATH }}/
- name: Setup Git Safe Directory
run: |
git config --global --add safe.directory '*'
- name: Build and install DLCompiler
run: |
set -ex
source /home/dlc_ci/.bashrc
source activate dlcompiler
source /usr/local/Ascend/ascend-toolkit/set_env.sh
cd ${{ env.CI_PATH }}
export JSON_PATH34=${{ vars.CI_BASE_PATH }}/data/v34/include.zip
export GOOGLETEST_DIR34=${{ vars.CI_BASE_PATH }}/data/v34/googletest
export LLVM_TGZ_PATH34=${{ vars.CI_BASE_PATH }}/data/v34/llvm-064f02da-ubuntu-arm64.tar.gz
rm -rf ./third_party/*
git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/ascendnpu-ir ./third_party/ascendnpu-ir
git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/json ./third_party/json
git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/triton_shared ./third_party/triton_shared
git clone --no-hardlinks ${{ env.THIRD_PARTY_PATH }}/triton ./third_party/triton
echo "whoami? $(whoami)"
echo "which python? $(which python)"
git submodule update --init
echo "git submodule update done."
pip install nanobind -i https://mirrors.huaweicloud.com/repository/pypi/simple
bash compile_shared.sh apply_patch=true
- name: Run tests on ascend
run: |
set -ex
source /home/dlc_ci/.bashrc
source activate dlcompiler
source /usr/local/Ascend/ascend-toolkit/set_env.sh
cd ${{env.CI_PATH }}
echo "whoami? $(whoami)"
echo "which python? $(which python)"
export PATH=${{ vars.CI_BASE_PATH }}/data/bishengir_latest/:$PATH
export ASCEND_RT_VISIBLE_DEVICES=7
bash test/ascend/run_tests.sh
- name: Clear workfile
if: always()
run: |
export workdir=$(pwd)
cd ..
rm -rf $workdir
mkdir $workdir
chmod -R 777 $workdir
if [ -d "${{ env.CI_PATH }}" ]; then
rm -rf ${{ env.CI_PATH }}
fi