@@ -34,7 +34,7 @@ class PyQnnManager {
3434 auto qnn_executorch_options = GetQnnExecuTorchOptions (
3535 qnn_executorch_option_ptr_.cast <std::string_view>().data ());
3636 qnn_manager_ = std::make_shared<QnnManager>(
37- qnn_executorch_options, qnn_executorch_context_binary_);
37+ qnn_executorch_options, qnn_executorch_context_binary_, false );
3838 }
3939
4040 // used for loading context binary directly
@@ -47,7 +47,7 @@ class PyQnnManager {
4747 qnn_executorch_context_binary_.buffer = info.ptr ;
4848 qnn_executorch_context_binary_.nbytes = info.size * info.itemsize ;
4949 qnn_manager_ = std::make_shared<QnnManager>(
50- qnn_executorch_options, qnn_executorch_context_binary_);
50+ qnn_executorch_options, qnn_executorch_context_binary_, false );
5151 }
5252
5353 // used during stage 2 of multi-graph mode
@@ -160,7 +160,7 @@ class PyQnnManager {
160160 qnn_executorch_context_binary_ =
161161 MakeQcirCustomBinaryInfo (qcir_bin, tensor_data);
162162 qnn_manager_ = std::make_shared<QnnManager>(
163- qnn_executorch_options, qnn_executorch_context_binary_);
163+ qnn_executorch_options, qnn_executorch_context_binary_, false );
164164 }
165165
166166 executorch::runtime::Error Init () {
@@ -195,7 +195,7 @@ class PyQnnManager {
195195 std::vector<std::shared_ptr<OpWrapper>>& op_wrappers) {
196196 QnnExecuTorchContextBinary binary_info;
197197
198- if (qnn_manager_->IsOnlinePrepare () || qnn_manager_-> IsMultipleGraphs ()) {
198+ if (qnn_manager_->IsMultipleGraphs ()) {
199199 builder_.Reset ();
200200 std::vector<uint8_t > tensor_data;
201201 std::vector<uint64_t > offsets;
@@ -305,8 +305,11 @@ class PyQnnManager {
305305 QNN_EXECUTORCH_LOG_ERROR (" Fail to compile QNN graph" );
306306 return py::array_t <char >(0 );
307307 }
308- if (qnn_manager_->GetContextBinary (binary_info) !=
309- executorch::runtime::Error::Ok) {
308+ auto qnn_executorch_options = GetQnnExecuTorchOptions (
309+ qnn_executorch_option_ptr_.cast <std::string_view>().data ());
310+ if (qnn_executorch_options->saver () ||
311+ qnn_manager_->GetContextBinary (binary_info) !=
312+ executorch::runtime::Error::Ok) {
310313 return py::array_t <char >(0 );
311314 }
312315 }
0 commit comments