文档
注册

--distributed_cluster_build

功能说明

大模型分布式编译切分开关,使能该参数后,生成的离线模型将用于分布式部署。

关联参数

当该参数设置为1时,如下参数可以同步设置:

  • 输入是完整大模型:
  • 输入是切片模型,模型中包括通信算子,将切片模型编译为om离线模型:

    --cluster_config参数必须配置,并且通过--shard_model_dir参数设置多个切片模型所在路径,通过--model_relation_config参数设置多个切片模型之间的输入输出关系。

参数取值

参数值:

1:打开分布式编译切分开关。

参数默认值:无。

推荐配置及收益

无。

示例

  • 分布式部署模型,输入是单个原始大模型(无算法切分,未指定部署设备,负载均衡将模型部署到所有设备的场景)
    atc --model=xxx.air --framework=1 --soc_version=Ascend310P3 --output=xxx --cluster_config=./numa_config.json --distributed_cluster_build=1
  • 分布式部署模型,输入是单个原始大模型,开启算法切分
    atc --model=./matmul2.pb --distributed_cluster_build=1 --cluster_config=./numa_config_2p.json --enable_graph_parallel="1" --graph_parallel_option_path=./parallel_option.json --soc_version=<soc_version>  --output=test_parallel --framework=3 --log=debug

    大模型算法切分后会将子模型要部署的logic device id存储在子模型的属性中,重新加载部署时,部署模块根据该属性进行分布式部署。

  • 分布式部署模型,输入是切片模型,模型中包含通信算子(shared_dir目录下包含多个切片模型)
    atc --distributed_cluster_build=1 --cluster_config=../numa_config_4p.json --shard_model_dir=../1_air --model_relation_config=./model_relation_config.json --output=1_increase_4p --framework=1 --log=debug   --soc_version=<soc_version>

支持的型号

Atlas 推理系列产品(Ascend 310P处理器)

Atlas 训练系列产品

Atlas A2训练系列产品/Atlas 800I A2推理产品

使用约束

分布式编译切分场景编译出来的离线模型,进行模型推理时,不能使用AscendCL的aclmdlLoadFromFile接口加载模型,必须使用Ascend IR构图中的LoadGraph接口通过session方式加载模型,最后使用RunGraph运行加载了该模型的Graph,得到图的执行结果。详情请参见编译Graph为离线模型并运行Graph(大模型分布式编译切分)

搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词