FlagOpen / FlagScale

FlagScale is a large model toolkit based on open-sourced projects.
Other
149 stars 42 forks source link

hetero训练模式 #239

Open drakethree3 opened 2 days ago

drakethree3 commented 2 days ago

请问在hetero模式下是不是必须要enable_hetero:True?显卡数量是不是要大于4?hostfile是不是必须需要?期待大家耐心回答!

heavyrain-lzy commented 1 day ago
  1. hetero模式下必须要enable_hetero:True
  2. 显卡数量没有要求,具体看异构并行策略
  3. 如果是单机运行可以不用hostfile 可以按照命令尝试调试 python run.py --config-path ./examples/aquila/conf --config-name config_hetero
drakethree3 commented 16 hours ago

感谢你的回答!我按照正常配置使用hetero模式,在enable_hetero:True前提下会有如下报错,我的服务器是4张卡。这个报错是什么原因呢? image

heavyrain-lzy commented 16 hours ago

感谢你的回答!我按照正常配置使用hetero模式,在enable_hetero:True前提下会有如下报错,我的服务器是4张卡。这个报错是什么原因呢? image

可以在报错的地方进行debug 或给出详细的yaml配置文件协助分析

drakethree3 commented 15 hours ago

我查看代码之后的理解是和服务器的卡数有关系,不知道对不对。yaml配置如下,请您帮忙看一下,谢谢啦! yaml.zip

heavyrain-lzy commented 15 hours ago

我查看代码之后的理解是和服务器的卡数有关系,不知道对不对。yaml配置如下,请您帮忙看一下,谢谢啦! yaml.zip

  #enable_hetero: True
  #hetero_device_types: ["A100", "A100", "A100", "A100"]
  hetero_device_types: A100
  hetero_current_device_type: A100
  hetero_pipeline_layer_split: [4, 2]
  #hetero_process_meshes: [4, 1, 1, 2, 1]

-->

  enable_hetero: True
  hetero_device_types: ["A100"]
  hetero_current_device_type: A100
  hetero_pipeline_layer_split: [4, 2]
  hetero_process_meshes: [1, 1, 1, 2, 2] #长度是5的倍速:tp1,cp1,ep1,dp1,pp1
drakethree3 commented 15 hours ago

好的太感谢了!代码还是没理解透彻,现在明白啦!

heavyrain-lzy commented 15 hours ago

最新的版本即将发布,会一同更新readme,可以持续关注! 如果问题得到解决,请及时关闭issue!

drakethree3 commented 12 hours ago

不好意思还有点问题想咨询,hetero_process_meshes参数内dp相等、pp是求和等于pipeline_model_parallel_size,但是tp的值如何设置呢?另外,hetero_device_types设置的个数和实际使用的卡数有什么关系呢?

drakethree3 commented 12 hours ago

如下图设置是可以的,tp的值也只能是等于tensor_model_parallel_size吗? image