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

[CodeStyle][task 1] enable Ruff UP032 rule with . except python/paddle/base #57409

Merged
merged 8 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'develop' into up32_2
  • Loading branch information
Liyulingyue authored Sep 20, 2023
commit 202caca06b26b4ac98818748da751aa141f7918f
23 changes: 0 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,29 +123,6 @@ ignore = [
"PLC0414",
]

# UP018
"python/paddle/distributed/fleet/meta_optimizers/localsgd_optimizer.py" = ["UP018"]
"python/paddle/distributed/fleet/meta_optimizers/sharding/utils.py" = ["UP018"]
"python/paddle/distributed/fleet/meta_optimizers/sharding_optimizer.py" = ["UP018"]
"python/paddle/distributed/fleet/utils/pp_parallel_adaptor.py" = ["UP018"]
"python/paddle/incubate/autograd/utils.py" = ["UP018"]
"python/paddle/incubate/optimizer/gradient_merge.py" = ["UP018"]
"python/paddle/nn/functional/loss.py" = ["UP018"]
"python/paddle/distributed/passes/auto_parallel_gradient_merge.py" = ["UP018"]
"python/paddle/hapi/dynamic_flops.py" = ["UP018"]
"python/paddle/incubate/optimizer/pipeline.py" = ["UP018"]
"python/paddle/static/nn/metric.py" = ["UP018"]
"test/cinn/ops/test_fill_constant_op.py" = ["UP018"]
"test/collective/fleet/parallel_dygraph_transformer.py" = ["UP018"]
"test/collective/fleet/test_dgc_op.py" = ["UP018"]
"test/dygraph_to_static/transformer_dygraph_model.py" = ["UP018"]
"test/legacy_test/fleet_heter_ps_training.py" = ["UP018"]
"test/legacy_test/test_fake_quantize_op.py" = ["UP018"]
"test/legacy_test/test_generate_mask_labels_op.py" = ["UP018"]
"test/legacy_test/test_imperative_transformer_sorted_gradient.py" = ["UP018"]
"test/legacy_test/test_progressbar.py" = ["UP018"]
"test/legacy_test/test_tensor_fill_.py" = ["UP018"]

# B017
"test/auto_parallel/spmd_rules/test_reshape_rule.py" = ["B017"]
"test/dygraph_to_static/test_assert.py" = ["B017"]
Expand Down
9 changes: 9 additions & 0 deletions python/paddle/distributed/passes/pipeline_scheduler_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,15 @@ def apply_pass(main_program, startup_program, pass_name, pass_attr={}):
"FThenB",
"1F1B",
], f"pipeline scheduler only support FThenB and 1F1B, but recieve {pass_name}"

if pass_name == "1F1B":
# TODO(Ruibiao): Move FLAGS_1f1b_backward_forward_overlap and
# FLAGS_mp_async_allreduce_in_backward to auto parallel Strategy
# after these two optimizations are available.
pass_attr["enable_backward_forward_overlap"] = int(
os.environ.get("FLAGS_1f1b_backward_forward_overlap", 0)
)

pipeline_pass = new_pass("pipeline_scheduler_" + pass_name, pass_attr)
pass_context = PassContext()
pipeline_pass.apply([main_program], [startup_program], pass_context)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.