Skip to content

升级到triton3.5 重构tt到linalg #338

升级到triton3.5 重构tt到linalg

升级到triton3.5 重构tt到linalg #338

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
echo "=== 切换前用户信息 ==="
echo "whoami: $(whoami)"
echo "user id: $(id)"
echo "PATH: $PATH"
echo "======================"
# 切换到 root 用户执行,确保有权限访问 NPU 设备
sudo -E bash -c '
source /home/dlc_ci/.bashrc
which conda
echo "which conda? $(which conda)"
conda activate dlcompiler
source /usr/local/Ascend/cann-9.1.0-beta.1/set_env.sh
cd ${{ env.CI_PATH }}
export JSON_PATH35=${{ vars.CI_BASE_PATH }}/data/v35/include.zip
export GOOGLETEST_DIR35=${{ vars.CI_BASE_PATH }}/data/v35/googletest
export LLVM_TGZ_PATH35=${{ vars.CI_BASE_PATH }}/data/v35/llvm-7d5de303-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 ./third_party/triton
echo "whoami before compile: $(whoami)"
echo "which python? $(which python)"
echo "npu-smi path: $(which npu-smi 2>/dev/null || echo "not found")"
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: Build and install tilelang-dlc
# run: |
# set -ex
# # 切换到 root 用户执行
# sudo -E bash -c '
# source /home/dlc_ci/.bashrc
# conda activate dlcompiler
# source /usr/local/Ascend/cann-9.1.0-beta.1/set_env.sh
# cd ${{ env.CI_PATH }}
# export TILELANG_DLC_PATH=${{ vars.CI_BASE_PATH }}/data/tilelang-dlc
# export DLCOMPILER_SOURCE=${{ env.CI_PATH }}
# export TILELANG_USE_DLCOMPILER=1
# echo "whoami? $(whoami)"
# echo "which python? $(which python)"
# bash scripts/install_tilelang-dlc.sh
# '
# - name: Run tilelang-dlc tests on ascend
# run: |
# set -ex
# # 切换到 root 用户执行
# sudo -E bash -c '
# source /home/dlc_ci/.bashrc
# conda activate dlcompiler
# source /usr/local/Ascend/cann-9.1.0-beta.1/set_env.sh
# cd ${{env.CI_PATH }}
# export PATH=${{ vars.CI_BASE_PATH }}/data/bishengir_latest/:$PATH
# export ASCEND_RT_VISIBLE_DEVICES=7
# export TILELANG_USE_DLCOMPILER=1
# bash test/commonir/run_tests.sh
# '
- name: Run triton tests on ascend
run: |
set -ex
# 切换到 root 用户执行
sudo -E bash -c '
source /home/dlc_ci/.bashrc
conda activate dlcompiler
source /usr/local/Ascend/cann-9.1.0-beta.1/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: Run MLIR tests
run: |
set -ex
# 切换到 root 用户执行
sudo -E bash -c '
source /home/dlc_ci/.bashrc
conda activate dlcompiler
source /usr/local/Ascend/cann-9.1.0-beta.1/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/test_mlir.sh
'
- name: Run DSL tests
run: |
set -ex
# 切换到 root 用户执行
sudo -E bash -c '
source /home/dlc_ci/.bashrc
conda activate dlcompiler
source /usr/local/Ascend/cann-9.1.0-beta.1/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/dsl/run_tests.sh
'
- name: Clear workfile
if: always()
run: |
# 使用 root 权限清理,确保能删除之前以 root 创建的文件
sudo bash -c '
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
'