-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 comments
on commit 315f2e7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ManfeiBai here are the setup steps I've seen run well on TPU v4 hardware. You will need to update them according to xl ml stack of course.
gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command="
sudo pip3 uninstall torch torch_xla libtpu-nightly torchvision -y
pip3 uninstall torch torch_xla libtpu-nightly torchvision -y
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-nightly-cp38-cp38-linux_x86_64.whl
pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp38-cp38-linux_x86_64.whl
pip3 install torch-xla[tpuvm]
sudo git clone --branch llama2-google-next-inference https://github.com/pytorch-tpu/llama.git
gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command="
sudo apt update
sudo apt-get install libopenblas-dev"
gcloud compute tpus tpu-vm scp params_7b.json ${TPU_NAME}:params.json --zone ${ZONE} --project ${PROJECT_ID} --worker=all
# TODO: run a similar command to add `t5_tokenizer/spiece.model` as tokenizer under `llama` director
gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command="
sudo chmod -R 777 llama
cd llama/
pip3 install -r requirements.txt
pip3 install -e ."
gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command="cd /home/miladmo/llama &&
PJRT_DEVICE=TPU python3.8 example_text_completion.py --ckpt_dir . --tokenizer_path /home/miladmo/llama1/t5_tokenizer/spiece.model --max_seq_len 2048 --max_gen_len 1000 --max_batch_size 1 --mp True --dynamo True"
side question: should we switch this change to a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ManfeiBai here are the setup steps I've seen run well on TPU v4 hardware. You will need to update them according to xl ml stack of course.
gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command=" sudo pip3 uninstall torch torch_xla libtpu-nightly torchvision -y pip3 uninstall torch torch_xla libtpu-nightly torchvision -y pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch-nightly-cp38-cp38-linux_x86_64.whl pip3 install https://storage.googleapis.com/pytorch-xla-releases/wheels/tpuvm/torch_xla-nightly-cp38-cp38-linux_x86_64.whl pip3 install torch-xla[tpuvm] sudo git clone --branch llama2-google-next-inference https://github.com/pytorch-tpu/llama.git gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command=" sudo apt update sudo apt-get install libopenblas-dev" gcloud compute tpus tpu-vm scp params_7b.json ${TPU_NAME}:params.json --zone ${ZONE} --project ${PROJECT_ID} --worker=all # TODO: run a similar command to add `t5_tokenizer/spiece.model` as tokenizer under `llama` director gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command=" sudo chmod -R 777 llama cd llama/ pip3 install -r requirements.txt pip3 install -e ." gcloud compute tpus tpu-vm ssh ${TPU_NAME} --zone ${ZONE} --project ${PROJECT_ID} --worker=all --command="cd /home/miladmo/llama && PJRT_DEVICE=TPU python3.8 example_text_completion.py --ckpt_dir . --tokenizer_path /home/miladmo/llama1/t5_tokenizer/spiece.model --max_seq_len 2048 --max_gen_len 1000 --max_batch_size 1 --mp True --dynamo True"
side question: should we switch this change to a PR?
thanks, will update PR according to this, and PR is : #965
looks like the target hardware is TPU v4. shouldn't we use 3.8 instead of 3.10?