[{"data":1,"prerenderedAt":439},["ShallowReactive",2],{"content-query-65uG9fYiV2":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":433,"_id":434,"_source":435,"_file":436,"_stem":437,"_extension":438},"/technology-blogs/zh/814","zh",false,"","技术干货｜极速、极智、极简的昇思MindSpore Lite：助力华为Watch更加智能","介绍MindSpore Lite在华为智能手表WATCH上的应用","2021-12-02","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/22e761a9eecb453697155e0bd9d6760b.png","technology-blogs","大V博文",{"type":15,"children":16,"toc":430},"root",[17,25,34,43,48,56,114,122,173,180,188,193,202,209,216,236,255,273,278,296,301,308,313,331,338,343,361,366,371,380,392,397,404,409,420,425],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"技术干货极速极智极简的昇思mindspore-lite助力华为watch更加智能",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":18,"tag":30,"props":31,"children":33},"img",{"alt":7,"src":32},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/682d57d3d11f412897abb1fde1a6c9ea.gif",[],{"type":18,"tag":26,"props":35,"children":36},{},[37],{"type":18,"tag":38,"props":39,"children":40},"strong",{},[41],{"type":24,"value":42},"作者：李锐锋 ｜来源：知乎",{"type":18,"tag":26,"props":44,"children":45},{},[46],{"type":24,"value":47},"昇思MindSpore Lite是MindSpore全场景AI框架的端侧引擎，目前MindSpore Lite作为华为HMS Core、鸿蒙、运营商、能源领域嵌入式设备机器学习服务的推理引擎底座，已为全球4000+应用提供推理引擎服务，日均调用量超过7亿，同时在各类手机、穿戴感知、智慧屏、智能手表和其他IoT设备的AI特性上得到了广泛应用。本文介绍MindSpore Lite在华为智能手表WATCH上的应用，也欢迎您发布基于MindSpore Lite的应用。",{"type":18,"tag":26,"props":49,"children":50},{},[51],{"type":18,"tag":38,"props":52,"children":53},{},[54],{"type":24,"value":55},"使用MindSpore Lite的优势",{"type":18,"tag":57,"props":58,"children":59},"ol",{},[60,75,88,101],{"type":18,"tag":61,"props":62,"children":63},"li",{},[64,69,73],{"type":18,"tag":38,"props":65,"children":66},{},[67],{"type":24,"value":68},"极致性能",{"type":18,"tag":70,"props":71,"children":72},"br",{},[],{"type":24,"value":74},"高效的内核算法和汇编级优化，支持CPU、GPU、NPU异构调度，最大化发挥硬件算力，最小化推理时延和功耗。",{"type":18,"tag":61,"props":76,"children":77},{},[78,83,86],{"type":18,"tag":38,"props":79,"children":80},{},[81],{"type":24,"value":82},"轻量化",{"type":18,"tag":70,"props":84,"children":85},{},[],{"type":24,"value":87},"提供超轻量的解决方案，支持模型量化压缩，模型更小跑得更快，使能AI模型极限环境下的部署执行。",{"type":18,"tag":61,"props":89,"children":90},{},[91,96,99],{"type":18,"tag":38,"props":92,"children":93},{},[94],{"type":24,"value":95},"全场景支持",{"type":18,"tag":70,"props":97,"children":98},{},[],{"type":24,"value":100},"支持iOS、Android等手机操作系统以及LiteOS嵌入式操作系统，支持手机、大屏、平板、IoT等各种智能设备上的AI应用。",{"type":18,"tag":61,"props":102,"children":103},{},[104,109,112],{"type":18,"tag":38,"props":105,"children":106},{},[107],{"type":24,"value":108},"高效部署",{"type":18,"tag":70,"props":110,"children":111},{},[],{"type":24,"value":113},"支持MindSpore/TensorFlow Lite/Caffe/Onnx模型，提供模型压缩、数据处理等能力，统一训练和推理IR，方便用户快速部署。",{"type":18,"tag":26,"props":115,"children":116},{},[117],{"type":18,"tag":38,"props":118,"children":119},{},[120],{"type":24,"value":121},"使用MindSpore Lite的工作流程",{"type":18,"tag":57,"props":123,"children":124},{},[125,135,145,155],{"type":18,"tag":61,"props":126,"children":127},{},[128,133],{"type":18,"tag":38,"props":129,"children":130},{},[131],{"type":24,"value":132},"选择模型",{"type":24,"value":134},"：选择新模型或者重新训练现有模型",{"type":18,"tag":61,"props":136,"children":137},{},[138,143],{"type":18,"tag":38,"props":139,"children":140},{},[141],{"type":24,"value":142},"转换模型",{"type":24,"value":144},"：使用工具将模型转换为方便部署的端侧模型",{"type":18,"tag":61,"props":146,"children":147},{},[148,153],{"type":18,"tag":38,"props":149,"children":150},{},[151],{"type":24,"value":152},"部署应用",{"type":24,"value":154},"：将模型引入到应用中，并加载到移动或者嵌入式设备中",{"type":18,"tag":61,"props":156,"children":157},{},[158,163,165],{"type":18,"tag":38,"props":159,"children":160},{},[161],{"type":24,"value":162},"学习链接",{"type":24,"value":164},"：",{"type":18,"tag":166,"props":167,"children":171},"a",{"href":168,"rel":169},"https://www.mindspore.cn/lite/docs/zh-CN/master/quick_start/quick_start.html#id2",[170],"nofollow",[172],{"type":24,"value":168},{"type":18,"tag":26,"props":174,"children":175},{},[176],{"type":18,"tag":30,"props":177,"children":179},{"alt":7,"src":178},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/ab8629b2f8554a659d2a4ee0908dd608.jpg",[],{"type":18,"tag":26,"props":181,"children":182},{},[183],{"type":18,"tag":38,"props":184,"children":185},{},[186],{"type":24,"value":187},"获取MindSpore Lite最新版本：",{"type":18,"tag":26,"props":189,"children":190},{},[191],{"type":24,"value":192},"了解并下载MindSpore Lite：",{"type":18,"tag":26,"props":194,"children":195},{},[196],{"type":18,"tag":166,"props":197,"children":200},{"href":198,"rel":199},"https://www.mindspore.cn/lite/docs/zh-CN/r1.5/use/downloads.html",[170],[201],{"type":24,"value":198},{"type":18,"tag":26,"props":203,"children":204},{},[205],{"type":18,"tag":30,"props":206,"children":208},{"alt":7,"src":207},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/118280e04c21491faa4a0acad2124979.jpg",[],{"type":18,"tag":26,"props":210,"children":211},{},[212],{"type":18,"tag":30,"props":213,"children":215},{"alt":7,"src":214},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/f88affc88d894a8992ad42df03532a36.jpg",[],{"type":18,"tag":26,"props":217,"children":218},{},[219,224,226,231,232],{"type":18,"tag":38,"props":220,"children":221},{},[222],{"type":24,"value":223},"●",{"type":24,"value":225}," ",{"type":18,"tag":38,"props":227,"children":228},{},[229],{"type":24,"value":230},"生活中的AI",{"type":24,"value":225},{"type":18,"tag":38,"props":233,"children":234},{},[235],{"type":24,"value":223},{"type":18,"tag":26,"props":237,"children":238},{},[239,241,246,248,253],{"type":24,"value":240},"MCU的全称是Microcontroller Unit，中文可以称为微控制器或者单片机。MCU既可用于汽车电子、工业控制等领域，也可应用于小型和低功耗设备中。全球有数十亿台物联网（IOT）设备，大到扫地机器人、微波炉、音箱，小到手表、手环、电动牙刷等，都离不开MCU。MCU不仅承担计算任务，还可扩展接入众多外设，比如按键、麦克风、扬声器、摄像头和传感器等，实现与周围环境的互动。即便五年前，大部分MCU小型设备都不具备智能能力。近几年，随着",{"type":18,"tag":38,"props":242,"children":243},{},[244],{"type":24,"value":245},"深度神经网络技术",{"type":24,"value":247},"的快速发展，出现了TinyML的细分领域。TinyML(微型机器学习)是指机器学习或者",{"type":18,"tag":38,"props":249,"children":250},{},[251],{"type":24,"value":252},"深度学习",{"type":24,"value":254},"应用于微型设备上的场景。简单来说，它是指在MCU设备上进行AI模型训练和推理。有了TinyML，再小的设备也可以具备智能化，而无需依赖昂贵的硬件或者可靠的互联网传输。TinyML的另一项优势是隐私保护，所有操作均在本地完成，无需向云侧发送任何数据。",{"type":18,"tag":26,"props":256,"children":257},{},[258,262,263,268,269],{"type":18,"tag":38,"props":259,"children":260},{},[261],{"type":24,"value":223},{"type":24,"value":225},{"type":18,"tag":38,"props":264,"children":265},{},[266],{"type":24,"value":267},"现实问题",{"type":24,"value":225},{"type":18,"tag":38,"props":270,"children":271},{},[272],{"type":24,"value":223},{"type":18,"tag":26,"props":274,"children":275},{},[276],{"type":24,"value":277},"智能手表是华为消费者业务除手机外另一个重要的产品，也是典型的MCU设备。华为在2015年发布了第一款智能手表。前两代手表自发布后，经常收到用户反馈在抬腕亮屏这个功能上体验不佳，比如亮屏时延较大、概率性不亮屏和误亮等，这些问题也间接造成了手表续航时间的减少，对华为品牌声誉造成影响。造成该问题长期存在的原因很多，比如早期使用的是传统算法（非深度学习）；使用了友商的推理框架，由于该框架没有对MCU设备进行优化，导致程序的ROM和RAM占用均较高，这对于资源受限的MCU设备来说，无疑雪上加霜。另外，该框架算子计算性能不佳，导致推理时延也比较大，最终导致亮屏时延较大。",{"type":18,"tag":26,"props":279,"children":280},{},[281,285,286,291,292],{"type":18,"tag":38,"props":282,"children":283},{},[284],{"type":24,"value":223},{"type":24,"value":225},{"type":18,"tag":38,"props":287,"children":288},{},[289],{"type":24,"value":290},"解决方案",{"type":24,"value":225},{"type":18,"tag":38,"props":293,"children":294},{},[295],{"type":24,"value":223},{"type":18,"tag":26,"props":297,"children":298},{},[299],{"type":24,"value":300},"2020年，华为自研的深度学习框架昇思MindSpore正式对外开源。作为一款优秀的全场景AI框架，昇思MindSpore也提供对TinyML模型端到端的部署能力。昇思MindSpore训练框架可以让用户快速入门AI应用，简单高效地训练出自己专属的AI模型。而MindSpore Lite for Micro作为一款超轻量AI推理引擎，让用户轻松部署自己的TinyML模型。MindSpore Lite for Micro核心理念是“模型即代码”，会根据目标硬件的CPU体系结构、内存状况，以低功耗、高性能和无第三方依赖为优化目标，为每个模型生成专属的高效推理代码。",{"type":18,"tag":26,"props":302,"children":303},{},[304],{"type":18,"tag":30,"props":305,"children":307},{"alt":7,"src":306},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/f060198f13c2430cb46558fa10e1a443.jpg",[],{"type":18,"tag":26,"props":309,"children":310},{},[311],{"type":24,"value":312},"该方案分为Host和Device两个阶段。在Host阶段，我们会对AI模型进行各种算子转换和图优化操作，大幅缩减冗余计算，力求在目标硬件上达到最优推理性能。这里的模型不单指MindSpore的模型，还支持其他主流模型格式接入，比如TF、TFLITE、ONNX和CAFFE等。我们还支持训练后量化，实现模型更小、推理更快。Device阶段，用户需要将生成的目标源代码进行交叉编译，部署到目标硬件上。我们生成代码的同时，配套提供了CMake的构建工程，大大方便了用户集成；对于IDE集成的用户，我们在官网也提供了操作指南。",{"type":18,"tag":26,"props":314,"children":315},{},[316,320,321,326,327],{"type":18,"tag":38,"props":317,"children":318},{},[319],{"type":24,"value":223},{"type":24,"value":225},{"type":18,"tag":38,"props":322,"children":323},{},[324],{"type":24,"value":325},"助力Watch3续航提升",{"type":24,"value":225},{"type":18,"tag":38,"props":328,"children":329},{},[330],{"type":24,"value":223},{"type":18,"tag":26,"props":332,"children":333},{},[334],{"type":18,"tag":30,"props":335,"children":337},{"alt":7,"src":336},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/43634e97a5b64d4692dff8600680401b.jpg",[],{"type":18,"tag":26,"props":339,"children":340},{},[341],{"type":24,"value":342},"2021年6月2日，HarmonyOS及华为全场景新品发布会上，作为华为旗舰智能腕表的WATCH 3正式发布。该款产品内置了我们MindSpore Lite for Micro超轻量AI引擎，实现了误亮屏减少50%、超长续航模式下续航提升1.2天、ROM和RAM占用均大幅减少的优秀成绩，取得了不俗的市场评价和用户口碑。在解决长期困扰手表用户的抬腕亮屏问题背后，是MindSpore Lite for Micro针对MCU设备的精准定位。首先，它在模型小型化上做到极致，通过模型优化和代码裁剪大幅降低代码量，从而降低ROM的空间占用。其次，它通过代码优化提升内存块复用，从而减少RAM空间占用。最后，基于开源CMSIS-NN算子库进行卷积类算子优化，进一步提升性能，降低时延。",{"type":18,"tag":26,"props":344,"children":345},{},[346,350,351,356,357],{"type":18,"tag":38,"props":347,"children":348},{},[349],{"type":24,"value":223},{"type":24,"value":225},{"type":18,"tag":38,"props":352,"children":353},{},[354],{"type":24,"value":355},"结语",{"type":24,"value":225},{"type":18,"tag":38,"props":358,"children":359},{},[360],{"type":24,"value":223},{"type":18,"tag":26,"props":362,"children":363},{},[364],{"type":24,"value":365},"MindSpore Lite超轻量AI引擎不仅助力了Huawei Watch3，在智慧屏、智能音箱、蓝牙耳机、打印机等众多华为IOT设备上都有它的身影。未来，我们也将助力整个中国的物联网和AI产业迈向成功，使用MindSpore Lite for Micro超轻量AI引擎实现“模型即代码”，使能IOT设备的AI能力，让AI智慧化无处不在。",{"type":18,"tag":26,"props":367,"children":368},{},[369],{"type":24,"value":370},"如需要进一步了解这个MCU模型部署利器，请访问官网：",{"type":18,"tag":26,"props":372,"children":373},{},[374],{"type":18,"tag":166,"props":375,"children":378},{"href":376,"rel":377},"https://www.mindspore.cn/",[170],[379],{"type":24,"value":376},{"type":18,"tag":26,"props":381,"children":382},{},[383,385,390],{"type":24,"value":384},"本文作者在MindSpore社区从事相关AI工作，欢迎您",{"type":18,"tag":38,"props":386,"children":387},{},[388],{"type":24,"value":389},"官方QQ群: 486831414",{"type":24,"value":391},"，与数千MindSpore开发者一起交流，用MindSpore赋能千行百业，点亮您的智慧生活。",{"type":18,"tag":26,"props":393,"children":394},{},[395],{"type":24,"value":396},"扫描下方二维码加入MindSpore项目↓",{"type":18,"tag":26,"props":398,"children":399},{},[400],{"type":18,"tag":30,"props":401,"children":403},{"alt":7,"src":402},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/12/03/55eb0bb65a974ca48a9c3a40d4d7d3dc.jpg",[],{"type":18,"tag":26,"props":405,"children":406},{},[407],{"type":24,"value":408},"MindSpore官方资料",{"type":18,"tag":26,"props":410,"children":411},{},[412,414],{"type":24,"value":413},"GitHub : ",{"type":18,"tag":166,"props":415,"children":418},{"href":416,"rel":417},"https://github.com/mindspore-ai/mindspore",[170],[419],{"type":24,"value":416},{"type":18,"tag":26,"props":421,"children":422},{},[423],{"type":24,"value":424},"Gitee : https : //gitee.com/mindspore/mindspore",{"type":18,"tag":26,"props":426,"children":427},{},[428],{"type":24,"value":429},"官方QQ群 : 486831414",{"title":7,"searchDepth":431,"depth":431,"links":432},4,[],"markdown","content:technology-blogs:zh:814.md","content","technology-blogs/zh/814.md","technology-blogs/zh/814","md",1776506141582]