Skip to content

Commit f091774

Browse files
committed
follow comments
1 parent f3f889b commit f091774

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Update to point to the source file.
4+
VGG_SRC="vgg16_fluid.py"
5+
6+
export TRAINING_ROLE=PSERVER
7+
export TRAINERS=2
8+
export POD_IP=127.0.0.1
9+
export PADDLE_INIT_PORT=6174
10+
MKL_NUM_THREADS=1 python -u ${VGG_SRC} --local 0 --ps_host=127.0.0.1:6174 --trainer_hosts=127.0.0.1:6174 &
11+
12+
# Need to wait for the ps to start first.
13+
sleep 10
14+
echo "done start ps"
15+
16+
export TRAINING_ROLE=TRAINER
17+
export TRAINERS=2
18+
export POD_IP=127.0.0.1
19+
export PADDLE_INIT_PORT=6174
20+
CUDA_VISIBLE_DEVICES=4 MKL_NUM_THREADS=1 python -u ${VGG_SRC} --local 0 --ps_host=127.0.0.1:6174 --trainer_hosts=127.0.0.1:6174 --device=GPU --task_index=0 &
21+
CUDA_VISIBLE_DEVICES=5 MKL_NUM_THREADS=1 python -u ${VGG_SRC} --local 0 --ps_host=127.0.0.1:6174 --trainer_hosts=127.0.0.1:6174 --device=GPU --task_index=1 &

benchmark/cluster/vgg16/vgg16_fluid.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""VGG16 benchmark in Fluid
15-
16-
# Single trainer, single PS on a single machine.
17-
VGG_SRC="${CODE_DIR}/vgg16_fluid.py"
18-
export TRAINING_ROLE=PSERVER
19-
export TRAINERS=1
20-
export POD_IP=127.0.0.1
21-
export PADDLE_INIT_PORT=6174
22-
MKL_NUM_THREADS=1 python -u ${VGG_SRC} --local 0 --ps_host=127.0.0.1:6174 --trainer_hosts=127.0.0.1:6174 &
23-
sleep 10 # wait for PS to start.
24-
export TRAINING_ROLE=TRAINER
25-
MKL_NUM_THREADS=1 python -u ${VGG_SRC} --local 0 --ps_host=127.0.0.1:6174 --trainer_hosts=127.0.0.1:6174 --device=GPU &
26-
27-
# To run multiple trainers on a single machine
28-
# change TRAINERS=2 and launch 2 trainers.
29-
# CUDA_VISIBLE_DEVICES=4 MKL_NUM_THREADS=1 python -u ${VGG_SRC} --local 0 --ps_host=127.0.0.1:6174 --trainer_hosts=127.0.0.1:6174 --device=GPU --task_index=0 &
30-
# CUDA_VISIBLE_DEVICES=5 MKL_NUM_THREADS=1 python -u ${VGG_SRC} --local 0 --ps_host=127.0.0.1:6174 --trainer_hosts=127.0.0.1:6174 --device=GPU --task_index=1 &
31-
"""
32-
14+
"""VGG16 benchmark in Fluid"""
3315
from __future__ import print_function
3416

3517
import sys

0 commit comments

Comments
 (0)