-
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] Support bmm and bmm_grad in xpu #45887
Conversation
paddle/phi/kernels/xpu/bmm_kernel.cc
Outdated
#include "paddle/phi/kernels/bmm_kernel.h" | ||
|
||
#include "paddle/phi/backends/xpu/enforce_xpu.h" | ||
#include "paddle/phi/backends/xpu/xpu_context.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.
done
paddle/phi/kernels/xpu/bmm_kernel.cc
Outdated
#include "paddle/phi/core/kernel_registry.h" | ||
|
||
// See Note [ Why still include the fluid headers? ] | ||
#include "paddle/fluid/platform/device/xpu/xpu_header.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.
done
|
||
#include "paddle/phi/kernels/bmm_grad_kernel.h" | ||
|
||
#include "paddle/phi/backends/xpu/xpu_context.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.
done
#include "paddle/phi/kernels/impl/matmul_grad_kernel_impl.h" | ||
|
||
// See Note [ Why still include the fluid headers? ] | ||
#include "paddle/fluid/platform/device/xpu/xpu_header.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.
removed
paddle/phi/kernels/xpu/bmm_kernel.cc
Outdated
namespace phi { | ||
|
||
template <typename T, typename FCT> | ||
static void MatMulXPUFunction(const DenseTensor& 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.
建议抽一个公共的头文件
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.
done
paddle/phi/kernels/xpu/bmm_kernel.cc
Outdated
} | ||
} // namespace phi | ||
|
||
PD_REGISTER_KERNEL(bmm, XPU, ALL_LAYOUT, phi::BmmKernel, float) {} |
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.
这里的类型,少了一个float16?
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.
done
* support bmm and bmm_grad in xpu * add error removal * test=kunlun * refactor code for better structure * test=kunlun * add fp16 kernel for bmm * test=kunlun
PR types
Others
PR changes
Others
Describe
Support bmm and bmm grad on XPU in Phi