Skip to content

Commit

Permalink
fix limit_by_capacity op
Browse files Browse the repository at this point in the history
  • Loading branch information
liyagit21 committed Sep 27, 2021
1 parent da99d23 commit 0f13c5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions paddle/fluid/operators/limit_by_capacity_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ class LimitByCapacityOpMaker : public framework::OpProtoAndCheckerMaker {
namespace ops = paddle::operators;
namespace plat = paddle::platform;

REGISTER_OP_WITHOUT_GRADIENT(LimitByCapacityOp, ops::LimitByCapacityOp,
ops::LimitByCapacityOpMaker);

REGISTER_OPERATOR(limit_by_capacity, ops::LimitByCapacityOp,
ops::LimitByCapacityOpMaker);

REGISTER_OP_CPU_KERNEL(limit_by_capacity, ops::LimitByCapacityOpCPUKernel<int>,
ops::LimitByCapacityOpCPUKernel<int64_t>);

REGISTER_OP_WITHOUT_GRADIENT(limit_by_capacity, ops::LimitByCapacityOp,
ops::LimitByCapacityOpMaker);
6 changes: 3 additions & 3 deletions paddle/fluid/operators/limit_by_capacity_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ using LoDTensor = framework::LoDTensor;
using Tensor = framework::Tensor;

template <typename T>
__global__ void LimitByCapacity(const T* expc, int* cap, T* out,
const int n_expert, const int n_worker) {
__global__ void limit_by_capacity_impl(const T* expc, int* cap, T* out,
const int n_expert, const int n_worker) {
int eid = blockIdx.y;
int wid = blockIdx.x * blockDim.x + threadIdx.x;
if (wid < n_worker) {
Expand Down Expand Up @@ -67,7 +67,7 @@ class LimitByCapacityOpCUDAKernel : public framework::OpKernel<T> {
framework::TensorCopy(*capacity, place, dev_ctx, &capacity_copy);
int* cap_data = capacity_copy.mutable_data<int>(place);

LimitByCapacity<T><<<grid_dim, block_dim, 0, dev_ctx.stream()>>>(
limit_by_capacity_impl<T><<<grid_dim, block_dim, 0, dev_ctx.stream()>>>(
ec_data, cap_data, out_data, n_expert, n_worker);
}
};
Expand Down

1 comment on commit 0f13c5d

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 0f13c5d Sep 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️ CI failures summary

🔍 PR: #15 Commit ID: 0f13c5d contains failed CI.

🔹 Failed: PR-CI-OP-benchmark

test_failed
2021-09-27 13:51:30 [tools/test_ci_op_benchmark.sh:271] [ERROR] Missing test script of "expert_count"(paddle/fluid/operators/expert_count_op.cu) in benchmark.
2021-09-27 13:51:30 + '[' 8 -ne 0 ']'
2021-09-27 13:51:30 + LOG '[INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.'
2021-09-27 13:51:30 + echo '[tools/test_ci_op_benchmark.sh:275] [INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.'
2021-09-27 13:51:30 [tools/test_ci_op_benchmark.sh:275] [INFO] See https://github.com/PaddlePaddle/Paddle/wiki/PR-CI-OP-benchmark-Manual for details.
2021-09-27 13:51:30 + LOG '[INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.'
2021-09-27 13:51:30 + echo '[tools/test_ci_op_benchmark.sh:276] [INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.'
2021-09-27 13:51:30 [tools/test_ci_op_benchmark.sh:276] [INFO] Or you can apply for one RD (Avin0323(Recommend), Xreki, luotao1) approval to pass this PR.
2021-09-27 13:51:30 + exit 8
2021-09-27 13:51:30 + EXCODE=8
2021-09-27 13:51:30 + echo 'EXCODE: 8'
2021-09-27 13:51:30 EXCODE: 8
2021-09-27 13:51:30 + echo 'ipipe_log_param_EXCODE: 8'
2021-09-27 13:51:30 ipipe_log_param_EXCODE: 8
2021-09-27 13:51:30 + '[' 8 -eq 0 ']'
2021-09-27 13:51:30 + set +x
2021-09-27 13:51:30 Sorry, some tests failed.
2021-09-27 13:51:30 + exit 8
2021-09-27 13:51:30 {build code state=8}

🔹 Failed: PR-CI-ROCM-Compile

Unknown Failed
2021-09-27 14:03:35 ccache hit rate: 99.67%
2021-09-27 14:03:35 + '[' 2 '!=' 0 ']'
2021-09-27 14:03:35 + exit 7
2021-09-27 14:03:35 + EXCODE=7
2021-09-27 14:03:35 + export current_dir=/paddle
2021-09-27 14:03:35 + current_dir=/paddle
2021-09-27 14:03:35 + set +x
2021-09-27 14:03:36 + SOURCE=/paddle/build/coverage-diff
2021-09-27 14:03:36 + [[ -d /paddle/build/coverage-diff ]]
2021-09-27 14:03:36 + [[ -f /paddle/build/coverage-diff ]]
2021-09-27 14:03:36 + echo 'No such file or directory: /paddle/build/coverage-diff'
2021-09-27 14:03:36 + exit 0
2021-09-27 14:03:36 No such file or directory: /paddle/build/coverage-diff
2021-09-27 14:03:36 report uploaded
2021-09-27 14:03:36 ===================================================================
2021-09-27 14:03:36 c++-coverage
2021-09-27 14:03:36 https://xly.bce.baidu.com/ipipe/ipipe-report/report/7853866/c++-coverage/
2021-09-27 14:03:36 ===================================================================
2021-09-27 14:03:36 Sorry, build failed.

🔹 Failed: PR-CI-CPU-Py2

approve_failed
2021-09-27 14:06:33 1. You must have one RD (XiaoguangHu01, lanxianghit or Superjomn) approval for API change.
2021-09-27 14:06:33 and one TPM approval for API change:
2021-09-27 14:06:33 jzhang533/ZhangJun, dingjiaweiww/DingJiaWei, Heeenrrry/LiKunLun, TCChenlong/ChenLong for general APIs
2021-09-27 14:06:33 PangHua/XiangHui for distributed related APIs
2021-09-27 14:06:33 twismon/WangYunKai, CheQiXiao/CheQiXiao for inference related APIs.
2021-09-27 14:06:33 2. You must have one TPM approval for API documents change:
2021-09-27 14:06:33 jzhang533/ZhangJun, dingjiaweiww/DingJiaWei, Heeenrrry/LiKunLun, TCChenlong/ChenLong for general API docs
2021-09-27 14:06:33 PangHua/XiangHui for distributed related API docs
2021-09-27 14:06:33 twismon/WangYunKai, CheQiXiao/CheQiXiao for inference related API docs.
2021-09-27 14:06:33
2021-09-27 14:06:33 There are 3 approved errors.
2021-09-27 14:06:33 ****************
2021-09-27 14:06:33 API Difference is:
2021-09-27 14:06:33 + paddle.distributed.utils.expert_count (ArgSpec(args=['gate_idx', 'n_expert'], varargs=None, varkw=None, defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={}), ('document', '45692bdc8989f3572240cf68513dda84'))
2021-09-27 14:06:33 + paddle.distributed.utils.limit_by_capacity (ArgSpec(args=['expert_count', 'capacity', 'n_worker'], varargs=None, varkw=None, defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={}), ('document', 'bbadb17b51d8934cef4cbd927ec8608c'))
2021-09-27 14:06:33 + paddle.fluid.core_avx.ops.expert_count (ArgSpec(), ('document', '1b63dddf0f919fd09ef9edc71b2e1744'))
2021-09-27 14:06:33 + paddle.fluid.core_avx.ops.limit_by_capacity (ArgSpec(), ('document', '1c824dbb897e2f1ff126faf4780ee523'))
2021-09-27 14:06:33 + approval_error=6
2021-09-27 14:06:33 + '[' 6 '!=' 0 ']'
2021-09-27 14:06:33 + exit 6
2021-09-27 14:06:33 + EXCODE=6

Please sign in to comment.