Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c22a204
move conv to pten
phlrain Feb 4, 2022
60a5d52
move conv to pten; test=develop
phlrain Feb 6, 2022
871a65c
fix bug;
phlrain Feb 7, 2022
9b3606f
add conv cudnn impl; test=develop
phlrain Feb 8, 2022
a2c4bb9
update
phlrain Feb 8, 2022
253c736
update operator; test=develop
phlrain Feb 8, 2022
0b28bbe
fix bug; test=develop
phlrain Feb 8, 2022
4c960d0
move operator and prepared_operator to develop; test=develop
phlrain Feb 9, 2022
5c21772
resolve conflict; test=develop
phlrain Feb 10, 2022
b1d2386
remove useless code;test=develop
phlrain Feb 10, 2022
c0a65da
add depency ; test=develop
phlrain Feb 10, 2022
097dcaf
fix bug;
phlrain Feb 12, 2022
64625fd
add sig.cc ; test=develop
phlrain Feb 12, 2022
399d7e0
fix use_op error; test=develop
phlrain Feb 13, 2022
9211f89
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 13, 2022
1c6055e
fix bug; test=develop
phlrain Feb 13, 2022
274b874
fix bug; test=develop
phlrain Feb 13, 2022
6fea445
add conv3d register; test=develop
phlrain Feb 13, 2022
d25fe52
fix star gan and conv_nn_grad test failed; test=develop
phlrain Feb 14, 2022
7e24753
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 14, 2022
781eb4e
add header; test=develop
phlrain Feb 14, 2022
68a9b6e
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 14, 2022
611aac5
manul to recover to develop;
phlrain Feb 24, 2022
2e32d3e
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 24, 2022
6972abd
resolve confilct; test=develop
phlrain Feb 24, 2022
beb8d73
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 24, 2022
95cd831
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 25, 2022
1483b1c
remove useless code
phlrain Feb 25, 2022
d13435f
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 25, 2022
3227e6d
fix bug;
phlrain Feb 27, 2022
198d87e
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 27, 2022
ea74f36
remove conv2d_cudnn; test=develop
phlrain Feb 27, 2022
6731d69
fix bugs; test=develop
phlrain Feb 28, 2022
1fd2934
fix cpu rocm compile bugs; test=develop
phlrain Feb 28, 2022
6d21b33
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 28, 2022
2f92557
fix blas error; test=develop
phlrain Feb 28, 2022
5833ca8
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Feb 28, 2022
2facf85
fix compile bug; test=develop
phlrain Mar 1, 2022
8e59fbe
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Mar 1, 2022
1bf7914
fix windows compile error; test=develop
phlrain Mar 1, 2022
fdc4272
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Mar 1, 2022
543b20f
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Mar 1, 2022
df8da05
fix windows error; test=develop
phlrain Mar 1, 2022
535708b
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Mar 3, 2022
490c412
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Mar 3, 2022
c67503a
resolve confilct; test=develop
phlrain Mar 3, 2022
4dee03b
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
phlrain Mar 3, 2022
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/fluid/inference/tensorrt/convert/test_conv2d_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License. */
#include "paddle/fluid/inference/tensorrt/convert/op_converter.h"
#include "paddle/fluid/inference/tensorrt/convert/ut_helper.h"

USE_OP(conv2d);
USE_OP_ITSELF(conv2d);
USE_OP(conv2d_transpose);

namespace paddle {
Expand Down
29 changes: 11 additions & 18 deletions paddle/fluid/operators/conv_cudnn_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ limitations under the License. */
#include "paddle/fluid/operators/eigen/eigen_function.h"
#include "paddle/fluid/platform/cuda_graph_with_memory_pool.h"
#include "paddle/fluid/platform/device/gpu/gpu_dnn.h"
#include "paddle/phi/backends/gpu/gpu_context.h"

namespace paddle {
namespace operators {
Expand Down Expand Up @@ -53,12 +54,11 @@ static inline void GetNCDHW(const framework::DDim& dims,
}

template <typename DeviceContext, typename T, size_t D>
static void RemovePaddingSlice(const framework::ExecutionContext& context,
static void RemovePaddingSlice(const phi::GPUContext& context,
const Tensor* input, Tensor* out,
const std::vector<int>& starts,
const std::vector<int>& axes) {
auto& place =
*context.template device_context<DeviceContext>().eigen_device();
auto& place = *context.eigen_device();
auto in_dims = input->dims();
auto new_out_dims = out->dims();
auto offsets = Eigen::DSizes<Eigen::DenseIndex, D>();
Expand Down Expand Up @@ -171,11 +171,10 @@ void ChooseAlgo(const std::vector<PerfType>& perf_results,

using framework::ConvSearchCache;

static void SetConvMathType(const framework::ExecutionContext& ctx,
cudnnDataType_t dtype,
static void SetConvMathType(const phi::GPUContext& ctx, cudnnDataType_t dtype,
const platform::ConvolutionDescriptor& cdesc) {
#if CUDA_VERSION >= 9000 && CUDNN_VERSION_MIN(7, 0, 1)
auto& dev_ctx = ctx.template device_context<platform::CUDADeviceContext>();
auto& dev_ctx = ctx;
if (dev_ctx.GetComputeCapability() >= 70 && dtype == CUDNN_DATA_HALF) {
PADDLE_ENFORCE_GPU_SUCCESS(platform::dynload::cudnnSetConvolutionMathType(
cdesc.desc(), CUDNN_TENSOR_OP_MATH));
Expand Down Expand Up @@ -231,8 +230,7 @@ struct SearchAlgorithm<cudnnConvolutionFwdAlgoPerf_t> {

template <typename T>
static algo_t Find(const ConvArgs& args, bool exhaustive_search,
bool deterministic,
const framework::ExecutionContext& ctx) {
bool deterministic, const phi::GPUContext& ctx) {
auto dtype = platform::CudnnDataType<T>::type;
bool has_got_workspace_size = true;
size_t workspace_size_limit = FLAGS_conv_workspace_size_limit * 1024 * 1024;
Expand Down Expand Up @@ -284,8 +282,7 @@ struct SearchAlgorithm<cudnnConvolutionFwdAlgoPerf_t> {
} else if (deterministic) {
algo = static_cast<cudnnConvolutionFwdAlgo_t>(1);
} else {
auto& dev_ctx =
ctx.template device_context<platform::CUDADeviceContext>();
auto& dev_ctx = ctx;
auto workspace_handle = dev_ctx.cudnn_workspace_handle();

AlgorithmsCache<algo_t>& algo_cache =
Expand Down Expand Up @@ -346,8 +343,7 @@ struct SearchAlgorithm<cudnnConvolutionBwdDataAlgoPerf_t> {

template <typename T>
static algo_t Find(const ConvArgs& args, bool exhaustive_search,
bool deterministic,
const framework::ExecutionContext& ctx) {
bool deterministic, const phi::GPUContext& ctx) {
auto dtype = platform::CudnnDataType<T>::type;
size_t workspace_size_limit = FLAGS_conv_workspace_size_limit * 1024 * 1024;
size_t workspace_size = 0;
Expand Down Expand Up @@ -413,8 +409,7 @@ struct SearchAlgorithm<cudnnConvolutionBwdDataAlgoPerf_t> {
} else if (deterministic) {
return CUDNN_CONVOLUTION_BWD_DATA_ALGO_1;
} else {
auto& dev_ctx =
ctx.template device_context<platform::CUDADeviceContext>();
auto& dev_ctx = ctx;
auto workspace_handle = dev_ctx.cudnn_workspace_handle();

AlgorithmsCache<algo_t>& algo_cache =
Expand Down Expand Up @@ -478,8 +473,7 @@ struct SearchAlgorithm<cudnnConvolutionBwdFilterAlgoPerf_t> {

template <typename T>
static algo_t Find(const ConvArgs& args, bool exhaustive_search,
bool deterministic,
const framework::ExecutionContext& ctx) {
bool deterministic, const phi::GPUContext& ctx) {
platform::CUDAGraphCaptureModeGuard guard;
auto dtype = platform::CudnnDataType<T>::type;
size_t workspace_size_limit = FLAGS_conv_workspace_size_limit * 1024 * 1024;
Expand Down Expand Up @@ -534,8 +528,7 @@ struct SearchAlgorithm<cudnnConvolutionBwdFilterAlgoPerf_t> {
} else if (deterministic) {
return CUDNN_CONVOLUTION_BWD_FILTER_ALGO_1;
} else {
auto& dev_ctx =
ctx.template device_context<platform::CUDADeviceContext>();
auto& dev_ctx = ctx;
auto workspace_handle = dev_ctx.cudnn_workspace_handle();
AlgorithmsCache<algo_t>& algo_cache =
*(framework::ConvSearchCache::Instance().GetBackwardFilter());
Expand Down
Loading