Skip to content

Commit

Permalink
Merge pull request #8 from microsoft/dev/ianb/nightly-testing
Browse files Browse the repository at this point in the history
Improve Test Automation

- Add testing of latest Triton with latest Triton-Shared plugin on a daily basis
- Add testing of LKG Triton with latest Triton-Shared after updates to main
- Allow testing workflow to easily be invoked with any combination Triton and Triton-Shared commits.
  • Loading branch information
manbearian authored Sep 29, 2023
2 parents 2be8f29 + 07140e6 commit 40584de
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 53 deletions.
61 changes: 8 additions & 53 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,12 @@ name: Integration Tests
on:
pull_request:
branches: [ "main" ]

push:
branches: [ "main" ]

jobs:
build_and_test_triton_shared:
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: triton
submodules: 'recursive'

- name: Checkout Triton-Shared
uses: actions/checkout@v4
with:
path: triton/third_party/triton_shared

- name: Clear Triton Cache
run: |
rm -rf ~/.triton
- name: Update PATH
run: |
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
- name: Check pre-commit
run: |
cd triton
python3 -m pip install --upgrade pre-commit
python3 -m pre_commit run --all-files --verbose
- name: Build/Install Triton
run: |
export TRITON_CODEGEN_TRITON_SHARED=1
cd triton/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 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
fi
lit -v "${LIT_TEST_DIR}"
call-workflow:
uses: ./.github/workflows/test-plugin.yml
with:
triton-ref: '215b2e77a1d92f907bc4addfa3c3ba204028c32e' # known good commit "Add Shared Middle Layer to Triton via Plug-In"
triton-shared-ref: ${{ github.ref }}
12 changes: 12 additions & 0 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Nightly Tests

on:
schedule:
- cron: '23 10 * * *' # random time in the middle of the night PT

jobs:
call-workflow:
uses: ./.github/workflows/test-plugin.yml
with:
triton-ref: 'main'
triton-shared-ref: 'main'
74 changes: 74 additions & 0 deletions .github/workflows/test-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Triton-Shared Plugin Testing

on:
workflow_call:
inputs:
triton-ref:
required: true
type: string
triton-shared-ref:
required: true
type: string
workflow_dispatch:
inputs:
triton-ref:
required: true
type: string
triton-shared-ref:
required: true
type: string

jobs:
build_and_test_triton_shared:
runs-on: ubuntu-latest

steps:

- name: Checkout Triton
uses: actions/checkout@v4
with:
repository: 'openai/triton'
ref: ${{ inputs.triton-ref }}
path: triton
submodules: 'recursive'

- name: Checkout Triton-Shared
uses: actions/checkout@v4
with:
ref: ${{ inputs.triton-shared-ref }}
path: triton/third_party/triton_shared

- name: Clear Triton Cache
run: |
rm -rf ~/.triton
- name: Update PATH
run: |
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
- name: Check pre-commit
run: |
cd triton
python3 -m pip install --upgrade pre-commit
python3 -m pre_commit run --all-files --verbose
- name: Build/Install Triton
run: |
export TRITON_CODEGEN_TRITON_SHARED=1
cd triton/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 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
fi
lit -v "${LIT_TEST_DIR}"

0 comments on commit 40584de

Please sign in to comment.