Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • 合并请求
  • !21488

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
大约 2 年 前同步成功

通知 2325
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板

Add CI for checking registered data_type of new Op !21488

  • Report abuse
!21488 已合并 12月 02, 2019 由 saxon_zh@saxon_zh 创建
#<User:0x00007f0ef9a7b4f8>
  • 概览 3
  • 提交 7
  • 变更 2

Created by: Aurelius84

This PR is mainly used to enhance checking registered data_type of new Op.

Here are some cases that would be not allowed:

  • Only one data_type is registered of new op in PR.
// one of float, double, int, int64_t
REGISTER_OP_CPU_KERNEL(
    expand_test_e, ops::ExpandKernel<paddle::platform::CPUDeviceContext, int>); 
REGISTER_OP_CPU_KERNEL(
    expand_test_e_grad,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, int>); 
  • Only one of float/double(or int/int64_t) is registered of new op in PR.
// If you register int, the int64_t should be registered too.
REGISTER_OP_CPU_KERNEL(
    expand_test_e, ops::ExpandKernel<paddle::platform::CPUDeviceContext, int>,
    ops::ExpandKernel<paddle::platform::CPUDeviceContext, float>); 
REGISTER_OP_CPU_KERNEL(
    expand_test_e_grad,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, int>,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, float>); 

However, the followed case is allowed:

// It looks good, because all needed data_types are registered.
REGISTER_OP_CPU_KERNEL(
    expand_test_e, ops::ExpandKernel<paddle::platform::CPUDeviceContext, float>,
    ops::ExpandKernel<paddle::platform::CPUDeviceContext, double>,
    ops::ExpandKernel<paddle::platform::CPUDeviceContext, int>,
    ops::ExpandKernel<paddle::platform::CPUDeviceContext, int64_t>); 
REGISTER_OP_CPU_KERNEL(
    expand_test_e_grad,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, float>,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, double>,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, int>,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, int64_t>); 

or

// It looks good, because both float and double are registered.
REGISTER_OP_CPU_KERNEL(
    expand_test_e, ops::ExpandKernel<paddle::platform::CPUDeviceContext, float>,
    ops::ExpandKernel<paddle::platform::CPUDeviceContext, double>); 
REGISTER_OP_CPU_KERNEL(
    expand_test_e_grad,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, float>,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, double>); 

or

// It looks good, because both int and int64_t are registered.
REGISTER_OP_CPU_KERNEL(
    expand_test_e, ops::ExpandKernel<paddle::platform::CPUDeviceContext, int>,
    ops::ExpandKernel<paddle::platform::CPUDeviceContext, int64_t>); 
REGISTER_OP_CPU_KERNEL(
    expand_test_e_grad,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, int>,
    ops::ExpandGradKernel<paddle::platform::CPUDeviceContext, int64_t>); 

For some special op, only one of float/double and int/int64_t is supported. You can request some specific reviewer to approve you PR.

Examples PR

  • please see log of PR 21526 in details. In this PR, five new operators are added and their registered data_type as follows:
expand_test_a -> float int   // not allowed
expand_test_b -> float double int  // not allowed
expand_test_c -> float  // not allowed
expand_test_d -> float double int int64_t 
expand_test_e -> int int64_t

In above ops, expand_test_a、expand_test_b andexpand_test_c are illegal, so gives warnings in log and needs specific reviewer to approve.

The warnings info:

[Step 1/1] 0 . More data_type of new operator should be regitered in your PR. Please make sure that both float/double (or int/int64_t) have been regitered. You must have one RD (Aurelius84 or liym27 or zhhsplendid)approval for the data_type registration of new operator.
[03:56:30]	[Step 1/1] 
[03:56:30]	[Step 1/1] There are 1 approved errors.
[03:56:30]	[Step 1/1] ****************
[03:56:31]	[Step 1/1] + expand_test_a float int
[03:56:31]	[Step 1/1] + expand_test_b double float int
[03:56:31]	[Step 1/1] + expand_test_c float
[03:56:39]	[Step 1/1] Process exited with code 1

image

If these new ops only supporte one of float/double and int/int64_t . You can request some specific reviewer to approve you PR. In above PR 21526, if one of Aurelius84/lym27/zhhsplendid approve it. The CI will pass and log looks like this in details.

指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/Paddle!21488
Source branch: github/fork/Aurelius84/CI_op_register_type
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7