diff --git a/.ci/tritonbench/install-triton-nightly.sh b/.ci/tritonbench/install-triton-main.sh similarity index 71% rename from .ci/tritonbench/install-triton-nightly.sh rename to .ci/tritonbench/install-triton-main.sh index 7b0a89b7..a4bd24aa 100644 --- a/.ci/tritonbench/install-triton-nightly.sh +++ b/.ci/tritonbench/install-triton-main.sh @@ -23,5 +23,10 @@ conda create --name "${CONDA_ENV}" -y --clone "${BASE_CONDA_ENV}" conda activate "${CONDA_ENV}" . "${SETUP_SCRIPT}" -# Install the nightly openai/triton -pip install -U --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/Triton-Nightly/pypi/simple/ triton-nightly \ No newline at end of file + +# Install and build triton from source code +cd /workspace +git clone https://github.com/triton-lang/triton.git +cd /workspace/triton +pip install ninja cmake wheel pybind11; # build-time dependencies +pip install -e python diff --git a/docker/tritonbench-nightly.dockerfile b/docker/tritonbench-nightly.dockerfile index de7abc39..d958fbea 100644 --- a/docker/tritonbench-nightly.dockerfile +++ b/docker/tritonbench-nightly.dockerfile @@ -3,7 +3,8 @@ ARG BASE_IMAGE=xzhao9/gcp-a100-runner-dind:latest FROM ${BASE_IMAGE} -ENV CONDA_ENV=tritonbench +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} @@ -49,9 +50,14 @@ RUN sudo apt update && sudo apt-get install -y libnvidia-compute-550 patchelf RUN cd /workspace/tritonbench && \ bash .ci/tritonbench/install.sh + # Test Tritonbench RUN cd /workspace/tritonbench && \ bash .ci/tritonbench/test-install.sh # Remove NVIDIA driver library - they are supposed to be mapped at runtime RUN sudo apt-get purge -y libnvidia-compute-550 + +# Clone the pytorch env as triton-main env, then compile triton main from source +RUN cd /workspace/tritonbench && \ + BASE_CONDA_ENV=${CONDA_ENV} CONDA_ENV=${CONDA_ENV_TRITON_MAIN} bash .ci/tritonbench/install-triton-main.sh