Skip to content

Commit

Permalink
[intel-npu] renaming to NPU_COMPILER_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
csoka committed Jan 9, 2025
1 parent a1f2d57 commit a0ca526
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ offer a limited set of supported OpenVINO features.
ov::intel_npu::device_alloc_mem_size
ov::intel_npu::device_total_mem_size
ov::intel_npu::driver_version
ov::intel_npu::compiler_api_version
ov::intel_npu::compiler_version
.. note::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ static constexpr ov::Property<uint32_t, ov::PropertyMutability::RO> driver_versi
/**
* @brief [Only for NPU plugin]
* Type: uint32_t
* Read-only property to get NPU compiler API version
* Read-only property to get NPU compiler version
* @ingroup ov_runtime_npu_prop_cpp_api
*/
static constexpr ov::Property<uint32_t, ov::PropertyMutability::RO> compiler_api_version{"NPU_COMPILER_API_VERSION"};
static constexpr ov::Property<uint32_t, ov::PropertyMutability::RO> compiler_version{"NPU_COMPILER_VERSION"};

/**
* @brief [Only for NPU compiler]
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_npu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ The following properties are supported:
| `ov::intel_npu::device_alloc_mem_size`/</br>`NPU_DEVICE_ALLOC_MEM_SIZE` | RO | Size of already allocated NPU DDR memory | `N/A` | `N/A` |
| `ov::intel_npu::device_total_mem_size`/</br>`NPU_DEVICE_TOTAL_MEM_SIZE` | RO | Size of available NPU DDR memory | `N/A` | `N/A` |
| `ov::intel_npu::driver_version`/</br>`NPU_DRIVER_VERSION` | RO | NPU driver version. | `N/A` | `N/A` |
| `ov::intel_npu::compiler_api_version`/</br>`NPU_COMPILER_API_VERSION` | RO | NPU compiler API version. MSB 16 bits are Major version, LSB 16 bits are Minor version | `N/A` | `N/A` |
| `ov::intel_npu::compiler_version`/</br>`NPU_COMPILER_VERSION` | RO | NPU compiler version. MSB 16 bits are Major version, LSB 16 bits are Minor version | `N/A` | `N/A` |
| `ov::intel_npu::compilation_mode_params`/</br>`NPU_COMPILATION_MODE_PARAMS` | RW | Set various parameters supported by the NPU compiler. (See bellow) | `<std::string>`| `N/A` |
| `ov::intel_npu::turbo`/</br>`NPU_TURBO` | RW | Set Turbo mode on/off | `YES`/ `NO`| `NO` |
| `ov::intel_npu::tiles`/</br>`NPU_TILES` | RW | Sets the number of npu tiles to compile the model for | `[0-]` | `-1` |
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/intel_npu/src/al/include/intel_npu/icompiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ class ICompiler : public std::enable_shared_from_this<ICompiler> {
virtual NetworkMetadata parse(const std::vector<uint8_t>& network, const Config& config) const = 0;

/**
* @brief Returns the compiler API version
* @return composite uint32_t value of compiler api version.
* @brief Returns the compiler version
* @return composite uint32_t value of compiler version.
* MSB 16 bits = Major version
* LSB 16bits = Minor version
*/
virtual uint32_t get_api_version() const = 0;
virtual uint32_t get_version() const = 0;

virtual std::vector<ov::ProfilingInfo> process_profiling_output(const std::vector<uint8_t>& profData,
const std::vector<uint8_t>& network,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ICompilerAdapter {
const Config& config) const = 0;
virtual std::shared_ptr<IGraph> parse(std::vector<uint8_t> network, const Config& config) const = 0;
virtual ov::SupportedOpsMap query(const std::shared_ptr<const ov::Model>& model, const Config& config) const = 0;
virtual uint32_t getApiVersion() const = 0;
virtual uint32_t get_version() const = 0;

virtual ~ICompilerAdapter() = default;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DriverCompilerAdapter final : public ICompilerAdapter {

ov::SupportedOpsMap query(const std::shared_ptr<const ov::Model>& model, const Config& config) const override;

uint32_t getApiVersion() const override;
uint32_t get_version() const override;

private:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PluginCompilerAdapter final : public ICompilerAdapter {

ov::SupportedOpsMap query(const std::shared_ptr<const ov::Model>& model, const Config& config) const override;

uint32_t getApiVersion() const override;
uint32_t get_version() const override;

private:
std::shared_ptr<ZeroInitStructsHolder> _zeroInitStruct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ ov::SupportedOpsMap DriverCompilerAdapter::query(const std::shared_ptr<const ov:
return result;
}

uint32_t DriverCompilerAdapter::getApiVersion() const {
return _zeroInitStruct->getCompilerApiVersion();
uint32_t DriverCompilerAdapter::get_version() const {
return _zeroInitStruct->getCompilerVersion();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ ov::SupportedOpsMap PluginCompilerAdapter::query(const std::shared_ptr<const ov:
return _compiler->query(model, config);
}

uint32_t PluginCompilerAdapter::getApiVersion() const {
return _compiler->get_api_version();
uint32_t PluginCompilerAdapter::get_version() const {
return _compiler->get_version();
}

} // namespace intel_npu
4 changes: 2 additions & 2 deletions src/plugins/intel_npu/src/plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,14 +454,14 @@ Plugin::Plugin()
[&](const Config& config) {
return _metrics->GetDriverVersion();
}}},
{ov::intel_npu::compiler_api_version.name(),
{ov::intel_npu::compiler_version.name(),
{true,
ov::PropertyMutability::RO,
[&](const Config& config) {
/// create dummy compiler
CompilerAdapterFactory compilerAdapterFactory;
auto dummyCompiler = compilerAdapterFactory.getCompiler(_backends->getIEngineBackend(), config);
return dummyCompiler->getApiVersion();
return dummyCompiler->get_version();
}}},
{ov::intel_npu::compilation_mode_params.name(),
{true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class ZeroInitStructsHolder final {
inline uint32_t getDriverVersion() const {
return driver_properties.driverVersion;
}
inline uint32_t getCompilerApiVersion() const {
return compiler_api_version;
inline uint32_t getCompilerVersion() const {
return compiler_version;
}
inline uint32_t getMutableCommandListVersion() const {
return mutable_command_list_version;
Expand Down Expand Up @@ -89,7 +89,7 @@ class ZeroInitStructsHolder final {

ze_api_version_t ze_drv_api_version = {};

uint32_t compiler_api_version = 0;
uint32_t compiler_version = 0;
};

} // namespace intel_npu
2 changes: 1 addition & 1 deletion src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ ZeroInitStructsHolder::ZeroInitStructsHolder() : log("NPUZeroInitStructsHolder",
graph_props.stype = ZE_STRUCTURE_TYPE_DEVICE_GRAPH_PROPERTIES;
auto result = graph_dditable_ext_decorator->pfnDeviceGetGraphProperties(device_handle, &graph_props);
THROW_ON_FAIL_FOR_LEVELZERO("pfnDeviceGetGraphProperties", result);
compiler_api_version = ZE_MAKE_VERSION(graph_props.compilerVersion.major, graph_props.compilerVersion.minor);
compiler_version = ZE_MAKE_VERSION(graph_props.compilerVersion.major, graph_props.compilerVersion.minor);
}

ZeroInitStructsHolder::~ZeroInitStructsHolder() {
Expand Down

0 comments on commit a0ca526

Please sign in to comment.