You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This instruction provides a starting point to build caffe2 on AMD GPUs (Caffe2 ROCm port) from source.
5
+
*Note*: it is recommended to start with a clean Ubuntu 16.04 system
6
+
7
+
## Install docker
8
+
9
+
If your machine doesn't have docker installed, follow the steps [here](https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce) to install docker.
10
+
11
+
## Install ROCm
12
+
13
+
Install ROCm stack following steps at [link](https://github.com/RadeonOpenCompute/ROCm/blob/master/README.md) if your machine doesn't have ROCm already.
14
+
15
+
Once the machine is ready with ROCm stack, there are two ways to use caffe2
16
+
* Run the docker container with caffe2 installed in it.
17
+
18
+
* Build caffe2 from source inside a docker with all the dependencies.
19
+
20
+
## Launch docker container with caffe2 pre-installed
21
+
```
22
+
docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add video rocm/caffe2:rocm1.8.2
23
+
```
24
+
25
+
To run benchmarks, skip directly to benchmarks section of the document.
26
+
27
+
## Build Caffe2 from source
28
+
### Pull the docker image
29
+
```
30
+
docker pull rocm/caffe2:unbuilt-rocm1.8.2
31
+
```
32
+
This docker image has all the dependencies for caffe2 pre-installed.
Run the binaries under `/pytorch/build_caffe2/bin`
70
+
71
+
## Run benchmarks
72
+
73
+
Navigate to build directory, `cd /pytorch/build_caffe2` to run benchmarks.
74
+
75
+
Caffe2 benchmarking script supports the following networks.
76
+
1. MLP
77
+
2. AlexNet
78
+
3. OverFeat
79
+
4. VGGA
80
+
5. Inception
81
+
6. Inception_v2
82
+
7. Resnet50
83
+
84
+
*Special case:* Inception_v2 and Resnet50 will need their corresponding protobuf files to run the benchmarks. Protobufs can be downloaded from caffe2 model zoo using the below command. Substitute model_name with `inception_v2` or `resnet50`
To run Inception_v2 or Resnet50, please add additional argument `--model_path` to the above command which should point to the model directories downloaded above.
0 commit comments