Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions paddle/fluid/distributed/collective/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,12 @@ if(WITH_NCCL OR WITH_RCCL)
cc_library(
processgroup_nccl
SRCS ProcessGroupNCCL.cc NCCLTools.cc Common.cc
DEPS place
cuda_stream
enforce
collective_helper
device_context
phi_api
eager_api)
DEPS place enforce collective_helper device_context phi_api eager_api)
if(WITH_DISTRIBUTE AND WITH_PSCORE)
cc_library(
processgroup_heter
SRCS ProcessGroupHeter.cc NCCLTools.cc Common.cc
DEPS place
cuda_stream
enforce
collective_helper
device_context
phi_api
eager_api)
DEPS place enforce collective_helper device_context phi_api eager_api)
endif()
endif()

Expand Down
1 change: 0 additions & 1 deletion paddle/fluid/distributed/collective/ProcessGroupHeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/gen_comm_id_helper.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/stream/cuda_stream.h"

#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL)
#include "paddle/fluid/distributed/collective/NCCLTools.h"
Expand Down
2 changes: 0 additions & 2 deletions paddle/fluid/distributed/collective/ProcessGroupNCCL.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/gen_comm_id_helper.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/stream/cuda_stream.h"

#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL)
#include "paddle/fluid/distributed/collective/NCCLTools.h"
Expand All @@ -46,7 +45,6 @@ namespace paddle {
namespace distributed {

using Place = paddle::platform::Place;
using CUDAStream = platform::stream::CUDAStream;
using CUDADeviceContext = paddle::platform::CUDADeviceContext;

class ProcessGroupNCCL : public ProcessGroup {
Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/framework/garbage_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#ifdef PADDLE_WITH_MLU
#include "paddle/fluid/platform/device/mlu/device_context.h"
#endif
#include "paddle/fluid/platform/stream_callback_manager.h"

namespace paddle {
namespace framework {
Expand Down
1 change: 0 additions & 1 deletion paddle/fluid/framework/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ limitations under the License. */
#include "paddle/fluid/platform/place.h"
#include "paddle/phi/core/ddim.h"
#include "paddle/phi/core/dense_tensor.h"
#include "paddle/phi/core/stream.h"

namespace paddle {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ phi::Allocation* StreamSafeCUDAAllocator::AllocateImpl(size_t size) {
default_stream_,
this);
VLOG(8) << "Allocate " << allocation->size() << " bytes at address "
<< allocation->ptr();
<< allocation->ptr() << " , stream: " << default_stream_;
return allocation;
}

Expand Down
3 changes: 1 addition & 2 deletions paddle/fluid/operators/decode_jpeg_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/platform/dynload/nvjpeg.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/stream/cuda_stream.h"

namespace paddle {
namespace operators {
Expand Down Expand Up @@ -69,7 +68,7 @@ class GPUDecodeJpegKernel : public framework::OpKernel<T> {
nvjpegStatus_t info_status =
platform::dynload::nvjpegGetImageInfo(nvjpeg_handle,
x_data,
(size_t)x->numel(),
static_cast<size_t>(x->numel()),
&components,
&subsampling,
widths,
Expand Down
3 changes: 1 addition & 2 deletions paddle/fluid/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ endif()

add_subdirectory(device)
add_subdirectory(dynload)
add_subdirectory(stream)

cc_library(
cpu_helper
Expand All @@ -130,7 +129,7 @@ if(WITH_DGC)
endif()

if(WITH_GPU OR WITH_ROCM)
set(GPU_CTX_DEPS dynload_cuda dynamic_loader cuda_stream)
set(GPU_CTX_DEPS dynload_cuda dynamic_loader)
endif()

if(WITH_IPU)
Expand Down
18 changes: 2 additions & 16 deletions paddle/fluid/platform/device_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ limitations under the License. */
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/profiler.h"
#include "paddle/fluid/platform/profiler/event_tracing.h"
#include "paddle/fluid/platform/stream/cuda_stream.h"
#include "paddle/phi/backends/gpu/gpu_context.h"
#include "paddle/phi/core/allocator.h"

Expand Down Expand Up @@ -534,24 +533,11 @@ void CudnnWorkspaceHandle::ReallocWorkspace(size_t required_workspace_bytes) {
allocation_ = memory::Alloc(device_context_, required_workspace_bytes);
}

CUDADeviceContext::CUDADeviceContext(CUDAPlace place) : phi::GPUContext(place) {
phi::GPUContext::PartialInitWithoutAllocator();
cuda_stream_.reset(new stream::CUDAStream(phi::GPUContext::stream(), place));
}
CUDADeviceContext::CUDADeviceContext(CUDAPlace place)
: phi::GPUContext(place) {}

CUDADeviceContext::~CUDADeviceContext() = default;

stream::CUDAStream* CUDADeviceContext::GetCudaStream() const {
return cuda_stream_.get();
}

stream::CUDAStream* CUDADeviceContext::SetCudaStream(
stream::CUDAStream* new_stream_ptr) {
auto* old_stream_ptr = cuda_stream_.release();
cuda_stream_.reset(new_stream_ptr);
return old_stream_ptr;
}

CUDAPinnedDeviceContext::CUDAPinnedDeviceContext() {
eigen_device_.reset(new Eigen::DefaultDevice());
}
Expand Down
13 changes: 1 addition & 12 deletions paddle/fluid/platform/device_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ limitations under the License. */
#include "glog/logging.h"
#include "paddle/fluid/platform/enforce.h"
#include "paddle/fluid/platform/place.h"
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
#include "paddle/fluid/platform/stream/cuda_stream.h"
#endif
#ifdef PADDLE_WITH_ASCEND_CL
#include "paddle/fluid/platform/device/npu/enforce_npu.h"
#include "paddle/fluid/platform/device/npu/npu_stream.h"
Expand Down Expand Up @@ -279,16 +276,8 @@ class CUDADeviceContext : public phi::GPUContext {
explicit CUDADeviceContext(CUDAPlace place);
virtual ~CUDADeviceContext();

// NOTE: Just for compatibility with the past, please delete if there is an
// elegant way.
stream::CUDAStream* GetCudaStream() const;
stream::CUDAStream* SetCudaStream(stream::CUDAStream*);

private:
// NOTE: Just for compatibility with the past, please delete if there is an
// elegant way.
std::unique_ptr<stream::CUDAStream> cuda_stream_;

int place_holder_; // TO BE REMOVED
DISABLE_COPY_AND_ASSIGN(CUDADeviceContext);
};

Expand Down
1 change: 0 additions & 1 deletion paddle/fluid/platform/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ limitations under the License. */
#include <hip/hip_runtime.h>
#endif
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/stream/cuda_stream.h"

namespace paddle {
namespace platform {
Expand Down
6 changes: 0 additions & 6 deletions paddle/fluid/platform/stream/CMakeLists.txt

This file was deleted.

147 changes: 0 additions & 147 deletions paddle/fluid/platform/stream/cuda_stream.cc

This file was deleted.

Loading