Skip to content

Commit

Permalink
[Executor] remove api paddle.static.ParallelExecutor (#51701)
Browse files Browse the repository at this point in the history
* remove api `class ParallelExecutor`

* remove other references
  • Loading branch information
kangguangli authored Mar 28, 2023
1 parent cdba7e3 commit e9c3da9
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 438 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from paddle.static import (
CompiledProgram,
Executor,
ParallelExecutor,
Program,
Variable,
default_main_program,
Expand Down Expand Up @@ -697,11 +696,6 @@ def _ps_inference_save_persistables(
single file, use `filename` to specify the file name.
"""

if isinstance(executor, ParallelExecutor):
raise TypeError(
"in fleet.save_persistables() function, executor must be as Executor type, ParallelExecutor is not allowed"
)

if not isinstance(executor, Executor):
raise TypeError(
"in fleet.save_persistables() function, executor must be as Executor type"
Expand Down Expand Up @@ -733,11 +727,6 @@ def _ps_inference_save_inference_model(
and then save it and all related parameters to given `dirname` by the `executor`.
"""

if isinstance(executor, ParallelExecutor):
raise TypeError(
"in fleet.save_inference_model() function, executor must be as Executor type, ParallelExecutor is not allowed"
)

if not isinstance(executor, Executor):
raise TypeError(
"in fleet.save_inference_model() function, executor must be as Executor type"
Expand Down
11 changes: 0 additions & 11 deletions python/paddle/distributed/fleet/runtime/the_one_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from paddle.fluid.compiler import CompiledProgram
from paddle.fluid.executor import Executor
from paddle.fluid.framework import Program
from paddle.fluid.parallel_executor import ParallelExecutor

from ..base.private_helper_function import wait_server_ready
from .runtime_base import RuntimeBase
Expand Down Expand Up @@ -1362,11 +1361,6 @@ def _ps_inference_save_persistables(
single file, use `filename` to specify the file name.
"""

if isinstance(executor, ParallelExecutor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type, ParallelExecutor is not allowed"
)

if not isinstance(executor, Executor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type"
Expand Down Expand Up @@ -1400,11 +1394,6 @@ def _ps_inference_save_inference_model(
and then save it and all related parameters to given `dirname` by the `executor`.
"""

if isinstance(executor, ParallelExecutor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type, ParallelExecutor is not allowed"
)

if not isinstance(executor, Executor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type"
Expand Down
12 changes: 1 addition & 11 deletions python/paddle/distributed/ps/the_one_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from paddle.distributed.ps.coordinator import Coordinator
from paddle.distributed.ps.utils.public import * # noqa: F403
from paddle.framework import core
from paddle.static import CompiledProgram, Executor, ParallelExecutor, Program
from paddle.static import CompiledProgram, Executor, Program

__all__ = [
'Table',
Expand Down Expand Up @@ -1491,11 +1491,6 @@ def _save_distributed_persistables(
single file, use `filename` to specify the file name.
"""

if isinstance(executor, ParallelExecutor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type, ParallelExecutor is not allowed"
)

if not isinstance(executor, Executor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type"
Expand Down Expand Up @@ -1526,11 +1521,6 @@ def _ps_inference_save_inference_model(
and then save it and all related parameters to given `dirname` by the `executor`.
"""

if isinstance(executor, ParallelExecutor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type, ParallelExecutor is not allowed"
)

if not isinstance(executor, Executor):
raise TypeError(
"in fleet.save() function, executor must be as Executor type"
Expand Down
3 changes: 0 additions & 3 deletions python/paddle/fluid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@
from .lod_tensor import create_lod_tensor, create_random_int_lodtensor
from . import profiler
from . import unique_name
from . import parallel_executor
from .parallel_executor import *
from . import compiler
from .compiler import *
from paddle.fluid.layers.math_op_patch import monkey_patch_variable
Expand All @@ -105,7 +103,6 @@
framework.__all__
+ executor.__all__
+ trainer_desc.__all__
+ parallel_executor.__all__
+ lod_tensor.__all__
+ data_feed_desc.__all__
+ compiler.__all__
Expand Down
Loading

0 comments on commit e9c3da9

Please sign in to comment.