Skip to content

Commit

Permalink
Make torch optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaddair committed Dec 20, 2023
1 parent fb74134 commit 9ddc4e6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 65 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ COPY server/Makefile server/Makefile

RUN cd server && \
make gen-server && \
pip install ".[bnb, accelerate, quantize]" --no-cache-dir
pip install ".[bnb, accelerate, quantize, peft]" --no-cache-dir

# Install router
COPY --from=builder /usr/src/target/release/lorax-router /usr/local/bin/lorax-router
Expand Down
2 changes: 1 addition & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ run-dev:
# SAFETENSORS_FAST_GPU=1 python -m torch.distributed.run --nproc_per_node=1 lorax_server/cli.py serve flozi00/Mistral-7B-german-assistant-v5-4bit-autogptq --quantize gptq

export-requirements:
poetry export -o requirements.txt -E bnb -E quantize --without-hashes
poetry export -o requirements.txt -E bnb --without-hashes
46 changes: 24 additions & 22 deletions server/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ einops = "^0.6.1"
tiktoken = "^0.5.2"
texttable = { version = "^1.6.7", optional = true }
datasets = { version = "^2.14.0", optional = true }
torch = {version = "2.1.1"}
peft = "0.4.0"
torch = {version = "2.1.1", optional = true }
peft = {version = "0.4.0", optional = true }
boto3 = "^1.28.34"
urllib3 = "<=1.26.18"
stanford-stk = "^0.0.6"

[tool.poetry.extras]
torch = ["torch"]
accelerate = ["accelerate"]
bnb = ["bitsandbytes"]
peft = ["peft"]
quantize = ["texttable", "datasets", "accelerate"]

[tool.poetry.group.dev.dependencies]
Expand Down
39 changes: 0 additions & 39 deletions server/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
accelerate==0.24.1 ; python_version >= "3.9" and python_version < "4.0"
aiohttp==3.9.1 ; python_version >= "3.9" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
async-timeout==4.0.3 ; python_version >= "3.9" and python_version < "3.11"
attrs==23.1.0 ; python_version >= "3.9" and python_version < "4.0"
backoff==2.2.1 ; python_version >= "3.9" and python_version < "4.0"
bitsandbytes==0.41.3.post2 ; python_version >= "3.9" and python_version < "4.0"
boto3==1.34.4 ; python_version >= "3.9" and python_version < "4.0"
Expand All @@ -11,14 +6,10 @@ certifi==2023.11.17 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows")
datasets==2.15.0 ; python_version >= "3.9" and python_version < "4.0"
deprecated==1.2.14 ; python_version >= "3.9" and python_version < "4.0"
dill==0.3.7 ; python_version >= "3.9" and python_version < "4.0"
einops==0.6.1 ; python_version >= "3.9" and python_version < "4.0"
filelock==3.13.1 ; python_version >= "3.9" and python_version < "4.0"
frozenlist==1.4.1 ; python_version >= "3.9" and python_version < "4.0"
fsspec==2023.10.0 ; python_version >= "3.9" and python_version < "4.0"
fsspec[http]==2023.10.0 ; python_version >= "3.9" and python_version < "4.0"
googleapis-common-protos==1.62.0 ; python_version >= "3.9" and python_version < "4.0"
grpc-interceptor==0.15.4 ; python_version >= "3.9" and python_version < "4.0"
grpcio-reflection==1.60.0 ; python_version >= "3.9" and python_version < "4.0"
Expand All @@ -28,27 +19,9 @@ hf-transfer==0.1.4 ; python_version >= "3.9" and python_version < "4.0"
huggingface-hub==0.19.4 ; python_version >= "3.9" and python_version < "4.0"
idna==3.6 ; python_version >= "3.9" and python_version < "4.0"
importlib-metadata==6.11.0 ; python_version >= "3.9" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.9" and python_version < "4.0"
jmespath==1.0.1 ; python_version >= "3.9" and python_version < "4.0"
loguru==0.6.0 ; python_version >= "3.9" and python_version < "4.0"
markupsafe==2.1.3 ; python_version >= "3.9" and python_version < "4.0"
mpmath==1.3.0 ; python_version >= "3.9" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.9" and python_version < "4.0"
multiprocess==0.70.15 ; python_version >= "3.9" and python_version < "4.0"
networkx==3.2.1 ; python_version >= "3.9" and python_version < "4.0"
numpy==1.26.2 ; python_version >= "3.9" and python_version < "4.0"
nvidia-cublas-cu12==12.1.3.1 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-cuda-cupti-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-cuda-nvrtc-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-cuda-runtime-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-cudnn-cu12==8.9.2.26 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-cufft-cu12==11.0.2.54 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-curand-cu12==10.3.2.106 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-cusolver-cu12==11.4.5.107 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-cusparse-cu12==12.1.0.106 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-nccl-cu12==2.18.1 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-nvjitlink-cu12==12.3.101 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
nvidia-nvtx-cu12==12.1.105 ; platform_system == "Linux" and platform_machine == "x86_64" and python_version >= "3.9" and python_version < "4.0"
opentelemetry-api==1.21.0 ; python_version >= "3.9" and python_version < "4.0"
opentelemetry-exporter-otlp-proto-common==1.21.0 ; python_version >= "3.9" and python_version < "4.0"
opentelemetry-exporter-otlp-proto-grpc==1.21.0 ; python_version >= "3.9" and python_version < "4.0"
Expand All @@ -60,14 +33,8 @@ opentelemetry-proto==1.21.0 ; python_version >= "3.9" and python_version < "4.0"
opentelemetry-sdk==1.21.0 ; python_version >= "3.9" and python_version < "4.0"
opentelemetry-semantic-conventions==0.42b0 ; python_version >= "3.9" and python_version < "4.0"
packaging==23.2 ; python_version >= "3.9" and python_version < "4.0"
pandas==2.1.4 ; python_version >= "3.9" and python_version < "4.0"
peft==0.4.0 ; python_version >= "3.9" and python_version < "4.0"
protobuf==4.25.1 ; python_version >= "3.9" and python_version < "4.0"
psutil==5.9.7 ; python_version >= "3.9" and python_version < "4.0"
pyarrow-hotfix==0.6 ; python_version >= "3.9" and python_version < "4.0"
pyarrow==14.0.2 ; python_version >= "3.9" and python_version < "4.0"
python-dateutil==2.8.2 ; python_version >= "3.9" and python_version < "4.0"
pytz==2023.3.post1 ; python_version >= "3.9" and python_version < "4.0"
pyyaml==6.0.1 ; python_version >= "3.9" and python_version < "4.0"
regex==2023.10.3 ; python_version >= "3.9" and python_version < "4.0"
requests==2.31.0 ; python_version >= "3.9" and python_version < "4.0"
Expand All @@ -77,20 +44,14 @@ sentencepiece==0.1.99 ; python_version >= "3.9" and python_version < "4.0"
setuptools==69.0.2 ; python_version >= "3.9" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
stanford-stk==0.0.6 ; python_version >= "3.9" and python_version < "4.0"
sympy==1.12 ; python_version >= "3.9" and python_version < "4.0"
texttable==1.7.0 ; python_version >= "3.9" and python_version < "4.0"
tiktoken==0.5.2 ; python_version >= "3.9" and python_version < "4.0"
tokenizers==0.15.0 ; python_version >= "3.9" and python_version < "4.0"
torch==2.1.1 ; python_version >= "3.9" and python_version < "4.0"
tqdm==4.66.1 ; python_version >= "3.9" and python_version < "4.0"
transformers==4.36.0 ; python_version >= "3.9" and python_version < "4.0"
triton==2.1.0 ; python_version >= "3.9" and python_version < "4.0"
typer==0.6.1 ; python_version >= "3.9" and python_version < "4.0"
typing-extensions==4.9.0 ; python_version >= "3.9" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.9" and python_version < "4.0"
urllib3==1.26.18 ; python_version >= "3.9" and python_version < "4.0"
win32-setctime==1.1.0 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32"
wrapt==1.16.0 ; python_version >= "3.9" and python_version < "4.0"
xxhash==3.4.1 ; python_version >= "3.9" and python_version < "4.0"
yarl==1.9.4 ; python_version >= "3.9" and python_version < "4.0"
zipp==3.17.0 ; python_version >= "3.9" and python_version < "4.0"

0 comments on commit 9ddc4e6

Please sign in to comment.