未验证 提交 87667c66 编写于 作者: W wbn 提交者: GitHub

Add the new XDNN implementation. test=kunlun (#42683)

* Add the new XDNN implementation. test=kunlun

* Add the new XDNN implementation. test=kunlun

* Modify the code based on review, test=kunlun
上级 34cda80b
...@@ -9,7 +9,7 @@ SET(XPU_RT_LIB_NAME "libxpurt.so") ...@@ -9,7 +9,7 @@ SET(XPU_RT_LIB_NAME "libxpurt.so")
if(NOT DEFINED XPU_BASE_URL) if(NOT DEFINED XPU_BASE_URL)
SET(XPU_BASE_URL_WITHOUT_DATE "https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev") SET(XPU_BASE_URL_WITHOUT_DATE "https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev")
SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220510") SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220511")
else() else()
SET(XPU_BASE_URL "${XPU_BASE_URL}") SET(XPU_BASE_URL "${XPU_BASE_URL}")
endif() endif()
...@@ -17,7 +17,7 @@ endif() ...@@ -17,7 +17,7 @@ endif()
# ubuntu and centos: use output by XDNN API team # ubuntu and centos: use output by XDNN API team
if(NOT DEFINED XPU_XDNN_BASE_URL) if(NOT DEFINED XPU_XDNN_BASE_URL)
SET(XPU_XDNN_BASE_URL_WITHOUT_DATE "https://klx-sdk-release-public.su.bcebos.com/xdnn/dev") SET(XPU_XDNN_BASE_URL_WITHOUT_DATE "https://klx-sdk-release-public.su.bcebos.com/xdnn/dev")
SET(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220510") SET(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220511")
else() else()
SET(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}") SET(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}")
endif() endif()
......
...@@ -12,6 +12,7 @@ limitations under the License. */ ...@@ -12,6 +12,7 @@ limitations under the License. */
#include <memory> #include <memory>
#include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/platform/device/device_wrapper.h"
namespace paddle { namespace paddle {
namespace operators { namespace operators {
...@@ -21,7 +22,6 @@ template <typename DeviceContext, typename T, typename AttrType = T> ...@@ -21,7 +22,6 @@ template <typename DeviceContext, typename T, typename AttrType = T>
class LogLossXPUKernel : public framework::OpKernel<T> { class LogLossXPUKernel : public framework::OpKernel<T> {
public: public:
void Compute(const framework::ExecutionContext& ctx) const override { void Compute(const framework::ExecutionContext& ctx) const override {
/*** TODO wait XDNN new interface
auto* predict = ctx.Input<Tensor>("Predicted"); auto* predict = ctx.Input<Tensor>("Predicted");
auto* labels = ctx.Input<Tensor>("Labels"); auto* labels = ctx.Input<Tensor>("Labels");
auto* loss = ctx.Output<Tensor>("Loss"); auto* loss = ctx.Output<Tensor>("Loss");
...@@ -29,26 +29,15 @@ class LogLossXPUKernel : public framework::OpKernel<T> { ...@@ -29,26 +29,15 @@ class LogLossXPUKernel : public framework::OpKernel<T> {
loss->mutable_data<T>(ctx.GetPlace()); loss->mutable_data<T>(ctx.GetPlace());
int n = predict->numel(); int n = predict->numel();
auto& dev_ctx = ctx.template device_context<DeviceContext>(); auto& dev_ctx = ctx.template device_context<DeviceContext>();
int r = int r = xpu::log_loss(dev_ctx.x_context(), predict->data<T>(),
xpu::log_loss_fwd(dev_ctx.x_context(), n, epsilon, labels->data<T>(), loss->data<T>(), n, epsilon);
predict->data<T>(), PADDLE_ENFORCE_XDNN_SUCCESS(r, "log_loss");
labels->data<T>(), loss->data<T>());
PADDLE_ENFORCE_EQ(
r, xpu::Error_t::SUCCESS,
platform::errors::External(
"XPU log_loss kernel return wrong value[%d], please check
whether "
"Baidu Kunlun Card is properly installed.",
r));
***/
} }
}; };
template <typename DeviceContext, typename T, typename AttrType = T> template <typename DeviceContext, typename T, typename AttrType = T>
class LogLossGradXPUKernel : public framework::OpKernel<T> { class LogLossGradXPUKernel : public framework::OpKernel<T> {
public: public:
void Compute(const framework::ExecutionContext& ctx) const override { void Compute(const framework::ExecutionContext& ctx) const override {
/*** TODO wait XDNN new interface
auto* predict = ctx.Input<Tensor>("Predicted"); auto* predict = ctx.Input<Tensor>("Predicted");
auto* labels = ctx.Input<Tensor>("Labels"); auto* labels = ctx.Input<Tensor>("Labels");
auto* dloss = ctx.Input<Tensor>(framework::GradVarName("Loss")); auto* dloss = ctx.Input<Tensor>(framework::GradVarName("Loss"));
...@@ -60,28 +49,20 @@ class LogLossGradXPUKernel : public framework::OpKernel<T> { ...@@ -60,28 +49,20 @@ class LogLossGradXPUKernel : public framework::OpKernel<T> {
dpred->mutable_data<T>(ctx.GetPlace()); dpred->mutable_data<T>(ctx.GetPlace());
int n = predict->numel(); int n = predict->numel();
auto& dev_ctx = ctx.template device_context<DeviceContext>(); auto& dev_ctx = ctx.template device_context<DeviceContext>();
int r = xpu::log_loss_bwd(dev_ctx.x_context(), n, epsilon, int r = xpu::log_loss_grad(dev_ctx.x_context(), predict->data<T>(),
predict->data<T>(), labels->data<T>(), labels->data<T>(), dloss->data<T>(),
dloss->data<T>(), dpred->data<T>()); dpred->data<T>(), n, epsilon);
PADDLE_ENFORCE_EQ( PADDLE_ENFORCE_XDNN_SUCCESS(r, "log_loss_grad");
r, xpu::Error_t::SUCCESS,
platform::errors::External(
"XPU log_loss kernel return wrong value[%d], please check
whether "
"Baidu Kunlun Card is properly installed.",
r));
***/
} }
}; };
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
// namespace ops = paddle::operators; namespace ops = paddle::operators;
// REGISTER_OP_XPU_KERNEL( REGISTER_OP_XPU_KERNEL(
// log_loss, ops::LogLossXPUKernel<paddle::platform::XPUDeviceContext, log_loss, ops::LogLossXPUKernel<paddle::platform::XPUDeviceContext, float>);
// float>); REGISTER_OP_XPU_KERNEL(
// REGISTER_OP_XPU_KERNEL( log_loss_grad,
// log_loss_grad, ops::LogLossGradXPUKernel<paddle::platform::XPUDeviceContext, float>);
// ops::LogLossGradXPUKernel<paddle::platform::XPUDeviceContext, float>);
#endif #endif
...@@ -14,6 +14,7 @@ limitations under the License. */ ...@@ -14,6 +14,7 @@ limitations under the License. */
#include "paddle/fluid/operators/optimizers/lamb_op.h" #include "paddle/fluid/operators/optimizers/lamb_op.h"
#include "gflags/gflags.h" #include "gflags/gflags.h"
#include "paddle/fluid/platform/device/device_wrapper.h"
namespace paddle { namespace paddle {
namespace operators { namespace operators {
...@@ -25,7 +26,6 @@ template <typename DeviceContext, typename T> ...@@ -25,7 +26,6 @@ template <typename DeviceContext, typename T>
class LambOpXPUKernel : public framework::OpKernel<T> { class LambOpXPUKernel : public framework::OpKernel<T> {
public: public:
void Compute(const framework::ExecutionContext& ctx) const override { void Compute(const framework::ExecutionContext& ctx) const override {
/*** TODO wait XDNN new interface
using paddle::framework::LoDTensor; using paddle::framework::LoDTensor;
const auto* param_var = ctx.InputVar("Param"); const auto* param_var = ctx.InputVar("Param");
PADDLE_ENFORCE_EQ(param_var->IsType<framework::LoDTensor>(), true, PADDLE_ENFORCE_EQ(param_var->IsType<framework::LoDTensor>(), true,
...@@ -49,15 +49,12 @@ class LambOpXPUKernel : public framework::OpKernel<T> { ...@@ -49,15 +49,12 @@ class LambOpXPUKernel : public framework::OpKernel<T> {
"Moment1", "Lamb"); "Moment1", "Lamb");
auto& mom2 = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Moment2"), "Input", auto& mom2 = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Moment2"), "Input",
"Moment2", "Lamb"); "Moment2", "Lamb");
auto& lr = GET_DATA_SAFELY(ctx.Input<LoDTensor>("LearningRate"), auto& lr = GET_DATA_SAFELY(ctx.Input<LoDTensor>("LearningRate"), "Input",
"Input",
"LearningRate", "Lamb"); "LearningRate", "Lamb");
auto& beta1_pow = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Beta1Pow"), auto& beta1_pow = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Beta1Pow"), "Input",
"Input",
"Beta1Pow", "Lamb"); "Beta1Pow", "Lamb");
auto& beta2_pow = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Beta2Pow"), auto& beta2_pow = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Beta2Pow"), "Input",
"Input",
"Beta2Pow", "Lamb"); "Beta2Pow", "Lamb");
auto& param_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("ParamOut"), auto& param_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("ParamOut"),
...@@ -66,70 +63,38 @@ class LambOpXPUKernel : public framework::OpKernel<T> { ...@@ -66,70 +63,38 @@ class LambOpXPUKernel : public framework::OpKernel<T> {
"Output", "Moment1Out", "Lamb"); "Output", "Moment1Out", "Lamb");
auto& mom2_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("Moment2Out"), auto& mom2_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("Moment2Out"),
"Output", "Moment2Out", "Lamb"); "Output", "Moment2Out", "Lamb");
auto& beta1_pow_out = auto& beta1_pow_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("Beta1PowOut"),
GET_DATA_SAFELY(ctx.Output<LoDTensor>("Beta1PowOut"),
"Output", "Beta1PowOut", "Lamb"); "Output", "Beta1PowOut", "Lamb");
auto& beta2_pow_out = auto& beta2_pow_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("Beta2PowOut"),
GET_DATA_SAFELY(ctx.Output<LoDTensor>("Beta2PowOut"),
"Output", "Beta2PowOut", "Lamb"); "Output", "Beta2PowOut", "Lamb");
auto& dev_ctx = ctx.template device_context<DeviceContext>(); auto& dev_ctx = ctx.template device_context<DeviceContext>();
if (grad_var->IsType<framework::LoDTensor>()) { if (grad_var->IsType<framework::LoDTensor>()) {
auto& grad = *ctx.Input<LoDTensor>("Grad"); auto& grad = *ctx.Input<LoDTensor>("Grad");
int r = xpu::lamb(dev_ctx.x_context(), grad.template data<T>(), int r = xpu::lamb(
mom1.template data<T>(), mom2.template data<T>(), dev_ctx.x_context(), grad.template data<T>(), mom1.template data<T>(),
param.template data<T>(), beta1_pow.template mom2.template data<T>(), param.template data<T>(),
data<T>(), beta1_pow.template data<T>(), beta2_pow.template data<T>(),
beta2_pow.template data<T>(), beta1, beta2, epsilon,
weight_decay, lr.template data<T>(),
mom1_out.template mutable_data<T>(ctx.GetPlace()), mom1_out.template mutable_data<T>(ctx.GetPlace()),
mom2_out.template mutable_data<T>(ctx.GetPlace()), mom2_out.template mutable_data<T>(ctx.GetPlace()),
param_out.template mutable_data<T>(ctx.GetPlace()), param_out.template mutable_data<T>(ctx.GetPlace()),
beta1_pow_out.template beta1_pow_out.template mutable_data<T>(ctx.GetPlace()),
mutable_data<T>(ctx.GetPlace()), beta2_pow_out.template mutable_data<T>(ctx.GetPlace()), beta1, beta2,
beta2_pow_out.template epsilon, weight_decay, lr.template data<T>(), param.numel());
mutable_data<T>(ctx.GetPlace()),
param.numel());
if (r == xpu::Error_t::INVALID_PARAM) { PADDLE_ENFORCE_XDNN_SUCCESS(r, "lamb");
PADDLE_ENFORCE_EQ(
r, xpu::Error_t::SUCCESS,
platform::errors::InvalidArgument(
"XPU kernel error of LambOp, error message: INVALID_PARAM, "
"please check your input & output."));
} else if (r == xpu::Error_t::RUNTIME_ERROR) {
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::Unavailable(
"XPU kernel error of LambOp, error message: "
"RUNTIME_ERROR, please check whether Baidu "
"Kunlun Card is properly installed."));
} else if (r == xpu::Error_t::NO_ENOUGH_WORKSPACE) {
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::ResourceExhausted(
"XPU kernel error of LambOp, error "
"message: NO_ENOUGH_WORKSPACE, XPU "
"has no enough memory."));
} else {
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::ResourceExhausted(
"XPU kernel error of LambOp, error "
"message: OTHER "
"XPU API returns error code: %d.",
r));
}
} else { } else {
PADDLE_THROW(platform::errors::InvalidArgument( PADDLE_THROW(platform::errors::InvalidArgument(
"Variable type not supported by lamb_op. Expect LoDTensor, " "Variable type not supported by lamb_op. Expect LoDTensor, "
"but got %s", "but got %s",
framework::ToTypeName(param_var->Type()))); framework::ToTypeName(param_var->Type())));
} }
**/
} }
}; };
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
// namespace ops = paddle::operators; namespace ops = paddle::operators;
// REGISTER_OP_XPU_KERNEL( REGISTER_OP_XPU_KERNEL(
// lamb, ops::LambOpXPUKernel<paddle::platform::XPUDeviceContext, float>); lamb, ops::LambOpXPUKernel<paddle::platform::XPUDeviceContext, float>);
#endif #endif
...@@ -17,6 +17,7 @@ limitations under the License. */ ...@@ -17,6 +17,7 @@ limitations under the License. */
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <iostream> #include <iostream>
#include "paddle/fluid/framework/op_registry.h" #include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/platform/device/device_wrapper.h"
namespace paddle { namespace paddle {
namespace operators { namespace operators {
...@@ -40,7 +41,6 @@ template <typename DeviceContext, typename T> ...@@ -40,7 +41,6 @@ template <typename DeviceContext, typename T>
class RmspropOpXPUKernel : public framework::OpKernel<T> { class RmspropOpXPUKernel : public framework::OpKernel<T> {
public: public:
void Compute(const framework::ExecutionContext& ctx) const override { void Compute(const framework::ExecutionContext& ctx) const override {
/*** TODO wait XDNN new interface
using paddle::framework::LoDTensor; using paddle::framework::LoDTensor;
// check Param & Grad tensor type // check Param & Grad tensor type
...@@ -67,8 +67,7 @@ class RmspropOpXPUKernel : public framework::OpKernel<T> { ...@@ -67,8 +67,7 @@ class RmspropOpXPUKernel : public framework::OpKernel<T> {
"Param", "Rmsprop"); "Param", "Rmsprop");
auto& meanSquare = GET_DATA_SAFELY(ctx.Input<LoDTensor>("MeanSquare"), auto& meanSquare = GET_DATA_SAFELY(ctx.Input<LoDTensor>("MeanSquare"),
"Input", "MeanSquare", "Rmsprop"); "Input", "MeanSquare", "Rmsprop");
auto& grad = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Grad"), "Input", auto& grad = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Grad"), "Input", "Grad",
"Grad",
"Rmsprop"); "Rmsprop");
auto& mom = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Moment"), "Input", auto& mom = GET_DATA_SAFELY(ctx.Input<LoDTensor>("Moment"), "Input",
"Moment", "Rmsprop"); "Moment", "Rmsprop");
...@@ -91,10 +90,8 @@ class RmspropOpXPUKernel : public framework::OpKernel<T> { ...@@ -91,10 +90,8 @@ class RmspropOpXPUKernel : public framework::OpKernel<T> {
"Output", "ParamOut", "Rmsprop"); "Output", "ParamOut", "Rmsprop");
auto& mom_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("MomentOut"), auto& mom_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("MomentOut"),
"Output", "MomentOut", "Rmsprop"); "Output", "MomentOut", "Rmsprop");
auto& mom_sqrt_out = auto& mom_sqrt_out = GET_DATA_SAFELY(ctx.Output<LoDTensor>("MeanSquareOut"),
GET_DATA_SAFELY(ctx.Output<LoDTensor>("MeanSquareOut"), "Output", "MeanSquareOut", "Rmsprop");
"Output", "MeanSquareOut",
"Rmsprop");
auto& dev_ctx = ctx.template device_context<DeviceContext>(); auto& dev_ctx = ctx.template device_context<DeviceContext>();
///// rmsprop优化算法 ///// rmsprop优化算法
...@@ -109,53 +106,23 @@ class RmspropOpXPUKernel : public framework::OpKernel<T> { ...@@ -109,53 +106,23 @@ class RmspropOpXPUKernel : public framework::OpKernel<T> {
/// const float* ms, const float* g, const float* mom, /// const float* ms, const float* g, const float* mom,
/// float epsilon, float rho, float momentum, float lr, /// float epsilon, float rho, float momentum, float lr,
/// float *ms_out, float *mom_out, float *p_out, int n) /// float *ms_out, float *mom_out, float *p_out, int n)
int r = xpu::rmsprop(dev_ctx.x_context(), param.template data<T>(), int r = xpu::rmsprop(dev_ctx.x_context(), grad.template data<T>(),
meanSquare.template data<T>(), grad.template param.template data<T>(),
data<T>(), meanSquare.template data<T>(), mom.template data<T>(),
mom.template data<T>(), epsilon, decay, momentum,
lr,
mom_sqrt_out.template
mutable_data<T>(ctx.GetPlace()),
mom_out.template mutable_data<T>(ctx.GetPlace()),
param_out.template mutable_data<T>(ctx.GetPlace()), param_out.template mutable_data<T>(ctx.GetPlace()),
param.numel()); mom_sqrt_out.template mutable_data<T>(ctx.GetPlace()),
mom_out.template mutable_data<T>(ctx.GetPlace()),
epsilon, decay, momentum, lr, param.numel());
if (r == xpu::Error_t::INVALID_PARAM) { PADDLE_ENFORCE_XDNN_SUCCESS(r, "rmsprop");
PADDLE_ENFORCE_EQ(
r, xpu::Error_t::SUCCESS,
platform::errors::InvalidArgument(
"XPU kernel error of RmspropOp, error message: INVALID_PARAM,
"
"please check your input & output."));
} else if (r == xpu::Error_t::RUNTIME_ERROR) {
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::Unavailable(
"XPU kernel error of RmspropOp, error message: "
"RUNTIME_ERROR, please check whether Baidu "
"Kunlun Card is properly installed."));
} else if (r == xpu::Error_t::NO_ENOUGH_WORKSPACE) {
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::ResourceExhausted(
"XPU kernel error of RmspropOp, error "
"message: NO_ENOUGH_WORKSPACE, XPU "
"has no enough memory."));
} else {
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::ResourceExhausted(
"XPU kernel error of RmspropOp, error "
"message: OTHER "
"XPU API returns error code: %d.",
r));
}
***/
} }
}; };
} // namespace operators } // namespace operators
} // namespace paddle } // namespace paddle
// namespace ops = paddle::operators; namespace ops = paddle::operators;
// REGISTER_OP_XPU_KERNEL( REGISTER_OP_XPU_KERNEL(
// rmsprop, rmsprop,
// ops::RmspropOpXPUKernel<paddle::platform::XPUDeviceContext, float>); ops::RmspropOpXPUKernel<paddle::platform::XPUDeviceContext, float>);
#endif #endif
...@@ -145,6 +145,7 @@ XPUOpMap& get_kl1_ops() { ...@@ -145,6 +145,7 @@ XPUOpMap& get_kl1_ops() {
{"hard_switch", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, {"hard_switch", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"iou_similarity", {"iou_similarity",
XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"lamb", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"layer_norm_grad", {"layer_norm_grad",
XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"layer_norm", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, {"layer_norm", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
...@@ -174,6 +175,9 @@ XPUOpMap& get_kl1_ops() { ...@@ -174,6 +175,9 @@ XPUOpMap& get_kl1_ops() {
pOpKernelType(vartype::INT32, XPUPlace()), pOpKernelType(vartype::INT32, XPUPlace()),
pOpKernelType(vartype::INT64, XPUPlace()), pOpKernelType(vartype::INT64, XPUPlace()),
pOpKernelType(vartype::FP32, XPUPlace())})}, pOpKernelType(vartype::FP32, XPUPlace())})},
{"log_loss_grad",
XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"log_loss", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"logsumexp", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, {"logsumexp", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"log", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, {"log", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"lookup_table_v2_grad", {"lookup_table_v2_grad",
...@@ -232,6 +236,7 @@ XPUOpMap& get_kl1_ops() { ...@@ -232,6 +236,7 @@ XPUOpMap& get_kl1_ops() {
pOpKernelType(vartype::INT32, XPUPlace()), pOpKernelType(vartype::INT32, XPUPlace()),
pOpKernelType(vartype::BOOL, XPUPlace()), pOpKernelType(vartype::BOOL, XPUPlace()),
pOpKernelType(vartype::FP32, XPUPlace())})}, pOpKernelType(vartype::FP32, XPUPlace())})},
{"rmsprop", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"rnn_grad", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, {"rnn_grad", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"rnn", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})}, {"rnn", XPUKernelSet({pOpKernelType(vartype::FP32, XPUPlace())})},
{"roi_align_grad", {"roi_align_grad",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册