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

Docker Image for running distilabel CLI #611

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions docker/CUDA.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Arguments
ARG PYTORCH_VERSION=2.1.1
ARG CUDA_VERSION=12.1.1
ARG UBUNTU_VERSION=22.04
ARG TORCH_VERSION=2.2.0

# Using runpod base image and installing torch, cuda and ubuntu
FROM runpod/pytorch:${PYTORCH_VERSION}-py3.10-cuda${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION} AS base

# Run system updates and clean up
RUN apt-get update && \
apt-get install python3 python3-pip -y

# Set python3 as default python
RUN ln -s /usr/bin/python3 /usr/bin/python
ENV PYTHON=/usr/bin/python

# Install torch
RUN python -m pip install --no-cache-dir --upgrade pip && \
python -m pip install --no-cache-dir torch==${TORCH_VERSION}

# Set the working directory to /
WORKDIR /

FROM runpod/pytorch:${PYTORCH_VERSION}-py3.10-cuda${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}

COPY . .

# Installing distilabel with GPU-related dependencies
RUN pip install -e ".[argilla,hf-transformers,hf-inference-endpoints,llama-cpp,vllm]"

EXPOSE 80

CMD ["distilabel"]
11 changes: 11 additions & 0 deletions docker/local.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG PYTHON_VERSION="3.11-slim"

FROM python:${PYTHON_VERSION}

WORKDIR /app

RUN pip install "distilabel[argilla]"

EXPOSE 80

CMD ["distilabel"]
8 changes: 8 additions & 0 deletions src/distilabel/pipeline/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@
_SUBPROCESS_EXCEPTION: Union[Exception, None] = None


# if platform.system() != "Windows":
# _MULTIPROCESSING_CONTEXT = "forkserver"
# else:
# _MULTIPROCESSING_CONTEXT = "spawn"

_MULTIPROCESSING_CONTEXT = "spawn"


def _init_worker(queue: "Queue[Any]") -> None:
signal.signal(signal.SIGINT, signal.SIG_IGN)
setup_logging(queue)
Expand Down