【技术分析】嘉楠科技SoC芯片K230

概述

K230是嘉楠科技Kendryte®系列AIoT芯片中的最新一代SoC芯片,该芯片采用全新的多异构单元加速计算架构,集成的玄铁C908具有2个高能效RISCV计算核心,内置新一代KPU(Knowledge Process Unit)智能计算单元,具备多精度AI算力,广泛支持通用的AI计算框架

硬件架构

CanMV-K230开发板功能框图

在这里插入图片描述

SoC架构

在这里插入图片描述

Core架构

K230 中采用的玄铁C908双核处理器中大核具备RVV1.0扩展的特性,能够大幅度提升CPU算子推理时的表现。

软件开发

对Transformer模型推理加速的支持

K230的KPU单元不支持对Transformer的decoder模型中的 softmax、layer_norm、where、gather,reduce_arg,reshape 进行硬件推理加速,因此需要使用C908实现推理,目前已经完成了对 softmax、layer_norm、where的RVV优化,性能提升明显。

在K230上优化前后的性能对比:
在这里插入图片描述

在开启RVV优化后能够极大的提升CPU算子的推理性能,缩短整个模型的推理时间(1973–> 46)ms,RVV优化后占据大部分时间的 softmax算子时间减少到25ms,layer_norm算子时间减少到0.97ms,where算子时间减少到0.91ms,整个模型的推理时间缩短了97.6%,在实际模型部署时具有很高的应用价值。

nncase

nncase是一个为 AI 加速器设计的神经网络编译器, 目前支持的 target有cpu/K210/K510/K230等1

nncase软件栈包括compiler和runtime两部分。

Compiler: 用于在PC上编译神经网络模型,最终生成kmodel文件。主要包括importer, IR, Evaluator, Quantize, Transform优化, Tiling, Partition, Schedule, Codegen等模块。

在这里插入图片描述

参考文献


  1. K230 nncase开发指南 ↩︎

### K230 on Linux System Specifications and Usage #### Overview of K230 Processor The K230 processor is designed specifically for embedded systems and low-power computing environments. This processor supports various operating systems including Linux, making it versatile for different application scenarios. #### Key Features of K230 on Linux Systems - **Low Power Consumption**: Optimized power management features allow efficient operation under Linux. - **Peripheral Support**: Comprehensive support for peripherals such as USB, UART, SPI, I2C, etc., ensuring compatibility with external devices[^1]. #### Running Linux on K230 To run Linux on the K230 platform, several steps are involved: ```bash # Install necessary packages sudo apt-get update && sudo apt-get install build-essential u-boot-tools device-tree-compiler # Download appropriate kernel sources or pre-built images compatible with K230 wget https://example.com/path/to/kernel-image-for-k230.tar.gz tar -xzvf kernel-image-for-k230.tar.gz # Configure U-Boot environment variables to boot from SD card/flash memory env default -a saveenv ``` For specific configurations like modifying Device Tree Blob (DTB), one can refer to similar processes used in QEMU setups where DTBs are manipulated using `dtc` tools[^3]: ```bash # Convert existing .dtb file into editable .dts format dtc -I dtb -O dts -o k230-custom.dts k230-original.dtb # Edit the generated .dts file according to requirements nano k230-custom.dts # Recompile modified .dts back into binary form (.dtb) dtc -I dts -O dtb -o k230-modified.dtb k230-custom.dts ``` This approach allows customization of hardware interfaces through software configuration without altering physical connections directly. #### Development Tools Integration When developing applications targeting both PowerVR GPUs alongside K230 processors running Linux, leveraging frameworks provided by SDKs becomes crucial. For instance, integrating the PowerVR Graphics SDK facilitates accelerated graphics processing tasks within these platforms[^2]. --related questions-- 1. What are some common challenges faced when porting Linux onto custom ARM-based SoCs? 2. How does the choice between monolithic vs microkernel architectures impact performance on small footprint CPUs like K230? 3. Can you provide guidance on setting up a cross-compilation toolchain tailored for building Linux kernels intended for K230 boards?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

KGback

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值