Skip to content

Commit 659e1de

Browse files
Merge pull request #2394 from AI-Hypercomputer:rbierneni-move-tunix-installation
PiperOrigin-RevId: 811531652
2 parents 240a59a + 38f38dd commit 659e1de

7 files changed

Lines changed: 23 additions & 13 deletions

File tree

.github/workflows/RunTests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ jobs:
111111
device_name: a100-40gb-4
112112
cloud_runner: linux-x86-a2-48-a100-4gpu
113113
pytest_marker: 'not cpu_only and not tpu_only and not integration_test'
114+
pytest_addopts: '--ignore=tests/sft_hooks_test.py'
114115
xla_python_client_mem_fraction: 0.65
115116
tf_force_gpu_allow_growth: true
116117
container_resource_option: "--shm-size 2g --runtime=nvidia --gpus all --privileged"
@@ -124,6 +125,7 @@ jobs:
124125
device_name: a100-40gb-4
125126
cloud_runner: linux-x86-a2-48-a100-4gpu
126127
pytest_marker: 'not cpu_only and not tpu_only and integration_test'
128+
pytest_addopts: '--ignore=tests/sft_hooks_test.py'
127129
xla_python_client_mem_fraction: 0.65
128130
tf_force_gpu_allow_growth: true
129131
container_resource_option: "--shm-size 2g --runtime=nvidia --gpus all --privileged"

.github/workflows/run_tests_internal.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ on:
3131
pytest_marker:
3232
required: true
3333
type: string
34+
pytest_addopts:
35+
required: false
36+
type: string
37+
default: ''
3438
is_scheduled_run:
3539
required: true
3640
type: string
@@ -67,4 +71,4 @@ jobs:
6771
FINAL_PYTEST_MARKER="${{ inputs.pytest_marker }} and not scheduled_only"
6872
fi
6973
python3 -m pip install -e . --no-dependencies &&
70-
LIBTPU_INIT_ARGS='--xla_tpu_scoped_vmem_limit_kib=65536' python3 -m pytest -v -m "${FINAL_PYTEST_MARKER}" --durations=0
74+
LIBTPU_INIT_ARGS='--xla_tpu_scoped_vmem_limit_kib=65536' python3 -m pytest ${{ inputs.pytest_addopts }} -v -m "${FINAL_PYTEST_MARKER}" --durations=0

maxtext_jax_ai_image.Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ RUN if [ "$DEVICE" = "tpu" ] && [ "$JAX_STABLE_STACK_BASEIMAGE" = "us-docker.pkg
4747
python3 -m pip install -r /deps/requirements_with_jax_ai_image.txt; \
4848
fi
4949

50+
# Install tunix at a pinned commit for TPU devices, skip for GPU
51+
RUN if [ "$DEVICE" = "tpu" ]; then \
52+
python3 -m pip install 'google-tunix @ https://github.com/google/tunix/archive/e03f154edd2abfddd6b9babb72a3d0d3c4d81bb2.zip'; \
53+
fi
54+
5055
# Now copy the remaining code (source files that may change frequently)
5156
COPY . .
5257

@@ -61,7 +66,7 @@ RUN if [ "$TEST_TYPE" = "xlml" ] || [ "$TEST_TYPE" = "unit_test" ]; then \
6166
fi
6267

6368
# Run the script available in JAX AI base image to generate the manifest file
64-
RUN bash /jax-stable-stack/generate_manifest.sh PREFIX=maxtext COMMIT_HASH=$COMMIT_HASH
69+
RUN bash /jax-ai-image/generate_manifest.sh PREFIX=maxtext COMMIT_HASH=$COMMIT_HASH
6570

6671
# Install (editable) MaxText
6772
RUN test -f '/tmp/venv_created' && "$(tail -n1 /tmp/venv_created)"/bin/activate ; pip install --no-dependencies -e .

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ tensorflow-text
3737
tensorflow
3838
tiktoken
3939
transformers
40-
google-tunix @ https://github.com/google/tunix/archive/e03f154edd2abfddd6b9babb72a3d0d3c4d81bb2.zip
4140
google-jetstream @ https://github.com/AI-Hypercomputer/JetStream/archive/daedc21c393f23449fb54ddc4f75fca34348ea9c.zip
4241
mlperf-logging @ https://github.com/mlcommons/logging/archive/38ab22670527888c8eb7825a4ece176fcc36a95d.zip
4342
qwix @ https://github.com/google/qwix/archive/f2fd7b9114ff8d09e5b0131a453351578502da8a.zip

requirements_with_jax_ai_image.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ tensorflow-datasets
2323
tensorflow-text>=2.17.0
2424
tiktoken
2525
transformers
26-
google-tunix @ https://github.com/google/tunix/archive/e03f154edd2abfddd6b9babb72a3d0d3c4d81bb2.zip
2726
qwix @ https://github.com/google/qwix/archive/f2fd7b9114ff8d09e5b0131a453351578502da8a.zip

setup.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ if [[ "$MODE" == "nightly" ]]; then
146146
# Remove/update this section based on the pinned github repo commit in requirements.txt
147147
sed -i -E \
148148
-e 's|^mlperf-logging @ https?://github.com/mlcommons/logging/archive/.*\.zip$|mlperf-logging@git+https://github.com/mlperf/logging.git|' \
149-
-e '/^tunix/!s|^([^ ]*) @ https?://github.com/([^/]*\/[^/]*)/archive/.*\.zip$|\1@git+https://github.com/\2.git|' \
149+
-e 's|^([^ ]*) @ https?://github.com/([^/]*\/[^/]*)/archive/.*\.zip$|\1@git+https://github.com/\2.git|' \
150150
requirements.txt.nightly-temp
151151

152152
echo "--- Installing modified nightly requirements: ---"
@@ -189,14 +189,10 @@ if [[ "$MODE" == "stable" || ! -v MODE ]]; then
189189
python3 -m uv pip install 'jax[tpu]>0.4' -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
190190
fi
191191

192-
if [[ -n "$LIBTPU_GCS_PATH" ]]; then
193-
# Install custom libtpu
194-
echo "Installing libtpu.so from $LIBTPU_GCS_PATH to $libtpu_path"
195-
# Install required dependency
196-
python3 -m uv pip install -U crcmod
197-
# Copy libtpu.so from GCS path
198-
gsutil cp "$LIBTPU_GCS_PATH" "$libtpu_path"
199-
fi
192+
# TODO: Once tunix has support for GPUs, move it from here to requirements.txt
193+
echo "Installing tunix for stable TPU environment"
194+
python3 -m uv pip install 'google-tunix @ https://github.com/google/tunix/archive/e03f154edd2abfddd6b9babb72a3d0d3c4d81bb2.zip'
195+
200196
if [[ -n "$LIBTPU_GCS_PATH" ]]; then
201197
# Install custom libtpu
202198
echo "Installing libtpu.so from $LIBTPU_GCS_PATH to $libtpu_path"
@@ -256,6 +252,8 @@ elif [[ $MODE == "nightly" ]]; then
256252
fi
257253
echo "Installing nightly tensorboard plugin profile"
258254
python3 -m uv pip install tbp-nightly --upgrade
255+
# Installing tunix
256+
python3 -m uv pip install 'git+https://github.com/google/tunix.git'
259257
fi
260258
echo "Installing nightly tensorboard plugin profile"
261259
python3 -m uv pip install tbp-nightly --upgrade

tests/sft_hooks_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# limitations under the License.
1414

1515
"""Tests for training and data loading hooks for SFT"""
16+
import pytest
17+
18+
pytestmark = pytest.mark.tpu_only
1619

1720
import jax
1821

0 commit comments

Comments
 (0)