README.md 1.39 KB
Newer Older
panning's avatar
panning committed
1
# 简介
huchen's avatar
huchen committed
2

panning's avatar
panning committed
3
该测试用例可用于ResNet50/Vgg16等网络的性能测试及精度验证。
huchen's avatar
huchen committed
4

panning's avatar
panning committed
5
# 单卡测试(单精度)
huchen's avatar
huchen committed
6

panning's avatar
panning committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 运行

```
export HIP_VISIBLE_DEVICES=0
python3 main_acc.py --batch-size=64 --arch=resnet50 -j 6 --epochs=90 --save-path=/path/to/{save_model_dir} /path/to/{ImageNet_pytorch_data_dir}/
```

# 单卡测试(混合精度)

## 运行

```
export HIP_VISIBLE_DEVICES=0
python3 main_acc.py --batch-size=64 --arch=resnet50 -j 6 --epochs=90 --amp --opt-level O1 --loss-scale=dynamic --save-path=/path/to/{save_model_dir} /path/to/{ImageNet_pytorch_data_dir}/
```

panning's avatar
panning committed
23
# 单机多卡测试(单精度)
huchen's avatar
huchen committed
24

panning's avatar
panning committed
25
26
27
28
29
30
31
## 运行

```
#single_process.sh与main_acc.py在同级目录下
mpirun --allow-run-as-root --bind-to none -np 4 single_process.sh localhost resnet50 64
```

panning's avatar
panning committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 多机多卡测试(单精度)

## 运行

```
mpirun -np ${num_dcu} --hostfile hostfile --allow-run-as-root --bind-to none `pwd`/single_process.sh [node1] resnet50 64
```

hostfile格式参考:

```
node1 slots=4
node2 slots=4
```

panning's avatar
panning committed
47
48
49
50
51
52
53
54
55
56
57
# 参数说明

```
--arch 设置要测试的网络,可以是 resnet50/vgg16/inception_v3/mobilenet_v2等
```

# inception_v3 测试说明

inception_v3测试时需要修改部分代码,具体可参考https://developer.hpccube.com/tool/ → AI生态包→ 技术文档 → 基于pytorch的DCU深度学习测试示例文档。

# 参考
huchen's avatar
huchen committed
58

panning's avatar
panning committed
59
https://github.com/pytorch/examples/tree/master/imagenet