Skip to content

Commit 9777a4c

Browse files
Merge pull request #3567 from AI-Hypercomputer:install_extra_deps_refactor
PiperOrigin-RevId: 894341508
2 parents 1f04ad1 + 67a6c47 commit 9777a4c

18 files changed

Lines changed: 48 additions & 56 deletions

.github/workflows/run_jupyter_notebooks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
7373
# 2. Install MaxText package and all the post training dependencies
7474
uv pip install ${maxtext_wheel}[tpu-post-train] --resolution=lowest
75-
install_maxtext_tpu_post_train_extra_deps
75+
install_tpu_post_train_extra_deps
7676
7777
python3 -m pip freeze
7878
- name: Run Post-Training Notebooks

.github/workflows/run_pathways_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
source .venv/bin/activate
8686
maxtext_wheel=$(ls maxtext-*-py3-none-any.whl 2>/dev/null)
8787
uv pip install ${maxtext_wheel}[tpu] --resolution=lowest
88-
uv pip install -r src/dependencies/github_deps/pre_train_deps.txt
88+
install_tpu_pre_train_extra_deps
8989
python3 --version
9090
python3 -m pip freeze
9191
- name: Copy test assets files

.github/workflows/run_tests_against_package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ jobs:
110110
echo "Installing ${maxtext_wheel} for ${MAXTEXT_PACKAGE_EXTRA}..."
111111
uv pip install ${maxtext_wheel}[${MAXTEXT_PACKAGE_EXTRA}] --resolution=lowest
112112
if [ "${MAXTEXT_PACKAGE_EXTRA}" == "tpu-post-train" ]; then
113-
uv pip install -r src/dependencies/github_deps/post_train_base_deps.txt
113+
install_tpu_post_train_extra_deps
114114
else
115-
uv pip install -r src/dependencies/github_deps/pre_train_deps.txt
115+
install_tpu_pre_train_extra_deps
116116
fi
117117
python3 --version
118118
python3 -m pip freeze

docs/install_maxtext.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ source maxtext_venv/bin/activate
4141

4242
# Option 1: Installing maxtext[tpu]
4343
uv pip install maxtext[tpu]==0.2.1 --resolution=lowest
44-
install_maxtext_tpu_github_deps
44+
install_tpu_pre_train_extra_deps
4545

4646
# Option 2: Installing maxtext[cuda12]
4747
uv pip install maxtext[cuda12]==0.2.1 --resolution=lowest
48-
install_maxtext_cuda12_github_dep
48+
install_cuda12_pre_train_extra_dep
4949

5050
# Option 3: Installing maxtext[tpu-post-train]
5151
uv pip install maxtext[tpu-post-train]==0.2.1 --resolution=lowest
52-
install_maxtext_tpu_post_train_extra_deps
52+
install_tpu_post_train_extra_deps
5353

5454
# Option 4: Installing maxtext[runner]
5555
uv pip install maxtext[runner]==0.2.1 --resolution=lowest
5656
```
5757

58-
> **Note:** The `install_maxtext_tpu_github_deps`, `install_maxtext_cuda12_github_dep`, and
59-
> `install_maxtext_tpu_post_train_extra_deps` commands are temporarily required to install dependencies directly from GitHub
58+
> **Note:** The `install_tpu_pre_train_extra_deps`, `install_cuda12_pre_train_extra_deps`, and
59+
> `install_tpu_post_train_extra_deps` commands are temporarily required to install dependencies directly from GitHub
6060
> that are not yet available on PyPI. As shown above, choose the one that corresponds to your use case.
6161
6262
> **Note:** The maxtext package contains a comprehensive list of all direct and transitive dependencies, with lower bounds, generated by [seed-env](https://github.com/google-ml-infra/actions/tree/main/python_seed_env). We highly recommend the `--resolution=lowest` flag. It instructs `uv` to install the specific, tested versions of dependencies defined by MaxText, rather than the latest available ones. This ensures a consistent and reproducible environment, which is critical for stable performance and for running benchmarks.
@@ -82,15 +82,15 @@ source maxtext_venv/bin/activate
8282

8383
# Option 1: Installing .[tpu]
8484
uv pip install -e .[tpu] --resolution=lowest
85-
install_maxtext_tpu_github_deps
85+
install_tpu_pre_train_extra_deps
8686

8787
# Option 2: Installing .[cuda12]
8888
uv pip install -e .[cuda12] --resolution=lowest
89-
install_maxtext_cuda12_github_dep
89+
install_cuda12_pre_train_extra_deps
9090

9191
# Option 3: Installing .[tpu-post-train]
9292
uv pip install -e .[tpu-post-train] --resolution=lowest
93-
install_maxtext_tpu_post_train_extra_deps
93+
install_tpu_post_train_extra_deps
9494

9595
# Option 4: Installing maxtext[runner]
9696
uv pip install -e .[runner] --resolution=lowest

docs/tutorials/inference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Required-by:
4747
If the plugin is not installed, please run the install post training extra dependencies script again with the following command:
4848

4949
```bash
50-
install_maxtext_tpu_post_train_extra_deps
50+
install_tpu_post_train_extra_deps
5151
```
5252

5353
# Offline Inference

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ packages = ["src/maxtext", "src/dependencies"]
4646
path = "build_hooks.py"
4747

4848
[project.scripts]
49-
install_maxtext_tpu_github_deps = "dependencies.github_deps.install_pre_train_deps:main"
50-
install_maxtext_cuda12_github_deps = "dependencies.github_deps.install_pre_train_deps:main"
51-
install_maxtext_tpu_post_train_extra_deps = "dependencies.github_deps.install_post_train_deps:main"
49+
install_tpu_pre_train_extra_deps = "dependencies.scripts.install_pre_train_extra_deps:main"
50+
install_cuda12_pre_train_extra_deps = "dependencies.scripts.install_pre_train_extra_deps:main"
51+
install_tpu_post_train_extra_deps = "dependencies.scripts.install_post_train_extra_deps:main"
5252
build_maxtext_docker_image = "dependencies.scripts.build_maxtext_docker_image:main"
5353
upload_maxtext_docker_image = "dependencies.scripts.upload_maxtext_docker_image:main"

src/dependencies/dockerfiles/maxtext_gpu_dependencies.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ENV MAXTEXT_REPO_ROOT=/deps
5050
WORKDIR /deps
5151

5252
# Copy setup files and dependency files separately for better caching
53-
COPY ${PACKAGE_DIR}/dependencies/github_deps/ src/dependencies/github_deps/
53+
COPY ${PACKAGE_DIR}/dependencies/extra_deps/ src/dependencies/extra_deps/
5454
COPY ${PACKAGE_DIR}/dependencies/requirements/ src/dependencies/requirements/
5555
COPY ${PACKAGE_DIR}/dependencies/scripts/ src/dependencies/scripts/
5656
COPY ${PACKAGE_DIR}/maxtext/integration/vllm/ src/maxtext/integration/vllm/

src/dependencies/dockerfiles/maxtext_tpu_dependencies.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ ENV MAXTEXT_REPO_ROOT=/deps
4747
WORKDIR /deps
4848

4949
# Copy setup files and dependency files separately for better caching
50-
COPY ${PACKAGE_DIR}/dependencies/github_deps/ src/dependencies/github_deps/
50+
COPY ${PACKAGE_DIR}/dependencies/extra_deps/ src/dependencies/extra_deps/
5151
COPY ${PACKAGE_DIR}/dependencies/requirements/ src/dependencies/requirements/
5252
COPY ${PACKAGE_DIR}/dependencies/scripts/ src/dependencies/scripts/
5353
COPY ${PACKAGE_DIR}/maxtext/integration/vllm/ src/maxtext/integration/vllm/
File renamed without changes.

0 commit comments

Comments
 (0)