Skip to content

Commit a1006b2

Browse files
authored
[phi decoupling] decouple dependency to device_context in phi (Part 1) (#50865)
* move DeviceContextPool to phi * add EmplaceExternalContextFunc * update namespace * update cmake * fix bugs and create context_pool_impl.h * replace platform::is_xxx_place * fix bugs * update generator * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs * fix bugs * fix enforce usage * Revert "fix enforce usage" This reverts commit 5f521f0. * fix bugs * rm XPUDeviceContext and CustomDeviceContext * fix bugs * fix fix context init bug * fix bugs after merge * fix bugs * fix name * fix mutable_data * update and fix bugs * fix bugs * update * fix bugs * fix name * fix bugs * merge * fix bugs * create context_pool in phi/backends * create context_pool in phi/backends * fix bugs * fix xpu bugs * fix rocm bugs * fix bugs * fix bugs * fix bugs * fix xpu bugs * update * update * fix bugs * fix bugs
1 parent 203a62b commit a1006b2

File tree

143 files changed

+1519
-1468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+1519
-1468
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,6 @@ paddle/fluid/pybind/op_function_impl.h
9494
paddle/fluid/pybind/*final_state_op_function_impl.h
9595
paddle/fluid/prim/api/generated/prim_api/*
9696
paddle/fluid/framework/__init__.py
97+
paddle/phi/api/profiler/__init__.py
9798
python/paddle/incubate/fleet/parameter_server/pslib/ps_pb2.py
99+
python/paddle/fluid/incubate/fleet/parameter_server/pslib/ps_pb2.py

paddle/fluid/operators/fused/fusion_conv_inception_op.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class CUDNNConvInceptionFusionOpKernel : public framework::OpKernel<T> {
165165
PADDLE_ENFORCE_GPU_SUCCESS(platform::dynload::cudnnSetConvolutionMathType(
166166
conv_desc[i], CUDNN_DEFAULT_MATH));
167167
#if CUDA_VERSION >= 11000 && CUDNN_VERSION >= 8000
168-
if (!platform::allow_tf32_cudnn) {
168+
if (!phi::allow_tf32_cudnn) {
169169
PADDLE_ENFORCE_GPU_SUCCESS(
170170
platform::dynload::cudnnSetConvolutionMathType(conv_desc[i],
171171
CUDNN_FMA_MATH));

paddle/fluid/operators/math/beam_search_xpu.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ namespace phi {
1919
class DenseTensor;
2020
} // namespace phi
2121

22-
namespace paddle {
23-
namespace framework {} // namespace framework
24-
namespace platform {
25-
class XPUDeviceContext;
26-
} // namespace platform
27-
} // namespace paddle
28-
2922
namespace paddle {
3023
namespace operators {
3124
namespace math {

paddle/fluid/platform/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ cc_library(
159159
cudnn_workspace_helper
160160
${XPU_CTX_DEPS}
161161
${MLU_CTX_DEPS}
162-
eigen3
163162
phi_backends
164163
phi_device_context
165164
generator)

paddle/fluid/platform/cuda_graph_with_memory_pool.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "paddle/fluid/platform/cuda_graph_with_memory_pool.h"
1616

1717
#include "paddle/fluid/memory/allocation/allocator_facade.h"
18-
#include "paddle/phi/backends/all_context.h"
18+
#include "paddle/phi/backends/context_pool.h"
1919

2020
DECLARE_bool(use_stream_safe_cuda_allocator);
2121
DECLARE_bool(new_executor_use_cuda_graph);

paddle/fluid/platform/device/custom/custom_device_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ void InitDevice() {
5454
}
5555
EXPECT_GT(static_cast<int>(places.size()), 0);
5656

57-
paddle::platform::DeviceContextPool::Init(places);
57+
paddle::platform::DeviceContextPool::Init(
58+
places, paddle::platform::EmplaceExternalContext);
5859
}
5960

6061
void TestDeviceInterface(const paddle::platform::Place& place) {

0 commit comments

Comments
 (0)