-
Notifications
You must be signed in to change notification settings - Fork 5.8k
【Hackathon 6th No.54】move fake_quantize_abs_max op to phi - part #63610
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
看起来fluid下的kernel/functor实现并没有给删去,是为什么? |
疏忽了,正在本地删除,晚点本地测试通过后commit |
|
||
#pragma once | ||
|
||
#include "paddle/common/hostdevice.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.
这个头文件需要?
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.
已移除
#pragma once | ||
|
||
#include "paddle/common/hostdevice.h" | ||
#include "paddle/phi/kernels/funcs/fake_quantize_functor.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.
这个头文件可以在.cc中包含吧?需要挪过去
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.
.cc文件和.cu文件都涉及到fake_quantize_functor.h里的functor,所以我觉得因为.cc和.cu都要引fake_quantize_abs_max_kernel.h,所以直接在头文件里定义可能会比较好
#include "paddle/phi/backends/all_context.h" | ||
#include "paddle/phi/common/scalar.h" | ||
#include "paddle/phi/common/transform.h" | ||
#include "paddle/phi/core/dense_tensor.h" | ||
#include "paddle/phi/kernels/funcs/blas/blas.h" | ||
#include "paddle/phi/kernels/funcs/eigen/common.h" | ||
#include "paddle/phi/kernels/impl/clip_kernel_impl.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.
hostdevice.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.
已添加
CI已通过,劳烦老师看一下,因为剩下其他算子在有本PR新增的paddle/phi/kernels/funcs/fake_quantize_functor.h文件后,迁移起来会方便一些。@yuanlehome |
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.
phi下我们分配内存不使用mutable_data,需要改用为dev_ctx.template Alloc<T>(out);
已修改 |
处理下冲突吧 |
Done |
@@ -1099,8 +1099,11 @@ | |||
attrs : [int round_type = 1] | |||
|
|||
- op : fake_quantize_abs_max | |||
extra : | |||
attrs : [int round_type = 1] |
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.
对了,这个部分的round_type的属性本身是放在extra里的,但是后面在phi的kernel实现里,没能找到对应获取的方法,所以直接设置成kernel的参数了,不知道是否可以?
…dlePaddle#63610) * move fake_quantize_abs_max op to phi * fix the bug in include * remove the impl in fluid * change the include * modify mutable_data to Alloc * fix typo * fix typo * create a impl file * fix the namespace * merge all fake_quantize_kernel to a file
PR Category
Others
PR Types
Others
Description
move fake_quantize_abs_max op to phi