diff --git a/Dockerfile.ARM b/Dockerfile.ARM new file mode 100644 index 0000000..e287d3d --- /dev/null +++ b/Dockerfile.ARM @@ -0,0 +1,34 @@ +FROM nvcr.io/nvidia/cuda-arm64:11.4.0-devel-ubuntu20.04 +LABEL maintainer="bigscience-workshop" +LABEL repository="petals" + +WORKDIR /home +# Set en_US.UTF-8 locale by default +RUN echo "LC_ALL=en_US.UTF-8" >> /etc/environment + +# Install packages +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + wget \ + git \ + sed \ + && apt-get clean autoclean && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/* + +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O install_miniconda.sh && \ + bash install_miniconda.sh -b -p /opt/conda && rm install_miniconda.sh +ENV PATH="/opt/conda/bin:${PATH}" + +RUN conda install python~=3.10.12 pip && \ + pip install --no-cache-dir "torch>=1.12" && \ + conda clean --all && rm -rf ~/.cache/pip + +VOLUME /cache +ENV PETALS_CACHE=/cache + +RUN sed '46d' setup.cfg + +COPY . petals/ +RUN pip install --no-cache-dir -e petals + +WORKDIR /home/petals/ +CMD bash diff --git a/README.md b/README.md index 63449ae..d880286 100644 --- a/README.md +++ b/README.md @@ -144,3 +144,25 @@ _arXiv preprint arXiv:2209.01188,_ 2022.

+ + +# setup + + + 1623 sudo cp petals-inference.service /etc/systemd/system/ + 1634 sudo systemctl daemon-reload + 1635 sudo systemctl status petals-inference.service -l + 1636 sudo systemctl restart petals-inference.service -l + + 1639 sudo useradd petals + 1640 sudo mkdir /home/petals + 1641 sudo chown petals: /home/petals/ + 1643 sudo cp -r ~/.venv/ /home/petals/venv + 1644 sudo rm -rf /home/petals/venv + 1658 sudo mv ~/.venv/ /home/petals/venv + 1659 sudo chown petals: /home/petals/ + +1670 sudo systemctl status petals-inference.service -l + 1674 sudo systemctl restart petals-inference.service -l + 1675 sudo systemctl status petals-inference.service -l + \ No newline at end of file diff --git a/etc/petals-inference.service b/etc/petals-inference.service new file mode 100644 index 0000000..9916f62 --- /dev/null +++ b/etc/petals-inference.service @@ -0,0 +1,11 @@ +[Unit] +Description=Petals Inference + +[Service] +#User=petals +#Group=petals +Environment=PJRT_DEVICE=TPU +ExecStart=/home/petals/venv/bin/python -m petals.cli.run_server --port 31330 petals-team/StableBeluga2 --device xla --num_blocks=4 + +[Install] +WantedBy=multi-user.target diff --git a/run.sh b/run.sh index 5dc6c0c..dbefff3 100755 --- a/run.sh +++ b/run.sh @@ -1 +1,2 @@ -PJRT_DEVICE=TPU python -m petals.cli.run_server --port 31330 petals-team/StableBeluga2 --device xla --num_blocks=4 --initial_peers /ip4/10.128.0.41/tcp/8099/p2p/QmVA1BeK2UYaXPwmHQ5EZ2biyzyVWdnQj2zHcEVYxgiSDY +PJRT_DEVICE=TPU python -m petals.cli.run_server --port 31330 petals-team/StableBeluga2 --device xla --num_blocks=4 +