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
[DOC, EXAMPLE] Updated READMEs, tests, etc. (apache#41)
* bug fix for new drivers in new PYNQ image v2.1
* updating instructions for resnet inference
* updated the instructions for starting the RPC server
* deriving host/port from env for unit tests
This guide describes how to setup a Pynq-based RPC server to accelerate deep learning workloads with VTA.
4
4
5
5
## Pynq Setup
6
6
7
7
Follow the getting started tutorial for the [Pynq board](http://pynq.readthedocs.io/en/latest/getting_started.html).
8
-
* For this RPC setup make sure to go with the *Connect to a Computer* Ethernet setup.
8
+
* This assumes that you've downloaded the latest Pynq image, PYNQ-Z1 v2.1 (released 21 Feb 2018).
9
+
* For this RPC setup, follow the ["Connect to a Computer"](http://pynq.readthedocs.io/en/latest/getting_started.html#connect-to-a-computer) Pynq setup instructions.
10
+
* To be able to talk to the board, you'll need to make sure that you've followed the steps to [assign a static IP address](http://pynq.readthedocs.io/en/latest/appendix.html#assign-your-computer-a-static-ip)
9
11
10
-
Make sure that you can ssh into your Pynq board successfully:
12
+
Make sure that you can talk to your Pynq board successfully:
11
13
```bash
12
-
ssh xilinx@192.168.2.99
14
+
ping 192.168.2.99
13
15
```
14
16
15
-
When ssh-ing onto the board, the default password for the `xilinx`account is `xilinx`.
17
+
When ssh-ing onto the board, the password for the `xilinx`username is `xilinx`.
16
18
17
-
For convenience let's go ahead and mount the Pynq board's file system to easily access it and maintain it:
19
+
For convenience let's go ahead and mount the Pynq board's file system to easily access it (this will require sshfs to be installed):
Now, ssh into your **Pynq board** to build the TVM runtime with the following commands:
37
+
Now, ssh into your **Pynq board** to build the TVM runtime with the following commands. This build should take about 5 minutes.
35
38
```bash
36
39
ssh xilinx@192.168.2.99 # ssh if you haven't done so
37
40
cd~/vta/nnvm/tvm
@@ -40,21 +43,18 @@ echo USE_RPC=1 >> config.mk
40
43
make runtime -j2
41
44
```
42
45
43
-
## Pynq RPC server setup
44
-
45
-
We're now ready to build the Pynq RPC server on the Pynq board.
46
+
We're now ready to build the Pynq RPC server on the Pynq board, which should take less than 30 seconds.
46
47
```bash
47
48
ssh xilinx@192.168.2.99 # ssh if you haven't done so
48
49
cd~/vta
49
-
make
50
+
make -j2
50
51
```
51
52
52
-
The last stage will build the `192.168.2.99:home/xilinx/vta/lib/libvta.so` library file. We are now ready to launch the RPC server on the Pynq. In order to enable the FPGA drivers, we need to run the RPC server with administrator privileges (using `su`, account: `xilinx`, pwd: `xilinx`).
53
+
The last stage will build the `vta/lib/libvta.so` library file. We are now ready to launch the RPC server on the Pynq. In order to enable the FPGA drivers, we need to run the RPC server with `sudo` privileges.
53
54
```bash
54
55
ssh xilinx@192.168.2.99 # ssh if you haven't done so
55
56
cd~/vta
56
-
su
57
-
./apps/pynq_rpc/start_rpc_server.sh
57
+
sudo ./apps/pynq_rpc/start_rpc_server.sh # pw is xilinx
58
58
```
59
59
60
60
You should see the following being displayed when starting the RPC server:
@@ -65,4 +65,4 @@ INFO:root:RPCServer: bind to 0.0.0.0:9091
65
65
66
66
Note that it should be listening on port `9091`.
67
67
68
-
To kill the RPC server, just enter the `Ctrl + c` command.
68
+
To kill the RPC server, just enter the `Ctrl + c` command.
Copy file name to clipboardExpand all lines: vta/examples/resnet18/pynq/README.md
+44-8Lines changed: 44 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,14 @@
2
2
3
3
In order to run this example you'll need to have:
4
4
* VTA installed
5
+
* LLVM 4.0 or newer installed
5
6
* TVM installed
6
7
* NNVM installed
7
8
* MxNet installed
8
9
* A Pynq-based RPC server running
10
+
* Python packages installed
11
+
12
+
Required setup time from scratch: ~15 mins.
9
13
10
14
## VTA installation
11
15
@@ -19,6 +23,23 @@ Update your `~/.bashrc` file to include the VTA python libraries in your `PYTHON
19
23
export PYTHONPATH=<vta root>/python:${PYTHONPATH}
20
24
```
21
25
26
+
## LLVM installation
27
+
28
+
We provide the set of commands to install LLVM 6.0 (stable branch) on Ubuntu Xenial. Note that the [LLVM installation process](apt.llvm.org) can be adapted to different LLVM branches, and operating systems/distros.
*`LLVM_CONFIG` points to the llvm-config executable (e.g. `LLVM_CONFIG = /usr/bin/llvm-config-4.0`). You'll need to have llvm4.0 installed or later.
64
+
*`LLVM_CONFIG` points to the `llvm-config` executable which path was derived in the TVM installation instructions above (e.g. `LLVM_CONFIG = /usr/bin/llvm-config-6.0`)
43
65
*`USE_RPC` should be set to 1
44
66
45
-
Launch the compilation, this takes about 5 minutes.
67
+
Launch the compilation, this takes about 5-10 minutes on two threads.
46
68
```bash
47
69
cd <tvm root>
48
-
make -j4
70
+
make -j2
49
71
```
50
72
51
73
Finally update your `~/.bashrc` file to include the TVM python libraries in your `PYTHONPATH` (don't forget to source the newly modified `.bashrc` file!):
@@ -60,16 +82,16 @@ Clone the NNVM repository from `tqchen` in the directory of your choosing:
To run this example, we rely on a special branch of NNVM until these changes get merged back into the main repo: `qt`:
85
+
To run this example, we rely on a special branch of NNVM `qt`:
64
86
```bash
65
87
cd <nnvm root>
66
88
git checkout qt
67
89
```
68
90
69
-
Launch the compilation, this takes less a minute.
91
+
Launch the compilation, this takes about a minute on two threads.
70
92
```bash
71
93
cd <nnvm root>
72
-
make -j4
94
+
make -j2
73
95
```
74
96
75
97
Finally update your `~/.bashrc` file to include the NNVM python libraries in your `PYTHONPATH` (don't forget to source the newly modified `.bashrc` file!):
@@ -85,19 +107,33 @@ Follow the [MxNet Installation Instructions](https://mxnet.incubator.apache.org)
85
107
86
108
Follow the [Pynq RPC Server Guide](https://github.com/uwsaml/vta/tree/master/apps/pynq_rpc/README.md)
87
109
110
+
## Python packages
111
+
112
+
You'll need the following packages to be installed for the example to run properly. You can use `pip` to install those packages:
113
+
* `decorator` (for TVM)
114
+
* `enum34` (for NNVM)
115
+
* `Pillow`
116
+
* `wget`
117
+
88
118
## Running the example
89
119
120
+
Configure your environment with the following:
121
+
```bash
122
+
export VTA_PYNQ_RPC_HOST=192.168.2.99
123
+
export VTA_PYNQ_RPC_PORT=9091
124
+
```
125
+
90
126
Simply run the following python script:
91
127
```bash
92
128
python imagenet_predict.py
93
129
```
94
130
95
131
This will run imagenet classification using the ResNet18 architecture on a VTA design that performs 8-bit integer inference, to perform classification on a cat image `cat.jpg`.
96
132
97
-
The script reports runtime measured on the Pynq board, and the top-1 result category:
133
+
The script reports runtime measured on the Pynq board (in seconds), and the top-1 result category:
0 commit comments