-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup Docker for TPU execution and update infra scripts.
I tried to optimize the Docker image size a bit using a staged build, as Ray currently requires a source build of Meson, which requires a Clang installation... even with this jax & libtpu are each themselves >250MB installs, so there's no avoiding a large image size at the moment. Still, with this configuration, a v5-32 (the most I could get given GCPs stingy IP address allocation) takes about 50 seconds to run setup-vm.sh and pull the initial image. After the initial pull, new deployments take a few seconds to package up the current source directory. It's still possible to use the `git clone` approach via a volume mount, but the permissions are a bit finicky at that point, and I'm not sure how many options we want to have.
- Loading branch information
Showing
18 changed files
with
432 additions
and
276 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
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
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,18 @@ | ||
FROM python:3.10 AS build | ||
RUN apt-get update && apt-get install -y clang | ||
RUN pip install virtualenv | ||
|
||
# venv binaries encode their directory, so we need to setup the venv in the final location | ||
RUN virtualenv -p python3.10 /opt/levanter/.venv | ||
RUN /opt/levanter/.venv/bin/pip install -U "jax[tpu]==0.4.26" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html | ||
|
||
WORKDIR /tmp | ||
|
||
# Add only the requirements files to cache dependency build/installation | ||
ADD pyproject.toml README.md /tmp/ | ||
RUN /opt/levanter/.venv/bin/pip install -e '.[test]' | ||
|
||
FROM python:3.10 | ||
|
||
WORKDIR /opt/levanter | ||
COPY --from=build /opt/levanter/.venv /opt/levanter/.venv |
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,16 @@ | ||
ARG REPO_LOCATION=us-west4-docker.pkg.dev/beastmaster-408319/levanter | ||
ARG BASE_VERSION=latest | ||
|
||
FROM ${REPO_LOCATION}/levanter:${BASE_VERSION} | ||
|
||
ENV TENSORSTORE_CURL_LOW_SPEED_TIME_SECONDS=60\ | ||
TENSORSTORE_CURL_LOW_SPEED_LIMIT_BYTES=1024\ | ||
RAY_USAGE_STATS_ENABLED=0\ | ||
PATH=/opt/levanter/.venv/bin:$PATH | ||
|
||
WORKDIR /opt/levanter | ||
|
||
ADD pyproject.toml README.md /opt/levanter/ | ||
RUN pip install -e '.[test]' | ||
|
||
ADD . /opt/levanter |
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
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
Empty file.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.