Skip to content

Commit

Permalink
【Hackathon 6th Fundable Projects 3 No.300】recurrent (#64545)
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc authored May 24, 2024
1 parent 218dadd commit eff1775
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 1,611 deletions.
24 changes: 12 additions & 12 deletions paddle/fluid/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ cc_library(
executor_gc_helper
SRCS executor_gc_helper.cc
DEPS while_op_helper
recurrent_op_helper
conditional_block_op_helper
pylayer_op_helper
scope
Expand Down Expand Up @@ -585,7 +584,6 @@ if(WITH_DISTRIBUTE)
device_worker_factory.cc
data_set.cc
DEPS fleet_wrapper
recurrent_op_helper
op_registry
device_context
scope
Expand Down Expand Up @@ -660,8 +658,7 @@ if(WITH_DISTRIBUTE)
heter_section_worker.cc
device_worker_factory.cc
data_set.cc
DEPS recurrent_op_helper
op_registry
DEPS op_registry
device_context
scope
framework_proto
Expand Down Expand Up @@ -736,8 +733,7 @@ if(WITH_DISTRIBUTE)
section_worker.cc
device_worker_factory.cc
data_set.cc
DEPS recurrent_op_helper
op_registry
DEPS op_registry
device_context
scope
framework_proto
Expand Down Expand Up @@ -796,8 +792,7 @@ elseif(WITH_PSLIB)
section_worker.cc
device_worker_factory.cc
data_set.cc
DEPS recurrent_op_helper
op_registry
DEPS op_registry
device_context
scope
framework_proto
Expand Down Expand Up @@ -843,8 +838,7 @@ else()
section_worker.cc
device_worker_factory.cc
data_set.cc
DEPS recurrent_op_helper
op_registry
DEPS op_registry
device_context
scope
framework_proto
Expand All @@ -867,8 +861,14 @@ else()
endif()

target_link_libraries(
executor while_op_helper executor_gc_helper recurrent_op_helper
conditional_block_op_helper pylayer_op_helper)
executor
while_op_helper
executor_gc_helper
static_prim_api
static_utils
get_expected_kernel_func
conditional_block_op_helper
pylayer_op_helper)

cc_library(
parallel_executor
Expand Down
3 changes: 0 additions & 3 deletions paddle/fluid/framework/executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ limitations under the License. */
#include "paddle/fluid/framework/trainer_desc.pb.h"
#include "paddle/fluid/framework/trainer_factory.h"
#include "paddle/fluid/operators/controlflow/conditional_block_op_helper.h"
#include "paddle/fluid/operators/controlflow/recurrent_op_helper.h"
#include "paddle/fluid/operators/controlflow/while_op_helper.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/profiler.h"
Expand Down Expand Up @@ -54,8 +53,6 @@ void ExecutorPrepareContext::PrepareUnusedVars(
prog_, static_cast<int>(block_id_), ops_);
operators::PrepareSafeEagerDeletionOnWhileOpAndWhileGradOp(
prog_, static_cast<int>(block_id_), ops_);
operators::PrepareSafeEagerDeletionOnRecurrentOpAndRecurrentGradOp(
prog_, static_cast<int>(block_id_), ops_);
}

force_disable_gc_ = force_disable_gc;
Expand Down
3 changes: 0 additions & 3 deletions paddle/fluid/framework/executor_gc_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "paddle/fluid/framework/var_desc.h"
#include "paddle/fluid/operators/controlflow/conditional_block_op_helper.h"
#include "paddle/fluid/operators/controlflow/pylayer_op_helper.h"
#include "paddle/fluid/operators/controlflow/recurrent_op_helper.h"
#include "paddle/fluid/operators/controlflow/while_op_helper.h"
#include "paddle/fluid/platform/enforce.h"

Expand Down Expand Up @@ -271,8 +270,6 @@ GetEagerDeletionCleanVarsForPartial(const ProgramDesc &origin_program,
program, 0, global_block_ops);
operators::PrepareSafeEagerDeletionOnWhileOpAndWhileGradOp(
program, 0, global_block_ops);
operators::PrepareSafeEagerDeletionOnRecurrentOpAndRecurrentGradOp(
program, 0, global_block_ops);
}

// find the skip vars on each block
Expand Down
5 changes: 0 additions & 5 deletions paddle/fluid/framework/ir/memory_optimize_pass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ cc_library(
while_op_eager_deletion_pass
SRCS while_op_eager_deletion_pass.cc
DEPS while_op_helper graph_helper pass)
cc_library(
recurrent_op_eager_deletion_pass
SRCS recurrent_op_eager_deletion_pass.cc
DEPS recurrent_op_helper graph_helper pass)
cc_library(
reference_count_pass_helper
SRCS reference_count_pass_helper.cc
Expand All @@ -34,7 +30,6 @@ set(EAGER_DELETETION_PASS_DEPS
conditional_block_op_eager_deletion_pass
pylayer_op_eager_deletion_pass
while_op_eager_deletion_pass
recurrent_op_eager_deletion_pass
reference_count_pass_helper)

cc_library(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@ void EagerDeletionPass::ApplyImpl(ir::Graph *graph) const {
auto while_op_eager_deletion_pass =
ir::PassRegistry::Instance().Get("while_op_eager_deletion_pass");
while_op_eager_deletion_pass->Apply(graph);

auto recurrent_op_eager_deletion_pass =
ir::PassRegistry::Instance().Get("recurrent_op_eager_deletion_pass");
recurrent_op_eager_deletion_pass->Apply(graph);
}

} // namespace ir
Expand All @@ -320,4 +316,3 @@ REGISTER_PASS(eager_deletion_pass, paddle::framework::ir::EagerDeletionPass)
USE_PASS(conditional_block_op_eager_deletion_pass);
USE_PASS(pylayer_op_eager_deletion_pass);
USE_PASS(while_op_eager_deletion_pass);
USE_PASS(recurrent_op_eager_deletion_pass);

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "paddle/fluid/memory/stats.h"
#include "paddle/fluid/operators/controlflow/conditional_block_op_helper.h"
#include "paddle/fluid/operators/controlflow/pylayer_op_helper.h"
#include "paddle/fluid/operators/controlflow/recurrent_op_helper.h"
#include "paddle/fluid/operators/controlflow/while_op_helper.h"
#include "paddle/fluid/operators/ops_extra_info.h"
#include "paddle/fluid/pir/dialect/operator/interface/op_yaml_info.h"
Expand Down Expand Up @@ -604,8 +603,6 @@ void BuildOpFuncList(const platform::Place& place,
main_program, block.ID(), ops_unique);
operators::PrepareSafeEagerDeletionOnWhileOpAndWhileGradOp(
main_program, block.ID(), ops_unique);
operators::PrepareSafeEagerDeletionOnRecurrentOpAndRecurrentGradOp(
main_program, block.ID(), ops_unique);
}

#ifdef PADDLE_WITH_DNNL
Expand Down
8 changes: 1 addition & 7 deletions paddle/fluid/operators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ endif()
set(OP_HEADER_DEPS ${OP_HEADER_DEPS} phi common phi_utils static_prim_api get_expected_kernel_func)

register_operators(EXCLUDES py_func_op generated_op1 generated_op2 generated_op3 generated_op4 load_combine_op lstm_op run_program_op quantize_linear_op
recurrent_op save_combine_op sync_batch_norm_op activation_op ${OP_MKL_DEPS} DEPS ${OP_HEADER_DEPS} processgroup_comm_utils)
save_combine_op sync_batch_norm_op activation_op ${OP_MKL_DEPS} DEPS ${OP_HEADER_DEPS} processgroup_comm_utils)

op_library(generated_op UNITY SRCS generated_op1.cc generated_op2.cc generated_op3.cc generated_op4.cc DEPS ${OP_HEADER_DEPS})
op_library(run_program_op DEPS executor_cache ${OP_HEADER_DEPS})
Expand All @@ -109,12 +109,6 @@ if (WITH_GPU OR WITH_ROCM)
endif()

op_library(lstm_op DEPS ${OP_HEADER_DEPS})
if (WITH_ROCM)
op_library(recurrent_op DEPS executor ${OP_HEADER_DEPS})
else()
op_library(recurrent_op DEPS ${OP_HEADER_DEPS})
endif()


set(COMMON_OP_DEPS ${OP_HEADER_DEPS})

Expand Down
4 changes: 0 additions & 4 deletions paddle/fluid/operators/controlflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ cc_library(
pylayer_op_helper
SRCS pylayer_op_helper.cc
DEPS op_variant operator pylayer_op)
cc_library(
recurrent_op_helper
SRCS recurrent_op_helper.cc
DEPS recurrent_op op_variant operator)
cc_library(
while_op_helper
SRCS while_op_helper.cc
Expand Down
Loading

0 comments on commit eff1775

Please sign in to comment.