Skip to content

Commit 2ce1c52

Browse files
committed
Fix failed tests
1 parent 576d90d commit 2ce1c52

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "crop_inst.h"
1212
#include "eltwise_inst.h"
1313
#include "gemm_inst.h"
14+
#include "assign_inst.h"
1415
#include "read_value_inst.h"
1516
#include "reshape_inst.h"
1617
#include "permute_inst.h"
@@ -476,6 +477,10 @@ bool crop_in_place_optimization::match(const program_node& node,
476477
return false;
477478
if (user->is_type<loop>() || user->is_type<non_max_suppression>())
478479
return false;
480+
// Read_value and assign don't handle data paddings internally, thus disable
481+
// crop optimization for now
482+
if (user->is_type<read_value>() || user->is_type<assign>())
483+
return false;
479484
// If the input tensor of convolution includes dynamic padding, there is an issue
480485
// where the total size of tensor is not properly calculated and becomes 0
481486
// It causes issue for internal buffer allocation during runtime

src/plugins/intel_gpu/src/graph/impls/cpu/assign.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ struct assign_impl : public typed_primitive_impl<assign> {
5454

5555
stream.wait_for_events(events);
5656

57-
const auto ev_set_memory = variable.get_memory()->copy_from(stream, instance.input_memory());
57+
const auto ev_set_memory = variable.get_memory()->copy_from(stream, instance.input_memory(), 0, 0, variable.get_layout().bytes_count(), true);
5858
variable.set();
5959

6060
return ev_set_memory;

src/plugins/intel_gpu/src/runtime/ocl/ocl_memory.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
namespace cldnn {
2828
namespace ocl {
2929

30-
static inline void check_boundaries(const std::string& func_str,
31-
size_t src_size,
30+
static inline void check_boundaries(size_t src_size,
3231
size_t src_offset,
3332
size_t dst_size,
3433
size_t dst_offset,
35-
size_t copy_size) {
34+
size_t copy_size,
35+
const std::string& func_str = "") {
3636
OPENVINO_ASSERT(src_offset + copy_size <= src_size && dst_offset + copy_size <= dst_size,
3737
"[GPU] Incorrect buffer sizes for ",
3838
func_str,
@@ -156,7 +156,7 @@ event::ptr gpu_buffer::copy_from(stream& stream, const void* data_ptr, size_t sr
156156
if (size == 0)
157157
return result_event;
158158

159-
check_boundaries("gpu_buffer::copy_from(void*)", SIZE_MAX, src_offset, _bytes_count, dst_offset, size);
159+
check_boundaries(SIZE_MAX, src_offset, _bytes_count, dst_offset, size, "gpu_buffer::copy_from(void*)");
160160

161161
auto cl_stream = downcast<ocl_stream>(&stream);
162162
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get())->get();
@@ -172,7 +172,7 @@ event::ptr gpu_buffer::copy_from(stream& stream, const memory& src_mem, size_t s
172172
if (size == 0)
173173
return result_event;
174174

175-
check_boundaries("gpu_buffer::copy_from(memory&)", src_mem.size(), src_offset, _bytes_count, dst_offset, size);
175+
check_boundaries(src_mem.size(), src_offset, _bytes_count, dst_offset, size, "gpu_buffer::copy_from(memory&)");
176176

177177
switch (src_mem.get_allocation_type()) {
178178
case allocation_type::usm_host:
@@ -208,7 +208,7 @@ event::ptr gpu_buffer::copy_to(stream& stream, void* data_ptr, size_t src_offset
208208
if (size == 0)
209209
return result_event;
210210

211-
check_boundaries("gpu_buffer::copy_to(void*)", _bytes_count, src_offset, SIZE_MAX, dst_offset, size);
211+
check_boundaries(_bytes_count, src_offset, SIZE_MAX, dst_offset, size, "gpu_buffer::copy_to(void*)");
212212

213213
auto cl_stream = downcast<ocl_stream>(&stream);
214214
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get())->get();
@@ -570,7 +570,7 @@ event::ptr gpu_usm::copy_from(stream& stream, const void* data_ptr, size_t src_o
570570
if (size == 0)
571571
return result_event;
572572

573-
check_boundaries("gpu_usm::copy_from(void*)", SIZE_MAX, src_offset, _bytes_count, dst_offset, size);
573+
check_boundaries(SIZE_MAX, src_offset, _bytes_count, dst_offset, size, "gpu_usm::copy_from(void*)");
574574

575575
auto cl_stream = downcast<ocl_stream>(&stream);
576576
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get())->get();
@@ -587,7 +587,7 @@ event::ptr gpu_usm::copy_from(stream& stream, const memory& src_mem, size_t src_
587587
if (size == 0)
588588
return result_event;
589589

590-
check_boundaries("gpu_usm::copy_from(memory&)", src_mem.size(), src_offset, _bytes_count, dst_offset, size);
590+
check_boundaries(src_mem.size(), src_offset, _bytes_count, dst_offset, size, "gpu_usm::copy_from(memory&)");
591591

592592
auto cl_stream = downcast<ocl_stream>(&stream);
593593
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get())->get();
@@ -620,7 +620,7 @@ event::ptr gpu_usm::copy_to(stream& stream, void* data_ptr, size_t src_offset, s
620620
if (size == 0)
621621
return result_event;
622622

623-
check_boundaries("gpu_usm::copy_to(void*)", _bytes_count, src_offset, SIZE_MAX, dst_offset, size);
623+
check_boundaries(_bytes_count, src_offset, SIZE_MAX, dst_offset, size, "gpu_usm::copy_to(void*)");
624624

625625
auto cl_stream = downcast<ocl_stream>(&stream);
626626
auto cl_event = blocking ? nullptr : &downcast<ocl_event>(result_event.get())->get();

0 commit comments

Comments
 (0)