我最近开始使用 Metaflow 进行超参数搜索。我对我的foreach所有参数使用如下:
from metaflow import FlowSpec, step
@step
def start_hpo(self):
self.next(self.train_model, foreach='hpo_parameters')
@step
def train_model(self):
# Trains model...
这有效,因为它train_model按预期启动了步骤,但不幸的是它希望一次并行化所有步骤。这会导致我的 gpu / cpu 在步骤失败时立即耗尽内存。
有没有办法告诉元流线性地/一次一个地执行这些步骤,或者另一种解决方法?
谢谢