File tree Expand file tree Collapse file tree 2 files changed +22
-19
lines changed Expand file tree Collapse file tree 2 files changed +22
-19
lines changed Original file line number Diff line number Diff line change
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 &
Original file line number Diff line number Diff line change 11
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
# See the License for the specific language governing permissions and
13
13
# 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"""
33
15
from __future__ import print_function
34
16
35
17
import sys
You can’t perform that action at this time.
0 commit comments