README.md 1.58 KB
Newer Older
qianyj's avatar
qianyj committed
1
2
# 简介

qianyj's avatar
qianyj committed
3
  该测试用例可用于ResNet50/Vgg16等网络的性能测试及精度验证。 
qianyj's avatar
qianyj committed
4
5
6
7
8
9
10
11
12
13
14
15

# 单卡测试 (单精度)

## 运行
    
    export HIP_VISIBLE_DEVICES=0  
    python3 ./benchmarks-master/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py --data_format=NCHW --batch_size=128 --model=resnet50 --optimizer=momentum --variable_update=parameter_server  --print_training_accuracy=true  --nodistortions --num_gpus=1 --num_epochs=90 --weight_decay=1e-4 --data_dir=$data_dir_path   --use_fp16=False --data_name=imagenet --train_dir=$save_checkpoint_path

# 单卡测试 (混合精度)

## 运行
    export HIP_VISIBLE_DEVICES=0    
qianyj's avatar
qianyj committed
16
    python3 ./benchmarks-master/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py --data_format=NCHW --batch_size=128 --model=resnet50 --optimizer=momentum --variable_update=parameter_server  --print_training_accuracy=true  --nodistortions --num_gpus=1 --num_epochs=90 --weight_decay=1e-4 --data_dir=$data_dir_path   --use_fp16=True --data_name=imagenet --train_dir=$save_checkpoint_path
qianyj's avatar
qianyj committed
17
18
19
20
21

# 多卡测试 (单精度)

## 运行

qianyj's avatar
qianyj committed
22
23
24
25
    mpirun -np 4 --hostfile hostfile  -mca btl self,tcp  --bind-to none scripts-run/single_process.sh 

# 多卡测试 (混合精度)

qianyj's avatar
qianyj committed
26
27
   修改scripts-run/single_process.sh中的--use_fp16=True

qianyj's avatar
qianyj committed
28
## 运行
qianyj's avatar
qianyj committed
29
30
  
   mpirun -np 4 --hostfile hostfile  -mca btl self,tcp  --bind-to none scripts-run/single_process.sh 
qianyj's avatar
qianyj committed
31
32
33
34
35
36
   
hostfile格式参考:

   node1 slots=4
   node2 slots=4 

qianyj's avatar
qianyj committed
37
# 参考资料
qianyj's avatar
qianyj committed
38
[https://github.com/tensorflow/benchmarks/tree/master/scripts/tf_cnn_benchmarks](https://github.com/tensorflow/benchmarks/tree/master/scripts/tf_cnn_benchmarks)
qianyj's avatar
qianyj committed
39