【发布时间】:2021-12-13 11:43:23
【问题描述】:
我想使用 AzureML 执行超参数搜索。我的模型很小(大约 1GB),因此我想在同一个 GPU/节点上运行多个模型以节省成本,但我不知道如何实现。
我目前提交作业的方式如下(导致每个 GPU/节点运行一次训练):
experiment = Experiment(workspace, experiment_name)
config = ScriptRunConfig(source_directory="./src",
script="train.py",
compute_target="gpu_cluster",
environment="env_name",
arguments=["--args args"])
run = experiment.submit(config)
ScriptRunConfig 可以提供distributed_job_config。我尝试在那里使用MpiConfiguration,但如果这样做,运行会由于 MPI 错误而失败,该错误读起来好像集群被配置为每个节点只允许运行一次:
Open RTE detected a bad parameter in hostfile: [...] The max_slots parameter is less than the slots parameter: slots = 3 max_slots = 1 [...] ORTE_ERROR_LOG: Bad Parameter in file util/hostfile/hostfile.c at line 407
使用HyperDriveConfig 也默认为向一个GPU 提交一次运行,另外提供MpiConfiguration 会导致与上图相同的错误。
我想我总是可以重写我的训练脚本来并行训练多个模型,s.t.每个run 包含多个培训。不过我想避免这个选项,因为这样日志记录和检查点写入变得越来越混乱,并且需要对火车管道进行大量重构。而且这个功能看起来很基础,我希望有一种方法可以优雅地做到这一点。有什么想法吗?
【问题讨论】:
标签: azure mpi cluster-computing azure-machine-learning-service