From ce1c5c2cf4c7d4b2c4e17ceb3ba464551ac1de4b Mon Sep 17 00:00:00 2001 From: Daniyal khan <48022006+danikhan632@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:01:36 -0500 Subject: [PATCH 1/5] Update test-plugin.yml --- .github/workflows/test-plugin.yml | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/.github/workflows/test-plugin.yml b/.github/workflows/test-plugin.yml index b7bdb283..7f97020b 100644 --- a/.github/workflows/test-plugin.yml +++ b/.github/workflows/test-plugin.yml @@ -83,3 +83,76 @@ jobs: - name: Run CPU backend examples working-directory: triton_shared/python/examples run: pytest . + + + build_and_test_triton_shared_arm: + runs-on: ["self-hosted", "1ES.Pool=triton-shared-github-arm"] + + steps: + - name: Check Architecture + run: uname -a + + - name: Force Failure + if: ${{ inputs.force-failure }} + run: exit 1 + + + - name: Checkout Triton-Shared + uses: actions/checkout@v4 + with: + ref: ${{ inputs.triton-shared-ref }} + path: triton_shared + submodules: recursive + + - name: Clear Triton Cache + run: | + rm -rf ~/.triton + + - name: Modify Instance + run: | + sudo apt-get update + sudo apt-get install -y build-essential ninja-build python3-pip libc6 + - name: Update PATH + run: | + echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}" + - name: Check pre-commit + working-directory: triton_shared/triton + run: | + python3 -m pip install --upgrade pre-commit + python3 -m pre_commit run --all-files --verbose + - name: Edit setup for arm64 + working-directory: triton_shared/triton + run: | + sed -i 's/arch = {"x86_64": "64", "arm64": "aarch64"}/arch = {"x86_64": "64", "arm64": "aarch64", "aarch64":"aarch64"}/' "python/setup.py" + sed -i 's|https://tritonlang.blob.core.windows.net/llvm-builds/|https://storage.googleapis.com/compiled-blob/|g' "python/setup.py" + - name: Build/Install Triton + working-directory: triton_shared/triton/python + run: | + python3 -m pip install --upgrade pip + python3 -m pip install cmake==3.24 ninja pytest-xdist + sudo apt-get update -y + sudo apt-get install -y ccache clang lld + export TRITON_PLUGIN_DIRS="${GITHUB_WORKSPACE}/triton_shared" + TRITON_BUILD_WITH_CLANG_LLD=true TRITON_BUILD_WITH_CCACHE=true python3 -m pip install --no-build-isolation -vvv '.[tests]' + - name: Run shared middle-layer lit tests + working-directory: triton_shared/triton/python + run: | + python3 -m pip install lit + LIT_TEST_DIR="build/$(ls build | grep -i cmake)/third_party/triton_shared/test" + if [ ! -d "${LIT_TEST_DIR}" ]; then + echo "Coult not find '${LIT_TEST_DIR}'" ; exit -1 + fi + lit -v "${LIT_TEST_DIR}" + - name: Install CPU backend example dependencies + run: | + python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu + python3 -m pip install pytest + - name: Prepare CPU backend environment + working-directory: triton_shared/triton/python + run: | + echo "TRITON_SHARED_OPT_PATH=$(pwd)/build/$(ls $(pwd)/build | grep -i cmake)/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt" >> "${GITHUB_ENV}" + echo "LLVM_BINARY_DIR=${HOME}/.triton/llvm/$(ls ${HOME}/.triton/llvm/ | grep -i llvm)/bin" >> "${GITHUB_ENV}" + - name: Run CPU backend examples + working-directory: triton_shared/python/examples + run: pytest . + From caaac6b0c89d13a378ca7e2892897caa29c3731a Mon Sep 17 00:00:00 2001 From: Daniyal khan <48022006+danikhan632@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:26:35 -0500 Subject: [PATCH 2/5] moving to latest --- .github/workflows/test-plugin.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-plugin.yml b/.github/workflows/test-plugin.yml index 7f97020b..8feab04b 100644 --- a/.github/workflows/test-plugin.yml +++ b/.github/workflows/test-plugin.yml @@ -123,7 +123,6 @@ jobs: - name: Edit setup for arm64 working-directory: triton_shared/triton run: | - sed -i 's/arch = {"x86_64": "64", "arm64": "aarch64"}/arch = {"x86_64": "64", "arm64": "aarch64", "aarch64":"aarch64"}/' "python/setup.py" sed -i 's|https://tritonlang.blob.core.windows.net/llvm-builds/|https://storage.googleapis.com/compiled-blob/|g' "python/setup.py" - name: Build/Install Triton working-directory: triton_shared/triton/python From 7ff65b61a84870861933a7c8c731d4ed5d353e14 Mon Sep 17 00:00:00 2001 From: Daniyal khan <48022006+danikhan632@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:34:37 -0500 Subject: [PATCH 3/5] removed custom blob --- .github/workflows/test-plugin.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-plugin.yml b/.github/workflows/test-plugin.yml index 8feab04b..96096310 100644 --- a/.github/workflows/test-plugin.yml +++ b/.github/workflows/test-plugin.yml @@ -120,10 +120,7 @@ jobs: run: | python3 -m pip install --upgrade pre-commit python3 -m pre_commit run --all-files --verbose - - name: Edit setup for arm64 - working-directory: triton_shared/triton - run: | - sed -i 's|https://tritonlang.blob.core.windows.net/llvm-builds/|https://storage.googleapis.com/compiled-blob/|g' "python/setup.py" + - name: Build/Install Triton working-directory: triton_shared/triton/python run: | From 66e4d59591fe69e54188e69ec6ff5c65608ebfe6 Mon Sep 17 00:00:00 2001 From: Daniyal khan <48022006+danikhan632@users.noreply.github.com> Date: Tue, 27 Feb 2024 14:12:37 -0500 Subject: [PATCH 4/5] ran precommit --- .github/workflows/test-plugin.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-plugin.yml b/.github/workflows/test-plugin.yml index dde9f493..116b1839 100644 --- a/.github/workflows/test-plugin.yml +++ b/.github/workflows/test-plugin.yml @@ -121,7 +121,7 @@ jobs: - name: Clear Triton Cache run: | rm -rf ~/.triton - + - name: Modify Instance run: | sudo apt-get update @@ -134,7 +134,7 @@ jobs: run: | python3 -m pip install --upgrade pre-commit python3 -m pre_commit run --all-files --verbose - + - name: Build/Install Triton working-directory: triton_shared/triton/python run: | @@ -165,4 +165,3 @@ jobs: - name: Run CPU backend examples working-directory: triton_shared/python/examples run: pytest . - From a211abc9b904cbcc9de4e942fe527efd530261a9 Mon Sep 17 00:00:00 2001 From: Daniyal khan <48022006+danikhan632@users.noreply.github.com> Date: Thu, 29 Feb 2024 18:01:03 -0500 Subject: [PATCH 5/5] Update test-plugin.yml --- .github/workflows/test-plugin.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-plugin.yml b/.github/workflows/test-plugin.yml index 116b1839..265ab877 100644 --- a/.github/workflows/test-plugin.yml +++ b/.github/workflows/test-plugin.yml @@ -129,6 +129,7 @@ jobs: - name: Update PATH run: | echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}" + - name: Check pre-commit working-directory: triton_shared/triton run: | @@ -144,6 +145,7 @@ jobs: sudo apt-get install -y ccache clang lld export TRITON_PLUGIN_DIRS="${GITHUB_WORKSPACE}/triton_shared" TRITON_BUILD_WITH_CLANG_LLD=true TRITON_BUILD_WITH_CCACHE=true python3 -m pip install --no-build-isolation -vvv '.[tests]' + - name: Run shared middle-layer lit tests working-directory: triton_shared/triton/python run: | @@ -153,15 +155,18 @@ jobs: echo "Coult not find '${LIT_TEST_DIR}'" ; exit -1 fi lit -v "${LIT_TEST_DIR}" + - name: Install CPU backend example dependencies run: | python3 -m pip install torch --index-url https://download.pytorch.org/whl/cpu python3 -m pip install pytest + - name: Prepare CPU backend environment working-directory: triton_shared/triton/python run: | echo "TRITON_SHARED_OPT_PATH=$(pwd)/build/$(ls $(pwd)/build | grep -i cmake)/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt" >> "${GITHUB_ENV}" echo "LLVM_BINARY_DIR=${HOME}/.triton/llvm/$(ls ${HOME}/.triton/llvm/ | grep -i llvm)/bin" >> "${GITHUB_ENV}" + - name: Run CPU backend examples working-directory: triton_shared/python/examples run: pytest .