Было интересно протестировать искусственный интеллект (ИИ) и, в частности, большие языковые модели (LLM) на Rockchip RK3588, чтобы понять, как можно использовать GPU и NPU для их ускорения и каких показателей производительности ожидать. Мы читали, что LLM могут быть требовательны к вычислительным ресурсам и памяти, поэтому искали одноплатный компьютер (SBC) на Rockchip RK3588 с 32 ГБ ОЗУ, и Mixtile – компания, разрабатывающая аппаратные решения для различных применений, включая IoT, ИИ и промышленные шлюзы, любезно предоставила образец своего Mixtile Blade 3 pico-ITX SBC с 32 ГБ RAM для этих целей.
Хотя обзор фокусируется на использовании RKNPU2 SDK с примерами компьютерного зрения, работающими на 6 TOPS NPU, и тестировании GPU-ускоренной LLM (поскольку реализация NPU еще не готова), мы также провели распаковку для осмотра аппаратной части и краткое руководство по запуску Ubuntu 22.04 на Mixtile Blade 3.
Распаковка Mixtile Blade 3
В комплекте от Mixtile было две коробки. Первая содержала одноплатную систему Mixtile Blade 3, вторая — корпус Mixtile Blade 3 Case.
Сначала рассмотрим комплект платы Mixtile Blade 3. Плата оказалась довольно тяжелой при первом поднятии — это связано с радиатором, полностью закрывающим нижнюю часть PCB для обеспечения пассивного охлаждения путем рассеивания тепла от SoC RK3588.
Тыльная панель Mixtile Blade 3 включает два порта Ethernet 2.5Gbps, два HDMI-порта (выход и вход), а также два порта USB Type-C. Плата также оснащена 30-контактным GPIO-разъемом, коннектором mini PCIe, разъемом MIPI-CSI для камеры, слотом для microSD карты, коннектором для вентилятора и отладочным разъемом для платы USB-TTL. Имеется также краевой разъем U.2 (SFF-8639) с сигналами 4-линейного PCIe Gen3 и SATA 3.0 для подключения PCIe/NVMe-устройств или объединения нескольких плат Blade 3 в кластер .
Теперь рассмотрим корпус для Mixtile Blade 3. Это алюминиевый корпус с ЧПУ-обработкой, который также поставляется с адаптером U.2-M.2 для подключения NVMe SSD или другого устройства PCIe (например, AI-акселератора), кнопкой питания, светодиодом для индикации рабочего состояния, набором винтов и отверткой.
Сборка корпуса Mixtile Blade 3
Теперь соберем плату Mixtile Blade 3 в корпус. Первым шагом снимается штатный радиатор, затем адаптер U.2-M.2 крепится к плате, после чего плата устанавливается в корпус. Сборка завершается закрытием крышки с использованием силиконовой термопрокладки, так как сам металлический корпус будет выполнять роль радиатора, охлаждающего процессор Rockchip RK3588.

Комплект не включает адаптер питания, поэтому его необходимо использовать собственный для питания платы Mixtile Blade 3. Требуется адаптер питания USB-C, совместимый со стандартом PD 2.0/PD 3.0. Полные характеристики платы можно узнать из предыдущей статьи о Mixtile Blade 3 .
Ubuntu 22.04 на Mixtile Blade 3
Mixtile Blade 3 поставляется с образом Ubuntu 22.04, что позволяет загружать Linux сразу после распаковки. Однако для установки новой операционной системы или обновления текущего образа можно использовать те же методы, что и для других одноплатных компьютеров на базе SoC Rockchip, а именно программу RKDevTool или через карту microSD.
Поскольку Mixtile Blade 3 оснащен только двумя портами USB, и один уже подключен к источнику питания, потребовалось подключить док-станцию USB-C для соединения клавиатуры и мыши с платой.
После первоначальной загрузки запустится мастер настройки Ubuntu OEM; после его завершения станет доступен стандартный рабочий стол Ubuntu 22.04.
Флеш-память eMMC объемом 128 ГБ и дополнительный NVMe SSD на 256 ГБ, подключенный через адаптер U.2 на M.2, можно проверить с помощью fdisk:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
arnon@arnon-desktop:~$ sudo fdisk -l Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk /dev/mmcblk0: 116.48 GiB, 125069950976 bytes, 244277248 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: AE8C1F40-2C40-4F65-AD1F-F7DD7D785383 Device Start End Sectors Size Type /dev/mmcblk0p1 32768 1081343 1048576 512M Linux extended boot /dev/mmcblk0p2 1081344 244277214 243195871 116G Linux filesystem Disk /dev/nvme0n1: 232.89 GiB, 250059350016 bytes, 488397168 sectors Disk model: WD_BLACK SN770 250GB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x71d948da Device Boot Start End Sectors Size Id Type /dev/nvme0n1p1 2048 488397167 488395120 232.9G 83 Linux |
Одноплатная система действительно оснащена 32 ГБ оперативной памяти:
1 2 3 4 |
arnon@arnon-desktop:~$ free -m total used free shared buff/cache available Mem: 31787 604 30595 5 587 30891 Swap: 2047 0 2047 |
Тестирование производительности ИИ через NPU RK3588 с использованием инструментария RKNPU2
Производительность ИИ Mixtile Blade 3 будет протестирована на примере Yolo v5 и тесте RKNN из RKNPU2, аналогично тестированию одноплатной системы Youyeeyoo YY3568 на базе Rockchip RK3568 с начальным NPU производительностью 0.8 TOPS.
После установки инструментария RKNN 2 из Github , можно скомпилировать пример YOLO5:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
arnon@arnon-desktop:~$ cd rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/ arnon@arnon-desktop:~/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo$ ./build-linux_RK3588.sh clean -- The C compiler identification is GNU 11.4.0 -- The CXX compiler identification is GNU 11.4.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenCV: /home/arnon/rknn-toolkit2/rknpu2/examples/3rdparty/opencv/opencv-linux-aarch64 (found version "3.4.5") -- Configuring done -- Generating done -- Build files have been written to: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/build/build_linux_aarch64 [ 20%] Building CXX object CMakeFiles/rknn_yolov5_demo.dir/src/preprocess.cc.o [ 20%] Building CXX object CMakeFiles/rknn_yolov5_video_demo.dir/src/main_video.cc.o [ 40%] Building CXX object CMakeFiles/rknn_yolov5_demo.dir/src/main.cc.o [ 40%] Building CXX object CMakeFiles/rknn_yolov5_demo.dir/src/postprocess.cc.o [ 50%] Building CXX object CMakeFiles/rknn_yolov5_video_demo.dir/src/postprocess.cc.o [ 60%] Building CXX object CMakeFiles/rknn_yolov5_video_demo.dir/utils/mpp_decoder.cpp.o [ 70%] Building CXX object CMakeFiles/rknn_yolov5_video_demo.dir/utils/mpp_encoder.cpp.o [ 80%] Building CXX object CMakeFiles/rknn_yolov5_video_demo.dir/utils/drawing.cpp.o [ 90%] Linking CXX executable rknn_yolov5_video_demo [ 90%] Built target rknn_yolov5_video_demo [100%] Linking CXX executable rknn_yolov5_demo [100%] Built target rknn_yolov5_demo Consolidate compiler generated dependencies of target rknn_yolov5_demo [ 40%] Built target rknn_yolov5_demo Consolidate compiler generated dependencies of target rknn_yolov5_video_demo [100%] Built target rknn_yolov5_video_demo Install the project... -- Install configuration: "" -- Installing: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/./rknn_yolov5_demo -- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/lib/librknnrt.so -- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/lib/librga.so -- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/./model/RK3588 -- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/./model/RK3588/yolov5s-640-640.rknn -- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/./model/bus.jpg-- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/./model/coco_80_labels_list.txt -- Installing: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/./rknn_yolov5_video_demo -- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/lib/librockchip_mpp.so -- Up-to-date: /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/lib/libmk_api.so /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo arnon@arnon-desktop:~/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo$ |
Затем можно запустить примеры YOLO5 с тестовым изображением:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
arnon@arnon-desktop:~/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux$ ./rknn_yolov5_demo model/RK3588/yolov5s-640-640.rknn model/man.jpg post process config: box_conf_threshold = 0.25, nms_threshold = 0.45 Loading mode... sdk version: 1.6.0 (9a7b5d24c@2023-12-13T17:31:11) driver version: 0.9.2 model input num: 1, output num: 3 index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, w_stride = 640, size_with_stride=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 index=0, name=output, n_dims=4, dims=[1, 255, 80, 80], n_elems=1632000, size=1632000, w_stride = 0, size_with_stride=1638400, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003860 index=1, name=283, n_dims=4, dims=[1, 255, 40, 40], n_elems=408000, size=408000, w_stride = 0, size_with_stride=491520, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 index=2, name=285, n_dims=4, dims=[1, 255, 20, 20], n_elems=102000, size=102000, w_stride = 0, size_with_stride=163840, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003915 model is NHWC input fmt model input height=640, width=640, channel=3 Read model/man.jpg ... img width = 640, img height = 640 once run use 25.523000 ms loadLabelName ./model/coco_80_labels_list.txt person @ (89 157 258 631) 0.895037 bowl @ (483 221 506 240) 0.679969 bowl @ (395 322 444 343) 0.659576 wine glass @ (570 200 588 241) 0.544585 bowl @ (505 221 527 239) 0.477606 bowl @ (482 322 532 338) 0.458121 wine glass @ (543 199 564 239) 0.452579 cup @ (418 215 437 238) 0.410092 cup @ (385 204 402 240) 0.374592 cup @ (435 212 451 238) 0.371657 bowl @ (613 215 639 239) 0.359605 wine glass @ (557 200 575 240) 0.359143 cup @ (446 211 461 238) 0.358369 spoon @ (255 257 271 313) 0.340807 bottle @ (412 84 432 119) 0.338540 spoon @ (307 267 322 326) 0.318563 spoon @ (324 265 340 332) 0.315867 bottle @ (453 305 466 340) 0.308927 cup @ (526 210 544 239) 0.290318 bottle @ (389 83 411 119) 0.277804 wine glass @ (583 198 602 239) 0.277093 bowl @ (24 359 101 383) 0.275663 oven @ (4 370 168 632) 0.256395 spoon @ (268 262 282 322) 0.252866 bottle @ (434 85 454 118) 0.250721 save detect result to ./out.jpg loop count = 10 , average run 18.620700 ms arnon@arnon-desktop:~/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux$ |
Как и ожидалось, производительность ИИ Rockchip RK3588 значительно превосходит Rockchip RK3568, как показано в таблице ниже.
Board/CPU | First run | Average of 10 runs |
---|---|---|
Mixtile Blade 3 (RK3588) | 25.523000 ms | 18.620700 ms |
YY3568 (RK3568) | 78.917000 ms | 69.709700 ms |
Плата Mixtile Blade 3 примерно втрое быстрее плат на базе Rockchip RK3568. Преобразование миллисекунд в FPS показывает, что Mixtile Blade 3 обрабатывает Yolo v5 на скорости 54 кадра в секунду, что считается очень быстрой обработкой, достаточной для приложений реального времени.
Результаты 10 запусков RKNN Benchmark на Mixtile Blade 3:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
arnon@arnon-desktop:~/rknn-toolkit2/rknpu2/examples/rknn_benchmark/install/rknn_benchmark_Linux$ ./rknn_benchmark /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/model/RK3588/yolov5s-640-640.rknn /home/arnon/rknn-toolkit2/rknpu2/examples/rknn_yolov5_demo/install/rknn_yolov5_demo_Linux/model/man.jpg rknn_api/rknnrt version: 1.6.0 (9a7b5d24c@2023-12-13T17:31:11), driver version: 0.9.2 total weight size: 7312128, total internal size: 7782400 total dma used size: 24784896 model input num: 1, output num: 3 input tensors: index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, w_stride = 640, size_with_stride=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 output tensors: index=0, name=output, n_dims=4, dims=[1, 255, 80, 80], n_elems=1632000, size=1632000, w_stride = 0, size_with_stride=1638400, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003860 index=1, name=283, n_dims=4, dims=[1, 255, 40, 40], n_elems=408000, size=408000, w_stride = 0, size_with_stride=491520, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 index=2, name=285, n_dims=4, dims=[1, 255, 20, 20], n_elems=102000, size=102000, w_stride = 0, size_with_stride=163840, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003915 custom string: Warmup ... 0: Elapse Time = 21.00ms, FPS = 47.63 1: Elapse Time = 20.88ms, FPS = 47.89 2: Elapse Time = 20.89ms, FPS = 47.87 3: Elapse Time = 20.11ms, FPS = 49.71 4: Elapse Time = 15.84ms, FPS = 63.14 Begin perf ... 0: Elapse Time = 15.82ms, FPS = 63.23 1: Elapse Time = 15.87ms, FPS = 63.01 2: Elapse Time = 15.87ms, FPS = 63.00 3: Elapse Time = 15.69ms, FPS = 63.72 4: Elapse Time = 15.89ms, FPS = 62.95 5: Elapse Time = 15.78ms, FPS = 63.36 6: Elapse Time = 15.92ms, FPS = 62.83 7: Elapse Time = 15.83ms, FPS = 63.17 8: Elapse Time = 15.88ms, FPS = 62.98 9: Elapse Time = 15.88ms, FPS = 62.98 Avg Time 15.84ms, Avg FPS = 63.123 Save output to rt_output0.npy Save output to rt_output1.npy Save output to rt_output2.npy ---- Top5 ---- 0.984223 - 16052 0.984223 - 16132 0.984223 - 16212 0.984223 - 560644 0.984223 - 560724 ---- Top5 ---- 0.996078 - 280970 0.996078 - 281010 0.996078 - 281011 0.992157 - 280769 0.992157 - 280770 ---- Top5 ---- 0.998327 - 70225 0.998327 - 70244 0.998327 - 70245 0.994412 - 36225 0.994412 - 36244 |
Тесты показывают среднюю скорость вывода 63,123 FPS, подтверждая пригодность платы Mixtile Blade 3 в качестве Edge AI компьютера.
Тестирование изображений допустимо, но учитывая возможности Mixtile Blade 3 для обработки ИИ в реальном времени, было решено протестировать Yolo5 с USB-камерой и трансляцией результатов через RTSP. Первым шагом стала установка RTSP-сервера MediaMTX на Mixtile Blade 3 по инструкциям на GitHub .
Также был отредактирован mediamtx.yml для кодирования вывода веб-камеры в H.264 с потоковой передачей в разрешении 640 x 640.
1 2 3 4 |
paths: cam: runOnInit: ffmpeg -f v4l2 -framerate 24 -video_size 640x640 -i /dev/video1 -vcodec h264 -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH runOnInitRestart: yes |
RTSP-поток на плате можно протестировать следующей командой:
1 |
./rknn_yolov5_video_demo model/RK3588/yolov5s-640-640.rknn rtsp://127.0.0.1:8554/cam 264 |
Обнаруженные объекты сохраняются в журнале, поскольку в тесте не используется OpenCV, а видео просто отображает рамки вокруг обнаруженных объектов, как показано в ролике ниже.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
resize with RGA! once run use 18.728000 ms post process config: box_conf_threshold = 0.25, nms_threshold = 0.45 cat @ (515 420 640 479) 0.692027 person @ (26 5 520 469) 0.661832 cup @ (375 199 456 272) 0.629220 laptop @ (277 333 424 405) 0.405269 knife @ (438 159 510 267) 0.156645 chn 0 size 5389 qp 27 time_gap=9on_track_frame_out ctx=0xffffc6769500 decoder=0xaaaade2ab060 receive packet size=27460 on_track_frame_out ctx=0xffffc6769500 decoder=0xaaaade2ab060 receive packet size=36555 decoder require buffer w:h [640:480] stride [640:480] buf_size 614400 pts=0 dts=0 get one frame 1708769692278 data_vir=0xffff88022000 fd=66 input image 640x480 stride 640x480 format=2560 resize with RGA! once run use 23.140000 ms post process config: box_conf_threshold = 0.25, nms_threshold = 0.45 person @ (18 9 519 468) 0.647593 cat @ (518 417 640 479) 0.612846 cup @ (371 201 455 271) 0.451749 spoon @ (445 162 509 246) 0.193526 chn 0 size 5449 qp 26 time_gap=-15decoder require buffer w:h [640:480] stride [640:480] buf_size 614400 pts=0 dts=0 get one frame 1708769692307 data_vir=0xffff882b8000 fd=46 input image 640x480 stride 640x480 format=2560 resize with RGA! once run use 18.781000 ms post process config: box_conf_threshold = 0.25, nms_threshold = 0.45 cat @ (518 415 640 479) 0.775714 person @ (24 3 512 473) 0.634580 cup @ (370 201 453 272) 0.592880 knife @ (439 159 507 267) 0.154147 chn 0 size 5585 qp 26 time_gap=9on_track_frame_out ctx=0xffffc6769500 |
Приведенный выше видеоклип демонстрирует хорошую производительность обработки ИИ с высокой частотой кадров для обнаружения и отслеживания объектов.
Тестирование производительности LLM на Rockchip RK3588 (GPU)
Первоначальной идеей было тестирование больших языковых моделей с использованием 6 TOPS NPU на Rockchip RK3588, как это было выполнено с RKNPU2 выше. Однако выяснилось, что эта функция пока не реализована, и вместо этого для данной цели используется встроенный в SoC Rockchip RK3588 графический процессор Arm Mali G610.
Начали с проекта llm-rk3588 Haolin Zhang на GitHub , но, несмотря на усилия, не удалось заставить его работать на плате Mixtile Blade 3. В итоге были найдены инструкции по запуску LLM на RK3588 с использованием docker, которые оказались работоспособными. В блоге показано использование моделей RedPajama-INCITE-Chat-3B-v1-q4f16_1 с 3 миллиардами параметров и Llama-2-7b-chat-hf-q4f16_1 с 7 миллиардами параметров, но также была протестирована модель Llama-2-13b-chat-hf-q4f16_1 с 13 миллиардами параметров для оценки производительности и полного использования доступных 32 ГБ ОЗУ.
Тестирование модели LLM RedPajama-INCITE-Chat-3B-v1-q4f16_1
Для запуска docker с моделью LLM на 3B была выполнена команда:
1 |
docker run --rm -it --privileged docker.io/milas/mlc-llm:redpajama-3b |
Был использован запрос: «Объясните, почему свободные электроны в изоляторе не могут перепрыгнуть через энергетическую щель в зону проводимости»:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
arnon@arnon-desktop:~$ docker run --rm -it --privileged docker.io/milas/mlc-llm:redpajama-3b Use MLC config: "/mlc-llm/dist/prebuilt/RedPajama-INCITE-Chat-3B-v1-q4f16_1/mlc-chat-config.json" Use model weights: "/mlc-llm/dist/prebuilt/RedPajama-INCITE-Chat-3B-v1-q4f16_1/ndarray-cache.json" Use model library: "/mlc-llm/dist/prebuilt/lib/RedPajama-INCITE-Chat-3B-v1-q4f16_1-mali.so" You can use the following special commands: /help print the special commands /exit quit the cli /stats print out the latest stats (token/sec) /reset restart a fresh chat /reload [local_id] reload model `local_id` from disk, or reload the current model if `local_id` is not specified Loading model... arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '7'. Loading finished Running system prompts... System prompts finished <human>: Explain why free electrons in an insulator cannot jump over the energy gap to the conduction band <bot>: Electrons in an insulator have lower energy than electrons in the conduction band. This is because the energy levels of the electrons are lower in an insulator compared to a conductor. The energy gap between the valence and the conduction band in an insulator is much smaller than in a conductor. The low energy level of the electrons in the insulator is caused by the presence of an energy gap between the valence and conduction bands. Electrons in the valence band are tightly bound to the atoms and molecules of the material, and they are not free to move. In contrast, electrons in the conduction band are less tightly bound to the atoms and molecules and are free to move around. However, they have lower energy than electrons in the valence band, which means that it is difficult for them to move across the energy gap into the conduction band. This is one of the main reasons why free electrons in an insulator cannot jump over the energy gap to the conduction band. The low energy level of the electrons in the insulator prevents them from moving across the energy gap and leading to a conductive material. <human>: /stats prefill: 4.6 tok/s, decode: 5.1 tok/s |
Производительность хорошая, а команда top показывает использование памяти системой при работе модели RedPajama-INCITE-Chat-3B-v1-q4f16_1 около 3.9 ГБ ОЗУ.
Тестирование модели Llama-2-7b-chat-hf-q4f16_1
Docker был перезапущен с моделью Llama 2 на 7B параметров…
1 |
docker run --rm -it --privileged docker.io/milas/mlc-llm:llama2-7b |
…и применен тот же запрос:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
arnon@arnon-desktop:~$ docker run --rm -it --privileged docker.io/milas/mlc-llm:llama2-7b Use MLC config: "/mlc-llm/dist/prebuilt/Llama-2-7b-chat-hf-q4f16_1/mlc-chat-config.json" Use model weights: "/mlc-llm/dist/prebuilt/Llama-2-7b-chat-hf-q4f16_1/ndarray-cache.json" Use model library: "/mlc-llm/dist/prebuilt/lib/Llama-2-7b-chat-hf-q4f16_1-mali.so" You can use the following special commands: /help print the special commands /exit quit the cli /stats print out the latest stats (token/sec) /reset restart a fresh chat /reload [local_id] reload model `local_id` from disk, or reload the current model if `local_id` is not specified Loading model... arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '7'. Loading finished Running system prompts... System prompts finished [INST]: Explain why free electrons in an insulator cannot jump over the energy gap to the conduction band [/INST]: Hello! I'm here to help you with your question. However, I must point out that the assumption in your question that free electrons in an insulator can jump over the energy gap to the conduction band is not entirely accurate. In solids, the electrons are arranged in a regular, periodic pattern called a crystal lattice. The energy gap, also known as the bandgap, is the energy difference between the valence band and the conduction band. The valence band is the lowest energy band where the electrons are localized, while the conduction band is the highest energy band where the electrons can move freely. In an insulator, the electrons are localized in the valence band and cannot easily jump to the conduction band because of the energy gap. The energy gap is typically too large for the free electrons to overcome, so they cannot hop from the valence band to the conduction band. I hope this clears up any confusion! If you have any further questions or need more clarification, please feel free to ask. [INST]: /stats prefill: 4.8 tok/s, decode: 2.8 tok/s |
Производительность остается хорошей, а использование системной памяти теперь составляет около 6.7 ГБ.
Тестирование модели Llama-2-13b-chat-hf-q4f16_1 на 13B на RK3588
Для этого теста использовался docker.io/milas/mlc-llm:redpajama-3b образ, после чего импортированы файлы модели Llama-2-13b-chat-hf-q4f16_1 в docker, перезагружена модель и выполнен запрос «Объясните, почему свободные электроны в изоляторе не могут перепрыгнуть через энергетическую щель в зону проводимости»:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
arnon@arnon-desktop:~/mlc-llm$ docker attach 4695123cf100 hello <bot>: Hello! How may I help you? <human>: /help You can use the following special commands: /help print the special commands /exit quit the cli /stats print out the latest stats (token/sec) /reset restart a fresh chat /reload [local_id] reload model `local_id` from disk, or reload the current model if `local_id` is not specified <human>: /reload Llama-2-13b-chat-hf-q4f16_1 Use MLC config: "/mlc-llm/dist/prebuilt/Llama-2-13b-chat-hf-q4f16_1/mlc-chat-config.json" Use model weights: "/mlc-llm/dist/prebuilt/Llama-2-13b-chat-hf-q4f16_1/ndarray-cache.json" Use model library: "/mlc-llm/dist/prebuilt/lib/Llama-2-13b-chat-hf-q4f16_1-mali.so" Loading model... Loading finished [INST]: Explain why free electrons in an insulator cannot jump over the energy gap to the conduction band [/INST]: Free electrons in an insulator cannot jump over the energy gap to the conduction band because of the energy barrier that exists between the valence and conduction bands. In an insulator, the valence band is filled with electrons, and the conduction band is empty. The energy difference between the valence and conduction bands is known as the bandgap. The bandgap is a fundamental property of the material, and it is responsible for the insulating behavior of the material. The free electrons in the valence band cannot jump over the energy gap to the conduction band because they do not have enough energy to overcome the bandgap. In order to move from the valence band to the conduction band, the electrons would need to acquire enough energy to overcome the bandgap. However, this is not possible because the bandgap is a fundamental property of the material, and it cannot be overcome by simple thermal motion or other random fluctuations. Therefore, the free electrons in an insulator are localized in the valence band, and they cannot participate in the flow of electric current. This is why insulators do not conduct electricity, and this is the fundamental reason why they are different from conductors and semiconductors. I hope this explanation helps clarify the reason why free electrons in an insulator cannot jump over the energy gap to the conduction band. If you have any further questions or need additional clarification, please don't hesitate to ask. [INST]: /stats prefill: 2.4 tok/s, decode: 1.2 tok/s |
Производительность значительно ниже, текст медленно выводится в терминале, и замечено отсутствие одной из GPU-связанных строк, присутствовавших в других моделях:
1 |
arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '7'. |
Не полностью ясно, используется ли GPU, несмотря на загрузку файла «/mlc-llm/dist/prebuilt/lib/Llama-2-13b-chat-hf-q4f16_1-mali.so». Тем не менее, модель функционирует, используя около 10.6 ГБ памяти при работе в docker, что предполагает достаточность 16 ГБ ОЗУ…
Сообщается, что Rockchip разрабатывает реализацию LLM с использованием NPU, которая будет значительно быстрее GPU-реализации. После ее выпуска планируется подготовить дополнительный краткий обзор.
Сводка результатов LLM на RK3588
Для всех моделей применялся идентичный запрос: «Объясните, почему свободные электроны в изоляторе не могут перепрыгнуть через энергетическую щель в зону проводимости». Все модели ответили корректно, но с разной скоростью. В таблице ниже обобщены скорости декодирования и предзаполнения в токенах в секунду (токен/с), отражающие количество обработанных слов или их фрагментов в секунду для каждой модели.
Model | Prefill (tok/s) | Decode (tok/s) |
---|---|---|
RedPajama-INCITE-Chat-3B-v1-q4f16_1 | 4.6 | 5.1 |
Llama-2-7b-chat-hf-q4f16_1 | 4.8 | 2.8 |
Llama-2-13b-chat-hf-q4f16_1 | 2.4 | 1.2 |
Для оценки ответов протестированных моделей использовался Google Gemini, чтобы определить наилучший результат:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
Here's my evaluation of the three answers you provided: Answer 1: Strengths: Accurately describes the concept of the energy gap and its role in conductivity. Mentions the difference between valence and conduction bands. Weaknesses: Overly detailed and repetitive, making it lengthy and potentially overwhelming. Uses unnecessarily complex language ("electrons in an insulator have lower energy than electrons in the conduction band"). Doesn't explicitly state that insulators lack enough energy to overcome the gap. Answer 2: Strengths: Polite and friendly introduction. Clearly points out the misconception in the question. Mentions crystal lattice, valence band, and conduction band for context. Weaknesses: Slightly indirect approach to answering the question. Could be more concise by removing unnecessary elements like the introduction and closing. Answer 3: Strengths: Well-structured and concise explanation. Clearly defines key terms like valence band, conduction band, and bandgap. Explains why the lack of energy prevents electrons from jumping the gap. Concludes by emphasizing the reason for insulators not conducting electricity. Weaknesses: While technically accurate, it uses slightly more complex vocabulary compared to Answer 2. Overall Ranking: Answer 3: This answer is the most concise, clear, and informative, effectively addressing the core question without unnecessary details. Answer 2: This answer is also good, but it takes a slightly indirect approach and could be more concise. Answer 1: While technically accurate, it is overly detailed and repetitive, making it less engaging and potentially confusing. |
Ожидаемо качество ответа улучшается с увеличением количества параметров в модели.
Заключение
После тестирования ИИ и LLM на плате Mixtile Blade 3 на базе Rockchip RK3588 с 32 ГБ ОЗУ можно заключить, что она демонстрирует хорошую производительность в задачах типа обнаружения объектов YoloV5 в реальном времени. Модели LLM успешно работают на GPU Arm Mali-610, но более крупные модели получат преимущество от NPU-ускорения, запланированного на этот год.
Сама одноплатная система Mixtile Blade 3 предлагается с флеш-памятью eMMC до 256 ГБ, поддерживает NVMe и является одной из немногих доступных плат RK3588 с 32 ГБ ОЗУ, пригодных для LLM. Качество сборки металлического корпуса превосходное, а конструкция обеспечивает беспроводное использование без деградации сигнала благодаря пластиковым элементам, но вентилятор оказался достаточно шумным.
Документация выполнена качественно, структурирована по разделам и достаточно полна, что позволяет начать работу без сложностей. В зависимости от применения плата может быть несколько громоздкой: например, для WiFi требуется модуль mPCIe, а для подключения клавиатуры и мыши — док-станция USB-C. Однако ее низкопрофильный дизайн с радиатором и разъемом U.2 делает идеальной для кластеров плат , особенно для приложений, требующих большого объема памяти, где каждая плата поддерживает до 32 ГБ ОЗУ. Компания также предоставляет программные драйверы для работы с кластерными вычислениями.
Благодарим Mixtile за предоставление платы Blade 3 на Rockchip RK3588 с 32 ГБ ОЗУ для экспериментов с ИИ и LLM. Плату можно приобрести в магазине Mixtile за $229 (4 ГБ ОЗУ/32 ГБ флеш) до $439 в протестированной конфигурации 32 ГБ/256 ГБ. Также она доступна на Aliexpress , но по высокой цене и без модели на 32 ГБ ОЗУ. Помимо магазина Mixtile, модель с 32 ГБ ОЗУ может быть найдена у других дистрибьюторов .
Выражаем свою благодарность источнику, с которого взята и переведена статья, сайту cnx-software.com.
Оригинал статьи вы можете прочитать здесь.