[{"data":1,"prerenderedAt":570},["ShallowReactive",2],{"content-query-pcZAJ7DLrj":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":564,"_id":565,"_source":566,"_file":567,"_stem":568,"_extension":569},"\u002Ftechnology-blogs\u002Fzh\u002F2026-8-27","zh",false,"","MindSpore Lite使能具身智能（VLA）OpenPi 0.5 在300I Duo & 香橙派上高效部署实践","本文基于MindSpore Lite推理框架，在Atlas 300I Duo与香橙派硬件平台实现π0.5的完整部署与深度性能优化。","2026-8-27","https:\u002F\u002Fobs-mindspore-file.obs.cn-north-4.myhuaweicloud.com\u002Ffile\u002F2024\u002F11\u002F28\u002F8e0e0150508a4c5ba4287fa3bec8ea3f.png","technology-blogs","技术解读",{"type":15,"children":16,"toc":548},"root",[17,25,30,37,42,53,73,79,86,91,98,104,109,116,121,127,133,138,145,151,158,163,170,213,219,224,231,275,282,288,293,343,349,354,359,366,372,377,413,422,427,435,458,465,471,476,482,489,495,502,508,513,518,529,534,543],{"type":18,"tag":19,"props":20,"children":21},"element","p",{},[22],{"type":23,"value":24},"text","具身智能VLA模型π0.5在边缘部署时面临“2B骨干串行300M专家、10步迭代去噪”带来的严峻时延挑战，对推理框架的图编译效率与硬件算力调度提出极高要求。",{"type":18,"tag":19,"props":26,"children":27},{},[28],{"type":23,"value":29},"本文基于MindSpore Lite推理框架，在Atlas 300I Duo与香橙派硬件平台实现π0.5的完整部署与深度性能优化。通过双模型拆分KV-cache复用、设备端零拷贝内存管理及CANN原生算子融合等核心技术，端到端推理时延压至270ms，为VLA类扩散模型在资源受限场景的部署提供了一套可复用的工程化实践方案。",{"type":18,"tag":31,"props":32,"children":34},"h1",{"id":33},"_01-部署背景与挑战",[35],{"type":23,"value":36},"01 部署背景与挑战",{"type":18,"tag":19,"props":38,"children":39},{},[40],{"type":23,"value":41},"π0.5 是 Physical Intelligence（PI）2025-04 发布的 视觉-语言-动作（VLA）模型，主打\"开放世界泛化\"——能进入从未见过的真实家庭执行 10–15 分钟的长程灵巧操作。其部署形态是 端到端从图像+语言指令直接生成高频连续机器人动作。",{"type":18,"tag":43,"props":44,"children":46},"div",{"style":45},"text-align: center;",[47],{"type":18,"tag":48,"props":49,"children":52},"img",{"src":50,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F1.jpg","display: block;margin: 0 auto;max-width:60%",[],{"type":18,"tag":54,"props":55,"children":56},"ul",{},[57,63,68],{"type":18,"tag":58,"props":59,"children":60},"li",{},[61],{"type":23,"value":62},"Atlas 300I Duo 强项是 FP16\u002FINT8 GEMM，功耗与成本远低于旗舰训练卡，适合云侧规模化推理与边缘部署。",{"type":18,"tag":58,"props":64,"children":65},{},[66],{"type":23,"value":67},"MindSpore Lite 提供图编译优化、CANN融合算子接入、设备端零拷贝 Tensor 等能力，匹配 π0.5\"小批量 + 多步循环 + KV 复用\"的推理需求。",{"type":18,"tag":58,"props":69,"children":70},{},[71],{"type":23,"value":72},"香橙派（OrangePi）联合 Atlas 300I Duo 可实现边缘侧的轻量化部署。",{"type":18,"tag":31,"props":74,"children":76},{"id":75},"_02-模-型-结-构",[77],{"type":23,"value":78},"02 模 型 结 构",{"type":18,"tag":80,"props":81,"children":83},"h2",{"id":82},"_21-双-transformer-架构",[84],{"type":23,"value":85},"2.1 双 Transformer 架构",{"type":18,"tag":19,"props":87,"children":88},{},[89],{"type":23,"value":90},"π0.5 Base 是一个受 Transfusion 启发的\"单序列、双权重\"模型：VLM 骨干与动作专家共享 Self-Attention，但 FFN 独立。其推理流水线天然可拆成两段计算：",{"type":18,"tag":43,"props":92,"children":93},{"style":45},[94],{"type":18,"tag":48,"props":95,"children":97},{"src":96,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F2.jpg",[],{"type":18,"tag":80,"props":99,"children":101},{"id":100},"_22-flow-matching-推理",[102],{"type":23,"value":103},"2.2 Flow Matching 推理",{"type":18,"tag":19,"props":105,"children":106},{},[107],{"type":23,"value":108},"从纯噪声出发，沿线性最优传输（Linear OT）路径积分 10 步得到动作：",{"type":18,"tag":43,"props":110,"children":111},{"style":45},[112],{"type":18,"tag":48,"props":113,"children":115},{"src":114,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F3.jpg",[],{"type":18,"tag":19,"props":117,"children":118},{},[119],{"type":23,"value":120},"关键：10步足够、每步只跑300M专家、FP32累加保证数值稳定。",{"type":18,"tag":31,"props":122,"children":124},{"id":123},"_03-mindspore-lite-推理实现",[125],{"type":23,"value":126},"03 MindSpore Lite 推理实现",{"type":18,"tag":80,"props":128,"children":130},{"id":129},"_31-模型迁移路径",[131],{"type":23,"value":132},"3.1 模型迁移路径",{"type":18,"tag":19,"props":134,"children":135},{},[136],{"type":23,"value":137},"整体部署流水线：",{"type":18,"tag":43,"props":139,"children":140},{"style":45},[141],{"type":18,"tag":48,"props":142,"children":144},{"src":143,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F4.jpg",[],{"type":18,"tag":80,"props":146,"children":148},{"id":147},"_32-核心优化技术",[149],{"type":23,"value":150},"3.2 核心优化技术",{"type":18,"tag":152,"props":153,"children":155},"h3",{"id":154},"_321-双模型拆分-前缀-kv-cache-复用",[156],{"type":23,"value":157},"3.2.1 双模型拆分 = 前缀 KV-cache 复用",{"type":18,"tag":19,"props":159,"children":160},{},[161],{"type":23,"value":162},"这是把 π0.5 推理延迟从\"10 倍全模型前向\"压到\"1 倍骨干 + 10 倍小专家\"的根本手段：",{"type":18,"tag":43,"props":164,"children":165},{"style":45},[166],{"type":18,"tag":48,"props":167,"children":169},{"src":168,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F5.jpg",[],{"type":18,"tag":54,"props":171,"children":172},{},[173,187,208],{"type":18,"tag":58,"props":174,"children":175},{},[176,178,185],{"type":23,"value":177},"Prefix Encoder 内部对 PaliGemma 调用 ",{"type":18,"tag":179,"props":180,"children":182},"code",{"className":181},[],[183],{"type":23,"value":184},"use_cache=True",{"type":23,"value":186},"，直接导出每层 KV。",{"type":18,"tag":58,"props":188,"children":189},{},[190,192,198,200,206],{"type":23,"value":191},"Denoise Step 用轻量 ",{"type":18,"tag":179,"props":193,"children":195},{"className":194},[],[196],{"type":23,"value":197},"SimpleCache",{"type":23,"value":199}," 持有前缀 KV，对 Action Expert 调用 ",{"type":18,"tag":179,"props":201,"children":203},{"className":202},[],[204],{"type":23,"value":205},"use_cache=False",{"type":23,"value":207},"。",{"type":18,"tag":58,"props":209,"children":210},{},[211],{"type":23,"value":212},"2B 骨干只前向一次，10 步循环主体只过 300M 专家，延迟分布被彻底重塑。",{"type":18,"tag":152,"props":214,"children":216},{"id":215},"_322-零拷贝-kv-cache",[217],{"type":23,"value":218},"3.2.2 零拷贝 KV Cache",{"type":18,"tag":19,"props":220,"children":221},{},[222],{"type":23,"value":223},"ZeroCopyKVCachePolicy 把前缀 KV 做成设备常驻 Tensor，在 10 步去噪间直接复用，不经 Host↔Device 往返：",{"type":18,"tag":43,"props":225,"children":226},{"style":45},[227],{"type":18,"tag":48,"props":228,"children":230},{"src":229,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F6.jpg",[],{"type":18,"tag":54,"props":232,"children":233},{},[234,262],{"type":18,"tag":58,"props":235,"children":236},{},[237,239,245,247,253,254,260],{"type":23,"value":238},"每步只把 ",{"type":18,"tag":179,"props":240,"children":242},{"className":241},[],[243],{"type":23,"value":244},"x_t",{"type":23,"value":246},"、",{"type":18,"tag":179,"props":248,"children":250},{"className":249},[],[251],{"type":23,"value":252},"timestep",{"type":23,"value":246},{"type":18,"tag":179,"props":255,"children":257},{"className":256},[],[258],{"type":23,"value":259},"prefix_pad_masks",{"type":23,"value":261},"（极小）从 Host 送入；36 个 KV 张量全程不动。",{"type":18,"tag":58,"props":263,"children":264},{},[265,267,273],{"type":23,"value":266},"省去的拷贝量：36 个 ",{"type":18,"tag":179,"props":268,"children":270},{"className":269},[],[271],{"type":23,"value":272},"(1,1,968,256)",{"type":23,"value":274}," 张量 ≈ fp16 每步 ~18 MB；10 步累计 ~180 MB 的 Host↔Device 搬运被完全消除。",{"type":18,"tag":43,"props":276,"children":277},{"style":45},[278],{"type":18,"tag":48,"props":279,"children":281},{"src":280,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F7.jpg",[],{"type":18,"tag":152,"props":283,"children":285},{"id":284},"_323-cann-rotarymul-算子融合",[286],{"type":23,"value":287},"3.2.3 CANN RotaryMul 算子融合",{"type":18,"tag":19,"props":289,"children":290},{},[291],{"type":23,"value":292},"RoPE 包装为 Custom ONNX 节点，转换后映射到 CANN 原生 RotaryMul 算子（y = x·cos + rotate_half(x)·sin）：",{"type":18,"tag":54,"props":294,"children":295},{},[296,309,338],{"type":18,"tag":58,"props":297,"children":298},{},[299,301,307],{"type":23,"value":300},"仅作用于 Action Expert（",{"type":18,"tag":179,"props":302,"children":304},{"className":303},[],[305],{"type":23,"value":306},"patch_denoise_expert_for_rope_fusion",{"type":23,"value":308},"），PaliGemma 骨干不动——因为专家跑 10 次，融合收益放大 10 倍。",{"type":18,"tag":58,"props":310,"children":311},{},[312,314,320,322,328,330,336],{"type":23,"value":313},"进一步优化：把 ",{"type":18,"tag":179,"props":315,"children":317},{"className":316},[],[318],{"type":23,"value":319},"[q, k]",{"type":23,"value":321}," 拼接后做一次 ",{"type":18,"tag":179,"props":323,"children":325},{"className":324},[],[326],{"type":23,"value":327},"RotaryMul",{"type":23,"value":329}," 再 split，将每层 Custom 节点从 2 个降到 1 个（",{"type":18,"tag":179,"props":331,"children":333},{"className":332},[],[334],{"type":23,"value":335},"FusedGemmaAttention",{"type":23,"value":337},"）。",{"type":18,"tag":58,"props":339,"children":340},{},[341],{"type":23,"value":342},"等效于把\"Q\u002FK 投影 → head split → RoPE → KV 写入\"在图编译期融合，减少访存与算子调度开销。",{"type":18,"tag":152,"props":344,"children":346},{"id":345},"_324-gelu-erf-展开",[347],{"type":23,"value":348},"3.2.4 GELU erf 展开",{"type":18,"tag":19,"props":350,"children":351},{},[352],{"type":23,"value":353},"π0.5 的 PaliGemma 与 Action Expert MLP 激活均配置为 gelu_pytorch_tanh。PyTorch 导出 ONNX 时会把它展开成 9 个 elementwise 算子，累积成显著开销。",{"type":18,"tag":19,"props":355,"children":356},{},[357],{"type":23,"value":358},"落地方案：FusedGelu 的 forward 直接写 erf 形式，PyTorch tracing 自然导出为标准 ONNX Mul\u002FErf\u002FAdd\u002FMul 算子，CANN 在 MindIR 转换期自动识别为单 Gelu kernel，性能收益：Prefix Encoder 从 224 ms 降到 162.6 ms（-27%）。",{"type":18,"tag":43,"props":360,"children":361},{"style":45},[362],{"type":18,"tag":48,"props":363,"children":365},{"src":364,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F8.jpg",[],{"type":18,"tag":152,"props":367,"children":369},{"id":368},"_325-混合精度-fp16-square-精度保护",[370],{"type":23,"value":371},"3.2.5 混合精度 FP16 + Square 精度保护",{"type":18,"tag":19,"props":373,"children":374},{},[375],{"type":23,"value":376},"ONNX 导出与 MindIR 转换均走 fp16，但对数值敏感算子做保护：",{"type":18,"tag":54,"props":378,"children":379},{},[380,400],{"type":18,"tag":58,"props":381,"children":382},{},[383,385,391,393,399],{"type":23,"value":384},"导出：模型先 ",{"type":18,"tag":179,"props":386,"children":388},{"className":387},[],[389],{"type":23,"value":390},"to_bfloat16_for_selected_params(\"float32\")",{"type":23,"value":392}," 再 ",{"type":18,"tag":179,"props":394,"children":396},{"className":395},[],[397],{"type":23,"value":398},"model.half()",{"type":23,"value":207},{"type":18,"tag":58,"props":401,"children":402},{},[403,405,411],{"type":23,"value":404},"转换配置 ",{"type":18,"tag":179,"props":406,"children":408},{"className":407},[],[409],{"type":23,"value":410},"config.ini",{"type":23,"value":412},"：",{"type":18,"tag":414,"props":415,"children":417},"pre",{"code":416},"[acl_build_options]  \nge.exec.precision_mode=allow_mix_precision_fp16  \nge.exec.modify_mixlist=\".\u002Fop_fp32.json\"\n",[418],{"type":18,"tag":179,"props":419,"children":420},{"__ignoreMap":7},[421],{"type":23,"value":416},{"type":18,"tag":19,"props":423,"children":424},{},[425],{"type":23,"value":426},"op_fp32.json 把 Square 强制保持 FP32（Square 是 RMSNorm x²→mean→rsqrt 路径上的关键算子，保 FP32 防止归一化精度退化）：",{"type":18,"tag":414,"props":428,"children":430},{"code":429},"{ \"black-list\": { \"to-add\": [\"Square\"] } }\n",[431],{"type":18,"tag":179,"props":432,"children":433},{"__ignoreMap":7},[434],{"type":23,"value":429},{"type":18,"tag":54,"props":436,"children":437},{},[438],{"type":18,"tag":58,"props":439,"children":440},{},[441,443,448,450,456],{"type":23,"value":442},"Euler 累加 FP32：推理脚本中 ",{"type":18,"tag":179,"props":444,"children":446},{"className":445},[],[447],{"type":23,"value":244},{"type":23,"value":449}," 累加全程 FP32，每步把 fp16 的 ",{"type":18,"tag":179,"props":451,"children":453},{"className":452},[],[454],{"type":23,"value":455},"v_t",{"type":23,"value":457}," 上转后再更新——保证 10 步积分的数值稳定。",{"type":18,"tag":43,"props":459,"children":460},{"style":45},[461],{"type":18,"tag":48,"props":462,"children":464},{"src":463,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F9.jpg",[],{"type":18,"tag":152,"props":466,"children":468},{"id":467},"_326-euler-积分循环编排",[469],{"type":23,"value":470},"3.2.6 Euler 积分循环编排",{"type":18,"tag":19,"props":472,"children":473},{},[474],{"type":23,"value":475},"10 步循环由 Python 编排（for step in range(10)），每步：填 x_t\u002Ftimestep\u002Fprefix_pad_masks 到 denoise 输入 → 拼接设备 KV → predict → Euler 更新。固定形状（50×32、968 前缀）使每步计算图确定，ascend_oriented 优化可充分生效。",{"type":18,"tag":31,"props":477,"children":479},{"id":478},"_04-性能基准",[480],{"type":23,"value":481},"04 性能基准",{"type":18,"tag":43,"props":483,"children":484},{"style":45},[485],{"type":18,"tag":48,"props":486,"children":488},{"src":487,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F10.jpg",[],{"type":18,"tag":31,"props":490,"children":492},{"id":491},"_05-竞争力分析",[493],{"type":23,"value":494},"05 竞争力分析",{"type":18,"tag":43,"props":496,"children":497},{"style":45},[498],{"type":18,"tag":48,"props":499,"children":501},{"src":500,"style":51,"alt":7},"\u002Fcategory\u002Finformation\u002Ftechnology-blogs\u002Fbanner\u002F2026-8-27\u002F11.jpg",[],{"type":18,"tag":31,"props":503,"children":505},{"id":504},"_06-欢迎加入-mindspore-lite",[506],{"type":23,"value":507},"06 欢迎加入 MindSpore Lite",{"type":18,"tag":19,"props":509,"children":510},{},[511],{"type":23,"value":512},"MindSpore Lite面向不同硬件设备提供轻量化AI推理加速能力，使能智能应用，为开发者提供端到端的解决方案。昇思MindSpore Lite始终秉持开源开放的合作理念，欢迎广大开发者参与共建。",{"type":18,"tag":19,"props":514,"children":515},{},[516],{"type":23,"value":517},"MindSpore Lite官网介绍：",{"type":18,"tag":19,"props":519,"children":520},{},[521],{"type":18,"tag":522,"props":523,"children":527},"a",{"href":524,"rel":525},"https:\u002F\u002Fwww.mindspore.cn\u002Flite\u002Fcloud_docs\u002Fzh-CN\u002Fmaster\u002Fquick_start\u002Fone_hour_introduction.html",[526],"nofollow",[528],{"type":23,"value":524},{"type":18,"tag":19,"props":530,"children":531},{},[532],{"type":23,"value":533},"开源社区实现：",{"type":18,"tag":19,"props":535,"children":536},{},[537],{"type":18,"tag":522,"props":538,"children":541},{"href":539,"rel":540},"https:\u002F\u002Fatomgit.com\u002Fmindspore\u002Fmindspore-lite\u002Ftree\u002Fmaster\u002Fmindspore-lite\u002Fexamples\u002Fbase_models\u002Fopen_pi_0.5",[526],[542],{"type":23,"value":539},{"type":18,"tag":19,"props":544,"children":545},{},[546],{"type":23,"value":547},"当前已适配场景：\nMindSpore Lite开源社区已适配视频生成、图片生成、VLM、LLM、ASR\u002FTTS、VLA、以及信息检索\u002F向量嵌入等多个场景的多个业务模型，后续会持续支持其他典型模型的推理加速。",{"title":7,"searchDepth":549,"depth":549,"links":550},4,[551,553,554,555],{"id":82,"depth":552,"text":85},2,{"id":100,"depth":552,"text":103},{"id":129,"depth":552,"text":132},{"id":147,"depth":552,"text":150,"children":556},[557,559,560,561,562,563],{"id":154,"depth":558,"text":157},3,{"id":215,"depth":558,"text":218},{"id":284,"depth":558,"text":287},{"id":345,"depth":558,"text":348},{"id":368,"depth":558,"text":371},{"id":467,"depth":558,"text":470},"markdown","content:technology-blogs:zh:2026-8-27.md","content","technology-blogs\u002Fzh\u002F2026-8-27.md","technology-blogs\u002Fzh\u002F2026-8-27","md",1788816606533]