diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4286292b0..f7b6081bb4 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -80,6 +80,9 @@ endif()
 
 if(WITH_GPU AND NOT APPLE)
   enable_language(CUDA)
+  set(CMAKE_CXX_FLAGS
+      "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations -Wno-deprecated-declarations -Wno-error=pessimizing-move -Wno-error=deprecated-copy"
+  )
   message(STATUS "CUDA compiler: ${CMAKE_CUDA_COMPILER}, version: "
                  "${CMAKE_CUDA_COMPILER_ID} ${CMAKE_CUDA_COMPILER_VERSION}")
 endif()
@@ -252,7 +255,7 @@ option(WITH_LIBXSMM "Compile with libxsmm" OFF)
 option(COVERALLS_UPLOAD "Package code coverage data to coveralls" OFF)
 option(WITH_PSLIB "Compile with pslib support" OFF)
 option(WITH_BOX_PS "Compile with box_ps support" OFF)
-option(WITH_XBYAK "Compile with xbyak support" ON)
+option(WITH_XBYAK "Compile with xbyak support" OFF)
 option(WITH_CONTRIB "Compile the third-party contributation" OFF)
 option(WITH_PSCORE "Compile with parameter server support" ${WITH_DISTRIBUTE})
 option(WITH_HETERPS "Compile with heterps" OFF})
@@ -267,11 +270,11 @@ option(
 option(WITH_LITE "Compile Paddle Fluid with Lite Engine" OFF)
 option(WITH_CINN "Compile PaddlePaddle with CINN" OFF)
 option(WITH_INFRT "Compile PaddlePaddle with INFRT" OFF)
-option(WITH_NCCL "Compile PaddlePaddle with NCCL support" ON)
-option(WITH_RCCL "Compile PaddlePaddle with RCCL support" ON)
+option(WITH_NCCL "Compile PaddlePaddle with NCCL support" OFF)
+option(WITH_RCCL "Compile PaddlePaddle with RCCL support" OFF)
 option(WITH_XPU_BKCL "Compile PaddlePaddle with BAIDU KUNLUN XPU BKCL" OFF)
 option(WITH_CNCL "Compile PaddlePaddle with CNCL support" OFF)
-option(WITH_CRYPTO "Compile PaddlePaddle with crypto support" ON)
+option(WITH_CRYPTO "Compile PaddlePaddle with crypto support" OFF)
 option(WITH_ARM "Compile PaddlePaddle with arm support" OFF)
 option(WITH_SW "Compile PaddlePaddle with sw support" OFF)
 option(WITH_MIPS "Compile PaddlePaddle with mips support" OFF)
@@ -286,7 +289,7 @@ option(NEW_RELEASE_ALL
 option(NEW_RELEASE_JIT
        "PaddlePaddle next-level release strategy for backup jit package" OFF)
 option(WITH_ASCEND_INT64 "Compile with int64 kernel for ascend NPU" OFF)
-option(WITH_POCKETFFT "Compile with pocketfft support" ON)
+option(WITH_POCKETFFT "Compile with pocketfft support" OFF)
 option(WITH_RECORD_BUILDTIME
        "Compile PaddlePaddle with record all targets build time" OFF)
 option(WITH_CUSTOM_DEVICE "Compile with custom device support" OFF)
diff --git a/cmake/generic.cmake b/cmake/generic.cmake
index ba59eae392..1090cbd63a 100644
--- a/cmake/generic.cmake
+++ b/cmake/generic.cmake
@@ -342,7 +342,7 @@ function(cc_library TARGET_NAME)
         if(WIN32)
           target_link_libraries(${TARGET_NAME} ${MKLML_IOMP_LIB})
         else(WIN32)
-          target_link_libraries(${TARGET_NAME} "-L${MKLML_LIB_DIR} -liomp5 -Wl,--as-needed")
+          target_link_libraries(${TARGET_NAME} "-L${MKLML_LIB_DIR} -lpthread -liomp5 -Wl,--as-needed")
         endif(WIN32)
       endif()
       # remove link to python, see notes at:
diff --git a/cmake/thrust.cmake b/cmake/thrust.cmake
index ff415b1e3c..49b9e40ed7 100644
--- a/cmake/thrust.cmake
+++ b/cmake/thrust.cmake
@@ -14,11 +14,11 @@ function(add_thrust_patches_if_necessary)
                   "--run" "${thrust_detect_file}"
                   WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                   RESULT_VARIABLE nvcc_res ERROR_QUIET)
-  if(NOT nvcc_res EQUAL 0)
+  #if(NOT nvcc_res EQUAL 0)
     set(thrust_patches "${PADDLE_SOURCE_DIR}/patches/thrust")
     message(STATUS "Add thrust patches: ${thrust_patches}")
     include_directories(${thrust_patches})
-  endif()
+  #endif()
 endfunction()
 
 add_thrust_patches_if_necessary()
diff --git a/paddle/fluid/framework/details/nan_inf_utils_detail.cu b/paddle/fluid/framework/details/nan_inf_utils_detail.cu
index f6a97160d8..5983e3a83b 100644
--- a/paddle/fluid/framework/details/nan_inf_utils_detail.cu
+++ b/paddle/fluid/framework/details/nan_inf_utils_detail.cu
@@ -92,7 +92,7 @@ __device__ __forceinline__ void PrintNanInfKernel(const T* value,
     printf("In block %d, there has %u,%u,%u nan,inf,num\n", blockIdx.x,
            nan_count, inf_count, num_count);
 #endif
-    PADDLE_ENFORCE(false, "===ERROR: in %s find nan or inf===", debug_info);
+    // PADDLE_ENFORCE(false, "===ERROR: in %s find nan or inf===", debug_info);
   }
 }
 
diff --git a/paddle/fluid/inference/tensorrt/plugin/gather_nd_op_plugin.cu b/paddle/fluid/inference/tensorrt/plugin/gather_nd_op_plugin.cu
index 4371cc69f3..d28f0ffc1d 100644
--- a/paddle/fluid/inference/tensorrt/plugin/gather_nd_op_plugin.cu
+++ b/paddle/fluid/inference/tensorrt/plugin/gather_nd_op_plugin.cu
@@ -43,13 +43,13 @@ __global__ void GatherNdCUDAKernel(const T* input, const int32_t* input_dims,
     int32_t temp = slice_size;
     for (int32_t j = end_size - 1; j >= 0; --j) {
       auto index_value = indices[indices_i * end_size + j];
-      PADDLE_ENFORCE(
-          index_value >= 0 && index_value < input_dims[j],
-          "The index is out of bounds, "
-          "please check whether the dimensions of index and "
-          "input meet the requirements. It should "
-          "be less than [%d] and greater or equal to 0, but received [%d]",
-          input_dims[j], index_value);
+      // PADDLE_ENFORCE(
+      //     index_value >= 0 && index_value < input_dims[j],
+      //     "The index is out of bounds, "
+      //     "please check whether the dimensions of index and "
+      //     "input meet the requirements. It should "
+      //     "be less than [%d] and greater or equal to 0, but received [%d]",
+      //     input_dims[j], index_value);
       gather_i += (index_value * temp);
       temp *= input_dims[j];
     }
diff --git a/paddle/fluid/operators/center_loss_op.cu b/paddle/fluid/operators/center_loss_op.cu
index 549bb5ae75..8afa0f8be9 100644
--- a/paddle/fluid/operators/center_loss_op.cu
+++ b/paddle/fluid/operators/center_loss_op.cu
@@ -30,9 +30,9 @@ __global__ void ComputeDifferent(T *centers_diff, const T *X, const T *centers,
 
   while (idy < K) {
     int64_t id = ids[idy];
-    PADDLE_ENFORCE(id >= 0, "Id should larger than 0 but received id: %d.", id);
-    PADDLE_ENFORCE(id < N, "Id should smaller than %d but received id: %d.", N,
-                   id);
+    // PADDLE_ENFORCE(id >= 0, "Id should larger than 0 but received id: %d.", id);
+    // PADDLE_ENFORCE(id < N, "Id should smaller than %d but received id: %d.", N,
+    //                id);
 
     T *out = centers_diff + idy * D;
     const T *x = X + idy * D;
@@ -54,9 +54,9 @@ __global__ void UpdateCenters(T *centers, T *centers_diff, const int64_t *ids,
   while (idy < K) {
     int count = 1;
     int64_t id = ids[idy];
-    PADDLE_ENFORCE(id >= 0, "Id should larger than 0 but received id: %d.", id);
-    PADDLE_ENFORCE(id < N, "Id should smaller than %d but received id: %d.", N,
-                   id);
+    // PADDLE_ENFORCE(id >= 0, "Id should larger than 0 but received id: %d.", id);
+    // PADDLE_ENFORCE(id < N, "Id should smaller than %d but received id: %d.", N,
+    //                id);
 
     for (int i = 0; i < K; i++) {
       if (ids[i] == id) {
diff --git a/paddle/fluid/operators/collective/c_embedding_op.cu b/paddle/fluid/operators/collective/c_embedding_op.cu
index ba50f5c48b..c2820e9c62 100644
--- a/paddle/fluid/operators/collective/c_embedding_op.cu
+++ b/paddle/fluid/operators/collective/c_embedding_op.cu
@@ -42,12 +42,12 @@ __global__ void CEmbedding(T *out, const T *table, const IndexT *ids,
 
     if (id >= start_idx && id < end_idx) {
       auto real_idx = id - start_idx;
-      PADDLE_ENFORCE(real_idx < N,
-                     "The index is out of bounds, "
-                     "please check whether the dimensions of index and "
-                     "input meet the requirements. It should "
-                     "be less than [%d], but received [%d]",
-                     N, real_idx);
+      // PADDLE_ENFORCE(real_idx < N,
+      //                "The index is out of bounds, "
+      //                "please check whether the dimensions of index and "
+      //                "input meet the requirements. It should "
+      //                "be less than [%d], but received [%d]",
+      //                N, real_idx);
       out[i] = table[real_idx * columns + col];
     } else {
       out[i] = static_cast<T>(0);
diff --git a/paddle/fluid/operators/collective/c_softmax_with_cross_entropy_op.cu b/paddle/fluid/operators/collective/c_softmax_with_cross_entropy_op.cu
index 4c9fb14842..6b47a65ab5 100644
--- a/paddle/fluid/operators/collective/c_softmax_with_cross_entropy_op.cu
+++ b/paddle/fluid/operators/collective/c_softmax_with_cross_entropy_op.cu
@@ -41,12 +41,12 @@ __global__ void MaskLabelByIndex(T* predicted_logits, const T* logit,
                                  const int64_t D, const int nranks) {
   CUDA_KERNEL_LOOP(i, N) {
     auto real_label = label[i];
-    PADDLE_ENFORCE((real_label < D * nranks) && (real_label >= 0),
-                   "The index is out of bounds, "
-                   "please check whether the value of label and "
-                   "input meet the class number. It should "
-                   "be less than [%d], but received [%d]",
-                   D * nranks, real_label);
+    // PADDLE_ENFORCE((real_label < D * nranks) && (real_label >= 0),
+    //                "The index is out of bounds, "
+    //                "please check whether the value of label and "
+    //                "input meet the class number. It should "
+    //                "be less than [%d], but received [%d]",
+    //                D * nranks, real_label);
 
     if (real_label >= start_index && real_label < end_index) {
       predicted_logits[i] = logit[i * D + real_label - start_index];
diff --git a/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h b/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h
index d53a24a57e..297abf9856 100644
--- a/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h
+++ b/paddle/fluid/operators/fused/fused_layernorm_residual_dropout_bias.h
@@ -239,7 +239,6 @@ __global__ __launch_bounds__(THREADS_PER_CTA) void fused_ln_fwd_1024_kernel(
         RandVec<VecSize>(&state, rand);
 #pragma unroll
         for (int jt = 0; jt < VecSize; jt++) {
-#pragma unroll
           mask_vec[it][jt] = static_cast<MaskType>(rand[jt] >= dropout_prob);
         }
       }
diff --git a/paddle/fluid/operators/lookup_table_op.cu b/paddle/fluid/operators/lookup_table_op.cu
index 29079b8b13..c4ad8c21aa 100644
--- a/paddle/fluid/operators/lookup_table_op.cu
+++ b/paddle/fluid/operators/lookup_table_op.cu
@@ -31,16 +31,16 @@ __global__ void LookupTable(T *output, const T *table, const int64_t *ids,
 
   while (idy < K) {
     int64_t id = ids[idy];
-    PADDLE_ENFORCE(
-        id >= 0,
-        "Variable value (input) of OP(fluid.layers.embedding) "
-        "expected >= 0 and < %ld, but got %ld. Please check input value.",
-        N, id);
-    PADDLE_ENFORCE(
-        id < N,
-        "Variable value (input) of OP(fluid.layers.embedding) "
-        "expected >= 0 and < %ld, but got %ld. Please check input value.",
-        N, id);
+    // PADDLE_ENFORCE(
+    //     id >= 0,
+    //     "Variable value (input) of OP(fluid.layers.embedding) "
+    //     "expected >= 0 and < %ld, but got %ld. Please check input value.",
+    //     N, id);
+    // PADDLE_ENFORCE(
+    //     id < N,
+    //     "Variable value (input) of OP(fluid.layers.embedding) "
+    //     "expected >= 0 and < %ld, but got %ld. Please check input value.",
+    //     N, id);
     T *out = output + idy * D;
     const T *tab = table + id * D;
     for (int i = idx; i < D; i += BlockDimX) {
@@ -66,16 +66,16 @@ __global__ void LookupTableGrad(T *table, const T *output, const int64_t *ids,
 
   while (idy < K) {
     int64_t id = ids[idy];
-    PADDLE_ENFORCE(
-        id >= 0,
-        "Variable value (input) of OP(fluid.layers.embedding) "
-        "expected >= 0 and < %ld, but got %ld. Please check input value.",
-        N, id);
-    PADDLE_ENFORCE(
-        id < N,
-        "Variable value (input) of OP(fluid.layers.embedding) "
-        "expected >= 0 and < %ld, but got %ld. Please check input value.",
-        N, id);
+    // PADDLE_ENFORCE(
+    //     id >= 0,
+    //     "Variable value (input) of OP(fluid.layers.embedding) "
+    //     "expected >= 0 and < %ld, but got %ld. Please check input value.",
+    //     N, id);
+    // PADDLE_ENFORCE(
+    //     id < N,
+    //     "Variable value (input) of OP(fluid.layers.embedding) "
+    //     "expected >= 0 and < %ld, but got %ld. Please check input value.",
+    //     N, id);
     const T *out = output + idy * D;
     T *tab = table + id * D;
     for (int i = idx; i < D; i += BlockDimX) {
diff --git a/paddle/fluid/operators/margin_cross_entropy_op.cu b/paddle/fluid/operators/margin_cross_entropy_op.cu
index a2e34d9846..adfe0caafe 100644
--- a/paddle/fluid/operators/margin_cross_entropy_op.cu
+++ b/paddle/fluid/operators/margin_cross_entropy_op.cu
@@ -101,12 +101,12 @@ __global__ void AddMarginToPositiveLogitsKernel(
   int num_classes = class_interval_ptr[nranks];
   CUDA_KERNEL_LOOP(i, N) {
     auto real_label = label[i];
-    PADDLE_ENFORCE((real_label < num_classes) && (real_label >= 0),
-                   "The index is out of bounds, "
-                   "please check whether the value of label and "
-                   "input meet the number of class. It should "
-                   "be less than [%d], but received [%d]",
-                   num_classes, real_label);
+    // PADDLE_ENFORCE((real_label < num_classes) && (real_label >= 0),
+    //                "The index is out of bounds, "
+    //                "please check whether the value of label and "
+    //                "input meet the number of class. It should "
+    //                "be less than [%d], but received [%d]",
+    //                num_classes, real_label);
 
     if (real_label >= start_index && real_label < end_index) {
       int64_t offset = i * D + real_label - start_index;
diff --git a/paddle/fluid/operators/math/cross_entropy.cu b/paddle/fluid/operators/math/cross_entropy.cu
index 80e06d4b7f..002c01d0c4 100644
--- a/paddle/fluid/operators/math/cross_entropy.cu
+++ b/paddle/fluid/operators/math/cross_entropy.cu
@@ -29,10 +29,10 @@ __global__ void CrossEntropyKernel(T* Y, const T* X, const LabelT* label,
                                    const int ignore_index) {
   CUDA_KERNEL_LOOP(i, N) {
     auto lbl = static_cast<int64_t>(label[i]);
-    PADDLE_ENFORCE(lbl >= 0 && lbl < D || lbl == ignore_index,
-                   "The value of label[%d] expected >= 0 and < %ld, or == %ld, "
-                   "but got %ld. Please check input value.",
-                   i, D, ignore_index, lbl);
+    // PADDLE_ENFORCE(lbl >= 0 && lbl < D || lbl == ignore_index,
+    //                "The value of label[%d] expected >= 0 and < %ld, or == %ld, "
+    //                "but got %ld. Please check input value.",
+    //                i, D, ignore_index, lbl);
     Y[i] = ignore_index == lbl
                ? static_cast<T>(0)
                : -math::TolerableValue<T>()(real_log(X[i * D + lbl]));
diff --git a/paddle/phi/core/utils/type_info.h b/paddle/phi/core/utils/type_info.h
index 33a4e09933..e114cc0866 100644
--- a/paddle/phi/core/utils/type_info.h
+++ b/paddle/phi/core/utils/type_info.h
@@ -31,7 +31,7 @@ class TypeInfo {
   bool operator==(TypeInfo other) const { return id_ == other.id(); }
   bool operator!=(TypeInfo other) const { return id_ != other.id(); }
 
-  static const TypeInfo kUnknownType;
+  static  TypeInfo kUnknownType;
 
  private:
   friend class TypeRegistry<BaseT>;
diff --git a/paddle/phi/core/utils/type_registry.h b/paddle/phi/core/utils/type_registry.h
index f27c3db227..afacaa0437 100644
--- a/paddle/phi/core/utils/type_registry.h
+++ b/paddle/phi/core/utils/type_registry.h
@@ -78,7 +78,7 @@ const std::string& TypeInfo<BaseT>::name() const {
 }
 
 template <typename BaseT>
-const TypeInfo<BaseT> TypeInfo<BaseT>::kUnknownType =
+ TypeInfo<BaseT> TypeInfo<BaseT>::kUnknownType =
     RegisterStaticType<BaseT>("Unknown");
 
 }  // namespace phi
diff --git a/paddle/phi/kernels/funcs/gather.cu.h b/paddle/phi/kernels/funcs/gather.cu.h
index 617d249308..887af76d5f 100644
--- a/paddle/phi/kernels/funcs/gather.cu.h
+++ b/paddle/phi/kernels/funcs/gather.cu.h
@@ -57,14 +57,14 @@ __global__ void GatherNdCUDAKernel(const T* input,
     int64_t temp = slice_size;
     for (int64_t j = end_size - 1; j >= 0; --j) {
       auto index_value = indices[indices_i * end_size + j];
-      PADDLE_ENFORCE(
-          index_value >= 0 && index_value < input_dims[j],
-          "The index is out of bounds, "
-          "please check whether the dimensions of index and "
-          "input meet the requirements. It should "
-          "be less than [%d] and greater than or equal to 0, but received [%d]",
-          input_dims[j],
-          index_value);
+      // PADDLE_ENFORCE(
+      //     index_value >= 0 && index_value < input_dims[j],
+      //     "The index is out of bounds, "
+      //     "please check whether the dimensions of index and "
+      //     "input meet the requirements. It should "
+      //     "be less than [%d] and greater than or equal to 0, but received [%d]",
+      //     input_dims[j],
+      //     index_value);
       gather_i += (index_value * temp);
       temp *= input_dims[j];
     }
@@ -182,14 +182,14 @@ __global__ void GatherGPUKernel(const T* input,
     int64_t index_dim_index = next_idx / outer_dim_size;
     U index_val = index[index_dim_index];
 
-    PADDLE_ENFORCE(
-        index_val >= 0 && index_val < input_index_dim_size,
-        "The index is out of bounds, "
-        "please check whether the dimensions of index and "
-        "input meet the requirements. It should "
-        "be less than [%d] and greater than or equal to 0, but received [%d]",
-        input_index_dim_size,
-        index_val);
+    // PADDLE_ENFORCE(
+    //     index_val >= 0 && index_val < input_index_dim_size,
+    //     "The index is out of bounds, "
+    //     "please check whether the dimensions of index and "
+    //     "input meet the requirements. It should "
+    //     "be less than [%d] and greater than or equal to 0, but received [%d]",
+    //     input_index_dim_size,
+    //     index_val);
 
     int64_t out_dim_index = next_idx - outer_dim_size * index_dim_index;
     int64_t input_index =
diff --git a/paddle/phi/kernels/funcs/scatter.cu.h b/paddle/phi/kernels/funcs/scatter.cu.h
index 87083af3bc..a613907ff9 100644
--- a/paddle/phi/kernels/funcs/scatter.cu.h
+++ b/paddle/phi/kernels/funcs/scatter.cu.h
@@ -34,12 +34,12 @@ __global__ void ScatterInitCUDAKernel(const IndexT* indices,
     int64_t slice_i = i - indices_i * slice_size;  // offset inside the slice
     IndexT scatter_i = indices[indices_i];
 
-    PADDLE_ENFORCE(scatter_i >= 0,
-                   "The index is out of bounds, "
-                   "please check whether the dimensions of index and "
-                   "input meet the requirements. It should "
-                   "be greater than or equal to 0, but received [%d]",
-                   scatter_i);
+    // PADDLE_ENFORCE(scatter_i >= 0,
+    //                "The index is out of bounds, "
+    //                "please check whether the dimensions of index and "
+    //                "input meet the requirements. It should "
+    //                "be greater than or equal to 0, but received [%d]",
+    //                scatter_i);
 
     int64_t out_i = scatter_i * slice_size + slice_i;
     *(output + out_i) = static_cast<T>(0);
@@ -58,12 +58,12 @@ __global__ void ScatterCUDAKernel(const T* params,
     int64_t slice_i = i - indices_i * slice_size;  // offset inside the slice
     IndexT scatter_i = indices[indices_i];
 
-    PADDLE_ENFORCE(scatter_i >= 0,
-                   "The index is out of bounds, "
-                   "please check whether the dimensions of index and "
-                   "input meet the requirements. It should "
-                   "be greater than or equal to 0, but received [%d]",
-                   scatter_i);
+    // PADDLE_ENFORCE(scatter_i >= 0,
+    //                "The index is out of bounds, "
+    //                "please check whether the dimensions of index and "
+    //                "input meet the requirements. It should "
+    //                "be greater than or equal to 0, but received [%d]",
+    //                scatter_i);
 
     int64_t out_i = scatter_i * slice_size + slice_i;
     if (overwrite) {
@@ -90,14 +90,14 @@ __global__ void ScatterNdCUDAKernel(const T* update,
     for (int64_t j = end_size - 1; j >= 0; --j) {
       IndexT index_value = indices[indices_i * end_size + j];
 
-      PADDLE_ENFORCE(
-          index_value >= 0 && index_value < output_dims[j],
-          "The index is out of bounds, "
-          "please check whether the dimensions of index and "
-          "input meet the requirements. It should "
-          "be less than [%d] and greater or equal to 0, but received [%d]",
-          output_dims[j],
-          index_value);
+      // PADDLE_ENFORCE(
+      //     index_value >= 0 && index_value < output_dims[j],
+      //     "The index is out of bounds, "
+      //     "please check whether the dimensions of index and "
+      //     "input meet the requirements. It should "
+      //     "be less than [%d] and greater or equal to 0, but received [%d]",
+      //     output_dims[j],
+      //     index_value);
 
       gather_i += (index_value * temp);
       temp *= output_dims[j];
diff --git a/paddle/phi/kernels/funcs/segment_pooling.cu b/paddle/phi/kernels/funcs/segment_pooling.cu
index 95606b1526..1f53834450 100644
--- a/paddle/phi/kernels/funcs/segment_pooling.cu
+++ b/paddle/phi/kernels/funcs/segment_pooling.cu
@@ -46,13 +46,13 @@ __global__ void SegmentSumIdsKernel(const Index* segment_ids,
     T sum = T(0);
     for (Index j = 0; j < actual_height; j++) {
       Index current_segment_id = segment_ids[dim_index_base + j];
-      PADDLE_ENFORCE(current_segment_id >= last_segment_id,
-                     "the segment ids should be sorted, but got "
-                     "segment_ids[%d]:%d > segment_ids[%d]:%d.",
-                     dim_index_base + j - 1,
-                     dim_index_base + j,
-                     last_segment_id,
-                     current_segment_id);
+      // PADDLE_ENFORCE(current_segment_id >= last_segment_id,
+      //                "the segment ids should be sorted, but got "
+      //                "segment_ids[%d]:%d > segment_ids[%d]:%d.",
+      //                dim_index_base + j - 1,
+      //                dim_index_base + j,
+      //                last_segment_id,
+      //                current_segment_id);
       if (current_segment_id > last_segment_id) {
         for (Index interval_id = last_segment_id + 1;
              interval_id < current_segment_id;
@@ -148,13 +148,13 @@ __global__ void __launch_bounds__(1024, 1) SegmentOpsKernel(
     for (Index j = 0; j < actual_height; j++) {
       Index current_segment_id = segment_ids[dim_index_base + j];
       // ensure the segment_ids is sorted.
-      PADDLE_ENFORCE(current_segment_id >= last_segment_id,
-                     "The segment ids should be sorted, but got "
-                     "segment_ids[%d]:%d > segment_ids[%d]:%d.",
-                     dim_index_base + j - 1,
-                     dim_index_base + j,
-                     last_segment_id,
-                     current_segment_id);
+      // PADDLE_ENFORCE(current_segment_id >= last_segment_id,
+      //                "The segment ids should be sorted, but got "
+      //                "segment_ids[%d]:%d > segment_ids[%d]:%d.",
+      //                dim_index_base + j - 1,
+      //                dim_index_base + j,
+      //                last_segment_id,
+      //                current_segment_id);
 
       if (current_segment_id > last_segment_id) {
         // reset the interval value which do not have corresponding ids.
diff --git a/paddle/phi/kernels/gpu/auc_kernel.cu b/paddle/phi/kernels/gpu/auc_kernel.cu
index 5a1bb9874f..9483a93f27 100644
--- a/paddle/phi/kernels/gpu/auc_kernel.cu
+++ b/paddle/phi/kernels/gpu/auc_kernel.cu
@@ -69,9 +69,9 @@ __global__ void AddDataKernel(const int64_t *label_data,
   }
   CUDA_KERNEL_LOOP(i, numel) {
     auto predict_data = pred_data[i * inference_width + (inference_width - 1)];
-    PADDLE_ENFORCE(predict_data <= 1, "The predict data must less or equal 1.");
-    PADDLE_ENFORCE(predict_data >= 0,
-                   "The predict data must gather or equal 0.");
+    // PADDLE_ENFORCE(predict_data <= 1, "The predict data must less or equal 1.");
+    // PADDLE_ENFORCE(predict_data >= 0,
+    //                "The predict data must gather or equal 0.");
     uint32_t binIdx = static_cast<uint32_t>(predict_data * num_thresholds);
     if (label_data[i]) {
       paddle::platform::CudaAtomicAdd(pos + cur_step_begin + binIdx, 1);
diff --git a/paddle/phi/kernels/gpu/bce_loss_kernel.cu b/paddle/phi/kernels/gpu/bce_loss_kernel.cu
index adbcd3b2b6..f925af0c3d 100644
--- a/paddle/phi/kernels/gpu/bce_loss_kernel.cu
+++ b/paddle/phi/kernels/gpu/bce_loss_kernel.cu
@@ -36,10 +36,10 @@ struct BCELossFunctor {
   }
 
   HOSTDEVICE inline T operator()(const T x, const T label) const {
-    PADDLE_ENFORCE(
-        (x >= static_cast<T>(0)) && (x <= one),
-        "Input is expected to be within the interval [0, 1], but recieved %f.",
-        x);
+    // PADDLE_ENFORCE(
+    //     (x >= static_cast<T>(0)) && (x <= one),
+    //     "Input is expected to be within the interval [0, 1], but recieved %f.",
+    //     x);
     T term1 = max(phi::kps::details::Log(x), neg_100);
     T term2 = max(phi::kps::details::Log(one - x), neg_100);
     return (((label - one) * term2) - (label * term1));
diff --git a/paddle/phi/kernels/gpu/bernoulli_kernel.cu b/paddle/phi/kernels/gpu/bernoulli_kernel.cu
index 79d8a7b0f3..23878675b5 100644
--- a/paddle/phi/kernels/gpu/bernoulli_kernel.cu
+++ b/paddle/phi/kernels/gpu/bernoulli_kernel.cu
@@ -50,9 +50,9 @@ struct BernoulliCudaFunctor {
   __host__ __device__ T operator()(const unsigned int n, const T p) const {
     // NOTE(zhiqiu): currently, PADDLE_ENFORCE in cuda kernel may print several
     // lines of error messages if, and it should be refined.
-    PADDLE_ENFORCE(p >= 0.0 && p <= 1.0,
-                   "The probability should be >=0 and <= 1, but got %f",
-                   p);
+    // PADDLE_ENFORCE(p >= 0.0 && p <= 1.0,
+    //                "The probability should be >=0 and <= 1, but got %f",
+    //                p);
     thrust::minstd_rand rng;
     rng.seed(seed_);
     thrust::uniform_real_distribution<T> dist(0.0, 1.0);
diff --git a/paddle/phi/kernels/gpu/multinomial_kernel.cu b/paddle/phi/kernels/gpu/multinomial_kernel.cu
index ee5f843b18..615631d613 100644
--- a/paddle/phi/kernels/gpu/multinomial_kernel.cu
+++ b/paddle/phi/kernels/gpu/multinomial_kernel.cu
@@ -61,15 +61,15 @@ __global__ void NormalizeProbability(T* norm_probs,
   int id = threadIdx.x + blockIdx.x * blockDim.x +
            blockIdx.y * gridDim.x * blockDim.x;
   if (id < num_distributions * num_categories) {
-    PADDLE_ENFORCE(
-        in_data[id] >= 0.0,
-        "The input of multinomial distribution should be >= 0, but got %f.",
-        in_data[id]);
+    // PADDLE_ENFORCE(
+    //     in_data[id] >= 0.0,
+    //     "The input of multinomial distribution should be >= 0, but got %f.",
+    //     in_data[id]);
     int64_t row_id = id / num_categories;
-    PADDLE_ENFORCE(sum_rows[row_id] > 0.0,
-                   "The sum of one multinomial distribution probability should "
-                   "be > 0, but got %f.",
-                   sum_rows[row_id]);
+    // PADDLE_ENFORCE(sum_rows[row_id] > 0.0,
+    //                "The sum of one multinomial distribution probability should "
+    //                "be > 0, but got %f.",
+    //                sum_rows[row_id]);
     norm_probs[id] = in_data[id] / sum_rows[row_id];
   }
 }
diff --git a/paddle/phi/kernels/gpu/nll_loss.h b/paddle/phi/kernels/gpu/nll_loss.h
index a457264498..9905f21510 100644
--- a/paddle/phi/kernels/gpu/nll_loss.h
+++ b/paddle/phi/kernels/gpu/nll_loss.h
@@ -45,8 +45,8 @@ __global__ void GPUNLLLossForward1D_no_reduce(T* out_data,
       out_data[i] = 0;
       continue;
     }
-    PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
-                   "label should not be out of bounds.");
+    // PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
+    //                "label should not be out of bounds.");
     const T cur_weight = weight_data ? weight_data[cur_label] : (T)1;
     out_data[i] = -x_data[i * n_classes + cur_label] * cur_weight;
   }
@@ -69,8 +69,8 @@ __global__ void GPUNLLLossForward1D_with_reduce(T* out_data,
   for (i = threadIdx.x; i < batch_size; i += NTHREADS) {
     const auto cur_label = label_data[i];
     if (cur_label != ignore_index) {
-      PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
-                     "label should not be out of bounds.");
+      // PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
+      //                "label should not be out of bounds.");
       const auto cur_weight = weight_data ? weight_data[cur_label] : (T)1;
       sharedInputs[threadIdx.x] -=
           x_data[i * n_classes + cur_label] * cur_weight;
@@ -217,8 +217,8 @@ __global__ void GPUNLLLossForward2D_no_reduce(T* out_data,
       out_data[index] = 0;
       continue;
     }
-    PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
-                   "label should not be out of bounds.");
+    // PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
+    //                "label should not be out of bounds.");
     const T cur_weight = weight_data ? weight_data[cur_label] : (T)1;
     out_data[index] =
         -x_data[b * sample_size + cur_label * map_size + h * in_dim3 + w] *
@@ -253,8 +253,8 @@ __global__ void GPUNLLLossForward2D_with_reduce(T* out_data,
        i += step) {
     const int64_t cur_label = label_data[toffset + i];
     if (cur_label != ignore_index) {
-      PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
-                     "label should not be out of bounds.");
+      // PADDLE_ENFORCE(cur_label >= 0 && cur_label < n_classes,
+      //                "label should not be out of bounds.");
       const T cur_weight = weight_data ? weight_data[cur_label] : (T)1;
       input_sum -= x_data[ioffset + i + map_nelem * cur_label] * cur_weight;
       acc_weight += cur_weight;
diff --git a/paddle/phi/kernels/gpu/one_hot_kernel.cu b/paddle/phi/kernels/gpu/one_hot_kernel.cu
index 2ae9e9333e..509b5c8c67 100644
--- a/paddle/phi/kernels/gpu/one_hot_kernel.cu
+++ b/paddle/phi/kernels/gpu/one_hot_kernel.cu
@@ -30,12 +30,12 @@ __global__ void FillOutputKernel(const InT* p_in_data,
                                  const int depth) {
   int idx = blockIdx.x * blockDim.x + threadIdx.x;
   if (idx < numel) {
-    PADDLE_ENFORCE(p_in_data[idx] >= 0 && p_in_data[idx] < depth,
-                   "Illegal index value, Input(input) value should be "
-                   "greater than or equal to 0, and less than depth [%d], "
-                   "but received [%lld].",
-                   depth,
-                   p_in_data[idx]);
+    // PADDLE_ENFORCE(p_in_data[idx] >= 0 && p_in_data[idx] < depth,
+    //                "Illegal index value, Input(input) value should be "
+    //                "greater than or equal to 0, and less than depth [%d], "
+    //                "but received [%lld].",
+    //                depth,
+    //                p_in_data[idx]);
 
     *(p_out_data + (idx * depth) + p_in_data[idx]) = 1.0;
   }
diff --git a/paddle/utils/flat_hash_map.h b/paddle/utils/flat_hash_map.h
index 64a75fffa5..eae4c00612 100644
--- a/paddle/utils/flat_hash_map.h
+++ b/paddle/utils/flat_hash_map.h
@@ -123,12 +123,12 @@ static constexpr int8_t min_lookups = 4;
 template <typename T>
 struct sherwood_v3_entry {
   sherwood_v3_entry() {}
-  sherwood_v3_entry(int8_t distance_from_desired)
-      : distance_from_desired(distance_from_desired) {}
+  sherwood_v3_entry(int8_t distance_from_desired, bool isDefault = false)
+      : distance_from_desired(distance_from_desired), isDefault(isDefault){}
   ~sherwood_v3_entry() {}
   static sherwood_v3_entry *empty_default_table() {
     static sherwood_v3_entry result[min_lookups] = {
-        {}, {}, {}, {special_end_value}};
+      {-1, true}, {}, {}, {special_end_value} };
     return result;
   }
 
@@ -147,6 +147,7 @@ struct sherwood_v3_entry {
   }
 
   int8_t distance_from_desired = -1;
+  bool isDefault = false;
   static constexpr int8_t special_end_value = 0;
   union {
     T value;
@@ -745,7 +746,7 @@ class sherwood_v3_table : private EntryAlloc, private Hasher, private Equal {
   void deallocate_data(EntryPointer begin,
                        size_t num_slots_minus_one,
                        int8_t max_lookups) {
-    if (begin != Entry::empty_default_table()) {
+    if (!static_cast<sherwood_v3_entry<T>*>(begin)[0].isDefault) {
       AllocatorTraits::deallocate(
           *this, begin, num_slots_minus_one + max_lookups + 1);
     }
