Slowdetect 安装部署 1. CTCCL0.4.0版本及以上。安装方式可参考CTCCL 使用指南。 2. 安装慢节点工具套件 · 安装ctccm 下载合适版本的ctccm whl安装包,使用以下命令安装: pip install ctccmxxx 通过pip show可以查看安装包的位置,并配置环境变量: pip show ctccm export PATH"/usr/local/python3/bin:$PATH" 启动命令: ctccm nodes 4 port 8000 debug(可选) · 安装ctcclprofilercomm 下载合适版本的ctcclprofilercomm安装包,使用以下命令安装: pip install ctcclprofilercommxxx 通过import ctccl profiler comm,在训练任务中调用ctcclprofilercomm提供的API使用。ctcclprofilercomm包括以下可用API: savetpdpgroups(tpgroup, dpgroup): 保存任务拓扑信息到本地文件。 •tpgroup (ProcessGroup):张量并行组(由megatron内置函数gettensormodelparallelgroup() 获取) •dpgroup (ProcessGroup):数据并行组(由megatron内置函数getdataparallelgroup() 获取) •返回:无 使用示例: from ctcclprofilercomm.gettpdpgroups import savetpdpgroups from megatron.core.parallelstate import gettensormodelparallelgroup from megatron.core.parallelstate import getdatamodelparallelgroup tpgroup gettensormodelparallelgroup() dpgroup getdatamodelparallelgroup() savetpdpgroups(tpgroup, dpgroup) CtcclProfiler(trainiters): 初始化CtcclProfiler类,创建CtcclProfiler对象。 •trainiters (int):训练任务迭代总数 •返回:CtcclProfiler对象 CtcclProfiler.gettime(): 时间打点,用于每个迭代前后,获得每次迭代的时间。 •返回:当前时间点 CtcclProfiler.updatestep(starttime, endtime, iteration): 根据当前的训练迭代数,以及迭代时间,判断是否要开启、继续收集、停止profiler。 •starttime (float):当前迭代开始时间(由 CtcclProfiler.gettime() 获取) •endtime (float):当前迭代结束时间(由 CtcclProfiler.gettime() 获取) •iteration (int):当前执行到的迭代步数 •返回:无 使用示例: from ctcclprofilercomm.ctcclprofiler import CtcclProfiler profiler CtcclProfiler(args.trainiters) ... while iteration < args.trainiters: ... starttime profiler.gettime() trainstep()
来自: