Skip to content

Commit 5bff99e

Browse files
xuzhao9facebook-github-bot
authored andcommitted
Test on both pytorch-triton and triton-main (#63)
Summary: Add check for both Triton-main and Triton-pytorch Pull Request resolved: #63 Reviewed By: FindHao Differential Revision: D66311149 Pulled By: xuzhao9 fbshipit-source-id: 06ae9cf052ff6a7e5ab3c5e9529cb41886df6ab4
1 parent abb7ac6 commit 5bff99e

File tree

3 files changed

+51
-22
lines changed

3 files changed

+51
-22
lines changed

.ci/tritonbench/install-triton-main.sh

+12
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,17 @@ conda activate "${CONDA_ENV}"
2828
cd /workspace
2929
git clone https://github.com/triton-lang/triton.git
3030
cd /workspace/triton
31+
# delete the original triton directory
32+
TRITON_PKG_DIR=$(python -c "import triton; import os; print(os.path.dirname(triton.__file__))")
33+
# make sure all pytorch triton has been uninstalled
34+
pip uninstall -y triton
35+
pip uninstall -y triton
36+
pip uninstall -y triton
37+
rm -rf "${TRITON_PKG_DIR}"
38+
39+
# install main triton
3140
pip install ninja cmake wheel pybind11; # build-time dependencies
3241
pip install -e python
42+
43+
# test main branch installation with importing experimental descriptor
44+
python -c "import triton.tools.experimental_descriptor"
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: linux-test-h100
2+
on:
3+
workflow_call:
4+
inputs:
5+
conda_env:
6+
required: True
7+
type: string
8+
description: |
9+
Conda environment to activate when testing Triton
10+
11+
jobs:
12+
linux-test-h100:
13+
if: github.repository_owner == 'pytorch-labs'
14+
runs-on: [gcp-h100-runner]
15+
timeout-minutes: 240
16+
environment: docker-s3-upload
17+
env:
18+
SETUP_SCRIPT: "/workspace/setup_instance.sh"
19+
CONDA_ENV: ${{ inputs.conda_env }}
20+
steps:
21+
- name: Checkout Tritonbench
22+
uses: actions/checkout@v3
23+
with:
24+
submodules: recursive
25+
- name: Tune Nvidia GPU
26+
run: |
27+
sudo nvidia-smi -pm 1
28+
sudo ldconfig
29+
nvidia-smi
30+
- name: Test Tritonbench operators on H100 GPU
31+
run: |
32+
bash ./.ci/tritonbench/test-gpu.sh

.github/workflows/pr.yaml

+7-22
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,13 @@ on:
77

88
jobs:
99
h100-pytorch-test:
10-
# Don't run on forked repos
11-
if: github.repository_owner == 'pytorch-labs'
12-
runs-on: [gcp-h100-runner]
13-
timeout-minutes: 240
14-
environment: docker-s3-upload
15-
env:
16-
CONDA_ENV: "pytorch"
17-
SETUP_SCRIPT: "/workspace/setup_instance.sh"
18-
steps:
19-
- name: Checkout Tritonbench
20-
uses: actions/checkout@v3
21-
with:
22-
# no need to checkout submodules recursively
23-
submodules: true
24-
- name: Tune Nvidia GPU
25-
run: |
26-
sudo nvidia-smi -pm 1
27-
sudo ldconfig
28-
nvidia-smi
29-
- name: Test Tritonbench operators on H100 GPU
30-
run: |
31-
bash ./.ci/tritonbench/test-gpu.sh
10+
uses: ./.github/workflows/_linux-test-h100.yml
11+
with:
12+
conda_env: "pytorch"
13+
h100-triton-main-test:
14+
uses: ./.github/workflows/_linux-test-h100.yml
15+
with:
16+
conda_env: "triton-main"
3217

3318
concurrency:
3419
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}

0 commit comments

Comments
 (0)