Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
109fdf14
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
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看板
未验证
提交
109fdf14
编写于
4月 30, 2021
作者:
X
XiangGao
提交者:
GitHub
4月 30, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add flag to check_kernel launch (#32692)
上级
6ab43f7f
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
24 addition
and
5 deletion
+24
-5
paddle/fluid/framework/op_registry.h
paddle/fluid/framework/op_registry.h
+9
-4
paddle/fluid/platform/flags.cc
paddle/fluid/platform/flags.cc
+13
-0
paddle/fluid/pybind/global_value_getter_setter.cc
paddle/fluid/pybind/global_value_getter_setter.cc
+2
-1
未找到文件。
paddle/fluid/framework/op_registry.h
浏览文件 @
109fdf14
...
@@ -25,6 +25,7 @@ limitations under the License. */
...
@@ -25,6 +25,7 @@ limitations under the License. */
#include <unordered_set>
#include <unordered_set>
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
#define GLOG_NO_ABBREVIATED_SEVERITIES // msvc conflict logging with windows.h
#include "gflags/gflags.h"
#include "glog/logging.h" // For VLOG()
#include "glog/logging.h" // For VLOG()
#include "paddle/fluid/framework/attribute.h"
#include "paddle/fluid/framework/attribute.h"
#include "paddle/fluid/framework/details/op_registry.h"
#include "paddle/fluid/framework/details/op_registry.h"
...
@@ -67,6 +68,8 @@ class Version;
...
@@ -67,6 +68,8 @@ class Version;
}
// namespace framework
}
// namespace framework
}
// namespace paddle
}
// namespace paddle
DECLARE_bool
(
check_kernel_launch
);
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
...
@@ -135,14 +138,16 @@ class OpRegistry {
...
@@ -135,14 +138,16 @@ class OpRegistry {
};
};
template
<
typename
PlaceType
>
template
<
typename
PlaceType
>
inline
void
CheckKernelLaunch
(
const
char
*
op_type
)
{};
inline
void
CheckKernelLaunch
(
const
char
*
op_type
)
{}
#ifdef PADDLE_WITH_CUDA
#ifdef PADDLE_WITH_CUDA
template
<
>
template
<
>
inline
void
CheckKernelLaunch
<::
paddle
::
platform
::
CUDAPlace
>
(
inline
void
CheckKernelLaunch
<::
paddle
::
platform
::
CUDAPlace
>
(
const
char
*
op_type
)
{
const
char
*
op_type
)
{
if
(
FLAGS_check_kernel_launch
)
{
PADDLE_ENFORCE_CUDA_LAUNCH_SUCCESS
(
op_type
);
PADDLE_ENFORCE_CUDA_LAUNCH_SUCCESS
(
op_type
);
};
}
}
#endif
#endif
template
<
typename
PlaceType
,
bool
at_end
,
size_t
I
,
typename
...
KernelType
>
template
<
typename
PlaceType
,
bool
at_end
,
size_t
I
,
typename
...
KernelType
>
...
...
paddle/fluid/platform/flags.cc
浏览文件 @
109fdf14
...
@@ -578,6 +578,19 @@ DEFINE_string(tracer_mkldnn_ops_on, "",
...
@@ -578,6 +578,19 @@ DEFINE_string(tracer_mkldnn_ops_on, "",
DEFINE_string
(
tracer_mkldnn_ops_off
,
""
,
DEFINE_string
(
tracer_mkldnn_ops_off
,
""
,
"List of OneDNN operation types to be turned off"
);
"List of OneDNN operation types to be turned off"
);
/**
* Debug related FLAG
* Name: check_kernel_launch
* Since Version: 2.1.0
* Value Range: bool, default=false
* Example:
* Note: Check kernel launch status after every kernel compute.
*/
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
DEFINE_bool
(
check_kernel_launch
,
false
,
"Check kernel launch status after every kernel compute"
);
#endif
/**
/**
* CUDNN related FLAG
* CUDNN related FLAG
* Name: conv2d_disable_cudnn
* Name: conv2d_disable_cudnn
...
...
paddle/fluid/pybind/global_value_getter_setter.cc
浏览文件 @
109fdf14
...
@@ -41,6 +41,7 @@ DECLARE_int32(multiple_of_cupti_buffer_size);
...
@@ -41,6 +41,7 @@ DECLARE_int32(multiple_of_cupti_buffer_size);
DECLARE_bool
(
reader_queue_speed_test_mode
);
DECLARE_bool
(
reader_queue_speed_test_mode
);
DECLARE_int32
(
call_stack_level
);
DECLARE_int32
(
call_stack_level
);
DECLARE_bool
(
sort_sum_gradient
);
DECLARE_bool
(
sort_sum_gradient
);
DECLARE_bool
(
check_kernel_launch
);
// device management
// device management
DECLARE_int32
(
paddle_num_threads
);
DECLARE_int32
(
paddle_num_threads
);
// executor
// executor
...
@@ -376,7 +377,7 @@ static void RegisterGlobalVarGetterSetter() {
...
@@ -376,7 +377,7 @@ static void RegisterGlobalVarGetterSetter() {
FLAGS_fraction_of_gpu_memory_to_use
,
FLAGS_initial_gpu_memory_in_mb
,
FLAGS_fraction_of_gpu_memory_to_use
,
FLAGS_initial_gpu_memory_in_mb
,
FLAGS_reallocate_gpu_memory_in_mb
,
FLAGS_enable_cublas_tensor_op_math
,
FLAGS_reallocate_gpu_memory_in_mb
,
FLAGS_enable_cublas_tensor_op_math
,
FLAGS_selected_gpus
,
FLAGS_sync_nccl_allreduce
,
FLAGS_selected_gpus
,
FLAGS_sync_nccl_allreduce
,
FLAGS_conv2d_disable_cudnn
);
FLAGS_conv2d_disable_cudnn
,
FLAGS_check_kernel_launch
);
#endif
#endif
#ifdef PADDLE_WITH_XPU
#ifdef PADDLE_WITH_XPU
REGISTER_PUBLIC_GLOBAL_VAR
(
FLAGS_selected_xpus
);
REGISTER_PUBLIC_GLOBAL_VAR
(
FLAGS_selected_xpus
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录