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

[Bugfix] recompute dep filter param #49010

Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions python/paddle/distributed/auto_parallel/reshard.py
Original file line number Diff line number Diff line change
Expand Up @@ -2497,6 +2497,8 @@ def _reshard_output(self, block):
"read",
"write_to_array",
"read_from_array",
"nop",
"depend",
]
global _g_special_ops
skip_ops += _g_special_ops
Expand Down
3 changes: 3 additions & 0 deletions python/paddle/distributed/auto_parallel/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,9 @@ def insert_dependencies_for_two_ops(

def _select_best_depend_var(vars):

# parameter should not be dep var since it maybe partition in sharding pass
vars = [var for var in vars if not var.is_parameter]
assert len(vars) > 0
vars_with_numels = [(var, get_var_numel(var)) for var in vars]
vars_with_numels.sort(key=lambda x: x[1])

Expand Down