大模型分布式编译切分开关,使能该参数后,生成的离线模型将用于分布式部署。
当该参数设置为1时,如下参数可以同步设置:
--cluster_config参数必须配置,并且通过--enable_graph_parallel参数开启算法切分,通过--graph_parallel_option_path参数配置切分策略配置文件路径。
算法切分场景,模型编译阶段会自动插入通信算子。
--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存储在子模型的属性中,重新加载部署时,部署模块根据该属性进行分布式部署。
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训练系列产品
分布式编译切分场景编译出来的离线模型,进行模型推理时,不能使用AscendCL的aclmdlLoadFromFile接口加载模型,必须使用Ascend IR构图中的LoadGraph接口通过session方式加载模型,最后使用RunGraph运行加载了该模型的Graph,得到图的执行结果。详情请参见编译Graph为离线模型并运行Graph(大模型分布式编译切分)。