Skip to content

Commit aa73a55

Browse files
authored
Default to file load mode in module (#10827)
Summary: We've seen a number of people hit issues with mlock as the default load mode. In particular, mlock will fail above a certain PTE size and may require elevated permissions on some systems. We should not default to using mlock and can leave at as an opt-in optimization. Differential Revision: D74607072
1 parent 473c77b commit aa73a55

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extension/module/module.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Module {
5353
*/
5454
explicit Module(
5555
const std::string& file_path,
56-
const LoadMode load_mode = LoadMode::MmapUseMlock,
56+
const LoadMode load_mode = LoadMode::File,
5757
std::unique_ptr<runtime::EventTracer> event_tracer = nullptr);
5858

5959
/**
@@ -68,7 +68,7 @@ class Module {
6868
explicit Module(
6969
const std::string& file_path,
7070
const std::string& data_map_path,
71-
const LoadMode load_mode = LoadMode::MmapUseMlock,
71+
const LoadMode load_mode = LoadMode::File,
7272
std::unique_ptr<runtime::EventTracer> event_tracer = nullptr);
7373

7474
/**
@@ -481,7 +481,7 @@ class Module {
481481

482482
std::string file_path_;
483483
std::string data_map_path_;
484-
LoadMode load_mode_{LoadMode::MmapUseMlock};
484+
LoadMode load_mode_{LoadMode::File};
485485
std::shared_ptr<Program> program_;
486486
std::unique_ptr<runtime::DataLoader> data_loader_;
487487
std::unique_ptr<runtime::MemoryAllocator> memory_allocator_;

0 commit comments

Comments
 (0)