-
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
[PHI decoupling] move softmax from fluid to phi and remove cpu_vec.h in fluid #48970
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
#include "paddle/phi/core/dense_tensor.h" | ||
#include "paddle/phi/kernels/funcs/eigen/extensions.h" | ||
#include "unsupported/Eigen/CXX11/Tensor" |
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.
#ifndef PADDLE_WITH_XBYAK | ||
#ifdef _WIN32 | ||
#define cpuid(reg, x) __cpuidex(reg, x, 0) | ||
#else | ||
#if !defined(WITH_NV_JETSON) && !defined(PADDLE_WITH_ARM) && \ | ||
!defined(PADDLE_WITH_SW) && !defined(PADDLE_WITH_MIPS) | ||
#include <cpuid.h> | ||
inline void cpuid(int reg[4], int x) { | ||
__cpuid_count(x, 0, reg[0], reg[1], reg[2], reg[3]); | ||
} | ||
#endif | ||
#endif | ||
#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.
CI-Windows-OPENBLAS 里有一个关于这段代码的报错我处理不了了
2022-12-10 11:56:16 FAILED: paddle/phi/backends/CMakeFiles/phi_backends.dir/cpu/cpu_info.cc.obj
...
2022-12-10 11:56:16 ..\paddle\phi\backends\cpu\cpu_info.cc(71): error C3861: '__cpuidex': identifier not found
2022-12-10 11:56:16 ..\paddle\phi\backends\cpu\cpu_info.cc(75): error C3861: '__cpuidex': identifier not found
2022-12-10 11:56:16 ..\paddle\phi\backends\cpu\cpu_info.cc(84): error C3861: '__cpuidex': identifier not found
2022-12-10 11:56:18 ..\paddle\phi\backends\cpu\cpu_info.cc(102): error C3861: '__cpuidex': identifier not found
phi
下的 cpu_info.cc
是我这次 PR 新加的,报错说找不到 __cpuidex
这个函数的声明,但在 cpu_info.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.
@YuanRisheng 帮忙看一下这个问题
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.
代码没看出啥问题,我先rerun下看看情况
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.
我先本地调试复现一下问题
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.
这个我本地解决了,目前不太清楚具体原因,但从经验角度考虑,问题的原因很可能是cmake依赖关系混乱出现的问题,Fluid下cpu_info被好几个地方依赖,cpu_info又依赖phi_backends,phi_backends本身又被好几个地方依赖,感觉很乱。我本地把Fluid目录下的cpu_info.cc全部挪到PHI下后,删了Fluid的cmakelist里的cpu_info编译target,把Fluid依赖cpu_info的地方替换成phi_backends后,本地编译可以通过,你可以试试。
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.
这个我本地解决了,目前不太清楚具体原因,但从经验角度考虑,问题的原因很可能是cmake依赖关系混乱出现的问题,Fluid下cpu_info被好几个地方依赖,cpu_info又依赖phi_backends,phi_backends本身又被好几个地方依赖,感觉很乱。我本地把Fluid目录下的cpu_info.cc全部挪到PHI下后,删了Fluid的cmakelist里的cpu_info编译target,把Fluid依赖cpu_info的地方替换成phi_backends后,本地编译可以通过,你可以试试。
好的,我试一下,谢谢老师
@YuanRisheng ,帮忙 Review 一下 |
@@ -9,7 +9,7 @@ file(APPEND ${jit_file} "\#include \"paddle/fluid/operators/jit/helper.h\"\n") | |||
file(APPEND ${jit_file} | |||
"\#include \"paddle/fluid/operators/jit/registry.h\"\n\n") | |||
|
|||
set(JIT_KERNEL_DEPS cpu_info cblas gflags enforce place xxhash) | |||
set(JIT_KERNEL_DEPS device_context cblas gflags enforce place xxhash) |
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.
这里device_context能否改成phi_backends?
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.
@YuanRisheng 这里我最开始用的是 phi_backends,然后编译报了找不到 device_context 中一些定义的错误,然后我就改成了 device_context(device_context 也依赖了 phi_backends)
paddle/fluid/platform/cpu_info.h
Outdated
#endif | ||
#endif | ||
#endif | ||
|
||
#include "paddle/phi/backends/cpu/cpu_info.h" | ||
|
||
namespace paddle { |
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.
直接把cpu_info.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.
已处理
@YuanRisheng 可以再review一下 |
@luotao1 ,CI-OP-benchmark 超时取消需要怎么处理,昨天也是这个情况 Rerun 后还是一样的结果 |
Done 已豁免 |
@XiaoguangHu01, Request approval for change 20+ files |
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
@luotao1,帮忙 Merge 一下 |
PR types
Others
PR changes
Others
Describe
softmax.h
,softmax_impl.h
,softmax.cc
,softmax.cu
从paddle/fluid/operators/math/
目录移动到paddle/phi/kernels/funcs/
目录。cpu_info
完全移动到phi
下paddle/fluid/operators/math/cpu_vec.h
,因为paddle/phi/kernels/funcs/cpu_vec.h
有相同的实现