Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#20 from xymyeah/sequence_pool_cvm_opt
Browse files Browse the repository at this point in the history
abacus-aibox-861, bug fix
  • Loading branch information
xymyeah committed Oct 31, 2023
2 parents 876da5b + ed7100a commit a5a42d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmake/external/xpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if (WITH_BOX_PS OR WITH_XPU_KP)
CACHE STRING "" FORCE)
#"https://klx-sdk-release-public.su.bcebos.com/xdnn/release/2.6.0.1/${XPU_XDNN_DIR_NAME}.tar.gz"
set(XPU_XDNN_URL
"https://klx-sdk-release-public.su.bcebos.com/xdnn_train/dev/paddlebox/20231019/${XPU_XDNN_DIR_NAME}.tar.gz"
"https://klx-sdk-release-public.su.bcebos.com/xdnn_train/dev/paddlebox/20231031/${XPU_XDNN_DIR_NAME}.tar.gz"
CACHE STRING "" FORCE)
set(SCALOPUS_URL
"https://klx-sdk-release-public.su.bcebos.com/xdnn_train/dev/paddlebox/20230306/scalopus.tar.gz"
Expand Down
14 changes: 11 additions & 3 deletions paddle/fluid/operators/fused/fused_seqpool_cvm_op_xpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ class FusedSeqpoolCVMOpXPUKernel : public framework::OpKernel<T> {
auto clk_coeff = ctx.Attr<float>("clk_coeff");
auto threshold = ctx.Attr<float>("threshold");
auto cvm_offset = ctx.Attr<int>("cvm_offset");
auto embed_thres_size = ctx.Attr<int>("embed_thres_size");
bool embed_threshold_filter = ctx.Attr<bool>("embed_threshold_filter");
float embed_threshold = ctx.Attr<float>("embed_threshold");
int embed_thres_size = ctx.Attr<int>("embed_thres_size");

auto x0_lod = ins[0]->lod();
auto x0_dims = ins[0]->dims();
Expand Down Expand Up @@ -145,7 +147,10 @@ class FusedSeqpoolCVMOpXPUKernel : public framework::OpKernel<T> {
show_coeff,
clk_coeff,
threshold,
cvm_offset);
cvm_offset,
embed_threshold_filter,
embed_threshold,
embed_thres_size);
PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::External(
"The sequence_sum_pool_cvm_concat XPU OP return wrong value[%d %s]",
Expand All @@ -167,6 +172,7 @@ class FusedSeqpoolCVMGradOpXPUKernel : public framework::OpKernel<T> {
auto use_cvm = ctx.Attr<bool>("use_cvm");//TODO:
bool clk_filter = ctx.Attr<bool>("clk_filter");
auto cvm_offset = ctx.Attr<int>("cvm_offset");
int embed_thres_size = ctx.Attr<int>("embed_thres_size");
int slot_num = dxs.size();
auto xpu_context = ctx.template device_context<DeviceContext>().x_context();
auto place = ctx.GetPlace();
Expand Down Expand Up @@ -224,7 +230,9 @@ class FusedSeqpoolCVMGradOpXPUKernel : public framework::OpKernel<T> {
clk_filter,//split
item_size,
batch_size,
slot_num);
slot_num,
embed_thres_size);

PADDLE_ENFORCE_EQ(r, xpu::Error_t::SUCCESS,
platform::errors::External(
"The sequence_pool_cvm_grad XPU OP return wrong value[%d %s]",
Expand Down

0 comments on commit a5a42d2

Please sign in to comment.