Skip to content

Commit

Permalink
Merge pull request #904 from anarkiwi/gc
Browse files Browse the repository at this point in the history
Run cloner on native builder.
  • Loading branch information
anarkiwi authored Oct 7, 2023
2 parents 6cd5419 + 476bcb9 commit 967553e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-extras.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
context: docker
file: docker/Dockerfile.torchserve
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
tags: iqtlabs/gamutrf-torchserve:${{ steps.change_version.outputs.VERSION }}
if: github.repository == 'iqtlabs/gamutrf' && github.event_name == 'push'
Expand Down
29 changes: 21 additions & 8 deletions docker/Dockerfile.torchserve
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
FROM ubuntu:22.04 as shader-compiler
FROM --platform=$BUILDPLATFORM ubuntu:22.04 as git-cloner
WORKDIR /root
RUN apt-get update && \
apt-get install -y \
ca-certificates \
git \
python3
RUN git clone https://github.com/google/shaderc -b v2023.6
RUN git clone https://github.com/pytorch/pytorch -b v2.1.0
RUN git clone https://github.com/pytorch/serve -b v0.8.2
WORKDIR /root/shaderc
RUN ./utils/git-sync-deps
WORKDIR /root/pytorch
RUN git submodule update --init --recursive

FROM ubuntu:22.04 as shader-compiler
WORKDIR /root
RUN apt-get update && \
apt-get install -y \
Expand All @@ -9,18 +23,19 @@ RUN apt-get update && \
ninja-build \
python3-dev \
python3-pip
RUN git clone https://github.com/google/shaderc -b v2023.6
WORKDIR /root/shaderc
RUN ./utils/git-sync-deps
COPY --from=git-cloner /root/shaderc /root/shaderc
WORKDIR /root/shaderc/build
RUN cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DSHADERC_SKIP_TESTS=on .. && ninja && ninja install

FROM ubuntu:22.04 as pytorch-compiler
# ENV USE_CUDA=1
ENV DEBIAN_FRONTEND=noninteractive
ENV USE_CUDA=0
ENV USE_VULKAN=1
ENV USE_VULKAN_SHADERC_RUNTIME=1
ENV USE_VULKAN_WRAPPER=0
WORKDIR /root
COPY --from=shader-compiler /usr/local /usr/local
COPY --from=git-cloner /root/pytorch /root/pytorch
RUN apt-get update && \
apt-get install -y \
build-essential \
Expand All @@ -30,8 +45,6 @@ RUN apt-get update && \
ninja-build \
python3-dev \
python3-pip
COPY --from=shader-compiler /usr/local /usr/local
RUN git clone https://github.com/pytorch/pytorch -b v2.1.0
WORKDIR /root/pytorch
COPY pytorch-patch.txt /root/pytorch
RUN patch -p1 < pytorch-patch.txt
Expand All @@ -51,7 +64,7 @@ RUN apt-get update && \
python3-dev \
python3-pip
WORKDIR /root
RUN git clone https://github.com/pytorch/serve -b v0.8.2
COPY --from=git-cloner /root/serve /root/serve
WORKDIR /root/serve
COPY torchserve-patch.txt /root/serve
RUN patch -p1 < torchserve-patch.txt
Expand Down

0 comments on commit 967553e

Please sign in to comment.