diff --git a/paddle/fluid/operators/fused/fused_multi_transformer_op.cu b/paddle/fluid/operators/fused/fused_multi_transformer_op.cu index 814827d95b6bd4ffad81dfe98a2840296c74c52f..01c5b79fff11569f7b43b7024ca95f8da1739b84 100644 --- a/paddle/fluid/operators/fused/fused_multi_transformer_op.cu +++ b/paddle/fluid/operators/fused/fused_multi_transformer_op.cu @@ -16,29 +16,25 @@ limitations under the License. */ // https://github.com/NVIDIA/FasterTransformer/blob/v4.0/fastertransformer/cuda/masked_multihead_attention.cu // We add License in the head. -// headers sort by clang-format may cause compiling error or test faiure, -// see https://github.com/PaddlePaddle/Paddle/pull/42840/ -// clang-format off #include #include + #include + #include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/operator.h" -#include "paddle/fluid/platform/device/gpu/gpu_device_function.h" -#include "paddle/fluid/platform/device/gpu/gpu_dnn.h" - -#include "paddle/phi/kernels/funcs/math_function.h" - #include "paddle/fluid/operators/fused/attention_layer_norm.h" #include "paddle/fluid/operators/fused/attn_gemm.h" #include "paddle/fluid/operators/fused/fmha_ref.h" #include "paddle/fluid/operators/fused/fused_dropout_helper.h" +#include "paddle/fluid/platform/device/gpu/gpu_device_function.h" +#include "paddle/fluid/platform/device/gpu/gpu_dnn.h" +#include "paddle/phi/kernels/funcs/math_function.h" #if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL) #include "paddle/fluid/platform/collective_helper.h" #include "paddle/fluid/platform/device/gpu/nccl_helper.h" #endif -// clang-format on namespace paddle { namespace operators { diff --git a/paddle/infrt/api/infrt_api.cc b/paddle/infrt/api/infrt_api.cc index 2f4bbd5df352c55f3846061fdef9d5334f5d550a..a58c6cc5b86ef4a1a5d95310234b2a295c0e791a 100644 --- a/paddle/infrt/api/infrt_api.cc +++ b/paddle/infrt/api/infrt_api.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// clang-format off #include "paddle/infrt/api/infrt_api.h" #include @@ -31,6 +30,7 @@ #include "paddle/infrt/dialect/dense_tensor.h" #include "paddle/infrt/dialect/infrt/ir/infrt_dialect.h" #include "paddle/infrt/dialect/infrt/pass/infrt_op_fuse_pass.h" +#include "paddle/infrt/dialect/infrt/pass/infrt_weights_unfold_pass.h" #include "paddle/infrt/dialect/mlir_loader.h" #include "paddle/infrt/dialect/phi/ir/phi_base.h" #include "paddle/infrt/dialect/phi/pass/phi_op_convert_pass.h" @@ -51,18 +51,14 @@ #include "paddle/infrt/kernel/test_kernels.h" #include "paddle/infrt/tensor/tensor_map.h" -#include "paddle/infrt/dialect/infrt/pass/infrt_weights_unfold_pass.h" - #if defined(INFRT_WITH_GPU) && defined(INFRT_WITH_TRT) -#include "paddle/infrt/kernel/tensorrt/registry.h" - #include "paddle/infrt/dialect/tensorrt/trt_graph_fuse_pass.h" #include "paddle/infrt/dialect/tensorrt/trt_graph_split_pass.h" #include "paddle/infrt/dialect/tensorrt/trt_op_converter_pass.h" #include "paddle/infrt/dialect/tensorrt/trt_op_teller_pass.h" #include "paddle/infrt/dialect/tensorrt/trt_type_convert_pass.h" +#include "paddle/infrt/kernel/tensorrt/registry.h" #endif -// clang-format on using namespace infrt::host_context; // NOLINT using namespace infrt::tensor; // NOLINT diff --git a/paddle/infrt/dialect/dense_tensor.h b/paddle/infrt/dialect/dense_tensor.h index 8dec818a80a2728005bcade381cd3417f0407288..eebcbbbcbc69840b82fad898c48cb8307195e087 100644 --- a/paddle/infrt/dialect/dense_tensor.h +++ b/paddle/infrt/dialect/dense_tensor.h @@ -14,17 +14,14 @@ #pragma once -// clang-format off #include #include #include #include -#include "paddle/infrt/dialect/infrt/ir/infrt_dialect.h" - #include "paddle/infrt/dialect/dense_tensor_dialect.hpp.inc" +#include "paddle/infrt/dialect/infrt/ir/infrt_dialect.h" #define GET_OP_CLASSES #include "paddle/infrt/dialect/dense_tensor.hpp.inc" -// clang-format on diff --git a/paddle/infrt/dialect/phi/ir/infrt_phi_tensor.h b/paddle/infrt/dialect/phi/ir/infrt_phi_tensor.h index f7358db5bf356f735a2b1d5a8178738cfe117e42..9e09cdde502b791b493e47a7560feba5e3f3417d 100644 --- a/paddle/infrt/dialect/phi/ir/infrt_phi_tensor.h +++ b/paddle/infrt/dialect/phi/ir/infrt_phi_tensor.h @@ -14,7 +14,6 @@ #pragma once -// clang-format off #include #include #include @@ -30,12 +29,10 @@ #include #include +#include "paddle/infrt/dialect/dense_tensor.h" #include "paddle/infrt/dialect/phi/ir/infrt_phi_tensorDialect.h.inc" #include "paddle/infrt/dialect/phi/ir/infrt_phi_tensorTypes.h.inc" - -#include "paddle/infrt/dialect/dense_tensor.h" #include "paddle/infrt/dialect/phi/ir/phi_base.h" // NOLINT #define GET_OP_CLASSES #include "paddle/infrt/dialect/phi/ir/infrt_phi_tensor.h.inc" -// clang-format on diff --git a/paddle/infrt/dialect/phi/pass/kernel_op_desc_test.cc b/paddle/infrt/dialect/phi/pass/kernel_op_desc_test.cc index 24af0ea437875c50428134c693c9269d40d8edb6..530d0981f1e8e9773e687a83cbe6551df745ea74 100644 --- a/paddle/infrt/dialect/phi/pass/kernel_op_desc_test.cc +++ b/paddle/infrt/dialect/phi/pass/kernel_op_desc_test.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -// clang-format off +#include "paddle/infrt/dialect/phi/pass/kernel_op_desc.h" + #include #include + #include -#include "paddle/infrt/dialect/phi/pass/kernel_op_desc.h" #include "paddle/phi/kernels/declarations.h" -// clang-format on namespace infrt { diff --git a/paddle/infrt/dialect/tensorrt/trt_exec.cc b/paddle/infrt/dialect/tensorrt/trt_exec.cc index 899e71f1c990f298232c27dbc739bf4c43bf57c7..d1ce1c1b562df5869d306e06d2c83feac557abe0 100644 --- a/paddle/infrt/dialect/tensorrt/trt_exec.cc +++ b/paddle/infrt/dialect/tensorrt/trt_exec.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// clang-format off #include #include @@ -27,18 +26,15 @@ #include "paddle/infrt/dialect/tensorrt/trt_op_converter_pass.h" #include "paddle/infrt/dialect/tensorrt/trt_op_teller_pass.h" #include "paddle/infrt/dialect/tensorrt/trt_type_convert_pass.h" - #include "paddle/infrt/host_context/core_runtime.h" #include "paddle/infrt/host_context/kernel_registry.h" #include "paddle/infrt/host_context/mlir_to_runtime_translate.h" - #include "paddle/infrt/kernel/basic_kernels.h" #include "paddle/infrt/kernel/control_flow_kernels.h" #include "paddle/infrt/kernel/tensor_kernels.h" #include "paddle/infrt/kernel/tensor_shape_kernels.h" -#include "paddle/infrt/kernel/test_kernels.h" - #include "paddle/infrt/kernel/tensorrt/registry.h" +#include "paddle/infrt/kernel/test_kernels.h" #ifdef INFRT_WITH_PHI #include "paddle/infrt/dialect/infrt/pass/infrt_op_fuse_pass.h" @@ -48,7 +44,6 @@ #endif #include -// clang-format on int main(int argc, char** argv) { static llvm::cl::opt input_file( diff --git a/paddle/infrt/dialect/tensorrt/trt_ops.cc b/paddle/infrt/dialect/tensorrt/trt_ops.cc index 161fbbbcc65a564b835ced615aa92ff8eec6ced9..8e39fea4cd8ece99a8b3a490c96fd481aa02cdd5 100644 --- a/paddle/infrt/dialect/tensorrt/trt_ops.cc +++ b/paddle/infrt/dialect/tensorrt/trt_ops.cc @@ -12,21 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -// clang-format off #include "paddle/infrt/dialect/tensorrt/trt_ops.h" + #include #include #include #include #include #include -#include "paddle/infrt/common/global.h" -#include "paddle/infrt/dialect/tensorrt/trt_dialect_types.h" +#include "paddle/infrt/common/global.h" #include "paddle/infrt/dialect/dense_tensor.h" #include "paddle/infrt/dialect/infrt/ir/infrt_dialect.h" #include "paddle/infrt/dialect/phi/ir/phi_base.h" -// clang-format on +#include "paddle/infrt/dialect/tensorrt/trt_dialect_types.h" namespace infrt { namespace trt { diff --git a/paddle/infrt/kernel/tensorrt/trt_kernels.cc b/paddle/infrt/kernel/tensorrt/trt_kernels.cc index 0ea68f2e835f76459b5aff3b476b5d786e5c69b2..931fe21b2c710735a6cf92d2a1072eba4461b421 100644 --- a/paddle/infrt/kernel/tensorrt/trt_kernels.cc +++ b/paddle/infrt/kernel/tensorrt/trt_kernels.cc @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -// clang-format off #include "paddle/infrt/kernel/tensorrt/trt_kernels.h" + #include #include + #include "NvInfer.h" #include "NvInferRuntime.h" #include "NvInferRuntimeCommon.h" @@ -27,17 +28,14 @@ #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/Operation.h" #include "mlir/IR/Value.h" - -#include "paddle/infrt/kernel/tensorrt/trt_helper.h" -#include "paddle/infrt/kernel/tensorrt/trt_layers.h" - #include "paddle/infrt/backends/tensorrt/trt_engine.h" #include "paddle/infrt/backends/tensorrt/trt_options.h" #include "paddle/infrt/dialect/tensorrt/trt_ops.h" #include "paddle/infrt/host_context/symbol_table.h" +#include "paddle/infrt/kernel/tensorrt/trt_helper.h" +#include "paddle/infrt/kernel/tensorrt/trt_layers.h" #include "paddle/phi/common/place.h" #include "paddle/phi/core/dense_tensor.h" -// clang-format on namespace infrt { namespace kernel {