Skip to content

Commit

Permalink
update fix when log set by set_property (global and pass log_None )
Browse files Browse the repository at this point in the history
  • Loading branch information
DanLiu2Intel committed Jul 10, 2024
1 parent 1a6eb99 commit a532d65
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/plugins/intel_npu/src/al/include/npu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class IEngineBackend : public std::enable_shared_from_this<IEngineBackend> {
virtual bool isBatchingSupported() const = 0;
/** @brief Register backend-specific options */
virtual void registerOptions(OptionsDesc& options) const;
/** @brief Update backend and device info */
virtual void updateInfo(const Config& config) = 0;

protected:
virtual ~IEngineBackend() = default;
Expand Down Expand Up @@ -74,6 +76,8 @@ class IDevice : public std::enable_shared_from_this<IDevice> {
const std::shared_ptr<const ICompiledModel>& compiledModel,
const std::shared_ptr<IExecutor>& executor,
const Config& config) = 0;

virtual void updateInfo(const Config& config) = 0;

protected:
virtual ~IDevice() = default;
Expand Down
9 changes: 9 additions & 0 deletions src/plugins/intel_npu/src/backend/include/zero_backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ class ZeroEngineBackend final : public IEngineBackend {

bool isBatchingSupported() const override;

void updateInfo(const Config& config) {
_logger.setLevel(config.get<LOG_LEVEL>());
if(_devices.size() > 0){
for(auto dev : _devices) {
dev.second->updateInfo(config);
}
}
}

private:
std::shared_ptr<ZeroInitStructsHolder> _instance;

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/intel_npu/src/backend/include/zero_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class ZeroDevice : public IDevice {
std::shared_ptr<SyncInferRequest> createInferRequest(const std::shared_ptr<const ICompiledModel>& compiledModel,
const std::shared_ptr<IExecutor>& executor,
const Config& config) override;
void updateInfo(const Config& config) {
log.setLevel(config.get<LOG_LEVEL>());
}

ZeroDevice& operator=(const ZeroDevice&) = delete;
ZeroDevice(const ZeroDevice&) = delete;
Expand Down
1 change: 0 additions & 1 deletion src/plugins/intel_npu/src/plugin/include/backends.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "npu_private_properties.hpp"

namespace intel_npu {

enum class AvailableBackends { LEVEL_ZERO, IMD };

/** @brief Represent container for all backends and hide all related searching logic */
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/intel_npu/src/plugin/src/backends.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ void NPUBackends::registerOptions(OptionsDesc& options) const {
// TODO config should be also specified to backends, to allow use logging in devices and all levels below
void NPUBackends::setup(const Config& config) {
_logger.setLevel(config.get<LOG_LEVEL>());
if (_backend != nullptr){
_backend->updateInfo(config);
}
}

std::string NPUBackends::getCompilationPlatform(const std::string_view platform, const std::string& deviceId) const {
Expand Down

0 comments on commit a532d65

Please sign in to comment.