Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions paddle/phi/kernels/funcs/lamb_functors.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ struct LambBetaPowUpdateFunctor<MT, /*NeedUpdateBetaPow=*/false> {
};

template <typename T, typename MT, bool IsMultiPrecision, bool UpdateBetaPow>
struct LambParamUpateFunctor
struct LambParamUpdateFunctor
: public LambBetaPowUpdateFunctor<MT, UpdateBetaPow> {
const MT* lr_;
const T* param_;
Expand All @@ -421,15 +421,15 @@ struct LambParamUpateFunctor

const bool* skip_update_;

LambParamUpateFunctor(const MT* lr,
const T* param,
const MT* master_param,
const MT* param_norm,
const MT* trust_ratio_div,
const MT* trust_ratio_div_norm,
T* param_out,
MT* master_param_out,
const bool* skip_update)
LambParamUpdateFunctor(const MT* lr,
const T* param,
const MT* master_param,
const MT* param_norm,
const MT* trust_ratio_div,
const MT* trust_ratio_div_norm,
T* param_out,
MT* master_param_out,
const bool* skip_update)
: lr_(lr),
param_(param),
master_param_(master_param),
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/kernels/impl/adagrad_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ void AdagradSparseKernel(const Context& ctx,
PADDLE_ENFORCE_EQ(param_tensor,
param_out_tensor,
phi::errors::InvalidArgument(
"the input tensor not euqal with output tensor"));
"the input tensor not equal with output tensor"));

auto* moment_tensor = &moment_t;
PADDLE_ENFORCE_EQ(moment_tensor,
moment_out_tensor,
phi::errors::InvalidArgument(
"the input moment not eual with output moment"));
"the input moment not equal with output moment"));

SparseAdagradFunctor<Context, T> functor;
functor(
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/impl/bilinear_grad_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void BilinearGradKernel(const Context& ctx,

auto blas = funcs::GetBlas<Context, T>(ctx);

// Caculate the Output(X@Grad) and Output(Y@Grad).
// Calculate the Output(X@Grad) and Output(Y@Grad).
if (dx || dy || dweight) {
Eigen::DSizes<int, 2> bcast_for_x(1, y_dim);
Eigen::DSizes<int, 2> bcast_for_y(1, x_dim);
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/impl/dot_grad_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ struct DotTripleGradFunction {
DenseTensor* out_tensor_d_ddy);
};

// TODO(wuweilong): enable this function when the unittests framewark for multi
// TODO(wuweilong): enable this function when the unittest framework for multi
// grad is ok (dtype: complex64 or complex128).
template <typename DeviceContext, typename T>
struct DotTripleGradFunction<DeviceContext, T, phi::funcs::EnableComplex<T>> {
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/kernels/impl/einsum_grad_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ DenseTensor PerformTileAndReduction(const Context& dev_ctx,
for (size_t i = 0; i < ellipsis_dims.size(); ++i)
if (ellipsis_dims[i] == 1) to_reduce.push_back(i + new_offset);

VLOG(5) << "PermformTileAndReduction: reduce sum axis: "
VLOG(5) << "PerformTileAndReduction: reduce sum axis: "
<< paddle::string::join_strings(to_reduce, ",");
if (to_reduce.size() != 0) {
ret = Sum<T, Context>(dev_ctx,
Expand All @@ -98,7 +98,7 @@ DenseTensor PerformTileAndReduction(const Context& dev_ctx,
} else {
ret = after_tile;
}
VLOG(5) << "PermformTileAndReduction: recover shape: "
VLOG(5) << "PerformTileAndReduction: recover shape: "
<< paddle::string::join_strings(recover_shape, ",");
ret.Resize(common::make_ddim(recover_shape));
// undiagonalize by einsum equation. only contain undiagonal operations.
Expand Down
6 changes: 3 additions & 3 deletions paddle/phi/kernels/impl/einsum_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ inline static void InferLabelPerm(const CharIterable& op,
int cur = 0;
for (int c : op) {
if (!label2perm->exist(
c)) // can appear repeatly. we just record the first position.
c)) // can appear repeatedly. we just record the first position.
(*label2perm)[c] = cur;
if (c == '.') {
cur += n_broadcast;
Expand Down Expand Up @@ -391,9 +391,9 @@ std::vector<T> GetShapeByType(const std::vector<char>& all_labels,
}

inline static std::vector<int> perm_moveto(int n, int from, int to) {
// a permution means moving `from` to `to`.
// a permutation means moving `from` to `to`.
/*
f => t permtation
f => t permutation
--------------------
0 1 2 3 4 5
5 => 2 : 0 2 5 2 3 4
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/impl/kron_grad_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ struct KronGradOpFunctor {
p_shape_y = dim_y.Get();
#endif
// dout_x: dout * kron(ones(X), Y) re-aranged in shape (numel_x, numel_y)
// dout_y: dout * kron(X, ones(Y)) re-aranged in shaoe (numel_y, numel_x)
// dout_y: dout * kron(X, ones(Y)) re-aranged in shape (numel_y, numel_x)
DenseTensor dout_x;
T *p_dout_x = nullptr;
if (dx) {
Expand Down
42 changes: 21 additions & 21 deletions paddle/phi/kernels/impl/lamb_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,27 +282,27 @@ void ComputeImpl(const Context& dev_ctx,
<< " , tn = " << tn[0];
}

#define CALL_PADDLE_UPDATE_LAMB_PARAM_FUNC(__should_update_beta_pow) \
do { \
LambParamUpateFunctor<T, MT, IsMultiPrecision, __should_update_beta_pow> \
param_update_functor(lr.template data<MT>(), \
static_cast<const T*>(param_ptr), \
static_cast<const MT*>(master_param_ptr), \
p_norm_ptr, \
trust_ratio_div_ptr, \
trust_ratio_div_norm_ptr, \
static_cast<T*>(param_out_ptr), \
static_cast<MT*>(master_param_out_ptr), \
skip_update_flag); \
if (__should_update_beta_pow) { \
param_update_functor.SetBetaPows(beta1_pow_ptr, \
beta2_pow_ptr, \
beta1_pow_out_ptr, \
beta2_pow_out_ptr, \
beta1, \
beta2); \
} \
for_range(param_update_functor); \
#define CALL_PADDLE_UPDATE_LAMB_PARAM_FUNC(__should_update_beta_pow) \
do { \
LambParamUpdateFunctor<T, MT, IsMultiPrecision, __should_update_beta_pow> \
param_update_functor(lr.template data<MT>(), \
static_cast<const T*>(param_ptr), \
static_cast<const MT*>(master_param_ptr), \
p_norm_ptr, \
trust_ratio_div_ptr, \
trust_ratio_div_norm_ptr, \
static_cast<T*>(param_out_ptr), \
static_cast<MT*>(master_param_out_ptr), \
skip_update_flag); \
if (__should_update_beta_pow) { \
param_update_functor.SetBetaPows(beta1_pow_ptr, \
beta2_pow_ptr, \
beta1_pow_out_ptr, \
beta2_pow_out_ptr, \
beta1, \
beta2); \
} \
for_range(param_update_functor); \
} while (0)

if (should_update_beta_pow_later) {
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/kernels/impl/matmul_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1478,12 +1478,12 @@ void MatmulKernel(const Context& ctx,
common::product(x.dims()),
0,
phi::errors::InvalidArgument("The Input(X) dims size must not be equal "
"0, but reviced dims size is 0."));
"0, but received dims size is 0."));
PADDLE_ENFORCE_NE(
common::product(y.dims()),
0,
phi::errors::InvalidArgument("The Input(Y) dims size must not be equal "
"0, but reviced dims size is 0."));
"0, but received dims size is 0."));
const std::vector<std::int64_t> x_dims = common::vectorize(x.dims());
const std::vector<std::int64_t> y_dims = common::vectorize(y.dims());
MatmulJudgeDtypeKernel<Context, T>(
Expand Down
42 changes: 21 additions & 21 deletions paddle/phi/kernels/selected_rows/impl/lamb_kernel_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,27 +337,27 @@ void ComputeRowImpl(const Context& dev_ctx,
<< " , tn = " << tn[0];
}

#define CALL_PADDLE_UPDATE_LAMB_PARAM_FUNC(__should_update_beta_pow) \
do { \
LambParamUpateFunctor<T, MT, IsMultiPrecision, __should_update_beta_pow> \
param_update_functor(lr.template data<MT>(), \
static_cast<const T*>(param_ptr), \
static_cast<const MT*>(master_param_ptr), \
p_norm_ptr, \
trust_ratio_div_ptr, \
trust_ratio_div_norm_ptr, \
static_cast<T*>(param_out_ptr), \
static_cast<MT*>(master_param_out_ptr), \
skip_update_flag); \
if (__should_update_beta_pow) { \
param_update_functor.SetBetaPows(beta1_pow_ptr, \
beta2_pow_ptr, \
beta1_pow_out_ptr, \
beta2_pow_out_ptr, \
beta1, \
beta2); \
} \
for_range(param_update_functor); \
#define CALL_PADDLE_UPDATE_LAMB_PARAM_FUNC(__should_update_beta_pow) \
do { \
LambParamUpdateFunctor<T, MT, IsMultiPrecision, __should_update_beta_pow> \
param_update_functor(lr.template data<MT>(), \
static_cast<const T*>(param_ptr), \
static_cast<const MT*>(master_param_ptr), \
p_norm_ptr, \
trust_ratio_div_ptr, \
trust_ratio_div_norm_ptr, \
static_cast<T*>(param_out_ptr), \
static_cast<MT*>(master_param_out_ptr), \
skip_update_flag); \
if (__should_update_beta_pow) { \
param_update_functor.SetBetaPows(beta1_pow_ptr, \
beta2_pow_ptr, \
beta1_pow_out_ptr, \
beta2_pow_out_ptr, \
beta1, \
beta2); \
} \
for_range(param_update_functor); \
} while (0)

if (should_update_beta_pow_later) {
Expand Down