You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/update_dependencies.md
+64-41Lines changed: 64 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,40 +18,72 @@
18
18
19
19
## Introduction
20
20
21
-
This document provides a guide to updating dependencies in MaxText using the `seed-env` tool. `seed-env` helps generate deterministic and reproducible Python environments by creating fully-pinned `requirements.txt` files from a base set of requirements.
21
+
This document provides a guide to updating dependencies in MaxText using the
tool. `seed-env` helps generate deterministic and reproducible Python
24
+
environments by creating fully-pinned `requirements.txt` files from a base set
25
+
of requirements.
22
26
23
-
Please keep dependencies updated throughout development. This will allow each commit to work properly from both a feature and dependency perspective. We will periodically upload commits to PyPI for stable releases. But it is also critical to keep dependencies in sync for users installing MaxText from source.
27
+
Please keep dependencies updated throughout development. This will allow each
28
+
commit to work properly from both a feature and dependency perspective. We will
29
+
periodically upload commits to PyPI for stable releases. But it is also critical
30
+
to keep dependencies in sync for users installing MaxText from source.
24
31
25
-
## Overview of the Process
32
+
## Overview of the process
26
33
27
34
To update dependencies, you will follow these general steps:
28
35
29
-
1.**Modify Base Requirements**: Update the desired dependencies in `base_requirements/requirements.txt` or the hardware-specific files (`base_requirements/tpu-base-requirements.txt`, `base_requirements/gpu-base-requirements.txt`).
30
-
2.**Generate New Files**: Run the `seed-env` CLI tool to generate new, fully-pinned requirements files based on your changes.
31
-
3.**Update Project Files**: Copy the newly generated files into the `generated_requirements/` directory.
32
-
4.**Handle GitHub Dependencies**: Move any dependencies that are installed directly from GitHub from the generated files to `src/install_maxtext_extra_deps/extra_deps_from_github.txt`.
33
-
5.**Verify**: Test the new dependencies to ensure the project installs and runs correctly.
36
+
1.**Modify base requirements**: Update the desired dependencies in
37
+
`src/dependencies/requirements/base_requirements/requirements.txt` or the hardware-specific files
2.**Find the JAX build commit hash**: The dependency generation process is
40
+
pinned to a specific nightly build of JAX. You need to find the commit hash
41
+
for the desired JAX build.
42
+
3.**Generate the requirement files**: Run the `seed-env` CLI tool to generate
43
+
new, fully-pinned requirements files based on your changes.
44
+
4.**Update project files**: Copy the newly generated files into the
45
+
`src/dependencies/requirements/generated_requirements/` directory. If
46
+
necessary, also update any dependencies that are installed directly from
47
+
GitHub from the generated files to `src/dependencies/extra_deps`.
48
+
5.**Verify the new dependencies**: Test the new dependencies to ensure the
49
+
project installs and runs correctly.
34
50
35
51
The following sections provide detailed instructions for each step.
36
52
37
-
## Step 1: Install seed-env
53
+
## Step 0: Install `seed-env`
38
54
39
-
First, you need to install the `seed-env` command-line tool by running `pip install seed-env uv`. Or follow the instructions in the
40
-
[seed-env repository](https://github.com/google-ml-infra/actions/tree/main/python_seed_env#install-the-seed-env-tool) if you want to build `seed-env` from source.
55
+
First, you need to install the `seed-env` command-line tool by running
56
+
`pip install seed-env uv`. Or follow the instructions in the
You can find the latest commit hashes in the [JAX `build/` folder](https://github.com/jax-ml/jax/commits/main/build). Choose a recent, successful build and copy its full commit hash.
68
+
## Step 2: Find the JAX buildcommit hash
47
69
48
-
## Step 3: Generate the Requirements Files
70
+
The dependency generation process is pinned to a specific nightly build of JAX.
71
+
You need to find the commit hash for the desired JAX build.
49
72
50
-
Next, run the `seed-env` CLI to generate the new requirements files. You will need to do this separately for the TPU and GPU environments. The generated files will be placed in a directory specified by `--output-dir`.
Currently, MaxText uses a few dependencies, such as `mlperf-logging` and `google-jetstream`, that are installed directly from GitHub source. These are defined in `base_requirements/requirements.txt`, and the `seed-env` tool will carry them over to the generated requirements files.
0 commit comments