[docs] Update documents
authorYelin Jeong <yelini.jeong@samsung.com>
Tue, 1 Aug 2023 08:01:56 +0000 (17:01 +0900)
committer추지호/SoC Architecture팀(SR)/삼성전자 <jiho.chu@samsung.com>
Mon, 28 Aug 2023 02:51:03 +0000 (11:51 +0900)
- Add npubin-fmt repo info
- Fix broken link
- Update versions
- Update tests usage

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
docs/markdown/Artifactory.md
docs/markdown/CommandLine.md
docs/markdown/FastModels.md
docs/markdown/QuickStart.md
docs/markdown/TestingGuide.md
docs/markdown/Ubuntu.md
docs/markdown/index.md
tests/utils/ne_test_utils.cc

index f77ab56b14b08be8d65d11a65ee5068910577900..a01994c5f41ee3d5c6a5801deca6ad474972d6b4 100644 (file)
@@ -25,14 +25,16 @@ Then, you can easily download and install our packages in Debian dists.
 Note that all files are installed under `/opt/trinity/`.
 
 ```console
-$ sudo apt install npu-engine npu-engine-example npu-engine-testdata
+$ sudo apt install npu-engine npu-engine-example
+(if needed)
+$ sudo apt install npu-engine-testdata npu-engine-testdata-triv240 npu-engine-testdata-triv242
 ...
 $ ls /opt/trinity/lib
 libmrpsim.a  libmrpsim.so  libnpu-engine.so  pkgconfig
 $ ls /opt/trinity/bin
 apptests  unittests
 $ ls /opt/trinity/share/npu-engine/testdata
-TRIV221_8TOPS  TRIV238_2TOPS
+TRIV221_8TOPS  TRIV238_2TOPS TRIV240 TRIV242
 ```
 
 # Artifactory RPM Repository
@@ -75,20 +77,20 @@ Using Yum
 ```console
 $ yum list
 Available Packages
-npu-engine.x86_64           2.5.1-0     Artifactory
-npu-engine-devel.x86_64     2.5.1-0     Artifactory
-npu-engine-example.x86_64   2.5.1-0     Artifactory
-npu-engine-utils.x86_64     2.5.1-0     Artifactory
+npu-engine.x86_64           2.6.1-0     Artifactory
+npu-engine-devel.x86_64     2.6.1-0     Artifactory
+npu-engine-example.x86_64   2.6.1-0     Artifactory
+npu-engine-utils.x86_64     2.6.1-0     Artifactory
 $ yum install npu-engine
 ```
 
 Using Zypper
 ```console
 $ zypper search -s | grep artifactory
-  | npu-engine         | package | 2.5.1-0 | x86_64 | artifactory
-  | npu-engine-devel   | package | 2.5.1-0 | x86_64 | artifactory
-  | npu-engine-example | package | 2.5.1-0 | x86_64 | artifactory
-  | npu-engine-utils   | package | 2.5.1-0 | x86_64 | artifactory
+  | npu-engine         | package | 2.6.1-0 | x86_64 | artifactory
+  | npu-engine-devel   | package | 2.6.1-0 | x86_64 | artifactory
+  | npu-engine-example | package | 2.6.1-0 | x86_64 | artifactory
+  | npu-engine-utils   | package | 2.6.1-0 | x86_64 | artifactory
 $ sudo zypper install npu-engine
 ```
 
index 791cfacf4d0cdf2e5abc79fd8bac57b007a75552..c9e107a17d8e93ac2cbd50fc62e86e27e105a3ef 100644 (file)
@@ -30,10 +30,10 @@ The `npu-engine-testdata` package contains testdata used in some example test pr
 
 ## Example: apptest_tvn_triv2_example
 This application ([tvn_triv2_example.cc](https://github.sec.samsung.net/AIP/NPU_SystemService/blob/tizen/tests/apptests/tvn_triv2_example.cc)) executes a given TRIV2 model using [libnpuhost.h](https://github.sec.samsung.net/AIP/NPU_SystemService/blob/tizen/include/host/libnpuhost.h).
-Note that the testdata used here follows the NPU binary format ([npubinfmt.h](https://github.sec.samsung.net/AIP/NPU_SystemService/blob/tizen/include/common/npubinfmt.h)).
+Note that the testdata used here follows the NPU binary format ([npubinfmt.h](https://github.sec.samsung.net/AIP/npubin-fmt/blob/master/include/npubinfmt.h)).
 Also, TRIV2 currently works with npubinfmt v3 only.
 
-Let's assume you are testing the application in Ubuntu 18.04.
+Let's assume you are testing the application in Ubuntu 20.04.
 ```console
 $ sudo apt-get install npu-engine-example npu-engine-testdata
 $ cd /opt/trinity
index 5da0e474e8301d9e9fa2642bdffb6b43062836d1..fe9aa78eaa8d037498105cf4b7cbf02caf3ce77d 100644 (file)
@@ -220,8 +220,8 @@ $ gbs build -A aarch64 --clean
 If the build has finished successfully, you should find the built packages like below.
 ```console
 $ ls ~/GBS-ROOT/local/repos/tizen/aarch64/RPMS/
-npu-engine-2.5.0-1.aarch64.rpm        npu-engine-example-2.5.0-1.aarch64.rpm
-npu-engine-devel-2.5.0-1.aarch64.rpm  npu-engine-utils-2.5.0-1.aarch64.rpm
+npu-engine-2.6.1-1.aarch64.rpm        npu-engine-example-2.6.1-1.aarch64.rpm
+npu-engine-devel-2.6.1-1.aarch64.rpm  npu-engine-utils-2.6.1-1.aarch64.rpm
 ```
 
 You can test your packages after installing them.
@@ -232,8 +232,9 @@ $ ./run_taos
 [ in another shell ]
 $ telnet localhost 5000
 root:~> cd /mnt/RPMS
-root:~> rpm -ivh --force npu-engine-2.5.0-1.aarch64.rpm
-root:~> rpm -ivh --force npu-engine-example-2.5.0-1.aarch64.rpm
+root:~> rpm -ivh --force npu-engine-2.6.1-1.aarch64.rpm
+root:~> rpm -ivh --force npu-engine-example-2.6.1-1.aarch64.rpm
+root:~> rpm -ihv --force npubin-fmt-3.0.0-0.aarch64.rpm
 root:~> /usr/lib64/npu-engine/bin/apptests/apptest_tvn_triv2 /usr/share/npu-engine/testdata/TRIV238_2TOPS/MAX_POOL_2D_000
 ```
 
index 66972f90c6b7c1406d25f9f7031c43ec14b5e38e..52d50a271c148af94f6251241073012e8c16817f 100644 (file)
@@ -35,10 +35,18 @@ input_fmap_0.bin  model.tvn  output_fmap_0.bin
 
 root# cd /opt/trinity/bin/apptests/
 
-root# apptest_tvn_triv2 /opt/trinity/share/npu-engine/testdata/TRIV238_2TOPS/MOBILENET_V1
+root# apptest_tvn_triv2 /opt/trinity/share/npu-engine/testdata/TRIV238_2TOPS/MOBILENET_V1 -v 2.3
 >>> Initializaing SPM with zero. It can be time-consuming...
 >>> Initializaing SPM with zero. It can be time-consuming...
-[Core Name: NPCore0], [File Name: /opt/trinity/share/mRPsim/decoder-triv2-cp.bin], [Ver: 1]
+[Core Name: NPCore0], [File Name: /opt/trinity/share/mRPsim/decoder-0.29.0-cp.bin], [Ver: 1]
+        Section(.SRP.FLIH) Base (22000000) Size(36)
+...
+[APPTEST] apptest_tvn_triv2: PASSED
+
+root# apptest_tvn_triv2 /opt/trinity/share/npu-engine/testdata/TRIV242/MOBILENET_V1 -v 2.4
+>>> Initializaing SPM with zero. It can be time-consuming...
+>>> Initializaing SPM with zero. It can be time-consuming...
+[Core Name: NPCore0], [File Name: /opt/trinity/share/mRPsim/decoder-4.2.5-cp.bin], [Ver: 1]
         Section(.SRP.FLIH) Base (22000000) Size(36)
 ...
 [APPTEST] apptest_tvn_triv2: PASSED
index 25df2bccc7a44617fb0ff8be0a8de314fab4c65d..d10d46231f537168d7de9d5e3ef2745f93dc33d0 100644 (file)
@@ -9,7 +9,7 @@ This page describes how to install and test NPU-DDK packages on FPGA (ZCU102-ZYN
 
 ## Prerequisites
 
-First of all, you have to install the petalinux SDK in your host PC (Ubuntu 18.04 recommended).
+First of all, you have to install the petalinux SDK in your host PC (Ubuntu 20.04 recommended).
 Please refer to [here](PetaLinux.md) for detail instructions.
 
 However, please note that if you are NOT supposed to update any source codes, skip the below FPGA-related descriptions.
@@ -26,7 +26,7 @@ Then, you can change the source repository of `NPU_SystemService` to yours if th
 $ cd meta-trinity
 $ ls
 build  conf  COPYING.MIT  hw  README.md  recipes-app  recipes-bsp  recipes-ddk  recipes-devtools  recipes-kernel
-$ vim recipes-ddk/npu-engine/npu-engine_2.5.0.bb
+$ vim recipes-ddk/npu-engine/npu-engine_2.6.1.bb
 [ ... ]
 SRC_URI = "git://git@github.sec.samsung.net/AIP/NPU_SystemService.git;protocol=ssh;branch=tizen"
 [ ... ]
@@ -40,48 +40,32 @@ Once you build the patelinux project, packages are created on your local build d
 [ ... ]
 $ petalinux-build
 $ ls build/tmp/deploy/rpm/aarch64 | grep npu-engine
-npu-engine-2.5.0-r0.aarch64.rpm
-npu-engine-testcases-2.5.0-r0.aarch64.rpm
+npu-engine-2.6.1-r0.aarch64.rpm
+npu-engine-testcases-2.6.1-r0.aarch64.rpm
 ```
 
 As our FPGA board supports `ssh` connection, the created packages can be simply copied.
 
 ```
 $ cd build/tmp/deploy/rpm/aarch64/
-$ scp npu-engine-2.5.0-r0.aarch64.rpm root@[FPGA IP Address]:.
-$ scp npu-engine-2.5.0-testcases-r0.aarch64.rpm root@[FPGA IP Address]:.
+$ scp npu-engine-2.6.1-r0.aarch64.rpm root@[FPGA IP Address]:.
+$ scp npu-engine-2.6.1-testcases-r0.aarch64.rpm root@[FPGA IP Address]:.
 ```
 
 Then, you can install them using `rpm` command in the FPGA board.
 ```
 $ ssh root@[FPGA IP Address]
 [ ... ]
-# rpm -ivh npu-engine-2.5.0-r0.aarch64.rpm --force
+# rpm -ivh npu-engine-2.6.1-r0.aarch64.rpm --force
 # ls -al /usr/lib/libnpu-engine.so
 rwxr-xr-x 1 root root 210872 May 28 05:27 /usr/lib/libnpu-engine.so
 
-# rpm -ivh npu-engine-testcases-2.5.0-r0.aarch64.rpm --force
+# rpm -ivh npu-engine-testcases-2.6.1-r0.aarch64.rpm --force
 # ls -al /usr/lib/npu-engine/bin/
 drwxr-xr-x 2 root root 4096 May 28 05:24 apptests
 drwxr-xr-x 2 root root 4096 May 28 05:24 unittests
 ```
 
-Also, please make sure that `source.sh` is executed after booting.
-```
-# pwd
-/home/root
-# source setting.sh
-# dmesg | tail
-[   23.804902] triv2 402010000.triv2: misc device created!
-[   23.830077] triv2 402010000.triv2: Trinity Vision2 (TRIV2) probed
-[   23.877240] triv2 402010000.triv2: [0] /home/root/idu/cp/zero.bin -> 0x402000000
-[   23.887010] triv2 402010000.triv2: [1] /home/root/idu/cp/data.bin -> 0x402000010
-[   23.903432] triv2 402010000.triv2: [2] /home/root/idu/cp/code.bin -> 0x480100000
-[   23.920371] triv2 402010000.triv2: [3] /home/root/idu/dsp/zero.bin -> 0x402100000
-[   23.930675] triv2 402010000.triv2: [4] /home/root/idu/dsp/data.bin -> 0x402100010
-[   23.948438] triv2 402010000.triv2: [5] /home/root/idu/dsp/code.bin -> 0x480600000
-```
-
 ## How to test features
 
 NPU-DDK supports two types of test programs: `unittest` and `apptests`.
@@ -110,11 +94,12 @@ drwxr-xr-x 5 root root   4096 Aug 24 02:30 ..
 -rwxr-xr-x 1 root root 551016 Aug 24 02:19 unittest_ne_libnpuhost
 ```
 
-Any program in `unittests` can be runnable without arguments.
+Some Program in `unittests` can be runnable with NPU_VER environment variable.
 ```
 # pwd
 /home/root
 # unittest_ne_libnpuhost
+root@xilinx-zcu102-2019_2:~# NPU_VER=2.3
 root@xilinx-zcu102-2019_2:~# unittest_ne_libnpuhost
 [==========] Running 33 tests from 1 test case.
 [----------] Global test environment set-up.
@@ -170,8 +155,9 @@ drwxr-xr-x 5 root root  4096 Aug 24 02:30 ..
 -rwxr-xr-x 1 root root 47176 Aug 24 02:19 apptest_tvn_triv2_xml
 ```
 
-They may use test models stored in `/home/root/TRIV238_2TOPS` if necessary.
+They may use test models stored in `/home/root/TRIV238_2TOPS` or `/home/root/TRIV242` if necessary.
 - `TRIV238_2TOPS`: TRIV v2.3.8 (2-TOPS) test models with NHWC format
+- `TRIV242`: TRIV v2.4.2 (4-TOPS) test models with NHWC format
 
 Programs in `apptests` are linked to `libnpu-engine.so` and may require extra arguments.
 The below shows example command lines for each apptest.
@@ -191,19 +177,23 @@ Options:
   -m             Mute stdout/stderr messages
   -s             Enable run sync mode
   -o             Enable output dump mode
+  -v <arg>       Set NPU_VER [2.3|2.4] (default 2.4)
   -h             Show help messages
 [APPTEST] apptest_tvn_triv2: SKIPPED
 
-# apptest_tvn_triv2 TRIV238_2TOPS/MOBILENET_V1
+# apptest_tvn_triv2 -v 2.3 TRIV238_2TOPS/MOBILENET_V1
+[APPTEST] apptest_tvn_triv2: PASSED
+
+# apptest_tvn_triv2 -v 2.4 TRIV242/MOBILENET_V1
 [APPTEST] apptest_tvn_triv2: PASSED
 
-# apptest_tvn_triv2_dmabuf TRIV238_2TOPS/MOBILENET_V1
+# apptest_tvn_triv2_dmabuf -v 2.3 TRIV238_2TOPS/MOBILENET_V1
 [APPTEST] apptest_tvn_triv2_dmabuf: PASSED
 
-# apptest_tvn_triv2_preempt TRIV238_2TOPS
+# apptest_tvn_triv2_preempt -v 2.3 TRIV238_2TOPS
 [APPTEST] apptest_tvn_triv2_preempt: PASSED
 
-# apptest_tvn_triv2_profile TRIV238_2TOPS/MOBILENET_V1 -p visa
+# apptest_tvn_triv2_profile -v 2.3 TRIV238_2TOPS/MOBILENET_V1 -p visa
 [ ... ]
 [663] ADMA_OUT
         Running Cycles  : 631
@@ -327,27 +317,27 @@ Options:
   <dirpath>TRIV238_2TOPS/MOBILENET_V2</dirpath>
  </model>
 </testcases>
-# apptest_tvn_triv2_xml model.xml
+# apptest_tvn_triv2_xml -v 2.3 model.xml
 [APPTEST] apptest_tvn_triv2_xml: PASSED
 
-# apptest_tvn_triv2_sigkill TRIV238_2TOPS/MOBILENET_V1
+# apptest_tvn_triv2_sigkill -v 2.3 TRIV238_2TOPS/MOBILENET_V1
 [APPTEST] apptest_tvn_triv2_sigkill: PASSED
 
-# apptest_tvn_triv2_interleave 10 TRIV238_2TOPS/MAX_POOL_2D_000,TRIV238_2TOPS/CONV_2D_300
+# apptest_tvn_triv2_interleave -v 2.3 10 TRIV238_2TOPS/MAX_POOL_2D_000,TRIV238_2TOPS/CONV_2D_300
 [APPTEST] apptest_tvn_triv2_interleave: PASSED
 
-# apptest_tvn_triv2_aging TRIV238_2TOPS/CONV_2D_300 1 10
+# apptest_tvn_triv2_aging -v 2.3 TRIV238_2TOPS/CONV_2D_300 1 10
 [APPTEST] apptest_tvn_triv2_aging: PASSED
 
-# apptest_tvn_triv2_aging TRIV238_2TOPS/CONV_2D_300 2 10
+# apptest_tvn_triv2_aging -v 2.3 TRIV238_2TOPS/CONV_2D_300 2 10
 [APPTEST] apptest_tvn_triv2_aging: PASSED
 
-# apptest_tvn_triv2_aging TRIV238_2TOPS/CONV_2D_300 3 10
+# apptest_tvn_triv2_aging -v 2.3 TRIV238_2TOPS/CONV_2D_300 3 10
 [APPTEST] apptest_tvn_triv2_aging: PASSED
 
-# apptest_tvn_triv2_aging TRIV238_2TOPS/CONV_2D_300 4 10
+# apptest_tvn_triv2_aging -v 2.3 TRIV238_2TOPS/CONV_2D_300 4 10
 [APPTEST] apptest_tvn_triv2_aging: PASSED
 
-# apptest_tvn_triv2_bulk TRIV238_2TOPS
+# apptest_tvn_triv2_bulk -v 2.3 TRIV238_2TOPS
 [APPTEST] apptest_tvn_triv2_bulk: PASSED (110), FAILED (0)
 ```
index e01be53f1692dd847dc2c4ffd494fd87ffb233d8..0ee4701bd562345a3f622e3ac01172b348cfe0d9 100644 (file)
@@ -20,7 +20,7 @@ If you just want to use NPU-DDK in Ubuntu environment, [Artifactory](Artifactory
 Optionally, you can change source codes and build packages manually. But, please make sure you added the [Artifactory](Artifactory.md) repository was added to your apt source list to resolve build dependencies.
 
 First, clone the github repository and build using `debuild`.
-If some build-dependent packages are missing, please install them (e.g., `libmrpsim-dev`).
+If some build-dependent packages are missing, please install them (e.g., `libmrpsim-dev`,`npubin-fmt`).
 ```console
 $ git clone https://github.sec.samsung.net/AIP/NPU_SystemService
 $ cd NPU_SystemService
@@ -31,8 +31,8 @@ $ debuild -us -uc
 If the build has finished successfully, you should find the built packages like below.
 ```console
 $ ls ../*.deb
-../npu-engine_2.5.0_amd64.deb      ../npu-engine-example_2.5.0_amd64.deb
-../npu-engine-dev_2.5.0_amd64.deb  ../npu-engine-utils_2.5.0_amd64.deb
+../npu-engine_2.6.1_amd64.deb      ../npu-engine-example_2.6.1_amd64.deb
+../npu-engine-dev_2.6.1_amd64.deb  ../npu-engine-utils_2.6.1_amd64.deb
 ```
 
 Then, install your packages manually.
@@ -40,11 +40,11 @@ Then, install your packages manually.
 After `npu-engine-dev` is successfully installed, your application can access the required header files in `/opt/trinity/include`.
 
 ```console
-$ dpkg -i ../npu-engine_2.5.0_amd64.deb ../npu-engine-dev_2.5.0_amd64.deb
+$ dpkg -i ../npu-engine_2.6.1_amd64.deb ../npu-engine-dev_2.6.1_amd64.deb
 $ ls /opt/trinity/lib
 libnpu-engine.so
 $ ls /opt/trinity/include/npu-engine
-libnpuhost.h  npubinfmt.h  typedef.h
+libnpuhost.h
 ```
 
 ## Application Build
@@ -64,8 +64,6 @@ The header files NPU Engine provides are as follows:
 
 ```
 libnpuhost.h: The user APIs that NPU Engine provides
-npubinfmt.h:  The format of NPU model binary
-typedef.h:    The type definitions used in NPU Engine
 ```
 
 Thus, what you need to do is just to include these headers and use the defined APIs in your application. Here are a few APIs that you may use frequently:
index 6615d492535d518348c924909daffb6b30ac313d..08f85f1c507dcd11241dc706de1915227b467d9d 100644 (file)
@@ -14,6 +14,7 @@ This includes user APIs, core engines, driver wrappers, and kernel drivers.
 * Linux Kernel Driver: [AIP/NPU_Linux-kernel](https://github.sec.samsung.net/AIP/NPU_Linux-kernel)
 * Bootstrap for FastModels: [AIP/NPU_bootstrap](https://github.sec.samsung.net/AIP/NPU_bootstrap)
 * Bitbake recipes for FPGA: [AIP/meta-trinity](https://github.sec.samsung.net/AIP/meta-trinity)
+* NPU Binary Metadata Format: [AIP/npubin-fmt](https://github.sec.samsung.net/AIP/npubin-fmt)
 
 ## Features
 
index f335f33b39b73274a3be207c79aa8ed2aad3fcc3..1bdf97ebeeddacf5f970b068190b978ec37c4517 100644 (file)
@@ -282,6 +282,7 @@ UtilTrinity::printUsage (const char *prog_name, const char *param_str) {
   std::cerr << "  -d <arg> \t Set a device node path (e.g., /dev/triv2-0)\n";
   std::cerr << "  -n <arg> \t Set output notimode [intr|polling]\n";
   std::cerr << "  -p <arg> \t Set profile level [visa|layer]\n";
+  std::cerr << "  -v <arg> \t Set NPU_VER [2.3|2.4] (default 2.4)";
   std::cerr << "  -t \t\t Enable trinity data format\n";
   std::cerr << "  -m \t\t Mute stdout/stderr messages\n";
   std::cerr << "  -s \t\t Enable run sync mode\n";