SiMa.ai (hereinafter referred to as SiMa) is a device with strengths in edge AI, rivaling the performance of Alpha Inc., a company that provides GPUs (graphics processing units). There are also voices expressing interest in actually using SiMa's MLSoC (Machine Learning System-on-Chip). In this article, we will introduce how to port a model that was running on Alpha Inc.'s GPU to SiMa and actually run it.
The transplant procedure is as follows:
Step-2: Preparation
Step 3: Environment setup
Step 4: Implementation
The results of this demo video are as follows:
Alpha company video
SiMa Video
Building the board and host machine environment for development and evaluation
We will introduce it in three pages.
2. Host machine environment setup
As explained in the Preparation section, there are requirements for installing Palette.
Please check again.
Requirement Type | detail |
---|---|
Host Machine |
|
OS |
|
Docker Engine |
|
Python |
|
Open Port |
|
Firewall settings |
|
The Palette software package is delivered using the Docker container application. To update or install the Docker container application, run the following command:
sima-user@sima-user-machine:~$ sudo apt-get update sima-user@sima-user-machine:~$ sudo apt-get install docker-engine
*For detailed instructions on installing Docker, please refer to the official documentation.
https://docs.docker.com/engine/install/linux-postinstall/
If you are using Docker Desktop, follow the instructions in the official installation documentation.
https://docs.docker.com/desktop/install/linux/ubuntu/
You can download the Palette software from the Developer Portal, under "Palette", "Software Installation", and then "Download Palette Software".
Click Download Now and a zip file will be downloaded.
*You can view and download by registering on the Developer Portal on the SiMa website.
If you cannot view the site even after registering, please contact Shinko Shoji.
To unzip the downloaded software package, run the following command:
sima-user@sima-user-machine:~$ cd Downloads sima-user@sima-user-machine:~/Downloads$ unzip SiMa_CLI_1.4.0_master_B122.zip Archive: SiMa_CLI_1.4.0_master_B122.zip creating: 1.4.0_master_B122/ creating: 1.4.0_master_B122/sima-cli/ inflating: 1.4.0_master_B122/sima-cli/uninstall.py inflating: 1.4.0_master_B122/sima-cli/release-notes.txt inflating: 1.4.0_master_B122/sima-cli/stop.py inflating: 1.4.0_master_B122/sima-cli/start.py inflating: 1.4.0_master_B122/sima-cli/install.py inflating: 1.4.0_master_B122/sima-cli/simaclisdk_1_4_0_master_B122.tar inflating: 1.4.0_master_B122/sima-cli/preinstall.py sima-user@sima-user-machine:~/Downloads$ cd 1.4.0_master_B122/sima-cli/ sima-user@sima-user-machine:~/Downloads/1.4.0_master_B122/sima-cli$ ls install.py release-notes.txt start.py uninstall.py preinstall.py simaclisdk_1_4_0_master_B122.tar stop.py
* If the previously installed Palette software remains
If you already have the Palette software installed, stop your current Docker container before installing the new version, which ensures that any processes using the Palette software are properly terminated.
Run the following commands to install the required packages.
sima-user@sima-user-machine:~$ sudo apt-get install python3 sima-user@sima-user-machine:~$ sudo apt-get install python3-pip sima-user@sima-user-machine:~$ sudo apt-get install net-tools
To install the downloaded software package, run the following command:
sima-user@sima-user-machine:~/Sima_CLI_ /sima-cli$ python3 install.py Palette Dependency Checklist ********************************** This script checks the necessary dependencies a system needs to meet to ensure compatibility and readiness for Palette installation and use. Please review and verify each of the following dependencies. _________________________________________________________________________________ SYSTEM REQUIREMENTS REPORT Component Requirement Found Result ========== ============ ========== ========= OS Version 20.04.5/22.04 Ubuntu 22.04 LTS [PASS] Docker v20.10.21 24.0.5, [PASS] Python 3.8.10 3.10.12 [PASS] CPU/RAM 4 Cores/16 GB RAM 6 Cores/33.35 GB [PASS] Free space 30 GB free 47.12GB [PASS] Host specification Meets requirements Meets requirements [PASS] Firewall status disabled disabled [PASS] Port 80 Not used Not used [PASS] ------------------------------------------------------------------------------------ Result: [PASS] All system requirements are successfully meet, you may proceed to Palette installation. ------------------------------------------------------------------------------------ Checking if SiMa CLI version 1.4.0_develop_B1052 is already installed... Enter work directory [/home/manuel/workspace]: Loading Docker image version 1.4.0_master_B122... This step may take a few minutes to complete. Thank you for your patience. Image loaded successfully. Checking SiMa SDK Bridge Network... SiMa SDK Bridge Network found. Creating and starting the Docker container... Installation successful. To log in to the Docker container, please use the './start.py or python3 start.py' Your local work directory '/home/manuel/workspace' has been mounted to '/home/docker/sima-cli'
In order to properly install the Palette software, you must ensure that your system meets the necessary dependencies.
The installation script, install.py, will automatically check for these dependencies and ensure that you have what it takes for the installation to succeed.
Once all dependencies have been verified, a final report will be displayed and the installation will proceed.
If you only want to check the readiness of your system, you can run the install.py script with the --check-dependencies flag, which will only check for dependencies and will not proceed with installing the software.
sima-user@sima-user-machine:~/Sima_CLI_1.4.0_master_B109/1.4.0_master_B109/sima-cli$ python3 install.py --check-dependencies
Run python3 install.py to set up the Docker shared directory. You will be prompted to specify a working directory that will be mounted inside the Docker container. This directory will be shared between the Docker SDK image and your host machine. You can store your development files here so that they are not lost when you stop the container. You can specify any directory you like.
After the installation is successful, run the following command to log in to the Docker container that was created.
sima-user@sima-user-machine:~/Downloads/1.4.0_master_B122/sima-cli$ python3 start.py Checking if the container is already running... ==> Starting the stopped container: simaclisdk_1_4_0_master_B122 simaclisdk_1_4_0_master_B122 sima-user@docker-image-id:/home$ ps aux USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND sima-user 1 4.6 0.1 30928 22596 pts/0 Ss+ 05:52 0:00 /usr/bin/python3 /usr/bin/supervisord -n -c /etc/supervisor/conf.d/ sima-user 7 0.0 0.0 7244 3712 pts/1 Ss 05:52 0:00 bash sima-user 21 199 1.2 7570224 205076 pts/0 Sl 05:52 0:03 java -jar rpm-service.jar sima-user 22 205 1.2 7570224 210388 pts/0 Sl 05:52 0:04 java -jar plugin-compilation.jar sima-user 23 33.0 0.0 2908 1792 pts/0 S 05:52 0:00 /usr/local/bin/device_status_shadow -v sima-user 24 221 1.2 7570224 209960 pts/0 Sl 05:52 0:04 java -jar gst-generator-service.jar sima-user 25 35.5 0.0 2908 1792 pts/0 S 05:52 0:00 /usr/local/bin/local_port_forwarding -v sima-user 26 210 1.3 5495088 215624 pts/0 Sl 05:52 0:04 java -Xmx2048m -jar packaging-service.jar sima-user 27 38.5 0.0 2908 1792 pts/0 S 05:52 0:00 /usr/local/bin/pcie_forwarding -v sima-user 28 140 0.8 7570224 145372 pts/0 Sl 05:52 0:02 java -jar performance-estimator.jar sima-user 29 19.0 0.0 2908 1664 pts/0 S 05:52 0:00 /usr/local/bin/remote_port_forwarding -v sima-user 127 31.0 0.6 479800 99848 pts/0 Sl 05:52 0:00 /usr/local/bin/remote_port_forwarding -v sima-user 128 61.0 0.7 129396 115032 pts/0 S 05:52 0:00 /usr/local/bin/device_status_shadow -v sima-user 129 57.0 0.7 500208 116800 pts/0 Sl 05:52 0:00 /usr/local/bin/local_port_forwarding -v sima-user 141 53.0 0.6 480952 104888 pts/0 Sl 05:52 0:00 /usr/local/bin/pcie_forwarding -v sima-user 164 0.0 0.6 279012 105364 pts/0 Sl 05:52 0:00 /usr/local/bin/local_port_forwarding -v sima-user 187 0.0 0.0 8896 2944 pts/1 R+ 05:52 0:00 ps aux
Verify that the installation was successful by running the MPK tool included in the Palette software package.
Please execute the following command.
sima-user@docker-image-id:/home$ mpk --help usage: mpk [-h] [-d] [-q] [-v] {remote-log,device,create,debug,deploy,firmware-upgrade,kill,launch,list,pe,remove} ... SiMa CLI Tool options: -h, --help show this help message and exit -d, --debug full application debug mode -q, --quiet suppress all console output -v, --version show program's version number and exit sub-commands: {remote-log,device,create,debug,deploy,firmware-upgrade,kill,launch,list,pe,remove} remote-log remote-log controller device device controller create create mpk from directory debug debug a running package or deploy mpk in debug mode deploy Deploy mpk to target firmware-upgrade Upgrade or Reset a device kill Kill the current running package. Note: 1. In case -i/--id parameter isn't provided, it will kill the latest active deployment. 2. Incase only -i/--id parameter is provided, the latest deployed mpk (to a target) with the given id is killed. 3. In case both -i/--id and -t/--target parameters are provided, only the latest active deployment with given id on given target will be killed. launch Launch previously deployed mpk list List the current running packages pe Run Performance Estimator remove Remove previously deployed mpk
If the MPK tool's help information is displayed, then the operation was successful.
In the next chapter, we will explain the implementation of the application.
Solution Technology Department 3
03-6361-8095Reception hours: Weekdays from 9:00am to 5:00pm