diff --git a/lite/load_and_run/src/options/device_options.cpp b/lite/load_and_run/src/options/device_options.cpp index 10152fe29b38c2aca311d9c9e0ec50d0a50a662d..c1d2dc6f7755d7d3d7e05085beac766e975c3fed 100644 --- a/lite/load_and_run/src/options/device_options.cpp +++ b/lite/load_and_run/src/options/device_options.cpp @@ -155,6 +155,8 @@ XPUDeviceOption::XPUDeviceOption() { thread_cnt == thread_num, "core ids number should be same with thread number set before"); enable_set_core_ids = true; + } else { + enable_set_core_ids = false; } m_option = { @@ -237,6 +239,8 @@ void XPUDeviceOption::config_model( thread_cnt == thread_num, "core ids number should be same with thread number set before"); enable_set_core_ids = true; + } else { + enable_set_core_ids = false; } CONFIG_MODEL_FUN; diff --git a/lite/load_and_run/src/options/device_options.h b/lite/load_and_run/src/options/device_options.h index 5d70e6682bf60d618dd480269627f822ef0c9e77..bb61aedda6c7ebe49f9addc06a2a0a307a69531a 100644 --- a/lite/load_and_run/src/options/device_options.h +++ b/lite/load_and_run/src/options/device_options.h @@ -17,8 +17,7 @@ class XPUDeviceOption final : public OptionBase { public: static bool is_valid(); static std::shared_ptr create_option(); - void config_model( - RuntimeParam& runtime_param, std::shared_ptr model) override; + void config_model(RuntimeParam&, std::shared_ptr) override; std::string option_name() const override { return m_option_name; }; static void set_valid(bool val) { m_valid = val; } diff --git a/lite/load_and_run/src/strategys/strategy_fitting.cpp b/lite/load_and_run/src/strategys/strategy_fitting.cpp index 794d376024c1d5e9d64bc0e84680b4f97fcf8713..d7d1dc1ccd44ec95c4f8073983f195f6ee9f4850 100644 --- a/lite/load_and_run/src/strategys/strategy_fitting.cpp +++ b/lite/load_and_run/src/strategys/strategy_fitting.cpp @@ -160,6 +160,7 @@ void OptionsTimeProfiler::profile_with_given_options( mgb::RealTimer timer; auto stage_config_model = [&]() { for (auto& option : *given_options) { + mgb_assert(option.second, "invalid option %s\n", option.first.c_str()); option.second->config_model(runtime_param, model); } }; @@ -456,7 +457,6 @@ void FittingStrategy::dump_best_options_with_model() { } model->run_model(); model->wait(); - std::vector model_data = model->get_model_data(); mgb_log_warn("model_data size=%zu", model_data.size()); mgb_log_warn("json_info size=%zu", json_info.size()); @@ -465,7 +465,7 @@ void FittingStrategy::dump_best_options_with_model() { lite::ModelPacker packer( model_data, m_dumped_model, json_info, info_algo_policy_data, info_binary_cache_data); - packer.set_header(); + packer.set_header("NONE", "NONE", info_binary_cache_data.empty()); packer.pack_model(); } ///////////////////////// AutoCleanFile///////////////////////////