-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: We are building rocm nightly docker on-demand, also update the third-party kernel inventories with their dependencies. Pull Request resolved: #64 Test Plan: CI Fixes #49 Reviewed By: FindHao Differential Revision: D66305346 Pulled By: xuzhao9 fbshipit-source-id: 15a5277d9cc34f88b18ab510371cdf411b06f120
- Loading branch information
1 parent
45d195c
commit d5702ef
Showing
9 changed files
with
301 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: TritonBench Nightly ROCM Docker Build | ||
on: | ||
pull_request: | ||
paths: | ||
- .github/workflows/docker-rocm.yaml | ||
- docker/tritonbench-rocm-nightly.dockerfile | ||
workflow_dispatch: | ||
inputs: | ||
nightly_date: | ||
description: "PyTorch nightly version" | ||
required: false | ||
env: | ||
CONDA_ENV: "tritonbench" | ||
SETUP_SCRIPT: "/workspace/setup_instance.sh" | ||
|
||
jobs: | ||
build-push-docker: | ||
if: ${{ github.repository_owner == 'pytorch-labs' }} | ||
runs-on: 32-core-ubuntu | ||
environment: docker-s3-upload | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
path: tritonbench | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: pytorch-labs | ||
password: ${{ secrets.TRITONBENCH_ACCESS_TOKEN }} | ||
- name: Build TritonBench nightly docker | ||
run: | | ||
set -x | ||
export NIGHTLY_DATE="${{ github.event.inputs.nightly_date }}" | ||
cd tritonbench/docker | ||
# branch name is github.head_ref when triggered by pull_request | ||
# and it is github.ref_name when triggered by workflow_dispatch | ||
branch_name=${{ github.head_ref || github.ref_name }} | ||
docker build . --build-arg TRITONBENCH_BRANCH="${branch_name}" --build-arg FORCE_DATE="${NIGHTLY_DATE}" \ | ||
-f tritonbench-rocm-nightly.dockerfile -t ghcr.io/pytorch-labs/tritonbench:rocm-latest | ||
# Extract pytorch version from the docker | ||
PYTORCH_VERSION=$(docker run -e SETUP_SCRIPT="${SETUP_SCRIPT}" ghcr.io/pytorch-labs/tritonbench:rocm-latest bash -c '. "${SETUP_SCRIPT}"; python -c "import torch; print(torch.__version__)"') | ||
export DOCKER_TAG=$(awk '{match($0, /dev[0-9]+/, arr); print arr[0]}' <<< "${PYTORCH_VERSION}") | ||
docker tag ghcr.io/pytorch-labs/tritonbench:rocm-latest ghcr.io/pytorch-labs/tritonbench:rocm-${DOCKER_TAG} | ||
- name: Push docker to remote | ||
if: github.event_name != 'pull_request' | ||
run: | | ||
# Extract pytorch version from the docker | ||
PYTORCH_VERSION=$(docker run -e SETUP_SCRIPT="${SETUP_SCRIPT}" ghcr.io/pytorch-labs/tritonbench:latest bash -c '. "${SETUP_SCRIPT}"; python -c "import torch; print(torch.__version__)"') | ||
export DOCKER_TAG=$(awk '{match($0, /dev[0-9]+/, arr); print arr[0]}' <<< "${PYTORCH_VERSION}") | ||
docker push ghcr.io/pytorch-labs/tritonbench:rocm-${DOCKER_TAG} | ||
docker push ghcr.io/pytorch-labs/tritonbench:rocm-latest | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | ||
cancel-in-progress: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Build ROCM base docker file | ||
# We are not building AMD CI in a short term, but this could be useful | ||
# for sharing benchmark results with AMD. | ||
ARG BASE_IMAGE=rocm/pytorch:latest | ||
|
||
FROM ${BASE_IMAGE} | ||
|
||
ENV CONDA_ENV=pytorch | ||
ENV CONDA_ENV_TRITON_MAIN=triton-main | ||
ENV SETUP_SCRIPT=/workspace/setup_instance.sh | ||
ARG TRITONBENCH_BRANCH=${TRITONBENCH_BRANCH:-main} | ||
ARG FORCE_DATE=${FORCE_DATE} | ||
|
||
RUN mkdir -p /workspace; touch "${SETUP_SCRIPT}" | ||
|
||
RUN echo "\ | ||
. /opt/conda/etc/profile.d/conda.sh\n\ | ||
conda activate base\n\ | ||
export CONDA_HOME=/opt/conda\n" > "${SETUP_SCRIPT}" | ||
|
||
RUN echo ". /workspace/setup_instance.sh\n" >> ${HOME}/.bashrc | ||
|
||
# Checkout TritonBench and submodules | ||
RUN git clone --recurse-submodules -b "${TRITONBENCH_BRANCH}" --single-branch \ | ||
https://github.com/pytorch-labs/tritonbench /workspace/tritonbench | ||
|
||
# Setup conda env | ||
RUN cd /workspace/tritonbench && \ | ||
. ${SETUP_SCRIPT} && \ | ||
python tools/python_utils.py --create-conda-env ${CONDA_ENV} && \ | ||
echo "if [ -z \${CONDA_ENV} ]; then export CONDA_ENV=${CONDA_ENV}; fi" >> "${SETUP_SCRIPT}" && \ | ||
echo "conda activate \${CONDA_ENV}" >> "${SETUP_SCRIPT}" | ||
|
||
|
||
# Install PyTorch nightly and verify the date is correct | ||
RUN cd /workspace/tritonbench && \ | ||
. ${SETUP_SCRIPT} && \ | ||
python -m tools.rocm_utils --install-torch-deps && \ | ||
python -m tools.rocm_utils --install-torch-nightly | ||
|
||
|
||
# Install Tritonbench | ||
RUN cd /workspace/tritonbench && \ | ||
bash .ci/tritonbench/install.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.