Skip to content

Commit

Permalink
Use official torch image (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackalcooper authored Dec 27, 2024
1 parent 144f9c2 commit a919eba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/sd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,25 @@ concurrency:

jobs:
build-oneflow:
name: Build sd ${{ matrix.image.repo }}:${{ matrix.image.suffix }}
name: Build sd ${{ matrix.image.repo }}:${{ matrix.image.tag }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
image:
- {
BASE_IMAGE: "nvcr.io/nvidia/pytorch:23.08-py3",
BASE_IMAGE: "pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime",
suffix: "cu118",
tag: "torch2.3-cuda11.8",
repo: "onediff",
}
- {
BASE_IMAGE: "nvcr.io/nvidia/pytorch:23.08-py3",
suffix: "cu121",
repo: "onediff-pro",
}
- {
BASE_IMAGE: "nvcr.io/nvidia/pytorch:23.08-py3",
BASE_IMAGE: "pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime",
suffix: "cu122",
tag: "torch2.3-cuda12.1",
repo: "onediff-pro",
}

env:
DOCKER_BUILDKIT: 1
steps:
Expand Down Expand Up @@ -79,8 +75,8 @@ jobs:
# 1.2 Build and push image to ACR
- name: Set env
run: |
echo ACR_TAG="$REGISTRY/$NAMESPACE/${{ matrix.image.repo }}:${{ matrix.image.suffix }}" >> $GITHUB_ENV
echo DOCKERHUB_TAG="oneflowinc/${{ matrix.image.repo }}:${{ matrix.image.suffix }}" >> $GITHUB_ENV
echo ACR_TAG="$REGISTRY/$NAMESPACE/${{ matrix.image.repo }}:${{ matrix.image.tag }}" >> $GITHUB_ENV
echo DOCKERHUB_TAG="oneflowinc/${{ matrix.image.repo }}:${{ matrix.image.tag }}" >> $GITHUB_ENV
- name: Set env (Pro)
if: matrix.image.repo == 'onediff-pro'
run: |
Expand All @@ -90,7 +86,7 @@ jobs:
run: |
curl "${{ env.ONEFLOW_PIP_INDEX }}"
ONEFLOW_PIP_INDEX=${{ env.ONEFLOW_PIP_INDEX }}
DEV_VERSION=$(curl ${{ env.ONEFLOW_PIP_INDEX }} | rg '/oneflow-(\d.+?)%2B(.+?)-cp' -or '$1+${2}' | head -n 1)
DEV_VERSION=$(curl ${{ env.ONEFLOW_PIP_INDEX }} | rg '/oneflow-(\d.+?)%2B(.+?)-cp' -or '$1+${2}' | sort | tail -n 1)
echo "DEV_VERSION: ${DEV_VERSION}"
if [ -z "$DEV_VERSION" ]
then
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FROM ${BASE_IMAGE}

ARG ONEFLOW_PIP_INDEX
ARG ONEFLOW_PACKAGE_NAME=oneflow
RUN pip install -f ${ONEFLOW_PIP_INDEX} ${ONEFLOW_PACKAGE_NAME} "nvidia-cudnn-cu11>=8.9,<9.0"
RUN python3 -m pip install "torch" "transformers==4.27.1" "diffusers[torch]==0.19.3" "huggingface-hub==0.23.2" nvidia-cuda-cupti-cu12 nvidia-nvjitlink-cu12
RUN pip install -f ${ONEFLOW_PIP_INDEX} ${ONEFLOW_PACKAGE_NAME}
RUN python3 -m pip install "torch" "transformers==4.27.1" "diffusers[torch]==0.19.3" "huggingface-hub==0.23.2"
ADD . /src/onediff
RUN python3 -m pip install -e /src/onediff
RUN python3 -m pip install -e /src/onediff/onediff_diffusers_extensions

0 comments on commit a919eba

Please sign in to comment.