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
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,8 @@ Status QnnBackendManager::LoadCachedQnnContextFromBuffer(char* buffer, uint64_t

void* bin_buffer = nullptr;
#ifdef QNN_FILE_MAPPED_WEIGHTS_AVAILABLE
if (file_mapped_weights_enabled_) {
// A nonzero buffer length implies an embedded context
if (file_mapped_weights_enabled_ && buffer_length == 0) {
ORT_RETURN_IF(!file_mapper_, "Attemping to use File Mapping feature but file_mapper_ is uninitialized");

ORT_RETURN_IF_ERROR(GetFileSizeIfValid(context_bin_filepath, buffer_length));
Expand Down
5 changes: 5 additions & 0 deletions onnxruntime/core/providers/qnn/qnn_execution_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,11 @@ QNNExecutionProvider::QNNExecutionProvider(const ProviderOptions& provider_optio
enable_file_mapped_weights_ = false;
LOGS_DEFAULT(WARNING) << "File mapped weights feature is only available on Windows arm64 devices for QNN API versions >= 2.32. "
<< "Feature will be disabled by default";
#else
if (qnn_context_embed_mode_ && enable_file_mapped_weights_) {
enable_file_mapped_weights_ = false;
LOGS_DEFAULT(WARNING) << "File mapped weights feature is incompatible with embedded EP contexts. Feature will be disabled by default.";
}
#endif

static const std::string QNN_DEVICE_ID = "device_id";
Expand Down
Loading