-
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
【Hackathon 5th No.104】move fusion_repeated_fc_relu/fusion_squared_mat_sub to phi #58300
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
scaled_dp_attention_functor.h的L330-L333 请问,上面的链接对应的代码部分会因为 |
这个是当时在fluid下添加这个算子的PR #54139 ,看起来由于这个条件满足才会去编这个算子 |
if(WITH_AVX
AND AVX512F_FOUND
AND AVX512F_FLAG
AND WITH_MKL)
# nothing
else()
list(REMOVE_ITEM kernel_cc "cpu/self_dp_attention_kernel.cc")
endif() |
额,已添加(已执行make clean+cmake),但还是说 |
这样写~ if(WITH_AVX
AND AVX512F_FOUND
AND AVX512F_FLAG
AND WITH_MKL)
# nothing
else()
list(REMOVE_ITEM kernel_cc "fusion/cpu/self_dp_attention_kernel.cc")
endif() |
也不行,(:з」∠) |
在remove item前后打印一下 kernel_cc,看一下是否真的被移出去了 |
他编译的时候走的是if分支,所以没有移出去 |
写在if分支里。。 if(WITH_AVX
AND AVX512F_FOUND
AND AVX512F_FLAG
AND WITH_MKL)
# nothing
else()
list(REMOVE_ITEM kernel_cc "fusion/cpu/self_dp_attention_kernel.cc")
endif() 不过我估计也不行 |
确实不行 |
Sorry to inform you that bfe2cae's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
好像写在 |
paddle/phi/CMakeLists.txt
Outdated
kernels/fusion/cpu/self_dp_attention_kernel.cc | ||
PROPERTIES COMPILE_FLAGS "-Wno-maybe-uninitialized -mfma ${AVX512F_FLAG}") | ||
else() | ||
list(REMOVE_ITEM kernel_cc "fusion/cpu/self_dp_attention_kernel.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.
这一行需要写到paddle/phi/kernels目录下,不然"fusion/cpu/self_dp_attention_kernel.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.
是否可以将路径改成“"kernels/fusion/cpu/self_dp_attention_kernel.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.
所以REMOVE_ITEM操作和set_source_files_properties分开写在不同的目录下
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/CMakeLists.txt
Outdated
AND AVX512F_FOUND | ||
AND AVX512F_FLAG | ||
AND WITH_MKL) | ||
set_source_files_properties( |
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.
kernels/funcs/scaled_dp_attention_functor.h文件就不需要set_source_files_properties了吧,.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.
好的我去除一下
set_target_properties( | ||
self_dp_attention_op | ||
PROPERTIES COMPILE_FLAGS "-Wno-maybe-uninitialized -mfma ${AVX512F_FLAG}") | ||
|
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.
这个if分支已经空了,为了不删掉?
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/CMakeLists.txt
Outdated
set_source_files_properties( | ||
kernels/fusion/cpu/self_dp_attention_kernel.cc | ||
PROPERTIES COMPILE_FLAGS "-Wno-maybe-uninitialized -mfma ${AVX512F_FLAG}") | ||
else() | ||
list(REMOVE_ITEM kernel_cc "fusion/cpu/self_dp_attention_kernel.cc") | ||
list(REMOVE_ITEM kernel_cc "kernels/fusion/cpu/self_dp_attention_kernel.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.
把这个else分支删掉,把if判断取反,把REMOVE_ITEM写在kernel/CMakeLists.txt里。kernel_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.
哦哦,明白了
好吧 |
这是self_dp_attention的新pr链接#58715 |
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
infer_meta : | ||
func : FusionRepeatedFCReluInferMeta | ||
kernel : | ||
func : fusion_repeated_fc_relu |
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.
需要对齐原来的逻辑,指定kernel的data_type
为 x
infer_meta : | ||
func : FusionSquaredMatSubInferMeta | ||
kernel : | ||
func : fusion_squared_mat_sub |
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.
同上
out->set_dims({i_dims[0], w_dims[sz - 1][1]}); | ||
out->share_lod(x); |
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.
dtype 也设置下
paddle/phi/infermeta/fusion.cc
Outdated
squared_x->set_dims(x_dims); | ||
squared_y->set_dims(y_dims); | ||
squared_xy->set_dims({x_dims[0], y_dims[1]}); | ||
out->set_dims({x_dims[0], y_dims[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.
设置 dtype
rollback add the type Update fusion.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.
LGTM
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 check_dygraph
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
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, no docs changes
这个冲突了,麻烦处理下再合入吧,另一个已经合入了 |
bf395f1
PR types
Others
PR changes
Others
Description
move fusion_repeated_fc_relu/fusion_squared_mat_sub to phi
#57262