Skip to content
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
3 changes: 0 additions & 3 deletions python/paddle/apy/sys/__builtin_registry_item__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class RegistryEntry:

def __init__(self):
self.__tag_name__ = None
self.__nice__ = None
Expand Down Expand Up @@ -48,15 +47,13 @@ def __call__(self, tag_name, nice):


class RegistryObject:

def __init__(self, tag_name, nice):
self.tag_name = tag_name
self.nice = nice
self.value = None


class RegisterItemDecorator:

def __init__(self, register_obj):
self.register_obj = register_obj

Expand Down
3 changes: 0 additions & 3 deletions python/paddle/base/framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -8546,7 +8546,6 @@ def set_op_roles(block, op_role, always_forward_ops):
# there would be always_forward_ops in your region, you should use "auto_complete_op_role"
@signature_safe_contextmanager
def pir_op_role_guard(op_role: int - 1) -> Generator[None, None, None]:

if paddle.framework.in_pir_mode():
original_op_rope = pir.get_op_role()
pir.set_op_role(op_role)
Expand All @@ -8559,7 +8558,6 @@ def pir_op_role_guard(op_role: int - 1) -> Generator[None, None, None]:

@signature_safe_contextmanager
def pir_chunk_id_guard(chunk_id: int - 1) -> Generator[None, None, None]:

if paddle.framework.in_pir_mode():
original_chunk_id = pir.get_chunk_id()
pir.set_chunk_id(chunk_id)
Expand All @@ -8572,7 +8570,6 @@ def pir_chunk_id_guard(chunk_id: int - 1) -> Generator[None, None, None]:

@signature_safe_contextmanager
def pir_op_name_guard(op_name: str) -> Generator[None, None, None]:

if paddle.framework.in_pir_mode() and core._is_bwd_prim_enabled():
original_comp_op_name = pir.get_comp_op_name()
pir.set_comp_op_name(op_name)
Expand Down
1 change: 0 additions & 1 deletion python/paddle/base/variable_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ def get_tensor_with_basic_indexing(
attrs['decrease_axis'],
)
else:

target_block = paddle.static.default_main_program().current_block()

slice_out_var = target_block.create_var(
Expand Down
1 change: 0 additions & 1 deletion python/paddle/decomposition/recompute.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ def partition_joint_graph(
def replace_mid_values_with_forward_subgraph(
program, saved_values, mid_values, fwd_op_end_idx, backward_op_start_idx
):

def _extract_forward_recompute_subgraph_for_backward(
saved_values, mid_values
):
Expand Down
2 changes: 0 additions & 2 deletions python/paddle/distributed/auto_parallel/pipelining/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ def forward_maybe_with_nosync(self, *args, **kwargs):
def backward_maybe_with_nosync(
self, backward_type, bwd_kwargs: dict, last_backward=False
) -> tuple[tuple[paddle.Tensor | None, ...], list[dict[str, Any] | None]]:

def perform_backward(
backward_type,
) -> Callable[
Expand Down Expand Up @@ -1245,7 +1244,6 @@ def _prepare_forward_infra(
args: tuple[Any, ...],
kwargs: dict[str, Any] | None = None,
) -> tuple[Any, ...]:

assert num_microbatches is not None, "num_microbatches must be provided"

outputs: tuple[Any, ...] = ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def _get_stage_mesh(stage_index, pp_group_size, style=None):
if style is not None:
raise ValueError(f"Unknown style: {style}, style can be None, v.")
else:

pp_idx = stage_index % pp_group_size
return _get_pp_mesh(pp_idx)

Expand Down
1 change: 0 additions & 1 deletion python/paddle/distributed/auto_parallel/process_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ def get_group(
if hasattr(fleet.fleet, "_hcg"):
hcg = fleet.get_hybrid_communicate_group()
if hcg is not None:

parallel_group_map = {
"pp": hcg.get_pipe_parallel_group,
"dp": hcg.get_data_parallel_group,
Expand Down
3 changes: 0 additions & 3 deletions python/paddle/distributed/auto_parallel/static/pir_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def apply_partition_pass(program, block=None):


class ReshardPasses:

@staticmethod
def decompose_reshard_pass(dist_program):
# split composed reshard op into atomic reshard ops, which would increase the opportunity of reshard Re-Use in following fold_reshard_pass.
Expand Down Expand Up @@ -445,7 +444,6 @@ def remove_sub_block_unused_inputs(op):


class RemovePasses:

@staticmethod
def remove_other_rank_op_pass(dist_program):
# pruning op and value not belong to cur rank
Expand Down Expand Up @@ -1855,7 +1853,6 @@ def fuse_attention_ffn_qkv_pass(

# Fuse params and init pir program fusion params.
with paddle.base.dygraph.guard():

dyparam_dtype = concated_dy_param_list[0].dtype
for param in concated_dy_param_list:
assert (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

class GlobalToSubMeshFunction(ReshardFunction):
def is_suitable(self, src_dist_attr, dst_dist_attr):

# NOTE we could allow the src_dist_attr is not replicated and reshard it as replicated before go through the global_to_sub logic
# but the dst_dist_attr should be replicated otherwise there will be un-defined result when change the mesh.
if not is_replicated(dst_dist_attr):
Expand All @@ -39,7 +38,6 @@ def is_suitable(self, src_dist_attr, dst_dist_attr):
return out_mesh in sub_meshes

def reshard(self, src_dist_attr, dst_dist_attr, src_value, dst_type):

# reshard operand as replicated before change the mesh.
if not is_replicated(src_dist_attr):
tmp_dist_attr = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ def apply(
value_states,
attention_mask,
):

bsz, q_len, num_heads, head_dim = query_states.shape
_, kv_seq_len, _, _ = value_states.shape

Expand Down Expand Up @@ -1263,7 +1262,6 @@ def apply(x, w1, b1, w2, b2):


def match_pattern(pattern, program):

def _compare_op_node(src, tgt):
"""Compare whether two op nodes are equivalent."""
if src.name() != tgt.name():
Expand Down
1 change: 1 addition & 0 deletions python/paddle/distributed/communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
Communicator is used for async distribute training in distribute_transpiler mode.
It's a wrapper of a cpp class Communicator and should be used inside fleet API.
"""

import paddle
from paddle.distributed.ps.utils.public import DistributedMode
from paddle.framework import core
Expand Down
1 change: 1 addition & 0 deletions python/paddle/distributed/fleet/base/role_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Definition of Role Makers."""

from __future__ import annotations

import os
Expand Down
1 change: 0 additions & 1 deletion python/paddle/distributed/fleet/fleet.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
from .utils.log_util import logger, set_log_level

if TYPE_CHECKING:

from collections.abc import (
Callable,
Iterable,
Expand Down
1 change: 0 additions & 1 deletion python/paddle/distributed/fleet/meta_parallel/dualpipev.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,6 @@ def forward_backward_pipeline(
main_stage=True,
)
else:

self._forward_backward_pass(
0,
1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


class WeightGradStore:

enabled = False
cache = []
funcs_queue = queue.Queue()
Expand Down Expand Up @@ -55,7 +54,6 @@ def clear(cls) -> None:


class EventStore:

event = None

@classmethod
Expand Down
1 change: 0 additions & 1 deletion python/paddle/distributed/launch/job/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def status(self):
return Status.FAILED

def __str__(self):

need_print = os.environ.get('FLAGS_print_launcher_env', 'false').lower()
if need_print == 'true' or need_print == '1':
return f'Container rank {self._rank} status {self.status} cmd {self._entrypoint} code {self.exit_code} log {self.errfile} \nenv {self._env}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

@register_pass("pipeline_scheduler_1F1B")
class Pipeline1F1BPass(PipelinePassBase):

def __init__(self):
super().__init__()
self.jobs_in_stable_phase = [self.BACKWARD, self.FORWARD]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


class PipelinePassBase(PassBase):

# Pipeline stages
RECV_FORWARD = "recv_forward"
SEND_BACKWARD = "send_backward"
Expand Down
1 change: 1 addition & 0 deletions python/paddle/distributed/transpiler/geo_sgd_transpiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
4. append sum ops that should run on current server instance.
5. add listen_and_serv op
"""

import collections

from paddle import framework
Expand Down
1 change: 0 additions & 1 deletion python/paddle/incubate/cc/ap/apy_to_axpr_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def convert_python_stmts_to_axpr_json(python_code_stmts_str):

@dataclass
class AnfExpr:

def DumpToFileAsJson(self, file_name):
with open(file_name, "w") as f:
json.dump(self.value, f, indent=2)
Expand Down