-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the current dependencies and Docker image CPU-only
Also makes it clear that this is a CPU-only setup
- Loading branch information
Showing
6 changed files
with
63 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
.DS_Store | ||
.idea | ||
.valohai | ||
Dockerfile | ||
Dockerfile.cpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# CPU-Only Environments | ||
|
||
## Dependencies | ||
|
||
Resolve and lock CPU dependencies: | ||
|
||
```bash | ||
uv pip compile --extra-index-url https://download.pytorch.org/whl/cpu requirements.in -o requirements-cpu.txt | ||
``` | ||
|
||
## Docker Image | ||
|
||
Build the CPU-only Docker image: | ||
|
||
```bash | ||
docker build -f Dockerfile.cpu -t llm-toolkit:dev-cpu . | ||
``` | ||
|
||
Smoke test the Docker image: | ||
|
||
```bash | ||
docker run -it --rm -v $(pwd):/workspace llm-toolkit:dev-cpu /bin/bash | ||
python -c "import torch; print(torch.__version__)" | ||
python -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))" | ||
``` | ||
|
||
Release a new version of the CPU-only Docker image: | ||
|
||
```bash | ||
export LLM_TOOLKIT_VERSION=0.2-cpu | ||
docker tag llm-toolkit:dev-cpu valohai/llm-toolkit:$LLM_TOOLKIT_VERSION | ||
docker push valohai/llm-toolkit:$LLM_TOOLKIT_VERSION | ||
``` | ||
|
||
Cleanup: | ||
|
||
```bash | ||
docker rmi valohai/llm-toolkit:$LLM_TOOLKIT_VERSION | ||
docker rmi llm-toolkit:dev-cpu | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM python:3.11.10-bookworm | ||
|
||
ENV PYTHONUNBUFFERED=1 \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=1 \ | ||
PIP_ROOT_USER_ACTION=ignore | ||
|
||
WORKDIR /workspace | ||
|
||
COPY requirements-cpu.txt . | ||
|
||
RUN pip install \ | ||
--no-cache-dir \ | ||
--extra-index-url https://download.pytorch.org/whl/cpu \ | ||
-r requirements-cpu.txt \ | ||
&& rm requirements-cpu.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters