@@ -44,73 +44,45 @@ Let's get started!
4444
4545## Create virtual environment and Install MaxText dependencies
4646
47- If you have already completed the
48- [ MaxText installation] ( ../../install_maxtext.md ) , you can skip to the next
49- section for post-training dependencies installations. Otherwise, please install
50- ` MaxText ` using the following commands before proceeding.
51-
5247``` bash
53- # 1. Clone the repository
54- git clone https://github.com/AI-Hypercomputer/maxtext.git
55- cd maxtext
56-
57- # 2. Create virtual environment
48+ # Create a virtual environment
5849export VENV_NAME=< your virtual env name> # e.g., maxtext_venv
5950pip install uv
6051uv venv --python 3.12 --seed $VENV_NAME
6152source $VENV_NAME /bin/activate
62-
63- # 3. Install dependencies in editable mode
64- uv pip install -e .[tpu] --resolution=lowest
65- install_maxtext_github_deps
6653```
6754
68- ## Install Post-Training dependencies
55+ ### Option 1: From PyPI releases (Recommended)
6956
70- ### Option 1: From PyPI releases
57+ Run the following commands to get all the necessary installations.
7158
72- > ** Caution:** RL in MaxText is currently broken with PyPI releases of
73- > post-training dependencies. We are working on fixing this and recommend
74- > following [ Option 2: From Github] ( #option-2-from-github ) in the meantime.
59+ ``` bash
60+ uv pip install maxtext[tpu-post-train] --resolution=lowest
61+ install_maxtext_tpu_post_train_extra_deps
62+ ```
7563
76- Next, run the following bash script to get all the necessary installations
77- inside the virtual environment (for e.g., ` maxtext_venv ` ). This will take few
78- minutes. Follow along the installation logs and look out for any issues!
64+ It installs MaxText and then for post-training, it installs primarily the following:
7965
80- ```
81- bash tools/setup/setup_post_training_requirements.sh
82- ```
66+ a. [ Tunix] ( https://github.com/google/tunix ) as the LLM Post-Training Library, and
8367
84- Primarily, it installs ` Tunix ` , and ` vllm-tpu ` which is
68+ b. ` vllm-tpu ` which is
8569[ vllm] ( https://github.com/vllm-project/vllm ) and
8670[ tpu-inference] ( https://github.com/vllm-project/tpu-inference ) and thereby
8771providing TPU inference for vLLM, with unified JAX and PyTorch support.
8872
8973### Option 2: From Github
9074
91- You can also locally git clone [ tunix] ( https://github.com/google/tunix ) and
92- install using the instructions
93- [ here] ( https://github.com/google/tunix?tab=readme-ov-file#installation ) .
94- Similarly install [ vllm] ( https://github.com/vllm-project/vllm ) and
95- [ tpu-inference] ( https://github.com/vllm-project/tpu-inference ) from source
96- following the instructions
97- [ here] ( https://docs.vllm.ai/projects/tpu/en/latest/getting_started/installation/#install-from-source ) .
98- To get a set of compatible commit IDs for ` maxtext ` , ` tunix ` , ` tpu-inference ` ,
99- and ` vllm ` , follow these steps:
100-
101- 1 . Navigate to the
102- [ MaxText Package Tests] ( https://github.com/AI-Hypercomputer/maxtext/actions/workflows/build_and_test_maxtext.yml?query=event%3Aschedule )
103- GitHub Actions workflow.
104-
105- 2 . Select the latest successful run.
75+ For using a version newer than the latest PyPI release, you could also install the latest vetted versions of the dependencies from MaxText in the following way:
10676
107- 3 . Within the workflow run, find and click on the ` maxtext_jupyter_notebooks (py312) ` job, then expand the ` run ` job.
108-
109- 4 . Locate the ` Record Commit IDs ` step. The commit SHAs for ` maxtext ` , ` tunix ` ,
110- ` tpu-inference ` , and ` vllm ` that were used in that successful run are listed
111- in the logs of this step.
77+ ``` bash
78+ # 1. Clone the repository
79+ git clone https://github.com/AI-Hypercomputer/maxtext.git
80+ cd maxtext
11281
113- 5 . Prior to installation, ensure that the ` maxtext ` , ` tunix ` , ` vllm ` , and ` tpu-inference ` repositories are synchronized to the specific commits recorded from the CI logs. For each repository, use the following command to switch to the correct commit: ` git checkout <commit_id> ` .
82+ # 2. Install dependencies in editable mode
83+ uv pip install -e .[tpu-post-train] --resolution=lowest
84+ install_maxtext_tpu_post_train_extra_deps
85+ ```
11486
11587## Setup environment variables
11688
0 commit comments