-
Notifications
You must be signed in to change notification settings - Fork 384
Expand file tree
/
Copy pathtrain_2gpu_ps_strategy.sh
More file actions
81 lines (73 loc) · 2.37 KB
/
Copy pathtrain_2gpu_ps_strategy.sh
File metadata and controls
81 lines (73 loc) · 2.37 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# distributed train script, train on one machine with 2gpus
EXP="2gpu"
LOG_DIR="logs/"
PIPELINE_CONFIG=$1
shift 1
if [ -z "$PIPELINE_CONFIG" ]
then
echo "usage: sh $0 pipeline_config_path ... "
exit 1
fi
if [ ! -e $PIPELINE_CONFIG ]
then
echo "config file: $PIPELINE_CONFIG does not exits"
exit 1
fi
if [ ! -e $LOG_DIR ]
then
mkdir $LOG_DIR
fi
# Parameter Server Process
export TF_CONFIG="{
\"cluster\":
{
\"ps\": [\"localhost:2227\"],
\"chief\": [\"localhost:2223\"],
\"worker\": [\"localhost:2224\"]
},
\"task\":
{
\"type\": \"ps\",
\"index\": 0
}
}"
CUDA_VISIBLE_DEVICES='' nohup python -m easy_rec.python.train_eval \
--pipeline_config_path $PIPELINE_CONFIG --is_tfrecord=0 $@\
> $LOG_DIR/log_${EXP}_ps.txt &
# Master Worker Process
export TF_CONFIG="{
\"cluster\":
{
\"ps\": [\"localhost:2227\"],
\"chief\": [\"localhost:2223\"],
\"worker\": [\"localhost:2224\"]
},
\"task\":
{
\"type\": \"chief\",
\"index\": 0
}
}"
CUDA_VISIBLE_DEVICES=4,5 nohup python -m easy_rec.python.train_eval \
--pipeline_config_path $PIPELINE_CONFIG --is_tfrecord=0 $@\
> $LOG_DIR/log_${EXP}_chief.txt &
# Master Worker Process
export TF_CONFIG="{
\"cluster\":
{
\"ps\": [\"localhost:2227\"],
\"chief\": [\"localhost:2223\"],
\"worker\": [\"localhost:2224\"]
},
\"task\":
{
\"type\": \"worker\",
\"index\": 0
}
}"
CUDA_VISIBLE_DEVICES=6,7 nohup python -m easy_rec.python.train_eval \
--pipeline_config_path $PIPELINE_CONFIG --is_tfrecord=0 $@\
> $LOG_DIR/log_${EXP}_worker.txt &
echo "logdir: $LOG_DIR/log_${EXP}_ps.txt"
echo "logdir: $LOG_DIR/log_${EXP}_chief.txt"
echo "logdir: $LOG_DIR/log_${EXP}_worker.txt"