Skip to content

Commit

Permalink
feat: more size optimization work
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com>
  • Loading branch information
cryptk committed May 4, 2024
1 parent ef131f3 commit 9a5f5f2
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 43 deletions.
55 changes: 27 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -284,54 +284,53 @@ SHELL ["/bin/bash", "-c"]
# We try to strike a balance between individual layer size (as that affects total push time) and total image size
# Splitting the backends into more groups with fewer items results in a larger image, but a smaller size for the largest layer
# Splitting the backends into fewer groups with more items results in a smaller image, but a larger size for the largest layer
RUN if [[ ( "${EXTRA_BACKENDS}" =~ "autogptq" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/autogptq \

RUN if [[ ( "${EXTRA_BACKENDS}" =~ "coqui" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/coqui \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "bark" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/bark \
if [[ ( "${EXTRA_BACKENDS}" =~ "parler-tts" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/parler-tts \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "diffusers" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/diffusers \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "transformers-musicgen" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/transformers-musicgen \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "exllama1" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/exllama \
; fi

RUN if [[ ( "${EXTRA_BACKENDS}" =~ "mamba" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/mamba \
RUN if [[ ( "${EXTRA_BACKENDS}" =~ "vall-e-x" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/vall-e-x \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "petals" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/petals \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "sentencetransformers" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/sentencetransformers \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "exllama2" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/exllama2 \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "transformers" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/transformers \
; fi

RUN if [[ ( "${EXTRA_BACKENDS}" =~ "vllm" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/vllm \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "rerankers" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/rerankers \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "vall-e-x" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/vall-e-x \
; fi

RUN if [[ ( "${EXTRA_BACKENDS}" =~ "exllama1" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/exllama \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "exllama2" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/exllama2 \
if [[ ( "${EXTRA_BACKENDS}" =~ "autogptq" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/autogptq \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "coqui" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/coqui \
; fi

RUN if [[ ( "${EXTRA_BACKENDS}" =~ "transformers-musicgen" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/transformers-musicgen \
if [[ ( "${EXTRA_BACKENDS}" =~ "bark" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/bark \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "parler-tts" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/parler-tts \
if [[ ( "${EXTRA_BACKENDS}" =~ "rerankers" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/rerankers \
; fi && \
if [[ ( "${EXTRA_BACKENDS}" =~ "petals" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/petals \
if [[ ( "${EXTRA_BACKENDS}" =~ "mamba" || -z "${EXTRA_BACKENDS}" ) && "$IMAGE_TYPE" == "extras" ]]; then \
make -C backend/python/mamba \
; fi

# Make sure the models directory exists
Expand Down
3 changes: 2 additions & 1 deletion backend/python/autogptq/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ auto-gptq==0.7.1
grpcio==1.63.0
protobuf
torch
certifi
certifi
transformers==4.38.2
3 changes: 2 additions & 1 deletion backend/python/bark/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ accelerate
bark==0.1.5
grpcio==1.63.0
protobuf
certifi
certifi
transformers==4.38.2
3 changes: 2 additions & 1 deletion backend/python/coqui/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ accelerate
TTS==0.22.0
grpcio==1.63.0
protobuf
certifi
certifi
transformers==4.38.2
2 changes: 1 addition & 1 deletion backend/python/diffusers/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ opencv-python
pillow
protobuf
torch
transformers
transformers==4.38.2
certifi
2 changes: 1 addition & 1 deletion backend/python/exllama/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
grpcio==1.63.0
protobuf
torch
transformers
transformers==4.38.2
certifi
3 changes: 2 additions & 1 deletion backend/python/mamba/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ causal-conv1d==1.2.0.post2
mamba-ssm==1.2.0.post1
grpcio==1.63.0
torch==2.1.2
certifi
certifi
transformers==4.38.2
3 changes: 2 additions & 1 deletion backend/python/parler-tts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ grpcio==1.63.0
protobuf
torch
git+https://github.com/huggingface/parler-tts.git@10016fb0300c0dc31a0fb70e26f3affee7b62f16
certifi
certifi
transformers==4.38.2
3 changes: 0 additions & 3 deletions backend/python/parler-tts/test_parler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def tearDown(self) -> None:
"""
This method tears down the gRPC service by terminating the server
"""
print("stopping service")
self.service.terminate()
self.service.wait()

Expand Down Expand Up @@ -54,8 +53,6 @@ def test_load_model(self):
with grpc.insecure_channel("localhost:50051") as channel:
stub = backend_pb2_grpc.BackendStub(channel)
response = stub.LoadModel(backend_pb2.ModelOptions(Model="parler-tts/parler_tts_mini_v0.1"))
print("response:")
print(response)
self.assertTrue(response.success)
self.assertEqual(response.message, "Model loaded successfully")
except Exception as err:
Expand Down
3 changes: 2 additions & 1 deletion backend/python/petals/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
git+https://github.com/bigscience-workshop/petals
certifi
certifi
transformers==4.38.2
3 changes: 2 additions & 1 deletion backend/python/rerankers/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ accelerate
rerankers[transformers]
grpcio==1.63.0
protobuf
certifi
certifi
transformers==4.38.2
1 change: 1 addition & 0 deletions backend/python/sentencetransformers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
accelerate
sentence-transformers==2.5.1
transformers==4.38.2
grpcio==1.63.0
protobuf
certifi
2 changes: 1 addition & 1 deletion backend/python/transformers-musicgen/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accelerate
transformers>=4.38.2
transformers==4.38.2
grpcio==1.63.0
protobuf
torch
Expand Down
2 changes: 1 addition & 1 deletion backend/python/transformers/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accelerate
transformers>=4.38.2
transformers==4.38.2
grpcio==1.63.0
protobuf
torch
Expand Down
3 changes: 2 additions & 1 deletion backend/python/vllm/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ accelerate
vllm
grpcio==1.63.0
protobuf
certifi
certifi
transformers==4.38.2

0 comments on commit 9a5f5f2

Please sign in to comment.