[{"data":1,"prerenderedAt":831},["ShallowReactive",2],{"content-query-FjrzsPXhYf":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"body":13,"_type":825,"_id":826,"_source":827,"_file":828,"_stem":829,"_extension":830},"/version-updates/zh/2819","zh",false,"","昇思MindSpore 2.2，提升大模型编译效率，支持更多热门预训练大模型","经过昇思社区开发者们2个月的辛勤耕耘，现正式发布昇思MindSpore2.2版本","2023-10-20","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/d62124d7d21344589a5e9d0b51070a25.png","version-updates",{"type":14,"children":15,"toc":816},"root",[16,24,30,42,47,55,60,71,76,83,88,96,104,112,124,129,134,144,149,153,163,168,173,183,188,193,203,208,212,222,227,231,241,246,250,259,264,268,278,283,287,297,302,306,316,321,325,335,340,344,354,359,363,373,378,382,392,397,401,411,416,421,431,436,440,450,455,459,469,474,479,489,494,499,504,509,519,531,545,552,558,563,571,584,590,595,603,614,625,630,635,640,645,652,663,674,679,686,692,697,702,709,715,720,727,737,748,753,758,765,770,775,780,790,801,806,811],{"type":17,"tag":18,"props":19,"children":21},"element","h1",{"id":20},"昇思mindspore-22提升大模型编译效率支持更多热门预训练大模型",[22],{"type":23,"value":8},"text",{"type":17,"tag":25,"props":26,"children":27},"p",{},[28],{"type":23,"value":29},"经过昇思社区开发者们2个月的辛勤耕耘，现正式发布昇思MindSpore2.2版本，持续提升大模型相关能力，包含提供Lazy inline模式提高大模型编译效率、大模型开发套件MindSpore Transformers支持20+热门预训练大模型和52+典型规格开箱即用，同时在生成式领域发布套件MindSpore One集成易用接口和前沿算法模型，在科学智能领域发布AI4Science高频模型套件MindSpore SciAI和地球科学套件MindSpore Earth，提供高效易用的AI4Science通用计算平台以及更多应用场景，下面就带大家详细了解下2.2版本的关键特性。",{"type":17,"tag":18,"props":31,"children":33},{"id":32},"_1-lazy-inline显著提升大模型静态图编译效率",[34,36],{"type":23,"value":35},"1. ",{"type":17,"tag":37,"props":38,"children":39},"strong",{},[40],{"type":23,"value":41},"Lazy inline：显著提升大模型静态图编译效率",{"type":17,"tag":25,"props":43,"children":44},{},[45],{"type":23,"value":46},"在神经网络模型（特别是LLM）的流水线并行场景下，对于被重复多次调用的计算单元，传统编译过程会将层级的代码表达inline成一张扁平图，Lazy inline模式则不执行inline或只在执行前的最后阶段inline，从而显著降低了图的规模，实现了编译性能倍数级的提升。我们通过盘古13B网络对Lazy inline的编译效率提升效果进行了验证：计算图编译节点从13万+下降到2万+，编译时间从3小时下降到20分钟，效率提升900%+。",{"type":17,"tag":25,"props":48,"children":49},{},[50],{"type":17,"tag":51,"props":52,"children":54},"img",{"alt":7,"src":53},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/7de47c42c9ed4c0b88f8a1d714ceba0b.png",[],{"type":17,"tag":25,"props":56,"children":57},{},[58],{"type":23,"value":59},"子图 loop body graph 仅有一份，使用Lazy inline方式多次调用子图",{"type":17,"tag":18,"props":61,"children":63},{"id":62},"_2-mindspore-transformers20热门预训练大模型支持52典型规格开箱即用",[64,66],{"type":23,"value":65},"2. ",{"type":17,"tag":37,"props":67,"children":68},{},[69],{"type":23,"value":70},"MindSpore Transformers：20+热门预训练大模型支持，52+典型规格开箱即用",{"type":17,"tag":25,"props":72,"children":73},{},[74],{"type":23,"value":75},"MindSpore Transformers的目标是构建一个大模型生命周期内，训练、微调、评估、推理、部署的全流程的开发套件，覆盖CV、NLP、AIGC等热门领域，提供快速开发能力，支持20+ 热门预训练大模型、52+典型规格开箱即用，支持AICC计算中心大规模集群训练部署，支持昇思MindSpore多维存储优化和多维混合分布式并行特性配置化开发方式。",{"type":17,"tag":77,"props":78,"children":80},"h2",{"id":79},"_21-热门预训练模型支持",[81],{"type":23,"value":82},"2.1 热门预训练模型支持",{"type":17,"tag":25,"props":84,"children":85},{},[86],{"type":23,"value":87},"MindSpore Transformers新增了对LLama2、Baichuan2、GLM2、Internlm、Ziya、SAM、CodeGeex2以及BILIP2预训练模型的支持，详细的支持列表如下：",{"type":17,"tag":25,"props":89,"children":90},{},[91],{"type":17,"tag":37,"props":92,"children":93},{},[94],{"type":23,"value":95},"模型",{"type":17,"tag":25,"props":97,"children":98},{},[99],{"type":17,"tag":37,"props":100,"children":101},{},[102],{"type":23,"value":103},"规格",{"type":17,"tag":25,"props":105,"children":106},{},[107],{"type":17,"tag":37,"props":108,"children":109},{},[110],{"type":23,"value":111},"支持模式",{"type":17,"tag":25,"props":113,"children":114},{},[115],{"type":17,"tag":116,"props":117,"children":121},"a",{"href":118,"rel":119},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/glm2.html",[120],"nofollow",[122],{"type":23,"value":123},"GLM2",{"type":17,"tag":25,"props":125,"children":126},{},[127],{"type":23,"value":128},"glm2_6b glm2_6b_lora",{"type":17,"tag":25,"props":130,"children":131},{},[132],{"type":23,"value":133},"预训练、微调、评测、推理/MSLite推理",{"type":17,"tag":25,"props":135,"children":136},{},[137],{"type":17,"tag":116,"props":138,"children":141},{"href":139,"rel":140},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/llama.html",[120],[142],{"type":23,"value":143},"LLama2",{"type":17,"tag":25,"props":145,"children":146},{},[147],{"type":23,"value":148},"llama2_7b llama2_13b",{"type":17,"tag":25,"props":150,"children":151},{},[152],{"type":23,"value":133},{"type":17,"tag":25,"props":154,"children":155},{},[156],{"type":17,"tag":116,"props":157,"children":160},{"href":158,"rel":159},"https://mindformers.readthedocs.io/zh_CN/latest/research/baichuan2/baichuan2.html",[120],[161],{"type":23,"value":162},"Baichuan2",{"type":17,"tag":25,"props":164,"children":165},{},[166],{"type":23,"value":167},"baichuan2_7b baichuan2_13b",{"type":17,"tag":25,"props":169,"children":170},{},[171],{"type":23,"value":172},"预训练、微调、评测、推理",{"type":17,"tag":25,"props":174,"children":175},{},[176],{"type":17,"tag":116,"props":177,"children":180},{"href":178,"rel":179},"https://gitee.com/mindspore/mindformers/blob/dev/docs/model_cards/codegeex2.md",[120],[181],{"type":23,"value":182},"CodeGeex2",{"type":17,"tag":25,"props":184,"children":185},{},[186],{"type":23,"value":187},"codegeex2_6b",{"type":17,"tag":25,"props":189,"children":190},{},[191],{"type":23,"value":192},"预训练、微调、推理",{"type":17,"tag":25,"props":194,"children":195},{},[196],{"type":17,"tag":116,"props":197,"children":200},{"href":198,"rel":199},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/blip2.html",[120],[201],{"type":23,"value":202},"BLIP2",{"type":17,"tag":25,"props":204,"children":205},{},[206],{"type":23,"value":207},"blip2_stage1_vit_g blip2_stage1_classification itt_blip2_stage2_vit_g_baichuan_7b itt_blip2_stage2_vit_g_llama_7b",{"type":17,"tag":25,"props":209,"children":210},{},[211],{"type":23,"value":172},{"type":17,"tag":25,"props":213,"children":214},{},[215],{"type":17,"tag":116,"props":216,"children":219},{"href":217,"rel":218},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/glm.html",[120],[220],{"type":23,"value":221},"GLM",{"type":17,"tag":25,"props":223,"children":224},{},[225],{"type":23,"value":226},"glm_6b glm_6b_lora",{"type":17,"tag":25,"props":228,"children":229},{},[230],{"type":23,"value":133},{"type":17,"tag":25,"props":232,"children":233},{},[234],{"type":17,"tag":116,"props":235,"children":238},{"href":236,"rel":237},"https://mindformers.readthedocs.io/zh_CN/latest/research/baichuan/baichuan.html",[120],[239],{"type":23,"value":240},"Baichuan",{"type":17,"tag":25,"props":242,"children":243},{},[244],{"type":23,"value":245},"baichuan_7b baichuan_13b",{"type":17,"tag":25,"props":247,"children":248},{},[249],{"type":23,"value":172},{"type":17,"tag":25,"props":251,"children":252},{},[253],{"type":17,"tag":116,"props":254,"children":256},{"href":139,"rel":255},[120],[257],{"type":23,"value":258},"LLama",{"type":17,"tag":25,"props":260,"children":261},{},[262],{"type":23,"value":263},"llama_7b llama_13b llama_7b_lora",{"type":17,"tag":25,"props":265,"children":266},{},[267],{"type":23,"value":133},{"type":17,"tag":25,"props":269,"children":270},{},[271],{"type":17,"tag":116,"props":272,"children":275},{"href":273,"rel":274},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/bloom.html",[120],[276],{"type":23,"value":277},"Bloom",{"type":17,"tag":25,"props":279,"children":280},{},[281],{"type":23,"value":282},"bloom_560m bloom_7.1b bloom_65b bloom_176b",{"type":17,"tag":25,"props":284,"children":285},{},[286],{"type":23,"value":133},{"type":17,"tag":25,"props":288,"children":289},{},[290],{"type":17,"tag":116,"props":291,"children":294},{"href":292,"rel":293},"https://mindformers.readthedocs.io/zh_CN/latest/research/internlm/internlm.html",[120],[295],{"type":23,"value":296},"Internlm",{"type":17,"tag":25,"props":298,"children":299},{},[300],{"type":23,"value":301},"Internlm_7b Internlm_7b_lora",{"type":17,"tag":25,"props":303,"children":304},{},[305],{"type":23,"value":172},{"type":17,"tag":25,"props":307,"children":308},{},[309],{"type":17,"tag":116,"props":310,"children":313},{"href":311,"rel":312},"https://mindformers.readthedocs.io/zh_CN/latest/research/ziya/ziya.html",[120],[314],{"type":23,"value":315},"ZiYa",{"type":17,"tag":25,"props":317,"children":318},{},[319],{"type":23,"value":320},"ziya-13b",{"type":17,"tag":25,"props":322,"children":323},{},[324],{"type":23,"value":172},{"type":17,"tag":25,"props":326,"children":327},{},[328],{"type":17,"tag":116,"props":329,"children":332},{"href":330,"rel":331},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/gpt2.html",[120],[333],{"type":23,"value":334},"GPT",{"type":17,"tag":25,"props":336,"children":337},{},[338],{"type":23,"value":339},"gpt2 gpt2_lora gpt2_txtcls gpt2_xl gpt2_xl_lora gpt2_13b gpt2_52b",{"type":17,"tag":25,"props":341,"children":342},{},[343],{"type":23,"value":172},{"type":17,"tag":25,"props":345,"children":346},{},[347],{"type":17,"tag":116,"props":348,"children":351},{"href":349,"rel":350},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/pangualpha.html",[120],[352],{"type":23,"value":353},"PanGuAlpha",{"type":17,"tag":25,"props":355,"children":356},{},[357],{"type":23,"value":358},"pangualpha_2_6_b pangualpha_13b",{"type":17,"tag":25,"props":360,"children":361},{},[362],{"type":23,"value":172},{"type":17,"tag":25,"props":364,"children":365},{},[366],{"type":17,"tag":116,"props":367,"children":370},{"href":368,"rel":369},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/bert.html",[120],[371],{"type":23,"value":372},"BERT",{"type":17,"tag":25,"props":374,"children":375},{},[376],{"type":23,"value":377},"bert_base_uncased txtcls_bert_base_uncased txtcls_bert_base_uncased_mnli tokcls_bert_base_chinese tokcls_bert_base_chinese_cluener qa_bert_base_uncased qa_bert_base_chinese_uncased",{"type":17,"tag":25,"props":379,"children":380},{},[381],{"type":23,"value":172},{"type":17,"tag":25,"props":383,"children":384},{},[385],{"type":17,"tag":116,"props":386,"children":389},{"href":387,"rel":388},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/t5.html",[120],[390],{"type":23,"value":391},"T5",{"type":17,"tag":25,"props":393,"children":394},{},[395],{"type":23,"value":396},"t5_small",{"type":17,"tag":25,"props":398,"children":399},{},[400],{"type":23,"value":192},{"type":17,"tag":25,"props":402,"children":403},{},[404],{"type":17,"tag":116,"props":405,"children":408},{"href":406,"rel":407},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/mae.html",[120],[409],{"type":23,"value":410},"MAE",{"type":17,"tag":25,"props":412,"children":413},{},[414],{"type":23,"value":415},"mae_vit_base_p16",{"type":17,"tag":25,"props":417,"children":418},{},[419],{"type":23,"value":420},"预训练、推理",{"type":17,"tag":25,"props":422,"children":423},{},[424],{"type":17,"tag":116,"props":425,"children":428},{"href":426,"rel":427},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/vit.html",[120],[429],{"type":23,"value":430},"VIT",{"type":17,"tag":25,"props":432,"children":433},{},[434],{"type":23,"value":435},"vit_base_p16",{"type":17,"tag":25,"props":437,"children":438},{},[439],{"type":23,"value":172},{"type":17,"tag":25,"props":441,"children":442},{},[443],{"type":17,"tag":116,"props":444,"children":447},{"href":445,"rel":446},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/swin.html",[120],[448],{"type":23,"value":449},"Swin",{"type":17,"tag":25,"props":451,"children":452},{},[453],{"type":23,"value":454},"swin_base_p4w7",{"type":17,"tag":25,"props":456,"children":457},{},[458],{"type":23,"value":172},{"type":17,"tag":25,"props":460,"children":461},{},[462],{"type":17,"tag":116,"props":463,"children":466},{"href":464,"rel":465},"https://mindformers.readthedocs.io/zh_CN/latest/docs/model_cards/clip.html",[120],[467],{"type":23,"value":468},"CLIP",{"type":17,"tag":25,"props":470,"children":471},{},[472],{"type":23,"value":473},"clip_vit_b_32 clip_vit_b_16 clip_vit_l_14 clip_vit_l_14@336",{"type":17,"tag":25,"props":475,"children":476},{},[477],{"type":23,"value":478},"微调、评测、推理",{"type":17,"tag":25,"props":480,"children":481},{},[482],{"type":17,"tag":116,"props":483,"children":486},{"href":484,"rel":485},"https://gitee.com/mindspore/mindformers/blob/dev/research/sam/Segment_Anything_Model.md",[120],[487],{"type":23,"value":488},"SAM",{"type":17,"tag":25,"props":490,"children":491},{},[492],{"type":23,"value":493},"sam_vit_b sam_vit_l sam_vit_h",{"type":17,"tag":25,"props":495,"children":496},{},[497],{"type":23,"value":498},"推理",{"type":17,"tag":25,"props":500,"children":501},{},[502],{"type":23,"value":503},"2.2 Pipeline在线推理体验",{"type":17,"tag":25,"props":505,"children":506},{},[507],{"type":23,"value":508},"此外MindSpore Transformers提供了便捷的pipeine推理接口，指定任务和模型规格，即可完成大模型推理。",{"type":17,"tag":510,"props":511,"children":513},"pre",{"code":512},"\nimport mindspore as ms\nfrom mindformers import pipeline\nms.set_context(mode=0)\npipeline_task = pipeline(task='text_generation', model='glm2_6b',max_length=193)\npipeline_task(\"你好\")\n# [{'text_generation_text': [你好！我是人工智能助手ChatGLM2-6B，很高兴见到你，欢迎问我任何问题。']}]\n",[514],{"type":17,"tag":515,"props":516,"children":517},"code",{"__ignoreMap":7},[518],{"type":23,"value":512},{"type":17,"tag":25,"props":520,"children":521},{},[522,524],{"type":23,"value":523},"以上为单卡单batch推理，如果需要多batch/分布式并行/MSLite推理等操作，可参考教程",{"type":17,"tag":116,"props":525,"children":528},{"href":526,"rel":527},"https://gitee.com/mindspore/mindformers/blob/dev/docs/model_cards/glm2.md",[120],[529],{"type":23,"value":530},"GLM2官方推理教程",{"type":17,"tag":25,"props":532,"children":533},{},[534,536,543],{"type":23,"value":535},"MindSpore Transformers还提供了便捷的在线LLM大模型聊天界面，用户可参考",{"type":17,"tag":116,"props":537,"children":540},{"href":538,"rel":539},"https://mindformers.readthedocs.io/zh_CN/latest/docs/feature_cards/Chat_Web.html",[120],[541],{"type":23,"value":542},"官方教程",{"type":23,"value":544},"体验业界SOTA大模型聊天能力，支持多种参数调节、多种Prompt模版定义、流式推理展示等。",{"type":17,"tag":25,"props":546,"children":547},{},[548],{"type":17,"tag":51,"props":549,"children":551},{"alt":7,"src":550},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/2a6387d9dcb84c60952560dade1efc5a.gif",[],{"type":17,"tag":77,"props":553,"children":555},{"id":554},"_23-trainer便捷任务调度",[556],{"type":23,"value":557},"2.3 Trainer便捷任务调度",{"type":17,"tag":25,"props":559,"children":560},{},[561],{"type":23,"value":562},"MindSpore Transformers提供Trainer高阶调度和开发接口，帮助用户轻松调度MindFormers已集成大模型或自定义开发的大模型，同时支持超参数自定义、边训练边评估、恢复训练、低参微调等特性。",{"type":17,"tag":510,"props":564,"children":566},{"code":565},"\nfrom mindspore as ms\nfrom mindspore.dataset import GeneratorDataset\nfrom mindformers import Trainer, TrainingArguments\n\n# 指定运行模式为图模式，运行设备为昇腾芯片\nms.set_context(mode=0, device_target=\"Ascend\")\n\ndef train_data():\n    \"\"\"train dataset generator.\"\"\"\n   　seq_len = 128\n    input_ids = np.random.randint(low=0, high=15, size=(seq_len,)).astype(np.int32)\n    labels = np.random.randint(low=0, high=15, size=(seq_len,)).astype(np.int32)\n    train_data = (input_ids, labels)\n    for _ in range(32):\n        yield train_data\n\n\ndef eval_data():\n    \"\"\"eval dataset generator.\"\"\"\n    seq_len = 127\n    input_ids = np.random.randint(low=0, high=15, size=(seq_len,)).astype(np.int32)\n    labels = np.random.randint(low=0, high=15, size=(seq_len,)).astype(np.int32)\n   　eval_data = (input_ids, labels)\n    for _ in range(8):\n        yield eval_data\n\ndef main(run_mode=\"finetune\", task='text_generation',model_type='glm2_6b',pet_method='lora'):\n    # 微调超参数定义\n    training_args = TrainingArguments(num_train_epochs=1, batch_size=2, learning_rate=0.001, warmup_steps=100,sink_mode=True, sink_size=2)\n    # 数据准备\n    train_dataset = GeneratorDataset(train_data, column_names=[\"input_ids\", \"labels\"])\n    eval_dataset = GeneratorDataset(eval_data, column_names=[\"input_ids\", \"labels\"])\n    train_dataset = train_dataset.batch(batch_size=2)\n    eval_dataset = eval_dataset.batch(batch_size=2)\n    # Trainer 任务便捷定义\n    task = Trainer(task=task,\n    　　　　        model=model_type,\n    　　　　        pet_method=pet_method,\n    　　　　        args=training_args,\n    　　　　        train_dataset=train_dataset,\n    　　　　        eval_dataset=eval_dataset)\n    # 一键调度训练、微调、评估、推理\n    if run_mode == train:\n        task.train()\n    elif run_mode == finetune:\n        task.fintune()\n    elif run_mode == eval:\n　　　　 task.evaluate()\n    elif run_mode == predict:\n        predict_result = task.predict(input_data=\"你好\")\n        print(predict_result)\n        #[{'text_generation_text': ['你好，我是 ChatGLM2-6B， 一个人工智能助手。我背后使用的模型是 GLM2-6B，是一种大型语言模型， 具有超过 2000亿参数，支持多种任务。']}]\n\nif __name__=='__main__':\n    # 执行GLM2-6B大模型Lora低参微调，另外还可支持一键评估、推理\n    main(run_mode=\"finetune\", task='text_generation',model_type='glm2_6b',pet_method='lora')\n",[567],{"type":17,"tag":515,"props":568,"children":569},{"__ignoreMap":7},[570],{"type":23,"value":565},{"type":17,"tag":25,"props":572,"children":573},{},[574,576,582],{"type":23,"value":575},"以上是Trainer单卡启动大模型的训练、微调、评估、推理流程，如果需要分布式并行运行，可参考",{"type":17,"tag":116,"props":577,"children":579},{"href":526,"rel":578},[120],[580],{"type":23,"value":581},"GLM2官方教程",{"type":23,"value":583},"进行使用。",{"type":17,"tag":77,"props":585,"children":587},{"id":586},"_24-autoclass一键索引实例",[588],{"type":23,"value":589},"2.4 AutoClass一键索引实例",{"type":17,"tag":25,"props":591,"children":592},{},[593],{"type":23,"value":594},"MindSpore Transformers预置了多种SOTA大模型规格的Tokenizer、Processor、ModelConfig、ModelClass，使用提供的AutoClass接口的from_pretrained可以轻松完成API的实例化，并获取到对应的词表、权重等文件，帮助用户便捷自定义开发创新大模型。",{"type":17,"tag":510,"props":596,"children":598},{"code":597},"\nfrom mindformers import AutoConfig, AutoModel, AutoTokenizer\n\n# 获取GLM2-6B的Tokenizer\ntokenizer = AutoTokenizer.from_pretrained('glm2_6b')\n    \n# 使用GLM2-6B的Tokenizer进行提词\ninputs = tokenizer(\"你好\")[\"input_ids\"]\n\n# 方式1：获取加载了GLM2-6B模型权重的模型实例，同时开启增量推理功能\nmodel1 = AutoModel.from_pretrained('glm2_6b', use_past=True)\n# 方式2：获取GLM2-6B的模型配置，同时开启增量推理功能\nconfig = AutoConfig.from_pretrained('glm2_6b', use_past=True)\nmodel2 = AutoModel.from_config(config)\n\n# 使用generate生成推理结果，同时支持多种生成参数配置\noutputs = model1.generate(inputs, max_new_tokens=20, do_sample=True, top_k=3)\nresponse = tokenizer.decode(outputs)\nprint(response)\n#['你好，作为一名人工智能助手，我欢迎您随时向我提问。']\n",[599],{"type":17,"tag":515,"props":600,"children":601},{"__ignoreMap":7},[602],{"type":23,"value":597},{"type":17,"tag":25,"props":604,"children":605},{},[606,608],{"type":23,"value":607},"更多功能和文档请参考：",{"type":17,"tag":116,"props":609,"children":612},{"href":610,"rel":611},"https://gitee.com/mindspore/mindformers",[120],[613],{"type":23,"value":610},{"type":17,"tag":18,"props":615,"children":617},{"id":616},"_3-mindspore-one生成式领域套件集成易用接口和前沿算法模型助力ai开发与创新",[618,620],{"type":23,"value":619},"3. ",{"type":17,"tag":37,"props":621,"children":622},{},[623],{"type":23,"value":624},"MindSpore One：生成式领域套件，集成易用接口和前沿算法模型，助力AI开发与创新",{"type":17,"tag":25,"props":626,"children":627},{},[628],{"type":23,"value":629},"MindSpore One是基于昇思MindSpore的高质量生成式领域系列算法模型库，提供了简单易用的模块接口，内置了悟空画画/SD1.5/SD2.0/SDXL/VideoComposer等最新的图像视频生成模型，高效支持用户训推一体化部署，具有简单易用、高效微调、性能领先等特性。",{"type":17,"tag":25,"props":631,"children":632},{},[633],{"type":23,"value":634},"1）简单易用：接口简洁，内置CLIP/OpenCLIP/VAE/UNet等基础模块及多种扩散模型，用户可以轻松地构建自己的数据处理流程和模型，开箱即用；",{"type":17,"tag":25,"props":636,"children":637},{},[638],{"type":23,"value":639},"2）高效微调：支持LoRA、DreamBooth等个性化微调方法，适应不同领域的生成任务，帮助用户构建个性化生成模型；",{"type":17,"tag":25,"props":641,"children":642},{},[643],{"type":23,"value":644},"3）性能领先：支持全场景推理，离线推理使用 MindSpore Lite，图像生成时间平均3秒。",{"type":17,"tag":25,"props":646,"children":647},{},[648],{"type":17,"tag":51,"props":649,"children":651},{"alt":7,"src":650},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/6a74f51f08764f5f96c4fde9dc8f3752.png",[],{"type":17,"tag":25,"props":653,"children":654},{},[655,657],{"type":23,"value":656},"详情参考：",{"type":17,"tag":116,"props":658,"children":661},{"href":659,"rel":660},"https://github.com/mindspore-lab/mindone",[120],[662],{"type":23,"value":659},{"type":17,"tag":18,"props":664,"children":666},{"id":665},"_4-mindspore-sciai-01版本ai4science高频模型套件模型覆盖度全球第一",[667,669],{"type":23,"value":668},"4. ",{"type":17,"tag":37,"props":670,"children":671},{},[672],{"type":23,"value":673},"MindSpore SciAI 0.1版本：AI4Science高频模型套件，模型覆盖度全球第一",{"type":17,"tag":25,"props":675,"children":676},{},[677],{"type":23,"value":678},"MindSpore SciAI是基于昇思MindSpore打造的AI4Science（科学智能）高频模型套件，内置了60+高频SOTA模型，覆盖物理感知（如PINNs、DeepRitz以及PFNN）和神经算子（如FNO、DeepONet、PDENet）等主流模型，覆盖度全球第一；提供了高阶API（一键环境配置、自动模型加载、极简训练微调等），开发者和用户开箱即用。 MindSpore SciAI为广大开发者和用户提供了高效、易用的AI4Science通用计算平台。MindSpore SciAI架构图如下：",{"type":17,"tag":25,"props":680,"children":681},{},[682],{"type":17,"tag":51,"props":683,"children":685},{"alt":7,"src":684},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/fdd43767175f42b79f70e3f9b602e727.png",[],{"type":17,"tag":77,"props":687,"children":689},{"id":688},"_41-物理感知模型",[690],{"type":23,"value":691},"4.1 物理感知模型：",{"type":17,"tag":25,"props":693,"children":694},{},[695],{"type":23,"value":696},"物理感知模型是指将物理学中的先验知识（如方程/初边界条件等）融入到神经网络中的一类模型，较为典型的有PINNs（如下述所示）、Deep Ritz以及PFNN等。该类模型的优势：无需生成离散网格；可基于AI框架的自动微分能力进行导数计算，避免数值微分离散误差；天然适用于反问题及数据同化问题；相比数据驱动具有更强的外插能力和更少的样本量。劣势：缺乏网络结构设计指引，奇异性问题学习困难；损失函数包含多项约束，训练难以收敛；物理约束变化时需要重新训练，缺乏泛化性；计算精度和收敛缺乏理论保证。",{"type":17,"tag":25,"props":698,"children":699},{},[700],{"type":23,"value":701},"针对上述问题，学术界和昇思MindSpore提出了一系列改进方案，如自适应激活函数、时间&空间分解、多尺度优化以及自适应加权等。MindSpore SciAI内置了SOTA物理感知模型，应用领域也涵盖了流体、电磁、声、热、固体等众多领域。",{"type":17,"tag":25,"props":703,"children":704},{},[705],{"type":17,"tag":51,"props":706,"children":708},{"alt":7,"src":707},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/29ee10dea6804b7cbec563820cea38ea.png",[],{"type":17,"tag":77,"props":710,"children":712},{"id":711},"_42-神经算子",[713],{"type":23,"value":714},"4.2 神经算子",{"type":17,"tag":25,"props":716,"children":717},{},[718],{"type":23,"value":719},"PINNs等物理感知模型主要求解特定方程，神经算子模型则能够学习无限维函数空间的映射，一次求解整个PDEs族。较为典型的有FNO（如下述所示）、DeepONet以及PDENet等。FNO主要利用傅里叶变换的性质，在傅里叶空间中学习函数之间的映射，然后再将结果转回至物理空间。DeepONet通过“branch net”和“trunk net”两个子网络学习函数之间的映射。神经算子模型在流体、气象、电磁等领域有较好的表现，MindSpore SciAI因此也内置了SOTA神经算子模型。",{"type":17,"tag":25,"props":721,"children":722},{},[723],{"type":17,"tag":51,"props":724,"children":726},{"alt":7,"src":725},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/fbadee41a9f04911b3a45ccc326c313f.png",[],{"type":17,"tag":25,"props":728,"children":729},{},[730,731],{"type":23,"value":656},{"type":17,"tag":116,"props":732,"children":735},{"href":733,"rel":734},"https://gitee.com/mindspore/mindscience/tree/master/SciAI",[120],[736],{"type":23,"value":733},{"type":17,"tag":18,"props":738,"children":740},{"id":739},"_5-mindspore-earth-01版本地球科学套件涵盖中期天气预报短临降水等多时空尺度预报场景",[741,743],{"type":23,"value":742},"5. ",{"type":17,"tag":37,"props":744,"children":745},{},[746],{"type":23,"value":747},"MindSpore Earth 0.1版本：地球科学套件，涵盖中期天气预报、短临降水等多时空尺度预报场景",{"type":17,"tag":25,"props":749,"children":750},{},[751],{"type":23,"value":752},"气象预报与人们的工作生活息息相关，也是AI4Science（科学智能）领域受到最广泛关注的应用场景之一。昇思MindSpore发布了MindSpore Earth地球科学套件0.1版本。该套件集成了多时空尺度下的AI气象预报SOTA模型，提供了数据前处理、预报可视化等工具，并集成了ERA5再分析、雷达回波、高分辨率DEM数据集，致力于高效使能AI+气象和海洋预报的融合研究。",{"type":17,"tag":25,"props":754,"children":755},{},[756],{"type":23,"value":757},"MindSpore Earth架构规划如下图所示，涵盖气象预报短临降水、中期预报、超分辨率等多个场景的业界SOTA模型，包括GraphCast、ViT-KNO、FourCastNet、DGMR等，模型覆盖度业界领先，预报精度超越传统数值模式，预报速度较传统数值模式提升千倍以上。",{"type":17,"tag":25,"props":759,"children":760},{},[761],{"type":17,"tag":51,"props":762,"children":764},{"alt":7,"src":763},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/10/20/861fa3f83dee4edda1b982a8ad39bf7a.png",[],{"type":17,"tag":25,"props":766,"children":767},{},[768],{"type":23,"value":769},"• 中期气象预报：MindSpore Earth提供了多个SOTA AI中期预报模型，包括FourCastNet、GraphCast以及华为先进计算与存储实验室与清华大学合作推出的ViT-KNO模型，可实现一周内气温、风速、湿度等要素秒级推理；",{"type":17,"tag":25,"props":771,"children":772},{},[773],{"type":23,"value":774},"• 短临降水预报：MindSpore Earth提供了DGMR降水模型，基于MindSpore Earth+昇腾可以进行对降水强度与空间分布进行高效训练与推理。",{"type":17,"tag":25,"props":776,"children":777},{},[778],{"type":23,"value":779},"• 数据前处理：昇思MindSpore团队、AI4Sci Lab与清华大学联合推出适用于全球区域的DEM超分模型，该模型在RMSE指标、清晰度、细节等方面均优于目前广泛采用的超分模型。",{"type":17,"tag":25,"props":781,"children":782},{},[783,784],{"type":23,"value":656},{"type":17,"tag":116,"props":785,"children":788},{"href":786,"rel":787},"https://gitee.com/mindspore/mindscience/tree/master/MindEarth",[120],[789],{"type":23,"value":786},{"type":17,"tag":18,"props":791,"children":793},{"id":792},"_6-支持bf16数据类型",[794,796],{"type":23,"value":795},"6. ",{"type":17,"tag":37,"props":797,"children":798},{},[799],{"type":23,"value":800},"支持BF16数据类型",{"type":17,"tag":25,"props":802,"children":803},{},[804],{"type":23,"value":805},"BF16一种相对较新的浮点数格式，又叫BFloat16或Brain Float16，在通过降低少量精度的前提下，来获得更大的数值空间，提升性能、并减少内存的消耗。",{"type":17,"tag":25,"props":807,"children":808},{},[809],{"type":23,"value":810},"昇思MindSpore2.2版本支持使用BF16数据类型训练网络，同时混合精度训练也支持配置BF16类型，达到自定义配置参数类型的效果。",{"type":17,"tag":25,"props":812,"children":813},{},[814],{"type":23,"value":815},"注意：当前部分算子还不支持BF16类型，后续会逐步补齐算子能力，敬请期待！",{"title":7,"searchDepth":817,"depth":817,"links":818},4,[819,821,822,823,824],{"id":79,"depth":820,"text":82},2,{"id":554,"depth":820,"text":557},{"id":586,"depth":820,"text":589},{"id":688,"depth":820,"text":691},{"id":711,"depth":820,"text":714},"markdown","content:version-updates:zh:2819.md","content","version-updates/zh/2819.md","version-updates/zh/2819","md",1776506145216]