Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug of sync_params_buffers #33955

Merged
merged 1 commit into from
Jul 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions python/paddle/fluid/dygraph/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
import numpy as np
import warnings
from collections import OrderedDict
import itertools
import warnings

import paddle
from paddle.fluid import core
from paddle.fluid import framework
from paddle.fluid.dygraph import layers
Expand All @@ -26,9 +29,7 @@
from paddle.utils import deprecated
from ..layers import collective
from paddle.fluid.dygraph import base as imperative_base
import warnings
import paddle
import itertools
from paddle.fluid.framework import ParamBase

__all__ = ["prepare_context", "ParallelEnv", "DataParallel"]

Expand Down Expand Up @@ -353,8 +354,9 @@ def sync_params_buffers(model,
raise TypeError("The data type of '%s' must be Varbase" %
param.name)
# is_distributed param not need to sync when in mp mode
if is_model_parallel and param.is_distributed:
continue
if is_model_parallel and isinstance(param, ParamBase):
if param.is_distributed:
continue

model_vars.append(param.detach())
if len(model_vars) == 0:
Expand Down