Imported Upstream version 1.8.0
[platform/core/ml/nnfw.git] / compiler / tf2nnpackage-value-remote-test / README.md
1 # tf2nnpackage-value-remote-test
2
3 `tf2nnpackage-value-remote-test` does random value test for nnpackage file using remote machine, normally Odroid, which `onert` runs on.
4
5 ### Prerequisites
6
7 1. Runtime Library and Binary files
8     - Detailed information is located in [here](../../docs/howto/how-to-cross-build-runtime-for-arm.md)
9     - If you build runtime, related files will be produced in `Product/out`. Do not rename or move it.
10 1. Remote machine information and test list
11     - You should create `test.lst` file first as shown below.
12         - Set IP address and username of remote machine using `set` command.
13         ```cmake
14         #--------------- Remote Machine Setting ---------------#
15         set(REMOTE_IP "xxx.xxx.xxx.xxx")
16         set(REMOTE_USER "remote_username")
17         ```
18     - If any recipe is added, or if `REMOTE_IP` and `REMOTE_USER` is not given, `tf2nnpackage-value-remote-test` will not be created.
19 1. (Optional) ssh authentication
20     - This test uses `ssh` and `scp` commands, and those commands require a password of remote machine whenever they are called. This means that you should enter the password everytime when `ssh` and `scp` require.
21     - This test resolves the problem by using `ssh-copy-id`, which copies the public key of host machine to `authorized_keys` of remote machine. Because of that, this test will ask the password of remote machine only once, at the first time. This is the only user interaction while running this test.
22     - If you do not want to interact with system, just do `ssh-copy-id ${REMOTE_USER}@${REMOTE_IP}` in advance, before running this test. Once `ssh-copy-id` is done, there will be no user-interaction action while running the test.
23
24 ### Running
25
26 - If you finished prerequisites properly, configuring -> building -> testing steps create cmake test automatically.
27 - All the related materials will be sent to `REMOTE_WORKDIR` in remote machine. Default value of `REMOTE_WORKDIR` is `CVT_YYMMDD_hhmmss`, which means Circle Value Test done on YY/MM/DD at hh:mm:ss.
28 - `REMOTE_WORKDIR` will not be removed automatically after this test finish.
29     ```sh
30     $ ./nncc configure && ./nncc build
31
32     # Default REMOTE_WORKDIR is CVT_YYMMDD_hhmmss folder
33     $ ./nncc test -R tf2nnpackage_value_remote_test
34
35     # You can set REMOTE_WORKDIR where you have write privilege
36     $ REMOTE_WORKDIR=/path/you/want/ ./nncc test -R tf2circle_value_pbtxt_remote_test
37     ```
38
39 ### Generated Files While Running
40
41 - All related files(`pb`, `circle`, `h5` ... etc.) are taken from `build/compiler/common-artifacts` folder.
42 - Runtime products and each nnpackage are sent to `REMOTE_WORKDIR` in remote machine.
43 - Each test result is generated in `build/compiler/common-artifacts` with the name `${RECIPE}.log`
44
45 ### Check Test Result
46
47 - Summary of test result will be created as csv file in host.
48     ```sh
49     # Result_latest is symbolic link to the latest csv result file
50     # Print the latest test result
51     $ cat build/compiler/tf2circle-value-pbtxt-remote-test/Result_latest
52     TEST_NAME, TF2CIRCLE, CIRCLE_VALUE_TEST
53     UNIT_Add_000, TRUE, TRUE
54     ...
55
56     # List all result csv files
57     $ ls build/compiler/tf2circle-value-pbtxt-remote-test/Result_*.csv
58     Result_20191119_212521.csv
59     ...
60     ```