-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move renorm op #44676
move renorm op #44676
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
paddle/phi/kernels/funcs/renorm.h
Outdated
// #if defined(__NVCC__) || defined(__HIPCC__) | ||
// #include "paddle/fluid/platform/device/gpu/gpu_primitives.h" | ||
// #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无用的注释删掉
paddle/phi/kernels/funcs/renorm.h
Outdated
// auto& dev_ctx = ctx.template device_context<DeviceContext>(); | ||
// std::vector<int64_t> dim_index(dim_size, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些注释应该是无用代码,删掉吧
paddle/phi/kernels/funcs/renorm.h
Outdated
// auto* out_data = | ||
// out->mutable_data<T>(context.GetPlace(), size_t(numel * sizeof(T))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
paddle/phi/kernels/funcs/renorm.h
Outdated
for (int i = 0; i < dim; i++) pre_mul *= input_dims[i]; | ||
pow_value.Resize(phi::make_ddim({pre_mul, dimension_each, dim_divisor})); | ||
dim_value.Resize(phi::make_ddim({dimension_each})); | ||
// pow_value.mutable_data<T>(context.GetPlace()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
paddle/phi/kernels/funcs/renorm.h
Outdated
// out->Resize(phi::make_ddim(phi::vectorize(input_dims))); | ||
// T* out_data = out->mutable_data<T>(context.GetPlace()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
paddle/phi/kernels/funcs/renorm.h
Outdated
// std::vector<const framework::Tensor*> ins = {x}; | ||
// std::vector<framework::Tensor*> outs = {&pow_value}; | ||
// auto func = UnsignedPowFunctor<MT, T>(p); | ||
// const auto& cuda_ctx = | ||
// context.template device_context<platform::CUDADeviceContext>(); | ||
|
||
// paddle::operators::LaunchSameDimsElementwiseCudaKernel<T>( | ||
// cuda_ctx, ins, &outs, func); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
paddle/phi/kernels/funcs/renorm.h
Outdated
|
||
#pragma once | ||
|
||
#include "paddle/fluid/memory/buffer.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个头文件有用到吗,没用到可以删掉
py_test_modules(test_renorm_op_without_eager MODULES test_renorm_op ENVS | ||
FLAGS_enable_eager_mode=0) | ||
|
||
set_tests_properties(test_renorm_op_without_eager PROPERTIES TIMEOUT 120) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里修改的原因是?
paddle/phi/kernels/funcs/renorm.h
Outdated
@@ -0,0 +1,390 @@ | |||
// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件我看只有renorm用到了,可以放到impl下,funcs下一般是放置通用的函数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for set_tests_properties(test_renorm_op_without_eager PROPERTIES TIMEOUT 120)
PR types
Function optimization
PR changes
Others
Describe
move renorm op