Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Browse files Browse the repository at this point in the history
… new-api
  • Loading branch information
S-HuaBomb committed Aug 27, 2022
2 parents 4ca5c41 + a635a8a commit 9fb6896
Show file tree
Hide file tree
Showing 466 changed files with 6,375 additions and 4,594 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Expand Up @@ -66,14 +66,14 @@ paddle/infrt/dialect/pd/common/pd_ops_info.h
paddle/infrt/tests/dialect/Output
paddle/infrt/tests/lit.cfg.py
paddle/infrt/kernel/phi/infershaped/infershaped_kernel_launchers.cc
paddle/fluid/pybind/eager_final_state_op_function.cc
paddle/fluid/pybind/eager_op_function.cc

# these files (directories) are generated before build system generation
paddle/fluid/operators/generated_op.cc
paddle/phi/ops/compat/generated_sig.cc
paddle/phi/api/yaml/parsed_apis/
python/paddle/utils/code_gen/
paddle/fluid/pybind/tmp_eager_final_state_op_function_impl.h
paddle/fluid/pybind/eager_final_state_op_function_impl.h
paddle/fluid/pybind/tmp_eager_op_function_impl.h
paddle/fluid/pybind/eager_op_function_impl.h
paddle/fluid/pybind/eager_op_function_impl.h
paddle/fluid/pybind/op_function_impl.h
12 changes: 12 additions & 0 deletions CMakeLists.txt
Expand Up @@ -364,6 +364,18 @@ if(WIN32)
endif()
endif()

if(NOT WITH_TESTING AND WITH_MULTINODE_TESTING)
message(
WARNING
"Disable WITH_MULTINODE_TESTING when compiling without TESTING. Force WITH_MULTINODE_TESTING=OFF."
)
set(WITH_MULTINODE_TESTING
OFF
CACHE STRING
"Disable WITH_MULTINODE_TESTING when compiling without TESTING"
FORCE)
endif()

if(NOT WITH_GPU AND WITH_NCCL)
message(
WARNING "Disable NCCL when compiling without GPU. Force WITH_NCCL=OFF.")
Expand Down
11 changes: 7 additions & 4 deletions paddle/fluid/distributed/collective/CMakeLists.txt
Expand Up @@ -23,9 +23,10 @@ if(WITH_NCCL OR WITH_RCCL)
if(WITH_DISTRIBUTE AND WITH_PSCORE)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
set_source_files_properties(
ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS})
endif()
set_source_files_properties(
ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
cc_library(
processgroup_heter
SRCS ProcessGroupHeter.cc NCCLTools.cc Common.cc
Expand All @@ -47,9 +48,11 @@ if(WITH_ASCEND_CL)
if(WITH_DISTRIBUTE AND WITH_PSCORE)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
set(DISTRIBUTE_COMPILE_FLAGS "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
set_source_files_properties(
ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS
${DISTRIBUTE_COMPILE_FLAGS})
endif()
set_source_files_properties(
ProcessGroupHeter.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})

cc_library(
processgroup_heter
SRCS ProcessGroupHeter.cc HCCLTools.cc Common.cc
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/eager/CMakeLists.txt
Expand Up @@ -41,7 +41,7 @@ if(NOT ((NOT WITH_PYTHON) AND ON_INFER))
grad_tensor_holder
SRCS grad_tensor_holder.cc
DEPS grad_node_info gradient_accumulator)
add_dependencies(grad_tensor_holder eager_final_state_codegen)
add_dependencies(grad_tensor_holder eager_codegen)
cc_library(
backward
SRCS backward.cc
Expand Down
Expand Up @@ -8,5 +8,5 @@ if(NOT (NOT WITH_PYTHON AND ON_INFER))
final_dygraph_node
SRCS nodes.cc ${eager_manual_nodes}
DEPS ${eager_deps})
add_dependencies(final_dygraph_node eager_final_state_codegen)
add_dependencies(final_dygraph_node eager_codegen)
endif()
Expand Up @@ -8,5 +8,5 @@ if(NOT (NOT WITH_PYTHON AND ON_INFER))
final_dygraph_function
SRCS dygraph_functions.cc ${eager_manual_functions}
DEPS ${eager_deps})
add_dependencies(final_dygraph_function eager_final_state_codegen)
add_dependencies(final_dygraph_function eager_codegen)
endif()
Expand Up @@ -16,10 +16,10 @@

#include "paddle/phi/api/include/tensor.h"

paddle::experimental::Tensor add_n_final_state_dygraph_function(
paddle::experimental::Tensor add_n_dygraph_function(
const std::vector<paddle::experimental::Tensor>& x);

paddle::experimental::Tensor conv2d_final_state_dygraph_function(
paddle::experimental::Tensor conv2d_dygraph_function(
const paddle::experimental::Tensor& input,
const paddle::experimental::Tensor& filter,
std::vector<int> strides,
Expand Down
Expand Up @@ -23,7 +23,7 @@
#pragma GCC diagnostic ignored "-Wunused-variable"
DECLARE_bool(check_nan_inf);

paddle::experimental::Tensor add_n_final_state_dygraph_function(
paddle::experimental::Tensor add_n_dygraph_function(
const std::vector<paddle::experimental::Tensor>& x) {
// Dygraph Record Event
paddle::platform::RecordEvent dygraph_entrance_record_event(
Expand All @@ -46,7 +46,7 @@ paddle::experimental::Tensor add_n_final_state_dygraph_function(
paddle::imperative::AutoCastGuard guard(
egr::Controller::Instance().GetCurrentTracer(),
paddle::imperative::AmpLevel::O0);
return add_n_final_state_dygraph_function(NEW_x);
return add_n_dygraph_function(NEW_x);
}
}

Expand All @@ -56,7 +56,7 @@ paddle::experimental::Tensor add_n_final_state_dygraph_function(
std::vector<egr::AutogradMeta*>* x_autograd_meta = &x_autograd_meta_vec;
// Forward API Call
VLOG(3) << "Final State Running: "
<< "add_n_final_state_dygraph_function";
<< "add_n_dygraph_function";
auto api_result = paddle::experimental::add_n(x);
// Check NaN and Inf if needed
if (FLAGS_check_nan_inf) {
Expand Down
Expand Up @@ -23,7 +23,7 @@
#pragma GCC diagnostic ignored "-Wunused-variable"
DECLARE_bool(check_nan_inf);

paddle::experimental::Tensor conv2d_final_state_dygraph_function(
paddle::experimental::Tensor conv2d_dygraph_function(
const paddle::experimental::Tensor& input,
const paddle::experimental::Tensor& filter,
std::vector<int> strides,
Expand Down Expand Up @@ -59,17 +59,17 @@ paddle::experimental::Tensor conv2d_final_state_dygraph_function(
paddle::imperative::AutoCastGuard guard(
egr::Controller::Instance().GetCurrentTracer(),
paddle::imperative::AmpLevel::O0);
return conv2d_final_state_dygraph_function(NEW_input,
NEW_filter,
strides,
paddings,
paddding_algorithm,
groups,
dilations,
data_format,
use_addto,
workspace_size_MB,
exhaustive_search);
return conv2d_dygraph_function(NEW_input,
NEW_filter,
strides,
paddings,
paddding_algorithm,
groups,
dilations,
data_format,
use_addto,
workspace_size_MB,
exhaustive_search);
}
}

Expand All @@ -80,7 +80,7 @@ paddle::experimental::Tensor conv2d_final_state_dygraph_function(
egr::EagerUtils::nullable_autograd_meta(filter);
// Forward API Call
VLOG(3) << "Final State Running: "
<< "conv2d_final_state_dygraph_function";
<< "conv2d_dygraph_function";
auto api_result = paddle::experimental::conv2d(input,
filter,
strides,
Expand Down
Expand Up @@ -64,8 +64,8 @@ AddNGradNodeFinal::operator()(

// dygraph function
for (size_t i = 0; i < returns[0].size(); i++) {
returns[0][i] = ::scale_final_state_dygraph_function(
out_grad, phi::Scalar(1.0), 0.0, true);
returns[0][i] =
::scale_dygraph_function(out_grad, phi::Scalar(1.0), 0.0, true);
}

// Check NaN and Inf id needed
Expand Down
6 changes: 3 additions & 3 deletions paddle/fluid/eager/auto_code_generator/CMakeLists.txt
@@ -1,4 +1,4 @@
add_subdirectory(final_state_generator)
add_subdirectory(generator)

set(EAGER_GENERETOR_DEPS
${GLOB_OP_LIB}
Expand Down Expand Up @@ -88,7 +88,7 @@ if(WIN32)
endif()

add_custom_target(
eager_codegen
legacy_eager_codegen
COMMAND
"${eager_generator_path}/eager_generator.exe"
"${PADDLE_SOURCE_DIR}/paddle/fluid/eager/api/generated/fluid_generated"
Expand All @@ -97,7 +97,7 @@ if(WIN32)
VERBATIM)
else()
add_custom_target(
eager_codegen
legacy_eager_codegen
COMMAND
${CMAKE_COMMAND} -E env
"LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_CURRENT_BINARY_DIR}/../../pybind"
Expand Down

0 comments on commit 9fb6896

Please sign in to comment.