diff --git a/.github/workflows/aipu-build-and-test.yml b/.github/workflows/aipu-build-and-test.yml index b4e5599a5..f0c6cdbe4 100644 --- a/.github/workflows/aipu-build-and-test.yml +++ b/.github/workflows/aipu-build-and-test.yml @@ -1,10 +1,11 @@ name: AIPU-Build-And-Test on: - push: - branches: [ "triton_v3.3.x" ] - pull_request: - branches: [ "triton_v3.3.x" ] + # push: + # branches: [ "triton_v3.3.x" ] + # pull_request: + # branches: [ "triton_v3.3.x" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/ascend-build-and-test.yml b/.github/workflows/ascend-build-and-test.yml index d2b91baa0..bc8e95f33 100644 --- a/.github/workflows/ascend-build-and-test.yml +++ b/.github/workflows/ascend-build-and-test.yml @@ -1,10 +1,11 @@ name: Ascend-Build-And-Test on: - push: - branches: [ "triton_v3.2.x" ] - pull_request: - branches: [ "triton_v3.2.x" ] + # push: + # branches: [ "triton_v3.2.x" ] + # pull_request: + # branches: [ "triton_v3.2.x" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/coordinator.yml b/.github/workflows/coordinator.yml new file mode 100644 index 000000000..54239f8aa --- /dev/null +++ b/.github/workflows/coordinator.yml @@ -0,0 +1,57 @@ +name: Test Coordinator + +on: + push: + branches: + - main + - triton_v3.2.x + - triton_v3.3.x + pull_request: + branches: + - main + - triton_v3.2.x + - triton_v3.3.x + +jobs: + ubuntu-native-aipu: + if: github.ref_name == 'triton_v3.3.x' + uses: ./.github/workflows/aipu-build-and-test.yml + + ubuntu-native-ascend: + if: github.ref_name == 'triton_v3.2.x' + uses: ./.github/workflows/ascend-build-and-test.yml + + ubuntu-native-cambricon: + if: github.ref_name == 'main' + uses: ./.github/workflows/cambricon-build-and-test.yml + + ubuntu-native-hcu: + if: github.ref_name == 'main' + uses: ./.github/workflows/hcu-build-and-test.yml + + ubuntu-native-iluvatar: + if: github.ref_name == 'main' + uses: ./.github/workflows/iluvatar-build-and-test.yml + + ubuntu-native-metax: + if: github.ref_name == 'main' + uses: ./.github/workflows/metax-build-and-test.yml + + ubuntu-native-mthreads: + if: github.ref_name == 'main' + uses: ./.github/workflows/mthreads-build-and-test.yml + + ubuntu-native-nv: + if: | + github.ref_name == 'main' || + github.ref_name == 'triton_v3.2.x' || + github.ref_name == 'triton_v3.3.x' + uses: ./.github/workflows/nv-build-and-test.yml + + ubuntu-native-tsingmicro: + if: github.ref_name == 'triton_v3.3.x' + uses: ./.github/workflows/tsingmicro-build-and-test.yml + + ubuntu-native-xpu: + if: github.ref_name == 'main' + uses: ./.github/workflows/xpu-build-and-test.yml diff --git a/.github/workflows/hcu-build-and-test.yml b/.github/workflows/hcu-build-and-test.yml index 0fc910cec..e0b5098ef 100644 --- a/.github/workflows/hcu-build-and-test.yml +++ b/.github/workflows/hcu-build-and-test.yml @@ -1,10 +1,11 @@ name: Hcu-Build-And-Test on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + # push: + # branches: [ "main" ] + # pull_request: + # branches: [ "main" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/iluvatar-build-and-test.yml b/.github/workflows/iluvatar-build-and-test.yml index d2ec03068..c9532b950 100644 --- a/.github/workflows/iluvatar-build-and-test.yml +++ b/.github/workflows/iluvatar-build-and-test.yml @@ -1,10 +1,11 @@ name: Iluvatar-Build-And-Test on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + # push: + # branches: [ "main" ] + # pull_request: + # branches: [ "main" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/metax-build-and-test.yml b/.github/workflows/metax-build-and-test.yml index cb9ec550d..1e409b66e 100644 --- a/.github/workflows/metax-build-and-test.yml +++ b/.github/workflows/metax-build-and-test.yml @@ -1,10 +1,11 @@ name: Metax-Build-And-Test on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + # push: + # branches: [ "main" ] + # pull_request: + # branches: [ "main" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/mthreads-build-and-test.yml b/.github/workflows/mthreads-build-and-test.yml index d86619fa8..0e87550a8 100644 --- a/.github/workflows/mthreads-build-and-test.yml +++ b/.github/workflows/mthreads-build-and-test.yml @@ -1,10 +1,11 @@ name: Mthreads-Build-And-Test on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + # push: + # branches: [ "main" ] + # pull_request: + # branches: [ "main" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/nv-build-and-test.yml b/.github/workflows/nv-build-and-test.yml index 952169159..dd4ec6155 100644 --- a/.github/workflows/nv-build-and-test.yml +++ b/.github/workflows/nv-build-and-test.yml @@ -3,10 +3,11 @@ name: NV-Build-And-Test on: schedule: - cron: '0 21 * * *' - push: - branches: [ "main", "triton_v3.2.x", "triton_v3.3.x" ] - pull_request: - branches: [ "main", "triton_v3.2.x", "triton_v3.3.x" ] + # push: + # branches: [ "main", "triton_v3.2.x", "triton_v3.3.x" ] + # pull_request: + # branches: [ "main", "triton_v3.2.x", "triton_v3.3.x" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/test_ubuntuNativeContainerNV.yml b/.github/workflows/test_ubuntuNativeContainerNV.yml new file mode 100644 index 000000000..1200dcfe2 --- /dev/null +++ b/.github/workflows/test_ubuntuNativeContainerNV.yml @@ -0,0 +1,162 @@ +name: Run Container ubuntu-native + +on: + push: + branches: + - main + pull_request: + branches: + - main +# schedule: +# - cron: '0 21 * * *' +# workflow_call: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test-in-ubuntu-container: + runs-on: ubuntu-latest + container: + image: ubuntu:22.04 + + steps: + - name: Set up Python and Install Dependencies + run: | + DEBIAN_FRONTEND=noninteractive apt-get update -y + DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip python3-venv git autotools-dev wget gcc g++ build-essential cmake ninja-build + DEBIAN_FRONTEND=noninteractive apt-get install -y python3.10-dev python3-distutils + pip3 install --upgrade pip setuptools wheel + pip3 install pybind11 + + # DEBIAN_FRONTEND=noninteractive apt-get update -y + # DEBIAN_FRONTEND=noninteractive apt-get install -y \ + # python3 python3-pip python3-venv git \ + # build-essential cmake ninja-build \ + # python3.10-dev python3-distutils + # pip3 install --upgrade pip setuptools wheel + # pip3 install pybind11 + + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb + dpkg -i cuda-keyring_1.1-1_all.deb + DEBIAN_FRONTEND=noninteractive apt-get update -y + DEBIAN_FRONTEND=noninteractive apt-get install -y cuda-drivers cuda-toolkit + DEBIAN_FRONTEND=noninteractive apt-get install -y libnccl2 libnccl-dev + + + - name: Verify Python and pybind11 paths + shell: bash + run: | + PYBIND11_DIR=$(python3 -m pybind11 --cmakedir) + echo "pybind11 CMake dir: $PYBIND11_DIR" + if [ ! -d "$PYBIND11_DIR" ]; then + echo "Error: pybind11 CMake directory not found at $PYBIND11_DIR" + exit 1 + fi + if [ ! -f "$PYBIND11_DIR/pybind11-config.cmake" ]; then + echo "Error: pybind11-config.cmake not found at $PYBIND11_DIR" + exit 1 + fi + echo "pybind11-config.cmake found at $PYBIND11_DIR" + + - name: Checkout Code + uses: actions/checkout@v6 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + ssh-strict: true + ssh-user: git + persist-credentials: true + clean: true + sparse-checkout-cone-mode: true + fetch-tags: false + show-progress: true + lfs: false + submodules: true + set-safe-directory: true + + - name: Detect Target Branch + shell: bash + run: | + set -x + if [ "${{ github.event_name }}" = "pull_request" ]; then + TARGET_BRANCH="${{ github.base_ref }}" + else + TARGET_BRANCH="${{ github.ref_name }}" + fi + echo "TARGET_BRANCH=$TARGET_BRANCH" >> $GITHUB_ENV + echo "TARGET_BRANCH=$TARGET_BRANCH" + + - name: Prepare LLVM for NVidia + shell: bash + run: | + case "${{ env.TARGET_BRANCH }}" in + "main") LLVM_HASH="10dc3a8e" ;; + "triton_v3.2.x") LLVM_HASH="86b69c31" ;; + "triton_v3.3.x") LLVM_HASH="a66376b0" ;; + "triton_v3.4.x") LLVM_HASH="8957e64a" ;; + "triton_v3.5.x") LLVM_HASH="7d5de303" ;; + *) LLVM_HASH="10dc3a8e" ;; + esac + + LLVM_DIR="$HOME/.flagtree/llvm_builds" + LLVM_FILE="llvm-${LLVM_HASH}-ubuntu-x64" + mkdir -p "$LLVM_DIR" + cd "$LLVM_DIR" + + if [ ! -d "${LLVM_FILE}" ]; then + echo "Downloading LLVM ${LLVM_HASH}..." + wget -q "https://oaitriton.blob.core.windows.net/public/llvm-builds/${LLVM_FILE}.tar.gz" + tar -zxf "${LLVM_FILE}.tar.gz" + rm "${LLVM_FILE}.tar.gz" + else + echo "LLVM ${LLVM_HASH} already exists, skipping download." + fi + echo "LLVM_SYSPATH=$LLVM_DIR/${LLVM_FILE}" >> $GITHUB_ENV + echo "LLVM_LIBRARY_DIR=$LLVM_DIR/${LLVM_FILE}/lib" >> $GITHUB_ENV + + - name: FlagTree Build on NVidia (Main branch) + if: ${{ env.TARGET_BRANCH == 'main' }} + shell: bash + run: | + set -x + pip uninstall -y triton + git config --global --add safe.directory /__w/flagtree/flagtree + export CMAKE_MAKE_PROGRAM=$(which ninja) + export PIP_NO_CACHE_DIR=1 + cd /__w/flagtree/flagtree/python + + MAX_JOBS=32 python3 -m pip install . --no-build-isolation \ + -C="--cmake-args=-DPython3_EXECUTABLE=/usr/bin/python3" \ + -C="--cmake-args=-DPython3_INCLUDE_DIR=/usr/include/python3.10" \ + -C="--cmake-args=-DPython3_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.10.so" \ + -C="--cmake-args=-Dpybind11_DIR=$PYBIND11_DIR" \ + -v + + - name: FlagTree Build on NVidia (triton_v3.2.x branch) + if: ${{ env.TARGET_BRANCH == 'triton_v3.2.x' }} + shell: bash + run: | + set -x + pip uninstall -y triton + cd /__w/flagtree/flagtree/python + MAX_JOBS=32 python3 -m pip install . --no-build-isolation + + - name: FlagTree Build on NVidia (triton_v3.3.x branch) + if: ${{ env.TARGET_BRANCH == 'triton_v3.3.x' }} + shell: bash + run: | + set -x + pip uninstall -y triton + cd /__w/flagtree/flagtree/python + MAX_JOBS=32 python3 -m pip install . --no-build-isolation + + - name: FlagTree Test on NVidia + shell: bash + run: | + set -x + python3 -m pytest -s python/test/unit + if [ -d "python/test/operators" ]; then + python3 -m pytest -s python/test/operators + fi \ No newline at end of file diff --git a/.github/workflows/tsingmicro-build-and-test.yml b/.github/workflows/tsingmicro-build-and-test.yml index 1cf2adf94..143bef229 100644 --- a/.github/workflows/tsingmicro-build-and-test.yml +++ b/.github/workflows/tsingmicro-build-and-test.yml @@ -1,10 +1,11 @@ name: Tsingmicro-Build-And-Test on: - push: - branches: [ "triton_v3.3.x" ] - pull_request: - branches: [ "triton_v3.3.x" ] + # push: + # branches: [ "triton_v3.3.x" ] + # pull_request: + # branches: [ "triton_v3.3.x" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/xpu-build-and-test.yml b/.github/workflows/xpu-build-and-test.yml index e256e8a65..12dba45cd 100644 --- a/.github/workflows/xpu-build-and-test.yml +++ b/.github/workflows/xpu-build-and-test.yml @@ -2,10 +2,11 @@ name: Xpu-Build-And-Test on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + # push: + # branches: [ "main" ] + # pull_request: + # branches: [ "main" ] + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}