cd ~ mkdir -p ~/wm_groups ~/xla_env/bin/python ~/wm_groups/cluster.py > ~/wm_groups/cluster.log 2>&1 || { echo CLUSTER_FAIL; exit 1; } for g in 0 1 2 3; do TPU_CHIPS_PER_PROCESS_BOUNDS=1,1,1 TPU_PROCESS_BOUNDS=1,1,1 TPU_VISIBLE_CHIPS=$g TPU_PROCESS_PORT=$((8476+g)) CLOUD_TPU_TASK_ID=0 \ PJRT_DEVICE=TPU GROUP=$g MAX_MIN=7 nohup ~/xla_env/bin/python ~/wm_groups/train_group.py > ~/wm_groups/stdout_g$g.txt 2>&1 & done wait echo ALL_GROUPS_DONE