Skip to content

Commit ee97170

Browse files
authored
[docker] add meta triton env (#525)
1 parent 1d43f6d commit ee97170

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

.github/workflows/docker.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
nightly_date:
1919
description: "PyTorch nightly version"
2020
required: false
21+
tags:
22+
description: "Tags to attach to the docker image, split by comma"
23+
required: false
2124
env:
2225
CONDA_ENV: "tritonbench"
2326
DOCKER_IMAGE: "ghcr.io/meta-pytorch/tritonbench:latest"
@@ -49,19 +52,24 @@ jobs:
4952
# and it is github.ref_name when triggered by workflow_dispatch
5053
branch_name=${{ github.head_ref || github.ref_name }}
5154
docker build . --build-arg TRITONBENCH_BRANCH="${branch_name}" --build-arg FORCE_DATE="${NIGHTLY_DATE}" \
52-
-f tritonbench-nightly.dockerfile -t ghcr.io/meta-pytorch/tritonbench:latest
53-
# Extract pytorch version from the docker
54-
PYTORCH_VERSION=$(docker run -e SETUP_SCRIPT="${SETUP_SCRIPT}" ghcr.io/meta-pytorch/tritonbench:latest bash -c '. "${SETUP_SCRIPT}"; python -c "import torch; print(torch.__version__)"')
55-
export DOCKER_TAG=$(awk '{match($0, /dev[0-9]+/, arr); print arr[0]}' <<< "${PYTORCH_VERSION}")
56-
docker tag ghcr.io/meta-pytorch/tritonbench:latest ghcr.io/meta-pytorch/tritonbench:${DOCKER_TAG}
55+
-f tritonbench-nightly.dockerfile -t ghcr.io/meta-pytorch/tritonbench:latest
5756
- name: Push docker to remote
5857
if: github.event_name != 'pull_request'
5958
run: |
6059
# Extract pytorch version from the docker
6160
PYTORCH_VERSION=$(docker run -e SETUP_SCRIPT="${SETUP_SCRIPT}" ghcr.io/meta-pytorch/tritonbench:latest bash -c '. "${SETUP_SCRIPT}"; python -c "import torch; print(torch.__version__)"')
6261
export DOCKER_TAG=$(awk '{match($0, /dev[0-9]+/, arr); print arr[0]}' <<< "${PYTORCH_VERSION}")
62+
docker tag ghcr.io/meta-pytorch/tritonbench:latest ghcr.io/meta-pytorch/tritonbench:${DOCKER_TAG}
6363
docker push ghcr.io/meta-pytorch/tritonbench:${DOCKER_TAG}
6464
docker push ghcr.io/meta-pytorch/tritonbench:latest
65+
set -x
66+
if [[ -n "${{ github.event.inputs.tags }}" ]]; then
67+
IFS=',' read -ra tags <<< "${{ github.event.inputs.tags }}"
68+
for tag in "${tags[@]}"; do
69+
docker tag ghcr.io/meta-pytorch/tritonbench:latest ghcr.io/meta-pytorch/tritonbench:${tag}
70+
docker push ghcr.io/meta-pytorch/tritonbench:${tag}
71+
done
72+
fi
6573
concurrency:
6674
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
6775
cancel-in-progress: true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bf16_flash_attention_fwd_shape4:
2+
op:
3+
blackwell_attentions
4+
args:
5+
--op blackwell_attentions --seq-len 8192 --batch 4 --n-heads 32 --d-head 128 --metrics tflops --rep 3000 --sleep 1.0 --only triton_tutorial_flash_dp_persistent_blackwell --simple-output --force
6+
envs:
7+
TRITON_ALWAYS_COMPILE=1

docker/tritonbench-nightly.dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FROM ${BASE_IMAGE}
44
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
55
ENV CONDA_ENV=pytorch
66
ENV CONDA_ENV_TRITON_MAIN=triton-main
7+
ENV CONDA_ENV_META_TRITON=meta-triton
78
ENV SETUP_SCRIPT=/workspace/setup_instance.sh
89
ARG OVERRIDE_GENCODE="-gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90a,code=sm_90a"
910
ARG OVERRIDE_GENCODE_CUDNN="-gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90a,code=sm_90a"
@@ -105,6 +106,12 @@ RUN cd /workspace/tritonbench && \
105106
--repo triton-lang/triton --commit main --side single \
106107
--install-dir /workspace/triton-main
107108

109+
# Build meta-triton conda env
110+
RUN cd /workspace/tritonbench && \
111+
bash .ci/triton/install.sh --conda-env "${CONDA_ENV_META_TRITON}" \
112+
--repo facebookexperimental/triton --commit ws-3.5 --side single \
113+
--install-dir /workspace/meta-triton
114+
108115
# Output setup script for inspection
109116
RUN cat "${SETUP_SCRIPT}"
110117

0 commit comments

Comments
 (0)