Skip to content

Commit 42cb7ed

Browse files
Merge pull request #2515 from SamuelMarks:install_maxtext_extra_deps__CACHE
PiperOrigin-RevId: 822224535
2 parents 2b68435 + 698bf40 commit 42cb7ed

File tree

9 files changed

+18
-20
lines changed

9 files changed

+18
-20
lines changed

base_requirements/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ tensorflow
3838
tiktoken
3939
transformers
4040
qwix
41-
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/daedc21c393f23449fb54ddc4f75fca34348ea9c.zip
41+
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/29329e8e73820993f77cfc8efe34eb2a73f5de98.zip
4242
mlperf-logging @ https://github.com/mlcommons/logging/archive/38ab22670527888c8eb7825a4ece176fcc36a95d.zip

maxtext_db_dependencies.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ WORKDIR /deps
4141

4242
# Copy setup files and dependency files separately for better caching
4343
COPY setup.sh ./
44-
COPY requirements.txt requirements_with_jax_ai_image.txt generated_requirements ./
44+
COPY requirements.txt requirements_with_jax_ai_image.txt src/install_maxtext_extra_deps/extra_deps_from_github.txt generated_requirements ./
4545

4646
# Install dependencies - these steps are cached unless the copied files change
4747
RUN echo "Running command: bash setup.sh MODE=$ENV_MODE JAX_VERSION=$ENV_JAX_VERSION LIBTPU_GCS_PATH=${ENV_LIBTPU_GCS_PATH} DEVICE=${ENV_DEVICE}"

maxtext_dependencies.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ WORKDIR /deps
4141

4242
# Copy setup files and dependency files separately for better caching
4343
COPY setup.sh ./
44-
COPY requirements.txt requirements_with_jax_ai_image.txt generated_requirements ./
44+
COPY requirements.txt requirements_with_jax_ai_image.txt src/install_maxtext_extra_deps/extra_deps_from_github.txt generated_requirements ./
4545

4646
# Install dependencies - these steps are cached unless the copied files change
4747
RUN echo "Running command: bash setup.sh MODE=$ENV_MODE JAX_VERSION=$ENV_JAX_VERSION LIBTPU_GCS_PATH=${ENV_LIBTPU_GCS_PATH} DEVICE=${ENV_DEVICE}"

maxtext_gpu_dependencies.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ WORKDIR /deps
4343

4444
# Copy setup files and dependency files separately for better caching
4545
COPY setup.sh ./
46-
COPY requirements.txt requirements_with_jax_ai_image.txt generated_requirements ./
46+
COPY requirements.txt requirements_with_jax_ai_image.txt src/install_maxtext_extra_deps/extra_deps_from_github.txt generated_requirements ./
4747

4848
# Install dependencies - these steps are cached unless the copied files change
4949
RUN echo "Running command: bash setup.sh MODE=$ENV_MODE JAX_VERSION=$ENV_JAX_VERSION DEVICE=${ENV_DEVICE}"

maxtext_jax_ai_image.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ WORKDIR /deps
1717

1818
# Copy setup files and dependency files separately for better caching
1919
COPY setup.sh ./
20-
COPY requirements.txt requirements_with_jax_ai_image.txt requirements_with_jax_stable_stack_0_6_1_pipreqs.txt generated_requirements ./
20+
COPY requirements.txt requirements_with_jax_ai_image.txt requirements_with_jax_stable_stack_0_6_1_pipreqs.txt src/install_maxtext_extra_deps/extra_deps_from_github.txt generated_requirements ./
2121

2222

2323
# For JAX AI tpu training images 0.4.37 AND 0.4.35

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ tensorflow-text
3838
tensorflow
3939
tiktoken
4040
transformers
41-
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/daedc21c393f23449fb54ddc4f75fca34348ea9c.zip
41+
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/29329e8e73820993f77cfc8efe34eb2a73f5de98.zip
4242
mlperf-logging @ https://github.com/mlcommons/logging/archive/38ab22670527888c8eb7825a4ece176fcc36a95d.zip

requirements_with_jax_ai_image.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
datasets @ https://github.com/huggingface/datasets/archive/6790e138c00b87a1ddc72184f89e7814cf784360.zip
44
flax>=0.11.0
55
google-api-python-client
6-
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/daedc21c393f23449fb54ddc4f75fca34348ea9c.zip
6+
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/29329e8e73820993f77cfc8efe34eb2a73f5de98.zip
77
grain[parquet]>=0.2.12
88
jaxtyping
99
jsonlines

setup.sh

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,32 +137,29 @@ if [[ $DEVICE == "tpu" ]]; then
137137
fi
138138
fi
139139

140-
# Save the script folder path of maxtext
141-
run_name_folder_path=$(pwd)
142-
143-
# Install dependencies from requirements.txt
144-
cd "$run_name_folder_path" && python3 -m uv pip install --upgrade pip
145140
if [[ "$MODE" == "nightly" ]]; then
146141
echo "Nightly mode: Installing requirements.txt, stripping commit pins from git+ repos."
147-
cp requirements.txt requirements.txt.nightly-temp
142+
148143
# Create a temp file, strip commit pins from git+ repos in requirements.txt
149144
# Remove/update this section based on the pinned github repo commit in requirements.txt
150-
sed -i -E \
151-
-e 's|^mlperf-logging @ https?://github.com/mlcommons/logging/archive/.*\.zip$|mlperf-logging@git+https://github.com/mlperf/logging.git|' \
145+
sed -E \
152146
-e 's|^([^ ]*) @ https?://github.com/([^/]*\/[^/]*)/archive/.*\.zip$|\1@git+https://github.com/\2.git|' \
153-
requirements.txt.nightly-temp
147+
-e '/JetStream/d' \
148+
-e '/mlperf-logging/d' \
149+
requirements.txt > requirements.txt.nightly-temp
154150

155151
echo "--- Installing modified nightly requirements: ---"
156152
cat requirements.txt.nightly-temp
157153
echo "-------------------------------------------------"
158154

159-
python3 -m uv pip install --no-cache-dir -U -r requirements.txt.nightly-temp
155+
python3 -m uv pip install --no-cache-dir -U -r requirements.txt.nightly-temp \
156+
-r "${MAXTEXT_REPO_ROOT?}"'/extra_deps_from_github.txt'
160157
rm requirements.txt.nightly-temp
161158
else
162159
# stable or stable_stack mode: Install with pinned commits
163160
echo "Installing tpu-requirements.txt with pinned commits."
164161
tpu_requirements_txt=
165-
for candidate in 'generated_requirements' "${MAXTEXT_REPO_ROOT}"'/generated_requirements' "$PWD"; do
162+
for candidate in 'generated_requirements' "${MAXTEXT_REPO_ROOT?}"'/generated_requirements' "$PWD"; do
166163
if [ -f "$candidate"'/tpu-requirements.txt' ]; then
167164
tpu_requirements_txt="$candidate"'/tpu-requirements.txt'
168165
break
@@ -174,7 +171,8 @@ else
174171
>&2 printf 'Could not find "tpu-requirements.txt", looked in: %s\n' "${searched%?}"
175172
exit 2
176173
else
177-
python3 -m uv pip install --resolution=lowest -r "$tpu_requirements_txt"
174+
python3 -m uv pip install --resolution=lowest -r "$tpu_requirements_txt" \
175+
-r "${MAXTEXT_REPO_ROOT?}"'/extra_deps_from_github.txt'
178176
fi
179177
fi
180178

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/daedc21c393f23449fb54ddc4f75fca34348ea9c.zip
1+
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/29329e8e73820993f77cfc8efe34eb2a73f5de98.zip
22
mlperf-logging @ https://github.com/mlcommons/logging/archive/38ab22670527888c8eb7825a4ece176fcc36a95d.zip

0 commit comments

Comments
 (0)