Skip to content

Commit a763716

Browse files
authored
Fix comments for PR #59644 (#59750)
* tinyfix for PR #59644 * tinyfix * tinyfix * update
1 parent e5fbff4 commit a763716

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

paddle/fluid/memory/allocation/allocator.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "paddle/fluid/platform/enforce.h"
2424
#include "paddle/fluid/platform/place.h"
2525
#include "paddle/phi/core/allocator.h"
26+
#include "paddle/phi/core/enforce.h"
2627
#include "paddle/phi/core/flags.h"
2728

2829
#ifdef PADDLE_WITH_NCCL
@@ -143,22 +144,22 @@ using DecoratedAllocationPtr =
143144

144145
template <typename T>
145146
static T&& FillValue(T&& allocation) {
146-
#if defined(PADDLE_WITH_NCCL)
147+
#if defined(PADDLE_WITH_CUDA)
147148
if (allocation != nullptr) {
148149
if (FLAGS_sync_after_alloc || FLAGS_alloc_fill_value >= 0) {
149-
cudaDeviceSynchronize();
150+
PADDLE_ENFORCE_GPU_SUCCESS(cudaDeviceSynchronize());
150151
if (FLAGS_alloc_fill_value >= 0) {
151152
VLOG(10) << "Set " << FLAGS_alloc_fill_value << " on "
152153
<< allocation->ptr() << " " << allocation->place() << " "
153154
<< allocation->size();
154155
if (platform::is_gpu_place(allocation->place())) {
155-
cudaMemset(
156-
allocation->ptr(), FLAGS_alloc_fill_value, allocation->size());
156+
PADDLE_ENFORCE_GPU_SUCCESS(cudaMemset(
157+
allocation->ptr(), FLAGS_alloc_fill_value, allocation->size()));
157158
} else {
158159
std::memset(
159160
allocation->ptr(), FLAGS_alloc_fill_value, allocation->size());
160161
}
161-
cudaDeviceSynchronize();
162+
PADDLE_ENFORCE_GPU_SUCCESS(cudaDeviceSynchronize());
162163
}
163164
}
164165
}

python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ def __init__(self, layers, hcg, strategy):
921921
self._virtual_pp_rank = 0
922922
self._reset_counter()
923923

924-
self._assign_vpp_info(self.model_chunks)
924+
self._check_sanity()
925925

926926
def _check_sanity(self):
927927
assert (

0 commit comments

Comments
 (0)