2nodes_single_process.sh 1.97 KB
Newer Older
hepj987's avatar
hepj987 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
export MIOPEN_DEBUG_DISABLE_FIND_DB=1
export HSA_USERPTR_FOR_PAGED_MEM=0
lrank=$OMPI_COMM_WORLD_LOCAL_RANK
comm_rank=$OMPI_COMM_WORLD_RANK
comm_size=$OMPI_COMM_WORLD_SIZE
APP="python3 /work/home/hepj/torch/bert-squad/run_squad_v4.py \
  --train_file  ${HOME}/data/sq1.1/train-v1.1.json \
  --predict_file  ${HOME}/data/sq1.1/dev-v1.1.json \
  --init_checkpoint  ${HOME}/model/pytorch_bert/model.ckpt-28252.pt \
  --vocab_file  ${HOME}/model/pytorch_bert/vocab.txt \
  --output_dir  ${HOME}/outdir/torch/SQUAD4 \
  --config_file  ${HOME}/model/pytorch_bert/bert_config.json \
  --json-summary  ${HOME}/outdir/torch/SQUAD4/results.json \
  --bert_model bert-large-uncased \
  --do_train \
  --do_predict \
  --train_batch_size  4 \
  --predict_batch_size 4 \
  --gpus_per_node  2 \
  --local_rank ${comm_rank} \
  --world_size ${comm_size} \
  --use_env  \
  --dist_url tcp://${1}:34567 \
 "
case ${lrank} in
[0])
  export HIP_VISIBLE_DEVICES=0
hepj987's avatar
hepj987 committed
29
30
  echo numactl --cpunodebind=0 --membind=0 ${APP}
  numactl --cpunodebind=0 --membind=0 ${APP}
hepj987's avatar
hepj987 committed
31
32
33
  ;;
[1])
  export HIP_VISIBLE_DEVICES=1
hepj987's avatar
hepj987 committed
34
35
  echo numactl --cpunodebind=0 --membind=0 ${APP}
  numactl --cpunodebind=0 --membind=0 ${APP}
hepj987's avatar
hepj987 committed
36
37
38
  ;;
[2])
  export HIP_VISIBLE_DEVICES=2
hepj987's avatar
hepj987 committed
39
40
  echo numactl --cpunodebind=0 --membind=0 ${APP}  
  numactl --cpunodebind=0 --membind=0 ${APP}
hepj987's avatar
hepj987 committed
41
42
43
  ;;
[3])
  export HIP_VISIBLE_DEVICES=3
hepj987's avatar
hepj987 committed
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
  echo numactl --cpunodebind=0 --membind=0 ${APP}  
  numactl --cpunodebind=0 --membind=0 ${APP}
  ;;
[4])
  export HIP_VISIBLE_DEVICES=4
  echo numactl --cpunodebind=3 --membind=3 ${APP}
  numactl --cpunodebind=3 --membind=3 ${APP}
  ;;
[5])
  export HIP_VISIBLE_DEVICES=5
  echo numactl --cpunodebind=3 --membind=3 ${APP}
  numactl --cpunodebind=3 --membind=3 ${APP}
  ;;
[6])
  export HIP_VISIBLE_DEVICES=6
  echo numactl --cpunodebind=3 --membind=3 ${APP}  
  numactl --cpunodebind=3 --membind=3 ${APP}
  ;;
[7])
  export HIP_VISIBLE_DEVICES=7
  echo numactl --cpunodebind=3 --membind=3 ${APP}  
  numactl --cpunodebind=3 --membind=3 ${APP}
hepj987's avatar
hepj987 committed
66
67
  ;;
esac