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][ruff] clean some I001 step: 14 #63771

Merged
merged 1 commit into from
Apr 23, 2024
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
fix I001
  • Loading branch information
gouzil committed Apr 23, 2024
commit 6bd9bb123ffbf22dcf90b6bb34c8d95630474e4e
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,3 @@ known-first-party = ["paddle"]

# temp ignore isort
"python/paddle/distributed/__init__.py" = ["I001"]
"python/paddle/distributed/passes/__init__.py" = ["I001"]
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import copy
from collections import defaultdict

from paddle.distributed.passes import PassContext
from paddle.distributed.passes.pass_base import PassContext
from paddle.framework import IrGraph, core, set_flags

from ..process_mesh import ProcessMesh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os
import time

from paddle.distributed.passes import PassManager, new_pass
from paddle.distributed.passes.pass_base import PassManager, new_pass
from paddle.framework import get_flags
from paddle.static import append_backward, program_guard

Expand Down
128 changes: 63 additions & 65 deletions python/paddle/distributed/passes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,122 +12,120 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from .pass_base import new_pass, PassManager, PassContext

from .auto_parallel_gradient_merge import ( # noqa: F401
parse_program,
GradientMergePass,
)
from .auto_parallel_sharding import ( # noqa: F401
ShardingPass,
is_sharding_param_broadcast_op,
partition_by_use_order,
partition_by_greedy_even,
partition_parameters,
re_order_program,
group_param,
ShardingInfo,
VarGroup,
from .allreduce_matmul_grad_overlapping import ( # noqa: F401
AllreduceMatmulGradOverlappingPass,
)
from .auto_parallel_amp import ( # noqa: F401
AMPLists,
AMPState,
AMPPass,
AMPState,
)
from .auto_parallel_master_grad import ( # noqa: F401
get_output_in_varlist,
MasterGradPass,
from .auto_parallel_data_parallel_optimization import ( # noqa: F401
DataParallelOptimizationPass,
GradientsGroup,
)
from .auto_parallel_fp16 import ( # noqa: F401
set_op_dtype_to_fp16,
set_auto_cast_attr,
FP16Pass,
FP16State,
cast_startup_program,
FP16Pass,
)
from .auto_parallel_recompute import ( # noqa: F401
RecomputeState,
RecomputePass,
set_auto_cast_attr,
set_op_dtype_to_fp16,
)
from .auto_parallel_quantization import QuantizationPass # noqa: F401
from .auto_parallel_data_parallel_optimization import ( # noqa: F401
DataParallelOptimizationPass,
GradientsGroup,
from .auto_parallel_fused_linear_promotion import ( # noqa: F401
FusedLinearPromotionPass,
)
from .auto_parallel_grad_clip import ( # noqa: F401
ClipHelper,
ClipGradByGlobalNormPass,
ClipHelper,
)
from .auto_parallel_fused_linear_promotion import ( # noqa: F401
FusedLinearPromotionPass,
from .auto_parallel_gradient_merge import ( # noqa: F401
GradientMergePass,
parse_program,
)
from .auto_parallel_supplement_explicit_dependencies import ( # noqa: F401
AutoParalSupplementDepPass,
from .auto_parallel_master_grad import ( # noqa: F401
MasterGradPass,
get_output_in_varlist,
)
from .auto_parallel_pipeline import PipelinePass, is_reshard_op # noqa: F401
from .auto_parallel_quantization import QuantizationPass # noqa: F401
from .auto_parallel_recompute import ( # noqa: F401
RecomputePass,
RecomputeState,
)
from .auto_parallel_pipeline import is_reshard_op, PipelinePass # noqa: F401
from .auto_parallel_sequence_parallel_optimization import ( # noqa: F401
SequenceParallelOptimizationPass,
)
from .allreduce_matmul_grad_overlapping import ( # noqa: F401
AllreduceMatmulGradOverlappingPass,
from .auto_parallel_sharding import ( # noqa: F401
ShardingInfo,
ShardingPass,
VarGroup,
group_param,
is_sharding_param_broadcast_op,
partition_by_greedy_even,
partition_by_use_order,
partition_parameters,
re_order_program,
)
from .auto_parallel_supplement_explicit_dependencies import ( # noqa: F401
AutoParalSupplementDepPass,
)
from .cpp_pass import ( # noqa: F401
FuseElementwiseAddActPass,
BuildCINNPass,
FuseAdamWPass,
FuseBatchNormActPass,
FuseBatchNormAddActPass,
FuseReluDepthwiseConvPass,
FusedAttentionPass,
FusedFeedforwardPass,
FuseGemmEpiloguePass,
FuseAdamWPass,
FuseDotProductAttentionPass,
FuseElementwiseAddActPass,
FuseGemmEpiloguePass,
FuseOptimizerPass,
InplaceAddtoOpPass,
FuseReluDepthwiseConvPass,
FuseResUnitPass,
BuildCINNPass,
InplaceAddtoOpPass,
)
from .fuse_all_reduce import ( # noqa: F401
find_adjacent_match_sequences,
insert_fuse_all_reduce_ops,
has_same_attrs,
FuseAllReducePass,
filter_all_collective_op_indices,
find_adjacent_match_sequences,
find_all_fuse_all_reduce_groups,
split_fuse_all_reduce_groups_by_deps,
has_same_attrs,
insert_coalesce_tensor_ops,
insert_fuse_all_reduce_by_memory_size,
FuseAllReducePass,
insert_fuse_all_reduce_ops,
split_fuse_all_reduce_groups_by_deps,
)
from .pass_base import PassContext, PassManager, new_pass
from .pipeline_scheduler_pass import ( # noqa: F401
PipelineFThenBPass,
Pipeline1F1BPass,
PipelineEager1F1BPass,
PipelineFThenBPass,
PipelineVirtualPipelinePass,
PipelineZeroBubblePipelinePass,
apply_pass,
)
from .ps_server_pass import ( # noqa: F401
AddGeoOptimizerPass,
AddListenAndServPass,
AddLrDecayTablePass,
AddOptimizerPass,
AddRpcGlobalFlagsPass,
BuildPserverStartupProgramPass,
DeleteUnusedInStartupPass,
)
from .ps_trainer_pass import ( # noqa: F401
AppendSendOpsPass,
DistributedOpsPass,
DeleteOptimizesPass,
DeleteExtraOptimizerPass,
DeleteOptimizesPass,
DistributedOpsPass,
FakeInitOpsPass,
PsGpuPass,
PsTranspilePass,
SplitHeterWorkerOpsPass,
SplitTrainerOpsPass,
SetHeterPipelineOptPass,
SplitFlOpsPass,
SplitHeterWorkerOpsPass,
SplitTrainerOpsPass,
)
from .ps_server_pass import ( # noqa: F401
AddLrDecayTablePass,
AddListenAndServPass,
AddRpcGlobalFlagsPass,
AddOptimizerPass,
AddGeoOptimizerPass,
BuildPserverStartupProgramPass,
DeleteUnusedInStartupPass,
)


__all__ = [
'new_pass',
Expand Down