未验证 提交 32efda3d 编写于 作者: H Haohongxiang 提交者: GitHub

support no_sync attr for params in DataParallel (#47536)

上级 ec7fe888
......@@ -706,7 +706,12 @@ class DataParallel(layers.Layer):
if param.trainable:
layers_param.append((sublayer, param))
trainable_parameters = [param for _, param in layers_param]
trainable_parameters = list(
filter(
lambda x: not getattr(x, "no_sync", False),
[param for _, param in layers_param],
)
)
assert len(trainable_parameters) > 0, (
"This model does not have any parameters to train, and "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册