From 37986d703e2e26326f5572e776b51866a2ddd03e Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:37:54 -0700 Subject: [PATCH 01/12] Create integration-tests.yml --- .github/workflows/integration-tests.yml | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/integration-tests.yml diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 00000000..c930bdff --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,43 @@ +name: Integration Tests + +on: + pull_request: + branches: [ "main" ] + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + + - name: Checkout Triton + uses: actions/checkout@v4 + with: + repository: 'openai/triton' + ref: '215b2e77a1d92f907bc4addfa3c3ba204028c32e' # known good commit "Add Shared Middle Layer to Triton via Plug-In" + path: ${{github.workspace}}/triton + + - name: Update Triton to point at this build + run: | + cd ${{github.workspace}}/triton/third_party/triton_shared + git switch ${{ github.sha }} + + + # - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + # run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + # - name: Build + # Build your program with the given configuration + # run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + # - name: Test +# working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + # run: ctest -C ${{env.BUILD_TYPE}} + From 000959338e749ac4c987f62d7257c0652b5ace24 Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:40:51 -0700 Subject: [PATCH 02/12] trying fetch first --- .github/workflows/integration-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index c930bdff..5c844cca 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -23,7 +23,8 @@ jobs: - name: Update Triton to point at this build run: | cd ${{github.workspace}}/triton/third_party/triton_shared - git switch ${{ github.sha }} + git fetch + git switch ${{ github.ref }} # - name: Configure CMake From 3d838ba84a729d0b51a4aed64a69e4a169cfaa84 Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:43:40 -0700 Subject: [PATCH 03/12] test --- .github/workflows/integration-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 5c844cca..6953162e 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -23,6 +23,8 @@ jobs: - name: Update Triton to point at this build run: | cd ${{github.workspace}}/triton/third_party/triton_shared + ls + git status git fetch git switch ${{ github.ref }} From 57e46a9c4bf8520b690273b527cc5a91b1aaf1e5 Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:47:50 -0700 Subject: [PATCH 04/12] fiddling with path --- .github/workflows/integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 6953162e..0fc63ee4 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -18,7 +18,7 @@ jobs: with: repository: 'openai/triton' ref: '215b2e77a1d92f907bc4addfa3c3ba204028c32e' # known good commit "Add Shared Middle Layer to Triton via Plug-In" - path: ${{github.workspace}}/triton + path: triton - name: Update Triton to point at this build run: | From bdba470bb60a876c609c405795ccaba69795ccec Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:49:13 -0700 Subject: [PATCH 05/12] submodules --- .github/workflows/integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0fc63ee4..44975bea 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -19,6 +19,7 @@ jobs: repository: 'openai/triton' ref: '215b2e77a1d92f907bc4addfa3c3ba204028c32e' # known good commit "Add Shared Middle Layer to Triton via Plug-In" path: triton + submodules: 'recursive' - name: Update Triton to point at this build run: | From 1ec6b18e4ecfd2c6bd8c52dccdf755257f1cc83a Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:50:44 -0700 Subject: [PATCH 06/12] back to sha --- .github/workflows/integration-tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 44975bea..0e033f47 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -24,10 +24,8 @@ jobs: - name: Update Triton to point at this build run: | cd ${{github.workspace}}/triton/third_party/triton_shared - ls - git status git fetch - git switch ${{ github.ref }} + git switch ${{ github.sha }} # - name: Configure CMake From 40aeaad14e8d32ab81105be2390b3f3ae62eb5ab Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:56:26 -0700 Subject: [PATCH 07/12] another approach --- .github/workflows/integration-tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0e033f47..0231877a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,11 +21,12 @@ jobs: path: triton submodules: 'recursive' - - name: Update Triton to point at this build - run: | - cd ${{github.workspace}}/triton/third_party/triton_shared - git fetch - git switch ${{ github.sha }} + - name: Checkout Triton-Shared + uses: actions/checkout@v4 + with: + path: triton/third_party/triton_shared + submodules: 'recursive' + # - name: Configure CMake From fcdad423d57be18619fd9e8737755520002c6a93 Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 13:58:42 -0700 Subject: [PATCH 08/12] test if layout worked --- .github/workflows/integration-tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0231877a..e6bb7d94 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -27,6 +27,11 @@ jobs: path: triton/third_party/triton_shared submodules: 'recursive' + - name: peak at our files + run: | + cd ${{github.workspace}}/triton/third_party/triton_shared + ls + ls .github/workflows # - name: Configure CMake From 346808dee3107588fd284e978a09151d0e638e58 Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 14:02:36 -0700 Subject: [PATCH 09/12] add the actual build and test --- .github/workflows/integration-tests.yml | 53 +++++++++++++++---------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index e6bb7d94..de5e2ced 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -25,27 +25,38 @@ jobs: uses: actions/checkout@v4 with: path: triton/third_party/triton_shared - submodules: 'recursive' - - name: peak at our files + - name: Clear cache + run: | + rm -rf ~/.triton + + - name: Update PATH run: | - cd ${{github.workspace}}/triton/third_party/triton_shared - ls - ls .github/workflows - - - # - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - # run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - # - name: Build - # Build your program with the given configuration - # run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - # - name: Test -# working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - # run: ctest -C ${{env.BUILD_TYPE}} + echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}" + - name: Check pre-commit + run: | + python3 -m pip install --upgrade pre-commit + python3 -m pre_commit run --all-files --verbose + + - name: Install Triton + run: | + export TRITON_CODEGEN_TRITON_SHARED=1 + git submodule update --init --recursive + cd python + python3 -m pip install --upgrade pip + python3 -m pip install cmake==3.24 + python3 -m pip install ninja + python3 -m pip uninstall -y triton + python3 setup.py build + python3 -m pip install --no-build-isolation -vvv '.[tests]' + + - name: Run shared middle-layer lit tests + run: | + python3 -m pip install lit + cd python + 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}" From 96eb99e307af55392075f17862ae254e3a35c5e1 Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 14:09:41 -0700 Subject: [PATCH 10/12] fix paths --- .github/workflows/integration-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index de5e2ced..0ba60e0c 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -36,14 +36,14 @@ jobs: - name: Check pre-commit run: | + cd triton python3 -m pip install --upgrade pre-commit python3 -m pre_commit run --all-files --verbose - name: Install Triton run: | export TRITON_CODEGEN_TRITON_SHARED=1 - git submodule update --init --recursive - cd python + cd triton/python python3 -m pip install --upgrade pip python3 -m pip install cmake==3.24 python3 -m pip install ninja @@ -54,7 +54,7 @@ jobs: - name: Run shared middle-layer lit tests run: | python3 -m pip install lit - cd python + cd triton/python 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 From 63b0849ffcc5961c9ea9a4497fd6de9aa5871e9f Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 14:28:00 -0700 Subject: [PATCH 11/12] Tweak some naming --- .github/workflows/integration-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0ba60e0c..0448fd7c 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -5,7 +5,7 @@ on: branches: [ "main" ] jobs: - build: + build_and_test_triton_shared: # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. # You can convert this to a matrix build if you need cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix @@ -26,7 +26,7 @@ jobs: with: path: triton/third_party/triton_shared - - name: Clear cache + - name: Clear Triton Cache run: | rm -rf ~/.triton @@ -40,7 +40,7 @@ jobs: python3 -m pip install --upgrade pre-commit python3 -m pre_commit run --all-files --verbose - - name: Install Triton + - name: Build/Install Triton run: | export TRITON_CODEGEN_TRITON_SHARED=1 cd triton/python From 3c6f50244b4eee2cbd3a29e1dd83b4c0c0186448 Mon Sep 17 00:00:00 2001 From: ian Bearman Date: Wed, 27 Sep 2023 14:35:34 -0700 Subject: [PATCH 12/12] remove stale template comments --- .github/workflows/integration-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 0448fd7c..20a7e322 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -6,9 +6,6 @@ on: jobs: build_and_test_triton_shared: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest steps: