Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
39ffef0d
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
未验证
提交
39ffef0d
编写于
12月 09, 2022
作者:
P
PuQing
提交者:
GitHub
12月 09, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PHI decoupling] move "flags.h" from fluid to phi (#48696)
上级
dd57860d
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
68 addition
and
73 deletion
+68
-73
paddle/fluid/distributed/store/tcp_store.cc
paddle/fluid/distributed/store/tcp_store.cc
+1
-1
paddle/fluid/eager/tests/performance_tests/benchmark_eager_cpu.cc
...luid/eager/tests/performance_tests/benchmark_eager_cpu.cc
+1
-1
paddle/fluid/eager/tests/performance_tests/benchmark_eager_cuda.cc
...uid/eager/tests/performance_tests/benchmark_eager_cuda.cc
+1
-1
paddle/fluid/framework/new_executor/executor_statistics.cc
paddle/fluid/framework/new_executor/executor_statistics.cc
+1
-1
paddle/fluid/imperative/flags.cc
paddle/fluid/imperative/flags.cc
+1
-1
paddle/fluid/imperative/profiler.cc
paddle/fluid/imperative/profiler.cc
+1
-1
paddle/fluid/inference/api/analysis_predictor.cc
paddle/fluid/inference/api/analysis_predictor.cc
+1
-2
paddle/fluid/memory/allocation/auto_growth_best_fit_allocator.cc
...fluid/memory/allocation/auto_growth_best_fit_allocator.cc
+1
-1
paddle/fluid/operators/controlflow/conditional_block_op.cc
paddle/fluid/operators/controlflow/conditional_block_op.cc
+1
-1
paddle/fluid/operators/conv_op.cc
paddle/fluid/operators/conv_op.cc
+0
-1
paddle/fluid/operators/conv_transpose_op.cc
paddle/fluid/operators/conv_transpose_op.cc
+0
-1
paddle/fluid/operators/fused/fusion_conv_inception_op.cc
paddle/fluid/operators/fused/fusion_conv_inception_op.cc
+2
-2
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+0
-9
paddle/fluid/platform/cpu_info.cc
paddle/fluid/platform/cpu_info.cc
+1
-1
paddle/fluid/platform/device/gpu/gpu_info.cc
paddle/fluid/platform/device/gpu/gpu_info.cc
+1
-1
paddle/fluid/platform/enforce.h
paddle/fluid/platform/enforce.h
+1
-1
paddle/fluid/platform/profiler/host_tracer.cc
paddle/fluid/platform/profiler/host_tracer.cc
+1
-1
paddle/fluid/pybind/global_value_getter_setter.cc
paddle/fluid/pybind/global_value_getter_setter.cc
+1
-1
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
+1
-1
paddle/phi/api/yaml/op_compat.yaml
paddle/phi/api/yaml/op_compat.yaml
+7
-7
paddle/phi/backends/CMakeLists.txt
paddle/phi/backends/CMakeLists.txt
+1
-0
paddle/phi/backends/gpu/CMakeLists.txt
paddle/phi/backends/gpu/CMakeLists.txt
+1
-0
paddle/phi/backends/gpu/cuda/CMakeLists.txt
paddle/phi/backends/gpu/cuda/CMakeLists.txt
+1
-0
paddle/phi/backends/gpu/cuda/cudnn_workspace_helper.cc
paddle/phi/backends/gpu/cuda/cudnn_workspace_helper.cc
+8
-7
paddle/phi/backends/gpu/cuda/cudnn_workspace_helper.h
paddle/phi/backends/gpu/cuda/cudnn_workspace_helper.h
+7
-6
paddle/phi/backends/xpu/xpu_info.cc
paddle/phi/backends/xpu/xpu_info.cc
+1
-1
paddle/phi/core/CMakeLists.txt
paddle/phi/core/CMakeLists.txt
+5
-0
paddle/phi/core/flags.cc
paddle/phi/core/flags.cc
+8
-9
paddle/phi/core/flags.h
paddle/phi/core/flags.h
+4
-6
paddle/phi/kernels/gpu/batch_norm_grad_kernel.cu
paddle/phi/kernels/gpu/batch_norm_grad_kernel.cu
+1
-1
paddle/phi/kernels/gpu/batch_norm_kernel.cu
paddle/phi/kernels/gpu/batch_norm_kernel.cu
+1
-1
paddle/phi/kernels/gpu/gelu_funcs.h
paddle/phi/kernels/gpu/gelu_funcs.h
+1
-1
paddle/phi/kernels/gpudnn/conv_grad_kernel.cu
paddle/phi/kernels/gpudnn/conv_grad_kernel.cu
+1
-1
paddle/phi/kernels/gpudnn/conv_kernel.cu
paddle/phi/kernels/gpudnn/conv_kernel.cu
+1
-1
paddle/phi/kernels/impl/conv_cudnn_impl.h
paddle/phi/kernels/impl/conv_cudnn_impl.h
+1
-1
paddle/testing/paddle_gtest_main.cc
paddle/testing/paddle_gtest_main.cc
+2
-2
未找到文件。
paddle/fluid/distributed/store/tcp_store.cc
浏览文件 @
39ffef0d
...
...
@@ -20,7 +20,7 @@
#include "paddle/fluid/distributed/store/tcp_utils.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
namespace
paddle
{
namespace
distributed
{
...
...
paddle/fluid/eager/tests/performance_tests/benchmark_eager_cpu.cc
浏览文件 @
39ffef0d
...
...
@@ -25,7 +25,7 @@
#include "paddle/fluid/eager/tests/performance_tests/benchmark_utils.h"
#include "paddle/fluid/eager/tests/test_utils.h"
#include "paddle/fluid/imperative/tracer.h"
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
#ifdef WITH_GPERFTOOLS
#include "gperftools/profiler.h"
...
...
paddle/fluid/eager/tests/performance_tests/benchmark_eager_cuda.cc
浏览文件 @
39ffef0d
...
...
@@ -24,7 +24,7 @@
#include "paddle/fluid/eager/tests/performance_tests/benchmark_utils.h"
#include "paddle/fluid/eager/tests/test_utils.h"
#include "paddle/fluid/imperative/tracer.h"
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
#ifdef WITH_GPERFTOOLS
#include "gperftools/profiler.h"
...
...
paddle/fluid/framework/new_executor/executor_statistics.cc
浏览文件 @
39ffef0d
...
...
@@ -24,9 +24,9 @@
#include <vector>
#include "glog/logging.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/fluid/platform/os_info.h"
#include "paddle/fluid/platform/profiler/utils.h"
#include "paddle/phi/core/flags.h"
DECLARE_bool
(
use_stream_safe_cuda_allocator
);
PADDLE_DEFINE_EXPORTED_string
(
static_executor_perfstat_filepath
,
...
...
paddle/fluid/imperative/flags.cc
浏览文件 @
39ffef0d
...
...
@@ -14,7 +14,7 @@
#include "paddle/fluid/imperative/flags.h"
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
PADDLE_DEFINE_EXPORTED_uint64
(
dygraph_debug
,
0
,
...
...
paddle/fluid/imperative/profiler.cc
浏览文件 @
39ffef0d
...
...
@@ -21,7 +21,7 @@
#include <mutex> // NOLINT
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
PADDLE_DEFINE_EXPORTED_string
(
tracer_profile_fname
,
...
...
paddle/fluid/inference/api/analysis_predictor.cc
浏览文件 @
39ffef0d
...
...
@@ -1422,8 +1422,7 @@ CreatePaddlePredictor<AnalysisConfig, PaddleEngineKind::kAnalysis>(
}
// support set flags from enviorment.
const
platform
::
ExportedFlagInfoMap
&
env_map
=
platform
::
GetExportedFlagInfoMap
();
const
phi
::
ExportedFlagInfoMap
&
env_map
=
phi
::
GetExportedFlagInfoMap
();
std
::
ostringstream
os
;
os
<<
"--tryfromenv="
;
for
(
auto
&
pair
:
env_map
)
{
...
...
paddle/fluid/memory/allocation/auto_growth_best_fit_allocator.cc
浏览文件 @
39ffef0d
...
...
@@ -18,8 +18,8 @@
#include <mutex> // NOLINT
#include "paddle/fluid/memory/allocation/aligned_allocator.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/fluid/platform/profiler/event_tracing.h"
#include "paddle/phi/core/flags.h"
PADDLE_DEFINE_EXPORTED_READONLY_bool
(
free_idle_chunk
,
...
...
paddle/fluid/operators/controlflow/conditional_block_op.cc
浏览文件 @
39ffef0d
...
...
@@ -17,7 +17,7 @@ limitations under the License. */
#include "paddle/fluid/framework/new_executor/standalone_executor.h"
#include "paddle/fluid/operators/assign_op.h"
#include "paddle/fluid/operators/controlflow/control_flow_op_helper.h"
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
#include "paddle/phi/kernels/funcs/math_function.h"
#ifdef PADDLE_WITH_MKLDNN
...
...
paddle/fluid/operators/conv_op.cc
浏览文件 @
39ffef0d
...
...
@@ -25,7 +25,6 @@ limitations under the License. */
#include "paddle/fluid/platform/mkldnn_helper.h"
#endif
#include "paddle/fluid/framework/infershape_utils.h"
#include "paddle/fluid/platform/cudnn_workspace_helper.h"
#include "paddle/phi/infermeta/binary.h"
namespace
paddle
{
...
...
paddle/fluid/operators/conv_transpose_op.cc
浏览文件 @
39ffef0d
...
...
@@ -21,7 +21,6 @@ limitations under the License. */
#include "paddle/fluid/framework/infershape_utils.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/op_version_registry.h"
#include "paddle/fluid/platform/cudnn_workspace_helper.h"
#include "paddle/phi/core/infermeta_utils.h"
#include "paddle/phi/infermeta/backward.h"
#include "paddle/phi/infermeta/binary.h"
...
...
paddle/fluid/operators/fused/fusion_conv_inception_op.cc
浏览文件 @
39ffef0d
...
...
@@ -16,7 +16,7 @@ limitations under the License. */
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/
fluid/platform
/cudnn_workspace_helper.h"
#include "paddle/
phi/backends/gpu/cuda
/cudnn_workspace_helper.h"
namespace
paddle
{
namespace
operators
{
...
...
@@ -113,7 +113,7 @@ class ConvInceptionFusionOpMaker : public framework::OpProtoAndCheckerMaker {
"allocated/freed each time the operator runs, larger "
"workspace size can increase performance but also requires "
"better hardware. This size should be chosen carefully."
)
.
SetDefault
(
p
latform
::
GetDefaultConvWorkspaceSizeLimitMB
());
.
SetDefault
(
p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB
());
AddComment
(
R"DOC(
)DOC"
);
}
...
...
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
39ffef0d
...
...
@@ -31,10 +31,6 @@ if(WITH_PYTHON)
endif
()
endif
()
cc_library
(
flags
SRCS flags.cc
DEPS gflags
)
cc_library
(
denormal
SRCS denormal.cc
...
...
@@ -178,11 +174,6 @@ if(WITH_GLOO)
DEPS framework_proto gloo_wrapper enforce
)
endif
()
cc_library
(
cudnn_workspace_helper
SRCS cudnn_workspace_helper.cc
DEPS
)
# separate init from device_context to avoid cycle dependencies
cc_library
(
init
...
...
paddle/fluid/platform/cpu_info.cc
浏览文件 @
39ffef0d
...
...
@@ -32,7 +32,7 @@ limitations under the License. */
#include <algorithm>
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
DECLARE_double
(
fraction_of_cpu_memory_to_use
);
DECLARE_uint64
(
initial_cpu_memory_in_mb
);
...
...
paddle/fluid/platform/device/gpu/gpu_info.cc
浏览文件 @
39ffef0d
...
...
@@ -24,7 +24,6 @@ limitations under the License. */
#include "paddle/fluid/memory/memory.h"
#include "paddle/fluid/platform/cuda_device_guard.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/fluid/platform/lock_guard_ptr.h"
#include "paddle/fluid/platform/macros.h"
#include "paddle/fluid/platform/monitor.h"
...
...
@@ -32,6 +31,7 @@ limitations under the License. */
#include "paddle/fluid/platform/profiler/mem_tracing.h"
#include "paddle/fluid/string/split.h"
#include "paddle/phi/backends/gpu/gpu_info.h"
#include "paddle/phi/core/flags.h"
#ifdef PADDLE_WITH_HIP
#include "paddle/fluid/platform/dynload/miopen.h"
...
...
paddle/fluid/platform/enforce.h
浏览文件 @
39ffef0d
...
...
@@ -101,7 +101,7 @@ limitations under the License. */
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
#include "paddle/fluid/platform/device/gpu/gpu_types.h"
#endif
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
namespace
phi
{
class
ErrorSummary
;
...
...
paddle/fluid/platform/profiler/host_tracer.cc
浏览文件 @
39ffef0d
...
...
@@ -17,9 +17,9 @@
#include "glog/logging.h"
#include "paddle/fluid/framework/op_proto_maker.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/fluid/platform/profiler/common_event.h"
#include "paddle/fluid/platform/profiler/host_event_recorder.h"
#include "paddle/phi/core/flags.h"
// Used to filter events, works like glog VLOG(level).
// RecordEvent will works if host_trace_level >= level.
...
...
paddle/fluid/pybind/global_value_getter_setter.cc
浏览文件 @
39ffef0d
...
...
@@ -252,7 +252,7 @@ static void RegisterGlobalVarGetterSetter() {
REGISTER_PUBLIC_GLOBAL_VAR
(
FLAGS_rpc_prefetch_thread_num
);
#endif
const
auto
&
flag_map
=
p
latform
::
GetExportedFlagInfoMap
();
const
auto
&
flag_map
=
p
hi
::
GetExportedFlagInfoMap
();
for
(
const
auto
&
pair
:
flag_map
)
{
const
std
::
string
&
name
=
pair
.
second
.
name
;
bool
is_writable
=
pair
.
second
.
is_writable
;
...
...
paddle/phi/api/yaml/generator/ops_extra_info_gen.py
浏览文件 @
39ffef0d
...
...
@@ -22,7 +22,7 @@ def map_code_template(attrs_str, attrs_checker_str):
return
f
"""// This file is generated by paddle/phi/api/yaml/generator/ops_extra_info_gen.py
#include "paddle/fluid/operators/ops_extra_info.h"
#include "paddle/
fluid/platform
/cudnn_workspace_helper.h"
#include "paddle/
phi/backends/gpu/cuda
/cudnn_workspace_helper.h"
namespace paddle {{
namespace operators {{
...
...
paddle/phi/api/yaml/op_compat.yaml
浏览文件 @
39ffef0d
...
...
@@ -202,7 +202,7 @@
str fuse_activation = ""
,
float fuse_alpha = 0.0f
,
float fuse_beta = 0.0f
,
bool use_addto = false
,
bool fuse_residual_connection = false
,
float Scale_in = 1.0f
,
float Scale_out = 1.0f
,
float Scale_in_eltwise = 1.0f
,
'
float[]
Scale_weights
=
{1.0f}'
,
bool force_fp32_output = false
,
int workspace_size_MB = p
latform
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
int workspace_size_MB = p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
-
op
:
conv2d_fusion
extra
:
...
...
@@ -211,7 +211,7 @@
str fuse_activation = ""
,
float fuse_alpha = 0.0f
,
float fuse_beta = 0.0f
,
bool use_addto = false
,
bool fuse_residual_connection = false
,
float Scale_in = 1.0f
,
float Scale_out = 1.0f
,
float Scale_in_eltwise = 1.0f
,
'
float[]
Scale_weights
=
{1.0f}'
,
bool force_fp32_output = false
,
int workspace_size_MB = p
latform
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
int workspace_size_MB = p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
-
op
:
conv2d_transpose
backward
:
conv2d_transpose_grad
...
...
@@ -219,7 +219,7 @@
attrs
:
[
bool is_test = false
,
bool use_cudnn = true
,
bool use_mkldnn = false
,
bool force_fp32_output = false
,
str mkldnn_data_type = "float32"
,
bool fuse_relu = false
,
str fuse_activation = ""
,
float fuse_alpha = 0.0f
,
float fuse_beta = 0.0f
,
int workspace_size_MB = p
latform
::
GetDefaultConvWorkspaceSizeLimitMB()
]
int workspace_size_MB = p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB()
]
-
op
:
conv3d
backward
:
conv3d_grad
...
...
@@ -227,12 +227,12 @@
attrs
:
[
bool is_test = false
,
bool use_cudnn = true
,
bool use_mkldnn = false
,
str mkldnn_data_type = "float32"
,
bool fuse_relu = false
,
str fuse_activation = ""
,
float fuse_alpha = 0.0f
,
float fuse_beta = 0.0f
,
bool use_addto = false
,
bool fuse_residual_connection = false
,
bool force_fp32_output = false
,
int workspace_size_MB = p
latform
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
int workspace_size_MB = p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
-
op
:
conv3d_transpose
backward
:
conv3d_transpose_grad
extra
:
attrs
:
[
bool use_cudnn = true
,
bool use_mkldnn = false
,
int workspace_size_MB = p
latform
::
GetDefaultConvWorkspaceSizeLimitMB()
]
attrs
:
[
bool use_cudnn = true
,
bool use_mkldnn = false
,
int workspace_size_MB = p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB()
]
-
op
:
cos
backward
:
cos_grad, cos_double_grad, cos_triple_grad
...
...
@@ -273,7 +273,7 @@
str fuse_activation = ""
,
float fuse_alpha = 0.0f
,
float fuse_beta = 0.0f
,
bool use_addto = false
,
bool fuse_residual_connection = false
,
float Scale_in = 1.0f
,
float Scale_out = 1.0f
,
float Scale_in_eltwise = 1.0f
,
'
float[]
Scale_weights
=
{1.0f}'
,
bool force_fp32_output = false
,
int workspace_size_MB = p
latform
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
int workspace_size_MB = p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB()
,
bool exhaustive_search = false
]
-
op
:
depthwise_conv2d_transpose
backward
:
depthwise_conv2d_transpose_grad
...
...
@@ -281,7 +281,7 @@
attrs
:
[
bool is_test = false
,
bool use_cudnn = false
,
bool use_mkldnn = false
,
bool force_fp32_output = false
,
str mkldnn_data_type = "float32"
,
bool fuse_relu = false
,
str fuse_activation = ""
,
float fuse_alpha = 0.0f
,
float fuse_beta = 0.0f
,
int workspace_size_MB = p
latform
::
GetDefaultConvWorkspaceSizeLimitMB()
]
int workspace_size_MB = p
hi
::
backends
::
gpu
::
GetDefaultConvWorkspaceSizeLimitMB()
]
-
op
:
dequantize_linear
extra
:
...
...
paddle/phi/backends/CMakeLists.txt
浏览文件 @
39ffef0d
add_subdirectory
(
dynload
)
add_subdirectory
(
gpu
)
set
(
BACKENDS_SRCS all_context.cc cpu/cpu_context.cc
)
set
(
BACKENDS_DEPS enforce place flags eigen3 phi_device_context
)
...
...
paddle/phi/backends/gpu/CMakeLists.txt
0 → 100644
浏览文件 @
39ffef0d
add_subdirectory
(
cuda
)
paddle/phi/backends/gpu/cuda/CMakeLists.txt
0 → 100644
浏览文件 @
39ffef0d
cc_library
(
cudnn_workspace_helper SRCS cudnn_workspace_helper.cc
)
paddle/
fluid/platform
/cudnn_workspace_helper.cc
→
paddle/
phi/backends/gpu/cuda
/cudnn_workspace_helper.cc
浏览文件 @
39ffef0d
// Copyright (c) 20
19
PaddlePaddle Authors. All Rights Reserved.
// Copyright (c) 20
22
PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
...
...
@@ -12,13 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/
fluid/platform
/cudnn_workspace_helper.h"
#include "paddle/
phi/backends/gpu/cuda
/cudnn_workspace_helper.h"
#include <cstdlib>
#include <string>
namespace
paddle
{
namespace
platform
{
namespace
phi
{
namespace
backends
{
namespace
gpu
{
static
int
GetDefaultConvWorkspaceSizeLimitMBImpl
()
{
const
char
*
env_str
=
std
::
getenv
(
"FLAGS_conv_workspace_size_limit"
);
...
...
@@ -30,6 +31,6 @@ int GetDefaultConvWorkspaceSizeLimitMB() {
static
auto
workspace_size
=
GetDefaultConvWorkspaceSizeLimitMBImpl
();
return
workspace_size
;
}
}
// namespace
platform
}
// namespace p
addle
}
// namespace gpu
}
// namespace
backends
}
// namespace p
hi
paddle/
fluid/platform
/cudnn_workspace_helper.h
→
paddle/
phi/backends/gpu/cuda
/cudnn_workspace_helper.h
浏览文件 @
39ffef0d
// Copyright (c) 20
19
PaddlePaddle Authors. All Rights Reserved.
// Copyright (c) 20
22
PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
...
...
@@ -14,12 +14,13 @@
#pragma once
namespace
paddle
{
namespace
platform
{
namespace
phi
{
namespace
backends
{
namespace
gpu
{
static
constexpr
int
kDefaultConvWorkspaceSizeLimitMB
=
512
;
int
GetDefaultConvWorkspaceSizeLimitMB
();
}
// namespace
platform
}
// namespace p
addle
}
// namespace gpu
}
// namespace
backends
}
// namespace p
hi
paddle/phi/backends/xpu/xpu_info.cc
浏览文件 @
39ffef0d
...
...
@@ -21,7 +21,7 @@ limitations under the License. */
// TODO(wilber): The phi computing library requires a component to manage
// flags.
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
PADDLE_DEFINE_EXPORTED_string
(
selected_xpus
,
...
...
paddle/phi/core/CMakeLists.txt
浏览文件 @
39ffef0d
...
...
@@ -5,6 +5,11 @@ if(WITH_GPU)
proto_library
(
external_error_proto SRCS external_error.proto
)
endif
()
cc_library
(
flags
SRCS flags.cc
DEPS gflags
)
cc_library
(
errors SRCS errors.cc
)
set
(
phi_enforce_deps errors flags
)
if
(
WITH_GPU
)
...
...
paddle/
fluid/platform
/flags.cc
→
paddle/
phi/core
/flags.cc
浏览文件 @
39ffef0d
...
...
@@ -13,13 +13,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/
fluid/platform
/flags.h"
#include "paddle/
phi/core
/flags.h"
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
#include "paddle/
fluid/platform
/cudnn_workspace_helper.h"
#include "paddle/
phi/backends/gpu/cuda
/cudnn_workspace_helper.h"
#endif
namespace
paddle
{
namespace
platform
{
namespace
phi
{
const
ExportedFlagInfoMap
&
GetExportedFlagInfoMap
()
{
return
*
GetMutableExportedFlagInfoMap
();
...
...
@@ -30,8 +29,7 @@ ExportedFlagInfoMap *GetMutableExportedFlagInfoMap() {
return
&
g_exported_flag_info_map
;
}
}
// namespace platform
}
// namespace paddle
}
// namespace phi
PADDLE_DEFINE_EXPORTED_int32
(
inner_op_parallelism
,
0
,
...
...
@@ -261,9 +259,10 @@ PADDLE_DEFINE_EXPORTED_bool(
* increased.
* Users need to balance memory and speed.
*/
PADDLE_DEFINE_EXPORTED_int64
(
conv_workspace_size_limit
,
paddle
::
platform
::
kDefaultConvWorkspaceSizeLimitMB
,
"cuDNN convolution workspace limit in MB unit."
);
PADDLE_DEFINE_EXPORTED_int64
(
conv_workspace_size_limit
,
phi
::
backends
::
gpu
::
kDefaultConvWorkspaceSizeLimitMB
,
"cuDNN convolution workspace limit in MB unit."
);
/**
* CUDNN related FLAG
...
...
paddle/
fluid/platform
/flags.h
→
paddle/
phi/core
/flags.h
浏览文件 @
39ffef0d
...
...
@@ -20,12 +20,11 @@
#include <type_traits>
#include "gflags/gflags.h"
#include "paddle/
fluid/platform
/macros.h"
#include "paddle/
phi/core
/macros.h"
#include "paddle/utils/variant.h"
namespace
paddle
{
namespace
platform
{
namespace
phi
{
struct
FlagInfo
{
using
ValueType
=
...
...
@@ -51,7 +50,7 @@ ExportedFlagInfoMap *GetMutableExportedFlagInfoMap();
static_assert(std::is_same<FlagDeclaredType, ::std::string>::value || \
std::is_arithmetic<FlagDeclaredType>::value, \
"FLAGS should be std::string or arithmetic type"); \
auto *instance = ::p
addle::platform::GetMutableExportedFlagInfoMap();
\
auto *instance = ::p
hi::GetMutableExportedFlagInfoMap();
\
auto &info = (*instance)[#__name]; \
info.name = #__name; \
info.value_ptr = &(FLAGS_##__name); \
...
...
@@ -96,5 +95,4 @@ ExportedFlagInfoMap *GetMutableExportedFlagInfoMap();
__PADDLE_DEFINE_EXPORTED_FLAG( \
name, true, ::std::string, string, default_value, doc)
}
// namespace platform
}
// namespace paddle
}
// namespace phi
paddle/phi/kernels/gpu/batch_norm_grad_kernel.cu
浏览文件 @
39ffef0d
...
...
@@ -14,11 +14,11 @@
#include "paddle/fluid/operators/layout_utils.h"
#include "paddle/fluid/operators/norm_utils.cu.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/backends/gpu/gpu_dnn.h"
#include "paddle/phi/common/layout.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/flags.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/batch_norm_kernel.h"
#include "paddle/phi/kernels/empty_kernel.h"
...
...
paddle/phi/kernels/gpu/batch_norm_kernel.cu
浏览文件 @
39ffef0d
...
...
@@ -22,11 +22,11 @@ namespace cub = hipcub;
#include "paddle/fluid/operators/layout_utils.h"
#include "paddle/fluid/operators/norm_utils.cu.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/backends/gpu/gpu_dnn.h"
#include "paddle/phi/common/layout.h"
#include "paddle/phi/core/enforce.h"
#include "paddle/phi/core/flags.h"
#include "paddle/phi/core/kernel_registry.h"
#include "paddle/phi/kernels/batch_norm_kernel.h"
#include "paddle/phi/kernels/funcs/batch_norm_utils.h"
...
...
paddle/phi/kernels/gpu/gelu_funcs.h
浏览文件 @
39ffef0d
...
...
@@ -14,10 +14,10 @@
#pragma once
#include "paddle/fluid/platform/flags.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/common/amp_type_traits.h"
#include "paddle/phi/common/place.h"
#include "paddle/phi/core/flags.h"
#include "paddle/phi/kernels/funcs/aligned_vector.h"
DECLARE_bool
(
use_fast_math
);
...
...
paddle/phi/kernels/gpudnn/conv_grad_kernel.cu
浏览文件 @
39ffef0d
...
...
@@ -23,8 +23,8 @@
#include "paddle/phi/kernels/gpudnn/conv_cudnn_v7.h"
#endif
#include "paddle/fluid/platform/cudnn_workspace_helper.h"
#include "paddle/fluid/platform/profiler.h"
#include "paddle/phi/backends/gpu/cuda/cudnn_workspace_helper.h"
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/common/float16.h"
#include "paddle/phi/kernels/cpu/conv_util.h"
...
...
paddle/phi/kernels/gpudnn/conv_kernel.cu
浏览文件 @
39ffef0d
...
...
@@ -24,8 +24,8 @@
#include "paddle/phi/kernels/gpudnn/conv_cudnn_v7.h"
#endif
#include "paddle/fluid/platform/cudnn_workspace_helper.h"
#include "paddle/fluid/platform/profiler.h"
#include "paddle/phi/backends/gpu/cuda/cudnn_workspace_helper.h"
#include "paddle/phi/common/bfloat16.h"
#include "paddle/phi/common/float16.h"
#include "paddle/phi/kernels/cpu/conv_util.h"
...
...
paddle/phi/kernels/impl/conv_cudnn_impl.h
浏览文件 @
39ffef0d
...
...
@@ -23,9 +23,9 @@
#include "paddle/phi/kernels/gpudnn/conv_cudnn_v7.h"
#endif
#include "paddle/fluid/platform/cudnn_workspace_helper.h"
#include "paddle/fluid/platform/profiler.h"
#include "paddle/phi/backends/dynload/cudnn.h"
#include "paddle/phi/backends/gpu/cuda/cudnn_workspace_helper.h"
#include "paddle/phi/common/float16.h"
#include "paddle/phi/kernels/cpu/conv_util.h"
#include "paddle/phi/kernels/funcs/batch_norm_utils.h"
...
...
paddle/testing/paddle_gtest_main.cc
浏览文件 @
39ffef0d
...
...
@@ -17,8 +17,8 @@ limitations under the License. */
#include "paddle/fluid/framework/phi_utils.h"
#include "paddle/fluid/memory/allocation/allocator_strategy.h"
#include "paddle/fluid/platform/device/npu/npu_info.h"
#include "paddle/fluid/platform/flags.h"
#include "paddle/fluid/platform/init.h"
#include "paddle/phi/core/flags.h"
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
DECLARE_bool
(
enable_gpu_memory_usage_log
);
...
...
@@ -43,7 +43,7 @@ int main(int argc, char** argv) {
}
#endif
const
auto
&
flag_map
=
p
addle
::
platform
::
GetExportedFlagInfoMap
();
const
auto
&
flag_map
=
p
hi
::
GetExportedFlagInfoMap
();
for
(
const
auto
&
pair
:
flag_map
)
{
const
std
::
string
&
name
=
pair
.
second
.
name
;
// NOTE(zhiqiu): some names may not linked in some tests, so add to
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录