|
14 | 14 | # See the License for the specific language governing permissions and |
15 | 15 | # limitations under the License. |
16 | 16 |
|
17 | | -# Example command: |
18 | | -# bash docker_build_dependency_image.sh MODE=stable |
19 | | -# bash docker_build_dependency_image.sh DEVICE={{gpu|tpu}} MODE=stable_stack BASEIMAGE={{JAX_STABLE_STACK BASEIMAGE FROM ARTIFACT REGISTRY}} |
20 | | -# bash docker_build_dependency_image.sh MODE=nightly |
21 | | -# bash docker_build_dependency_image.sh MODE=stable JAX_VERSION=0.4.13 |
22 | | -# Nightly build with JAX_VERSION for GPUs. Available versions listed at https://us-python.pkg.dev/ml-oss-artifacts-published/jax-public-nightly-artifacts-registry/simple/jax: |
23 | | -# bash docker_build_dependency_image.sh DEVICE=gpu MODE=nightly JAX_VERSION=0.4.36.dev20241109 # Note: this sets both jax-nightly and jaxlib-nightly |
24 | | -# MODE=custom_wheels is the same as nightly except that it reinstalls any |
25 | | -# additional wheels that are present in the maxtext directory. |
26 | | -# The main use case is to install custom jax or jaxlib wheels but it also |
27 | | -# works with any custom wheels. |
28 | | -# bash docker_build_dependency_image.sh MODE=custom_wheels |
29 | | - |
30 | | -# bash docker_build_dependency_image.sh MODE=post-training |
31 | | -# bash docker_build_dependency_image.sh MODE=post-training POST_TRAINING_SOURCE=local |
| 17 | +# This script is used to build the MaxText Docker image, supporting |
| 18 | +# different environments (stable, nightly) and use cases (pre-training, post-training). |
| 19 | +# IMPORTANT: This script must be executed from the root directory of the MaxText repository. |
| 20 | + |
| 21 | +# ================================== |
| 22 | +# PRE-TRAINING BUILD EXAMPLES |
| 23 | +# ================================== |
| 24 | + |
| 25 | +# Build docker image with stable dependencies |
| 26 | +## bash dependencies/scripts/docker_build_dependency_image.sh MODE=stable |
| 27 | +## bash dependencies/scripts/docker_build_dependency_image.sh DEVICE={{gpu|tpu}} MODE=stable_stack BASEIMAGE={{JAX_STABLE_STACK BASEIMAGE FROM ARTIFACT REGISTRY}} |
| 28 | + |
| 29 | +# Build docker image with nightly dependencies |
| 30 | +## bash dependencies/scripts/docker_build_dependency_image.sh MODE=nightly |
| 31 | + |
| 32 | +# Build docker image with stable dependencies and, a pinned JAX_VERSION for TPUs |
| 33 | +## bash dependencies/scripts/docker_build_dependency_image.sh MODE=stable JAX_VERSION=0.4.13 |
| 34 | + |
| 35 | +# Build docker image with stable dependencies and, a pinned JAX_VERSION for GPUs |
| 36 | +# Available versions listed at https://us-python.pkg.dev/ml-oss-artifacts-published/jax-public-nightly-artifacts-registry/simple/jax |
| 37 | +## bash dependencies/scripts/docker_build_dependency_image.sh DEVICE=gpu MODE=nightly JAX_VERSION=0.4.36.dev20241109 |
| 38 | + |
| 39 | +# MODE=custom_wheels builds the nightly environment, then reinstalls any |
| 40 | +# additional wheels present in the maxtext directory. |
| 41 | +# Use this mode to install custom dependencies, such as custom JAX or JAXlib builds. |
| 42 | +## bash dependencies/scripts/docker_build_dependency_image.sh MODE=custom_wheels |
| 43 | + |
| 44 | +# ================================== |
| 45 | +# POST-TRAINING BUILD EXAMPLES |
| 46 | +# ================================== |
| 47 | + |
| 48 | +# Build docker image with stable pre-training dependencies and stable post-training dependencies |
| 49 | +## bash dependencies/scripts/docker_build_dependency_image.sh MODE=post-training |
| 50 | + |
| 51 | +# Build docker image with stable pre-training dependencies and post-training dependencies from GitHub head |
| 52 | +## bash dependencies/scripts/docker_build_dependency_image.sh MODE=post-training POST_TRAINING_SOURCE=local |
32 | 53 |
|
33 | 54 | if [ "${BASH_SOURCE-}" ]; then |
34 | 55 | this_file="${BASH_SOURCE[0]}" |
|
0 commit comments