[{"data":1,"prerenderedAt":963},["ShallowReactive",2],{"content-query-o2Yo5wQHNm":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"body":13,"_type":957,"_id":958,"_source":959,"_file":960,"_stem":961,"_extension":962},"/version-updates/zh/734","zh",false,"","新版本｜昇思MindSpore再升级，深度科学计算的极致创新","1.5版本来咯~","2021-09-26","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/09/15/6e910b5b0db04066a39ab9b02997147d.png","version-updates",{"type":14,"children":15,"toc":954},"root",[16,24,33,46,51,58,70,78,86,94,104,112,122,136,147,155,165,173,183,194,202,212,220,230,238,248,259,267,278,286,294,304,312,322,336,347,355,365,373,383,400,408,419,427,437,452,462,473,481,489,497,508,516,526,534,542,552,560,570,580,588,599,607,615,626,634,644,655,663,673,689,700,708,716,726,734,750,758,768,776,792,803,811,819,829,837,845,861,869,885,896,912,928,944],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"新版本昇思mindspore再升级深度科学计算的极致创新",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28],{"type":17,"tag":29,"props":30,"children":32},"img",{"alt":7,"src":31},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/69cc417312aa40e7ac1c68df5b8e7489.gif",[],{"type":17,"tag":25,"props":34,"children":35},{},[36,38,44],{"type":23,"value":37},"空山新雨后，天气晚来秋~~经过MindSpore社区开发者们勤奋耕耘，在这个丰收的季节，为大家奉上全新的1.5版本，在这个版本中我们正式发布MindSpore中文名：",{"type":17,"tag":39,"props":40,"children":41},"strong",{},[42],{"type":23,"value":43},"昇思",{"type":23,"value":45},"，希望大家能够喜欢！",{"type":17,"tag":25,"props":47,"children":48},{},[49],{"type":23,"value":50},"此同时为大家带来全新科学计算行业套件MindScience、亲和算法库MindSpore Boost、支持混合专家（MoE）与异构并行、集群调优支持大规模分布式训练，并完善控制流使用，新增对外开放机制等诸多新特性，在使能科研创新和应用中不断努力，下面就带大家快速浏览1.5版本的关键特性。",{"type":17,"tag":25,"props":52,"children":53},{},[54],{"type":17,"tag":29,"props":55,"children":57},{"alt":7,"src":56},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/ee152206f99e49ddb4ae9958da12888f.png",[],{"type":17,"tag":25,"props":59,"children":60},{},[61],{"type":17,"tag":62,"props":63,"children":67},"a",{"href":64,"rel":65},"https://mp.weixin.qq.com/s/Tnnx6EJw_dMrVQIBEZatEQ",[66],"nofollow",[68],{"type":23,"value":69},"请在微信中打开进行观看",{"type":17,"tag":25,"props":71,"children":72},{},[73],{"type":17,"tag":39,"props":74,"children":75},{},[76],{"type":23,"value":77},"一 MindScience科学计算行业套件，为高性能科学应用提供计算新范式",{"type":17,"tag":25,"props":79,"children":80},{},[81],{"type":17,"tag":39,"props":82,"children":83},{},[84],{"type":23,"value":85},"当前多种算力正在激发跨领域的应用融合，AI已经成为研究科学计算的新范式。因此我们将MindSpore拓展到科学计算领域。",{"type":17,"tag":25,"props":87,"children":88},{},[89],{"type":17,"tag":39,"props":90,"children":91},{},[92],{"type":23,"value":93},"通过多尺度混合计算和高阶混合微分两大关键创新，将MindSpore原有的AI计算引擎升级为AI与科学计算的统一引擎，实现融合的统一加速。在此基础上，我们计划面向8大科学计算行业打造MindScience系列套件。这些行业套件包含业界领先的数据集、基础模型、预置高精度模型和前后处理工具，加速科学行业应用开发。",{"type":17,"tag":25,"props":95,"children":96},{},[97],{"type":17,"tag":39,"props":98,"children":99},{},[100],{"type":17,"tag":29,"props":101,"children":103},{"alt":7,"src":102},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/c6379d0a68124cc4bff26de9d3615098.jpg",[],{"type":17,"tag":25,"props":105,"children":106},{},[107],{"type":17,"tag":39,"props":108,"children":109},{},[110],{"type":23,"value":111},"当前，我们推出面向电子信息行业的MindElec套件和面向生命科学行业的MindSPONGE套件，分别实现了电磁仿真性能提升10倍和生物制药化合物模拟效率提升50%。",{"type":17,"tag":25,"props":113,"children":114},{},[115],{"type":17,"tag":39,"props":116,"children":117},{},[118],{"type":17,"tag":29,"props":119,"children":121},{"alt":7,"src":120},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/1858a21c50ce4398ad3cab197c34c78c.jpg",[],{"type":17,"tag":25,"props":123,"children":124},{},[125],{"type":17,"tag":39,"props":126,"children":127},{},[128,130],{"type":23,"value":129},"查看介绍：",{"type":17,"tag":62,"props":131,"children":134},{"href":132,"rel":133},"https://www.mindspore.cn/mindscience/",[66],[135],{"type":23,"value":132},{"type":17,"tag":25,"props":137,"children":138},{},[139],{"type":17,"tag":39,"props":140,"children":141},{},[142],{"type":17,"tag":39,"props":143,"children":144},{},[145],{"type":23,"value":146},"1. MindElec v0.1",{"type":17,"tag":25,"props":148,"children":149},{},[150],{"type":17,"tag":39,"props":151,"children":152},{},[153],{"type":23,"value":154},"MindElec电磁仿真套件主要由多模数据转换、高维数据编码、基础模型库以及多频信号网络优化等组成，同时支持时域和频域的电磁仿真。其计算过程如下：利用MindElec多模数据转换技术将复杂的CAD结构转换成AI亲和的张量数据，高维的张量数据通过编码方式进行压缩，大幅减少存储和计算量，压缩后的张量数据进入创新的AI电磁仿真基础模型进行训练，训练过程结合多频信号网络优化技术提升模型精度。",{"type":17,"tag":25,"props":156,"children":157},{},[158],{"type":17,"tag":39,"props":159,"children":160},{},[161],{"type":17,"tag":29,"props":162,"children":164},{"alt":7,"src":163},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/a527538596714ecf9a15eb5ec5a834ef.jpg",[],{"type":17,"tag":25,"props":166,"children":167},{},[168],{"type":17,"tag":39,"props":169,"children":170},{},[171],{"type":23,"value":172},"MindElec 0.1版本在手机电磁仿真领域已取得技术突破，仿真精度媲美传统科学计算软件，同时性能提升10倍。",{"type":17,"tag":25,"props":174,"children":175},{},[176],{"type":17,"tag":39,"props":177,"children":178},{},[179],{"type":17,"tag":29,"props":180,"children":182},{"alt":7,"src":181},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/0ac37d0cf7c94510b432089defadc266.jpg",[],{"type":17,"tag":25,"props":184,"children":185},{},[186],{"type":17,"tag":39,"props":187,"children":188},{},[189],{"type":17,"tag":39,"props":190,"children":191},{},[192],{"type":23,"value":193},"2. MindSPONGE v0.1",{"type":17,"tag":25,"props":195,"children":196},{},[197],{"type":17,"tag":39,"props":198,"children":199},{},[200],{"type":23,"value":201},"MindSPONGE是由高毅勤课题组（北京大学、深圳湾实验室）、华为MindSpore团队联合开发的分子模拟库，具有高性能、模块化等特性。",{"type":17,"tag":25,"props":203,"children":204},{},[205],{"type":17,"tag":39,"props":206,"children":207},{},[208],{"type":17,"tag":29,"props":209,"children":211},{"alt":7,"src":210},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/c67f4d8075254498918e8f5397b4a01f.jpg",[],{"type":17,"tag":25,"props":213,"children":214},{},[215],{"type":17,"tag":39,"props":216,"children":217},{},[218],{"type":23,"value":219},"MindSPONGE本次独立成仓，演进为0.1版本，新增支持分子动力学中常见的系综模拟包含NVT、NPT等，例如进行新冠病毒Delta毒株模拟，模拟结果有效反应病毒毒性增强，符合实际情况。MindSPONGE是第一个根植于AI框架的分子模拟工具，当前已内置Molecular CT，SchNet等AI神经网络，可用来进行势能函数的拟合，例如AI力场模拟克莱森重排反应，高效进行融合AI的分子动力学模拟，可看到体系在七元环和三元环之间进行转化。",{"type":17,"tag":25,"props":221,"children":222},{},[223],{"type":17,"tag":39,"props":224,"children":225},{},[226],{"type":17,"tag":29,"props":227,"children":229},{"alt":7,"src":228},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/4e6787ae97fc44ef8c0b829ad8d7a67f.jpg",[],{"type":17,"tag":25,"props":231,"children":232},{},[233],{"type":17,"tag":39,"props":234,"children":235},{},[236],{"type":23,"value":237},"抗生素的出现让人类的寿命延长了数十年，然而，由于细菌的耐药性变强，人类迫切需要寻找到下一代抗生素——抗菌肽（作为一种可以有效杀灭耐药性病原菌的肽类物质）。MindSpore团队与鹏城实验室等团队合作开发的鹏程.神农平台具有强大的氨基酸序列生成能力，其利用鹏程.盘古大模型完成预训练再通过finetune生成新的氨基酸序列，有望极大提升新型抗菌肽的发现速度。",{"type":17,"tag":25,"props":239,"children":240},{},[241],{"type":17,"tag":39,"props":242,"children":243},{},[244],{"type":17,"tag":29,"props":245,"children":247},{"alt":7,"src":246},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/0e52f35796a446aabe1e5195f519ee4a.jpg",[],{"type":17,"tag":25,"props":249,"children":250},{},[251],{"type":17,"tag":39,"props":252,"children":253},{},[254],{"type":17,"tag":39,"props":255,"children":256},{},[257],{"type":23,"value":258},"二 自动并行支持混合专家（MoE）与异构并行",{"type":17,"tag":25,"props":260,"children":261},{},[262],{"type":17,"tag":39,"props":263,"children":264},{},[265],{"type":23,"value":266},"既联合中科院发布全球首个三模态大模型—紫东.太初，又实现遥感领域超分辨率图像自动切分。",{"type":17,"tag":25,"props":268,"children":269},{},[270],{"type":17,"tag":39,"props":271,"children":272},{},[273],{"type":17,"tag":39,"props":274,"children":275},{},[276],{"type":23,"value":277},"1. 混合专家（MoE）及其并行",{"type":17,"tag":25,"props":279,"children":280},{},[281],{"type":17,"tag":39,"props":282,"children":283},{},[284],{"type":23,"value":285},"基于Transformer扩展的大模型是当前各种大模型的主干，现在，混合专家（Mixture of Expert，MoE）结构成为扩展Transformer的一种关键技术。",{"type":17,"tag":25,"props":287,"children":288},{},[289],{"type":17,"tag":39,"props":290,"children":291},{},[292],{"type":23,"value":293},"如下图所示，Transformer中每层是由Attention和FeedForward（FFN）这两个基础结构组成的。将FFN看做是一个专家（expert），MoE结构是由多个专家并行组成，其入口是一个路由器（router），负责将token分发给各个专家，可以有多种路由策略可选择（如Top,Top2等），其出口是加权求和。",{"type":17,"tag":25,"props":295,"children":296},{},[297],{"type":17,"tag":39,"props":298,"children":299},{},[300],{"type":17,"tag":29,"props":301,"children":303},{"alt":7,"src":302},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/690c15fd21aa486a9eb06bfd7896646b.jpg",[],{"type":17,"tag":25,"props":305,"children":306},{},[307],{"type":17,"tag":39,"props":308,"children":309},{},[310],{"type":23,"value":311},"MoE已被验证过在多种任务上有优异的效果，是万亿以上大模型的基础结构。MindSpore 1.5版本已实现了MoE的结构和专家并行的功能：允许多专家在多设备上并行执行。如下图所示，路由器（数据并行）经过AllToAll算子将token分配到各个设备上的专家进行计算，而后，又进过AllToAll将结果汇聚。",{"type":17,"tag":25,"props":313,"children":314},{},[315],{"type":17,"tag":39,"props":316,"children":317},{},[318],{"type":17,"tag":29,"props":319,"children":321},{"alt":7,"src":320},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/eb88cac2f5174a02b10a96b156c46d04.jpg",[],{"type":17,"tag":25,"props":323,"children":324},{},[325],{"type":17,"tag":39,"props":326,"children":327},{},[328,330],{"type":23,"value":329},"MindSpore MoE的代码实现详见：",{"type":17,"tag":62,"props":331,"children":334},{"href":332,"rel":333},"https://gitee.com/mindspore/mindspore/blob/r1.5/mindspore/parallel/nn",[66],[335],{"type":23,"value":332},{"type":17,"tag":25,"props":337,"children":338},{},[339],{"type":17,"tag":39,"props":340,"children":341},{},[342],{"type":17,"tag":39,"props":343,"children":344},{},[345],{"type":23,"value":346},"2. 异构并行",{"type":17,"tag":25,"props":348,"children":349},{},[350],{"type":17,"tag":39,"props":351,"children":352},{},[353],{"type":23,"value":354},"受限于GPU/NPU设备的内存瓶颈，有效利用Host端的内存成为解决大模型扩展的一种可行的途径。异构并行训练方法是通过分析图上算子内存占用和计算密集程度，将内存消耗巨大和适合CPU处理的算子切分到CPU子图，将内存消耗较小计算密集的算子切分到硬件加速器子图，框架协同不同子图进行网络训练的过程，能够充分利用异构硬件特点，有效的提升单卡可训练模型规模。",{"type":17,"tag":25,"props":356,"children":357},{},[358],{"type":17,"tag":39,"props":359,"children":360},{},[361],{"type":17,"tag":29,"props":362,"children":364},{"alt":7,"src":363},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/35ba455b9fd94f72911a3b91b51fd6c0.jpg",[],{"type":17,"tag":25,"props":366,"children":367},{},[368],{"type":17,"tag":39,"props":369,"children":370},{},[371],{"type":23,"value":372},"对于大规模预训练模型，其主要的瓶颈往往在于参数量过大，设备显存无法存放下来。MindSpore1.5版本在处理大规模预训练网络时，可以通过优化器异构将优化器指定到CPU上，以减少优化器状态量显存占用开销，进而扩展可训练模型规模。如下图所示，将FP32的Adam优化器放置于CPU上进行运算，可以减少60%多的参数显存占用。",{"type":17,"tag":25,"props":374,"children":375},{},[376],{"type":17,"tag":39,"props":377,"children":378},{},[379],{"type":17,"tag":29,"props":380,"children":382},{"alt":7,"src":381},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/eec42030c534458f86ee4fe60ac9fb5f.jpg",[],{"type":17,"tag":25,"props":384,"children":385},{},[386,388],{"type":23,"value":387},"****查看文档：",{"type":17,"tag":39,"props":389,"children":390},{},[391],{"type":17,"tag":62,"props":392,"children":395},{"href":393,"rel":394},"https://www.mindspore.cn/docs/programming_guide/zh-CN/r1.5/design/heterogeneous_training.html",[66],[396],{"type":17,"tag":39,"props":397,"children":398},{},[399],{"type":23,"value":393},{"type":17,"tag":25,"props":401,"children":402},{},[403],{"type":17,"tag":39,"props":404,"children":405},{},[406],{"type":23,"value":407},"MindSpore联合中科院自动化所发布全球首个三模态大模型—紫东.太初，多模态高效协同支撑图文跨模态理解与生成性能领先SOTA、视频理解与描述性能全球No.1，持续赋能行业，助力人工智能产业繁荣发展。",{"type":17,"tag":25,"props":409,"children":410},{},[411],{"type":17,"tag":39,"props":412,"children":413},{},[414],{"type":17,"tag":39,"props":415,"children":416},{},[417],{"type":23,"value":418},"3. MoE+异构并行，实现32卡训练2420亿参数模型",{"type":17,"tag":25,"props":420,"children":421},{},[422],{"type":17,"tag":39,"props":423,"children":424},{},[425],{"type":23,"value":426},"我们使用MoE结构扩展鹏程·盘古模型[1]，同时应用了专家并行+异构并行+数据并行+模型并行。如下示意图，将优化器相关的状态及其计算放到CPU端。在MoE结构中，同时应用了模型并行和专家并行，即在同一专家会切分到Server内部，如图中Server 1上的FFN1被切分到了两个设备上，由此产生的模型并行AllReduce会发生在Server内部；而不同Server的对应设备间是数据并行（和专家并行），即Server 1上的Device 1与Server 2上的Device 1是数据并行（和专家并行），Server 1上的Device 2与Server 2上的Device 2是数据并行（和专家并行），由此产生的AllToAll会发生在Server间。AllToAll用于完成数据并行到专家并行的转换和专家并行到数据并行的转换。",{"type":17,"tag":25,"props":428,"children":429},{},[430],{"type":17,"tag":39,"props":431,"children":432},{},[433],{"type":17,"tag":29,"props":434,"children":436},{"alt":7,"src":435},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/a67ced4320a6481f8ff5caac30a06c5a.jpg",[],{"type":17,"tag":25,"props":438,"children":439},{},[440,445,447],{"type":17,"tag":39,"props":441,"children":442},{},[443],{"type":23,"value":444},"我们分别在8卡、16卡、32卡昇腾设备上验证了优化器异构和专家并行对训练模型规模提升的效果，如下图所示，使用优化器异构基本都能达到",{"type":23,"value":446},"3倍",{"type":17,"tag":39,"props":448,"children":449},{},[450],{"type":23,"value":451},"的模型规模提升，在8卡上可以跑到612亿参数量，16卡上可以跑到1210亿参数量，32卡上可以跑到2420亿参数量的模型规模。",{"type":17,"tag":25,"props":453,"children":454},{},[455],{"type":17,"tag":39,"props":456,"children":457},{},[458],{"type":17,"tag":29,"props":459,"children":461},{"alt":7,"src":460},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/226b9330e4144464b29651776cbfe766.jpg",[],{"type":17,"tag":25,"props":463,"children":464},{},[465],{"type":17,"tag":39,"props":466,"children":467},{},[468],{"type":17,"tag":39,"props":469,"children":470},{},[471],{"type":23,"value":472},"4. 超分辨率图像自动并行，解决遥感影像“大幅面、多通道”的处理难题",{"type":17,"tag":25,"props":474,"children":475},{},[476],{"type":17,"tag":39,"props":477,"children":478},{},[479],{"type":23,"value":480},"超分辨率图像往往非常大，以遥感图像为例，分辨率是4*30000*30000，一张图片约14GB，单卡受限于内存无法完成计算，需要对图片进行多机多卡的并行处理。",{"type":17,"tag":25,"props":482,"children":483},{},[484],{"type":17,"tag":39,"props":485,"children":486},{},[487],{"type":23,"value":488},"在数据处理的过程中，支持对大幅面遥感影像的解码和数据增强，针对单样本尺寸大的特点，框架根据集群规模的大小，自动将大幅面数据切分成合适的大小（如切分H、W维度），并分发到不同的计算节点，以解决显存不足问题。",{"type":17,"tag":25,"props":490,"children":491},{},[492],{"type":17,"tag":39,"props":493,"children":494},{},[495],{"type":23,"value":496},"在训练和推理过程中，由于网络将对图片进行大量的卷积等计算，而图片的H、W维被切分后，对每个计算节点来说，可能有部分边缘特征信息存储在其他节点上，框架将自动识别边缘特征信息的分布情况，采用相邻节点交换等通信技术对分布在周边节点上的特征信息进行整合，最终保证网络执行结果无精度损失。",{"type":17,"tag":25,"props":498,"children":499},{},[500],{"type":17,"tag":39,"props":501,"children":502},{},[503],{"type":17,"tag":39,"props":504,"children":505},{},[506],{"type":23,"value":507},"三 推出亲和算法库——MindSpore Boost",{"type":17,"tag":25,"props":509,"children":510},{},[511],{"type":17,"tag":39,"props":512,"children":513},{},[514],{"type":23,"value":515},"众所周知，训练是一个复杂的计算过程，端到端训练包含很多步骤。如下图所示，深度学习训练过程本身是个高冗余的计算过程，需要围绕多个模块分别进行计算优化，最终实现不同AI场景下端到端训练的效率优化。",{"type":17,"tag":25,"props":517,"children":518},{},[519],{"type":17,"tag":39,"props":520,"children":521},{},[522],{"type":17,"tag":29,"props":523,"children":525},{"alt":7,"src":524},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/12efba73d727466faf8e98a12807fb61.png",[],{"type":17,"tag":25,"props":527,"children":528},{},[529],{"type":17,"tag":39,"props":530,"children":531},{},[532],{"type":23,"value":533},"端到端训练要素",{"type":17,"tag":25,"props":535,"children":536},{},[537],{"type":17,"tag":39,"props":538,"children":539},{},[540],{"type":23,"value":541},"在MindSpore 1.5版本中，华为中央媒体技术院与MindSpore共同推出亲和算法库MindSpore Boost 1.0，目标都是为了在不同的AI场景下，保持用户训练精度的同时，为用户提供高效的训练体验，包含数据、网络、通信、训练策略和优化器等维度的加速算法，架构图如下所示。",{"type":17,"tag":25,"props":543,"children":544},{},[545],{"type":17,"tag":39,"props":546,"children":547},{},[548],{"type":17,"tag":29,"props":549,"children":551},{"alt":7,"src":550},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/d9a2fb0b87e7462eb2075cdcc324b9c8.png",[],{"type":17,"tag":25,"props":553,"children":554},{},[555],{"type":17,"tag":39,"props":556,"children":557},{},[558],{"type":23,"value":559},"MindSpore Boost 1.0架构",{"type":17,"tag":25,"props":561,"children":562},{},[563,568],{"type":17,"tag":39,"props":564,"children":565},{},[566],{"type":23,"value":567},"除了亲和算法外，我们还提供",{"type":23,"value":569},"简易模式**，进行算法封装，为用户提供三种不同层级的选择，即O1/O2/O3，随着层级的递增，其加速比例增加，这种模式下，用户无需了解算法细节， 仅需要在调用Model的训练入口时，打开加速开关和选择加速层级即可，使用方法如下图所示。**",{"type":17,"tag":25,"props":571,"children":572},{},[573],{"type":17,"tag":39,"props":574,"children":575},{},[576],{"type":17,"tag":29,"props":577,"children":579},{"alt":7,"src":578},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/fa786142e35a486083cee63bd32cc40e.png",[],{"type":17,"tag":25,"props":581,"children":582},{},[583],{"type":17,"tag":39,"props":584,"children":585},{},[586],{"type":23,"value":587},"简易模式使用示意",{"type":17,"tag":25,"props":589,"children":590},{},[591],{"type":17,"tag":39,"props":592,"children":593},{},[594],{"type":17,"tag":39,"props":595,"children":596},{},[597],{"type":23,"value":598},"四 集群调试调优支持大规模分布式训练",{"type":17,"tag":25,"props":600,"children":601},{},[602],{"type":17,"tag":39,"props":603,"children":604},{},[605],{"type":23,"value":606},"大模型是当前深度学习领域研究的热点之一。模型的参数量和训练数据集的大小均以指数级的规模快速增长。以MindSpore和鹏城实验室共同发布的鹏程·盘古模型为例，模型的参数量达到了2000亿，使用2K集群历时数月进行训练。在这样的背景下，模型性能调优对减少训练时间和成本有着至关重要的意义。",{"type":17,"tag":25,"props":608,"children":609},{},[610],{"type":17,"tag":39,"props":611,"children":612},{},[613],{"type":23,"value":614},"MindSpore 1.5版本发布集群调试调优工具链，针对K级集群性能数据能够做到一键收集，提供集群慢节点/慢网络、计算通信比、内存热力图等多维性能分析与可视化能力，结合智能集群调优建议，达成小时级性能瓶颈定位。",{"type":17,"tag":25,"props":616,"children":617},{},[618],{"type":17,"tag":39,"props":619,"children":620},{},[621],{"type":17,"tag":39,"props":622,"children":623},{},[624],{"type":23,"value":625},"1. 集群迭代&通信性能分析",{"type":17,"tag":25,"props":627,"children":628},{},[629],{"type":17,"tag":39,"props":630,"children":631},{},[632],{"type":23,"value":633},"以集群视角汇总了多项性能关键数据，并对多卡数据提供了排序、分析功能，用户可快速的从K级集群中找到慢节点、慢链路等，并从集群页面跳转到对应的单卡页面，进一步定界节点慢的原因，找到最小性能瓶颈点。",{"type":17,"tag":25,"props":635,"children":636},{},[637],{"type":17,"tag":39,"props":638,"children":639},{},[640],{"type":17,"tag":29,"props":641,"children":643},{"alt":7,"src":642},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/78bb370a829e4759b099f6a6c76a8018.jpg",[],{"type":17,"tag":25,"props":645,"children":646},{},[647],{"type":17,"tag":39,"props":648,"children":649},{},[650],{"type":17,"tag":39,"props":651,"children":652},{},[653],{"type":23,"value":654},"2. 计算通信比分析",{"type":17,"tag":25,"props":656,"children":657},{},[658],{"type":17,"tag":39,"props":659,"children":660},{},[661],{"type":23,"value":662},"集群并行训练过程中，通信是影响性能的重要因素，计算通信比指标可以帮助开发者分析网络切分策略是否合理以及是否有优化空间。如下图所示，非overlap 87ms是开发者可关注的性能提升空间。",{"type":17,"tag":25,"props":664,"children":665},{},[666],{"type":17,"tag":39,"props":667,"children":668},{},[669],{"type":17,"tag":29,"props":670,"children":672},{"alt":7,"src":671},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/9b73b70abd1a4f0686fd621df0a3b5be.jpg",[],{"type":17,"tag":25,"props":674,"children":675},{},[676,677],{"type":23,"value":387},{"type":17,"tag":39,"props":678,"children":679},{},[680],{"type":17,"tag":62,"props":681,"children":684},{"href":682,"rel":683},"https://www.mindspore.cn/mindinsight/docs/zh-CN/r1.5/performance_profiling_ascend_of_cluster.html",[66],[685],{"type":17,"tag":39,"props":686,"children":687},{},[688],{"type":23,"value":682},{"type":17,"tag":25,"props":690,"children":691},{},[692],{"type":17,"tag":39,"props":693,"children":694},{},[695],{"type":17,"tag":39,"props":696,"children":697},{},[698],{"type":23,"value":699},"五 MindSpore Lite新增对外开放机制，支持Hi3516/3549芯片以及更多异构硬件的对接",{"type":17,"tag":25,"props":701,"children":702},{},[703],{"type":17,"tag":39,"props":704,"children":705},{},[706],{"type":23,"value":707},"此版本中，MindSpore Lite新增了两个对外开放的接入机制：支持南向自定义算子接入，支持第三方AI框架通过Delegate机制接入。",{"type":17,"tag":25,"props":709,"children":710},{},[711],{"type":17,"tag":39,"props":712,"children":713},{},[714],{"type":23,"value":715},"南向自定义算子的接入功能，支持用户自定义图优化能力，实现在离线阶段生成特定硬件支持的模型文件，同时支持特有硬件算子接入MindSpore Lite Runtime，实现MindSpore Lite在第三方硬件上高性能推理，当前我们已经接入Hi3516/3559芯片，使机器视觉AI应用开发更加便捷。",{"type":17,"tag":25,"props":717,"children":718},{},[719],{"type":17,"tag":39,"props":720,"children":721},{},[722],{"type":17,"tag":29,"props":723,"children":725},{"alt":7,"src":724},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/cc4a33e570b943ca9aea4329492579a5.png",[],{"type":17,"tag":25,"props":727,"children":728},{},[729],{"type":17,"tag":39,"props":730,"children":731},{},[732],{"type":23,"value":733},"第三方专用AI芯片南向接入MindSpore Lite",{"type":17,"tag":25,"props":735,"children":736},{},[737,738],{"type":23,"value":387},{"type":17,"tag":39,"props":739,"children":740},{},[741],{"type":17,"tag":62,"props":742,"children":745},{"href":743,"rel":744},"https://www.mindspore.cn/lite/docs/zh-CN/r1.5/use/register_kernel.html",[66],[746],{"type":17,"tag":39,"props":747,"children":748},{},[749],{"type":23,"value":743},{"type":17,"tag":25,"props":751,"children":752},{},[753],{"type":17,"tag":39,"props":754,"children":755},{},[756],{"type":23,"value":757},"Delegate机制，支持有构图能力的第三方AI框架接入MindSpore Lite，充分利用外部AI框架提供的特有硬件算子库或者更优越的推理性能。采用Delegate实现了 Lite+其他AI框架的异构执行，保持了离线模型一致性，当前我们已经通过Delegate机制支持了Kirin NPU以及更多异构硬件。",{"type":17,"tag":25,"props":759,"children":760},{},[761],{"type":17,"tag":39,"props":762,"children":763},{},[764],{"type":17,"tag":29,"props":765,"children":767},{"alt":7,"src":766},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/f2e2450f336240d8bcdca5893f191199.png",[],{"type":17,"tag":25,"props":769,"children":770},{},[771],{"type":17,"tag":39,"props":772,"children":773},{},[774],{"type":23,"value":775},"通过Delegate接入MindSpore Lite",{"type":17,"tag":25,"props":777,"children":778},{},[779,780],{"type":23,"value":387},{"type":17,"tag":39,"props":781,"children":782},{},[783],{"type":17,"tag":62,"props":784,"children":787},{"href":785,"rel":786},"https://www.mindspore.cn/lite/docs/zh-CN/r1.5/use/delegate.html",[66],[788],{"type":17,"tag":39,"props":789,"children":790},{},[791],{"type":23,"value":785},{"type":17,"tag":25,"props":793,"children":794},{},[795],{"type":17,"tag":39,"props":796,"children":797},{},[798],{"type":17,"tag":39,"props":799,"children":800},{},[801],{"type":23,"value":802},"六 灵活表达：完善控制流，支持多种控制语句混合编写，支持循环自动微分",{"type":17,"tag":25,"props":804,"children":805},{},[806],{"type":17,"tag":39,"props":807,"children":808},{},[809],{"type":23,"value":810},"在此版本中，在控制流语法的使用方面我们提供以下支持与优化：",{"type":17,"tag":25,"props":812,"children":813},{},[814],{"type":17,"tag":39,"props":815,"children":816},{},[817],{"type":23,"value":818},"1）进一步强化了对于静态图控制流的支持，通过使用虚拟机机制执行控制流算子，解决了控制流非尾递归场景的图递归执行问题，实现了对循环求反向的支持。同时，我们扩大了控制流的语法支持范围，目前控制流已可以支持if、while、for、break、continue表达。一个if语句基于虚拟机机制的控制流执行流程如图所示：",{"type":17,"tag":25,"props":820,"children":821},{},[822],{"type":17,"tag":39,"props":823,"children":824},{},[825],{"type":17,"tag":29,"props":826,"children":828},{"alt":7,"src":827},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/ee70a3b7158c4fb8a4d09147a249ed89.jpg",[],{"type":17,"tag":25,"props":830,"children":831},{},[832],{"type":17,"tag":39,"props":833,"children":834},{},[835],{"type":23,"value":836},"2）优化静态图编译过程，减少了控制流网络的子图数量，大幅提升部分复杂控制流网络场景下的编译性能和执行性能。",{"type":17,"tag":25,"props":838,"children":839},{},[840],{"type":17,"tag":39,"props":841,"children":842},{},[843],{"type":23,"value":844},"3）支持控制流MindIR导入导出功能，可以在云侧训练控制流网络导出MindIR，在端侧导入MindIR进行推理。",{"type":17,"tag":25,"props":846,"children":847},{},[848,849],{"type":23,"value":387},{"type":17,"tag":39,"props":850,"children":851},{},[852],{"type":17,"tag":62,"props":853,"children":856},{"href":854,"rel":855},"https://www.mindspore.cn/docs/programming_guide/zh-CN/r1.5/control_flow.html",[66],[857],{"type":17,"tag":39,"props":858,"children":859},{},[860],{"type":23,"value":854},{"type":17,"tag":25,"props":862,"children":863},{},[864],{"type":17,"tag":39,"props":865,"children":866},{},[867],{"type":23,"value":868},"参考文献：",{"type":17,"tag":25,"props":870,"children":871},{},[872],{"type":17,"tag":39,"props":873,"children":874},{},[875,877,883],{"type":23,"value":876},"[1] Zeng, Wei, et al. \"PanGu-$\\alpha $: Large-scale Autoregressive Pretrained Chinese Language Models with Auto-parallel Computation.\" ",{"type":17,"tag":878,"props":879,"children":880},"em",{},[881],{"type":23,"value":882},"arXiv preprint arXiv:2104.12369",{"type":23,"value":884}," (2021).",{"type":17,"tag":25,"props":886,"children":887},{},[888],{"type":17,"tag":39,"props":889,"children":890},{},[891],{"type":17,"tag":39,"props":892,"children":893},{},[894],{"type":23,"value":895},"往期回顾",{"type":17,"tag":25,"props":897,"children":898},{},[899],{"type":17,"tag":39,"props":900,"children":901},{},[902],{"type":17,"tag":62,"props":903,"children":906},{"href":904,"rel":905},"http://mp.weixin.qq.com/s?__biz=MzAxMDA1MDM0NQ==&mid=2247537595&idx=1&sn=70ffc4ee5a468e8c844756d9b16ea0f6&chksm=9b545dfdac23d4ebaff8da4e22d88e2615b02a8214cfb21b6ee799e6a22f8da06ad2b3c984c4&scene=21#wechat_redirect",[66],[907],{"type":17,"tag":39,"props":908,"children":909},{},[910],{"type":23,"value":911},"MindSpore 1.3，打造无所不在的智能，诠释可以信赖的开源",{"type":17,"tag":25,"props":913,"children":914},{},[915],{"type":17,"tag":39,"props":916,"children":917},{},[918],{"type":17,"tag":62,"props":919,"children":922},{"href":920,"rel":921},"http://mp.weixin.qq.com/s?__biz=MzAxMDA1MDM0NQ==&mid=2247531682&idx=1&sn=c47f2f665d0fcfc6f8fdb5a2fb090546&chksm=9b5472e4ac23fbf225f1ac09ed29f34bdf477a1638bd0a369731585032b30b99c224765ef0a2&scene=21#wechat_redirect",[66],[923],{"type":17,"tag":39,"props":924,"children":925},{},[926],{"type":23,"value":927},"MindSpore 1.2，国内首个支持千亿参数大模型训练的AI计算框架",{"type":17,"tag":25,"props":929,"children":930},{},[931],{"type":17,"tag":39,"props":932,"children":933},{},[934],{"type":17,"tag":62,"props":935,"children":938},{"href":936,"rel":937},"http://mp.weixin.qq.com/s?__biz=MzAxMDA1MDM0NQ==&mid=2247504579&idx=1&sn=7e113bf60c5756c76bdf55557ff38951&chksm=9b54dc85ac235593b0969a6a7df5f039207165e407fbb089bc161edbf2905be531aefd612d67&scene=21#wechat_redirect",[66],[939],{"type":17,"tag":39,"props":940,"children":941},{},[942],{"type":23,"value":943},"MindSpore 1.1，给你最值得期待的2021",{"type":17,"tag":25,"props":945,"children":946},{},[947],{"type":17,"tag":39,"props":948,"children":949},{},[950],{"type":17,"tag":29,"props":951,"children":953},{"alt":7,"src":952},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2021/09/26/95889cf1165c4398ba82c7df4a71485d.jpg",[],{"title":7,"searchDepth":955,"depth":955,"links":956},4,[],"markdown","content:version-updates:zh:734.md","content","version-updates/zh/734.md","version-updates/zh/734","md",1776506145871]