Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run cloner on native builder. #904

Merged
merged 1 commit into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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