To create TPU VM in command line:
export PROJECT_ID=YOUR_PROJECT_ID
export PATH=YOUR_SDK_PATH
cd ~
gcloud config set project ${PROJECT_ID}
gcloud config set account YOUR_EMAIL
export TPU_NAME=tpu-v3-8-01
gcloud compute tpus tpu-vm create ${TPU_NAME} \
--zone=europe-west4-a \
--accelerator-type=v3-8 \
--version=tpu-vm-pt-2.0
To view SSH public key:
cat ~/.ssh/id_rsa.pub
Create or edit ~/.ssh/config
:
vi ~/.ssh/config
Add content:
Host tpuv3-8-1
User sodus1102
Hostname EXTERNAL_ID
IdentityFile ~/.ssh/KEY_FILE
SSH into the TPU VM using VSCode or command line:
ssh tpuv3-8-1
sudo docker run -it --name tpu-torch \
-d --privileged \
-p 7860:7860 \
-v `pwd`:/workspace \
us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla:r2.1.0_3.10_tpuvm \
/bin/bash
- Pytorch on XLA devices: https://pytorch.org/xla/release/2.1/index.html
Explore the code:
git clone git@github.com:SoyeonHH/tpu-mllm.git
cd tpu-mllm
- Raven's IQ Test Dataset: https://aka.ms/kosmos-iq50
mkdir data && cd data
wget https://aka.ms/kosmos-iq50
- Kosmos-2-patch14-224: https://huggingface.co/microsoft/kosmos-2-patch14-224
-
Phrase grounding task for Kosmos-2: https://github.com/microsoft/unilm/blob/master/kosmos-2/evaluation/flickr_entities/README.md
-
Reffering expression comprehension task for Kosmos-2: https://github.com/microsoft/unilm/blob/master/kosmos-2/evaluation/refcoco/README.md
-
Reffering expression generation task for Kosmos-2: https://github.com/microsoft/unilm/tree/master/kosmos-2/evaluation
-
Image captioning for Kosmos-2: https://github.com/microsoft/unilm/tree/master/kosmos-2/evaluation
-
Visual question answering for Kosmos-2: https://github.com/microsoft/unilm/tree/master/kosmos-2#evaluation