Skip to content

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

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看板

Fix PADDLE_ENFORCE ci check bug !21233

  • Report abuse
!21233 已合并 11月 19, 2019 由 saxon_zh@saxon_zh 创建
#<User:0x00007f0ef252eec0>
  • 概览 0
  • 提交 2
  • 变更 1

Created by: chenwhql

This PR fix two problems:

  1. Error specification check error

When PADDLE_ENFORCE contains array index [], the grep -vx "$VALID_PADDLE_CHECK" will treat it as a regular expression metacharacter, resulting in a judgment error.

So this PR add -F to fix this problem.

  -F, --fixed-strings       PATTERN is a set of newline-separated strings

error example: https://github.com/PaddlePaddle/Paddle/pull/20972

  • : All PADDLE_ENFORCE{_*} this PR added
/work/paddle {gaowei/padding-fcc} ALL_PADDLE_CHECK=`git diff -U0 upstream/develop |grep "+" |grep -zoE "(PADDLE_ENFORCE[A-Z_]{0,9}|PADDLE_THROW)\(.[^,\);]*.[^;]*\);\s" || true`
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
/work/paddle {gaowei/padding-fcc} echo "$ALL_PADDLE_CHECK"
PADDLE_ENFORCE_GT(batch_size, 0, platform::errors::InvalidArgument(
+                                       "Batch size is illegal.", batch_size));
PADDLE_ENFORCE_EQ(
+            bias_dims[1], w_dims1,
+            platform::errors::InvalidArgument(
+                "The shape of Bias is invalid."
+                "The width of Bias should be equal to width of Weight."
+                "But reveived width of Bias is %d and width of Weight is %d.",
+                bias_dims[1], w_dims1));
PADDLE_ENFORCE_EQ(
+            bias_dims[0], w_dims1,
+            platform::errors::InvalidArgument(
+                "The shape of Bias is invalid."
+                "The height of Bias should be equal to the width of weight."
+                "But reveived height of Bias is %d and width of Weight is %d.",
+                bias_dims[0], w_dims1));
PADDLE_ENFORCE_EQ(in_mat_dims[1], w_dims0,
+                    platform::errors::InvalidArgument(
+                        "Fully Connected input and weigth size do not match. "
+                        "input width: %d,weight height: %d",
+                        in_mat_dims[1], w_dims0));
PADDLE_ENFORCE_EQ(
+        weight_padding, false,
+        platform::errors::PermissionDenied(
+            "Weight padding in fc can not be used in GPU scope."));
  • : Valid PADDLE_ENFORCE{_*} this PR added
/work/paddle {gaowei/padding-fcc} VALID_PADDLE_CHECK=`echo "$ALL_PADDLE_CHECK" | grep -zoE '(PADDLE_ENFORCE[A-Z_]{0,9}|PADDLE_THROW)\((.[^,;]+,)*.[^";]*(errors::).[^"]*".[^";]{20,}.[^;]*\);\s' || true`
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
/work/paddle {gaowei/padding-fcc} echo "$VALID_PADDLE_CHECK"
PADDLE_ENFORCE_GT(batch_size, 0, platform::errors::InvalidArgument(
+                                       "Batch size is illegal.", batch_size));
PADDLE_ENFORCE_EQ(
+            bias_dims[1], w_dims1,
+            platform::errors::InvalidArgument(
+                "The shape of Bias is invalid."
+                "The width of Bias should be equal to width of Weight."
+                "But reveived width of Bias is %d and width of Weight is %d.",
+                bias_dims[1], w_dims1));
PADDLE_ENFORCE_EQ(
+            bias_dims[0], w_dims1,
+            platform::errors::InvalidArgument(
+                "The shape of Bias is invalid."
+                "The height of Bias should be equal to the width of weight."
+                "But reveived height of Bias is %d and width of Weight is %d.",
+                bias_dims[0], w_dims1));
PADDLE_ENFORCE_EQ(in_mat_dims[1], w_dims0,
+                    platform::errors::InvalidArgument(
+                        "Fully Connected input and weigth size do not match. "
+                        "input width: %d,weight height: %d",
+                        in_mat_dims[1], w_dims0));
PADDLE_ENFORCE_EQ(
+        weight_padding, false,
+        platform::errors::PermissionDenied(
+            "Weight padding in fc can not be used in GPU scope."));
  • : Invalid PADDLE_ENFORCE{_*} this PR added (here are error match)
/work/paddle {gaowei/padding-fcc} INVALID_PADDLE_CHECK=`echo "$ALL_PADDLE_CHECK" |grep -vx "$VALID_PADDLE_CHECK" || true`
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
/work/paddle {gaowei/padding-fcc} echo "$INVALID_PADDLE_CHECK"
+            bias_dims[1], w_dims1,
+                bias_dims[1], w_dims1));
+            bias_dims[0], w_dims1,
+                bias_dims[0], w_dims1));
PADDLE_ENFORCE_EQ(in_mat_dims[1], w_dims0,
+                        in_mat_dims[1], w_dims0));
  1. PADDLE_ENFORCE using check match non-code content

image

Replace with a more precise regular expression

指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/Paddle!21233
Source branch: github/fork/chenwhql/easyuse/fix_ci_check_bug
渝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