Skip to content

Commit 9fd2a52

Browse files
committed
Remove async prefetch to avoid regression
1 parent c0b5219 commit 9fd2a52

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

src/common/util/include/openvino/util/parallel_mem_streambuf.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "openvino/util/log.hpp"
3232
#include "openvino/util/parallel_read_streambuf.hpp"
3333

34-
#define ENABLE_OPENVINO_DEBUG 0
34+
#define ENABLE_BD_PROFILING_LOG 0
3535

3636
namespace ov {
3737
namespace util {
@@ -242,7 +242,7 @@ class ParallelMemStreamBuf : public std::streambuf {
242242
madvise(const_cast<char*>(src), size, MADV_WILLNEED);
243243
#endif
244244

245-
#ifdef ENABLE_OPENVINO_DEBUG
245+
#if ENABLE_BD_PROFILING_LOG
246246
const auto t0 = std::chrono::steady_clock::now();
247247
#endif
248248

@@ -252,7 +252,7 @@ class ParallelMemStreamBuf : public std::streambuf {
252252
std::memcpy(dst + offset, src + offset, copy_size);
253253
});
254254

255-
#ifdef ENABLE_OPENVINO_DEBUG
255+
#if ENABLE_BD_PROFILING_LOG
256256
{
257257
const auto t1 = std::chrono::steady_clock::now();
258258
const double elapsed_s = std::chrono::duration<double>(t1 - t0).count();

src/common/util/include/openvino/util/parallel_read_streambuf.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class ParallelReadStreamBuf : public std::streambuf {
278278
std::vector<std::future<void>> futures;
279279
futures.reserve(num_threads);
280280

281-
#ifdef ENABLE_BD_PROFILING_LOG
281+
#if ENABLE_BD_PROFILING_LOG
282282
const auto t0 = std::chrono::steady_clock::now();
283283
#endif
284284

@@ -358,7 +358,7 @@ class ParallelReadStreamBuf : public std::streambuf {
358358
for (auto& f : futures) {
359359
f.get();
360360
}
361-
#ifdef ENABLE_BD_PROFILING_LOG
361+
#if ENABLE_BD_PROFILING_LOG
362362
{
363363
const auto t1 = std::chrono::steady_clock::now();
364364
const double elapsed_s = std::chrono::duration<double>(t1 - t0).count();

src/common/util/src/os/lin/lin_mmap_object.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ class MapHolder final : public MappedMemory {
8989
throw std::runtime_error("Can not create file mapping for " + std::to_string(fd) +
9090
", err=" + std::strerror(errno));
9191
}
92-
// Hint the kernel to read pages sequentially and start async
93-
// prefetch immediately. MADV_SEQUENTIAL doubles the readahead
94-
// window; MADV_WILLNEED initiates I/O in the background so pages
95-
// are resident before compile_model accesses individual constants.
96-
madvise(m_data, m_size, MADV_SEQUENTIAL | MADV_WILLNEED);
9792
} else {
9893
m_data = MAP_FAILED;
9994
}

src/common/util/src/os/win/win_mmap_object.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,6 @@ class MapHolder : public ov::MappedMemory {
116116
if (!m_data) {
117117
throw std::runtime_error("Can not create map view for " + util::path_to_string(path));
118118
}
119-
// Hint the OS to start async prefetch of all mapped pages so
120-
// they are (mostly) resident by the time constants are accessed.
121-
WIN32_MEMORY_RANGE_ENTRY prefetch_range{m_data, m_size};
122-
PrefetchVirtualMemory(GetCurrentProcess(), 1, &prefetch_range, 0);
123119
} else {
124120
m_data = nullptr;
125121
}

0 commit comments

Comments
 (0)