Skip to content

Comments

Refine cmake for cudnn op#8591

Merged
luotao1 merged 2 commits intoPaddlePaddle:developfrom
chengduoZH:feature/refine_cmake_for_cudnn
Feb 27, 2018
Merged

Refine cmake for cudnn op#8591
luotao1 merged 2 commits intoPaddlePaddle:developfrom
chengduoZH:feature/refine_cmake_for_cudnn

Conversation

@chengduoZH
Copy link
Contributor

@chengduoZH chengduoZH commented Feb 26, 2018

fix #8590

@chengduoZH chengduoZH requested a review from luotao1 February 26, 2018 16:16
@chengduoZH chengduoZH force-pushed the feature/refine_cmake_for_cudnn branch from e42489f to 16fc5e3 Compare February 26, 2018 16:27
op_library(conv_op SRCS conv_op.cc DEPS vol2col)
op_library(pool_op SRCS pool_op.cc DEPS pooling)
op_library(conv_transpose_op SRCS conv_transpose_op.cc DEPS vol2col)
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

因为SRCS会自动补全,所以170-180行可以简化为

if (WITH_GPU)
    op_library(conv_op DEPS vol2col depthwise_conv)
else()
    op_library(conv_op DEPS vol2col)
op_library(pool_op DEPS pooling)
op_library(conv_transpose_op DEPS vol2col)
op_library(edit_distance_op DEPS math_function) #edit_distance_op的CPU版本原来是不是给漏了?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

op_library(pool_op SRCS pool_op.cc DEPS pooling)
op_library(conv_transpose_op SRCS conv_transpose_op.cc DEPS vol2col)
endif()

Copy link
Contributor

Choose a reason for hiding this comment

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

能顺手简化下185-195行么?

op_library(fill_constant_batch_size_like_op DEPS batch_size_like)
op_library(uniform_random_batch_size_like_op DEPS batch_size_like uniform_random_op)
op_library(gaussian_random_batch_size_like_op DEPS batch_size_like gaussian_random_op)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@chengduoZH chengduoZH force-pushed the feature/refine_cmake_for_cudnn branch from 8a3b233 to 6b312d0 Compare February 27, 2018 02:40
Copy link
Contributor

Choose a reason for hiding this comment

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

由于math_function在16行set(op_common_deps operator op_registry math_function)中已经添加进依赖了,这儿不需要手动写,即可以删除182行。

同时可更新下169行的op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale math_function)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@chengduoZH chengduoZH force-pushed the feature/refine_cmake_for_cudnn branch from 6b312d0 to bfaa3f4 Compare February 27, 2018 02:54
@chengduoZH chengduoZH force-pushed the feature/refine_cmake_for_cudnn branch from bfaa3f4 to 62fe2f2 Compare February 27, 2018 03:31
Copy link
Contributor

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 1ac31d3 into PaddlePaddle:develop Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pybind USE_OP_DEVICE_KERNEL(XXX, CUDNN) automatically

2 participants