Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7de1d64
Add VCLApi and VCLCompilerImpl
XinWangIntel May 26, 2025
3aad6d8
Use vclAllocateExecutionCreate3 to get metadata
XinWangIntel Jul 20, 2025
cc62686
update vcl version check, default compilertype and vcl download link
DanLiu2Intel Sep 28, 2025
8b11ee8
fix export issue and build
DanLiu2Intel Nov 6, 2025
a08feb7
clang-format, add platform update and compiler check
DanLiu2Intel Nov 12, 2025
cbb8de0
remove ENABLE_VCL_FOR_COMPILER and update tile, default compilertype
DanLiu2Intel Nov 13, 2025
047aab1
set device desc empty and auto parse in compile
DanLiu2Intel Nov 13, 2025
baedc2b
update vcl compiler to openvino_intel_npu_compiler
DanLiu2Intel Nov 17, 2025
0338cfe
Merge branch 'master' into serialize-on-plugin-adapter
DanLiu2Intel Nov 17, 2025
8f3f570
fix ie mdk issue for compilerType Inconsistency issues for 3720
DanLiu2Intel Nov 17, 2025
4f1aa39
fix clang-format
DanLiu2Intel Nov 17, 2025
1a60dfa
fix unit test
DanLiu2Intel Nov 17, 2025
21ea396
fix SERIALIZATION_WEIGHTS_SIZE_THRESHOLD undeclared identifiers
DanLiu2Intel Nov 18, 2025
da62ff8
revert namespace for SERIALIZATION_WEIGHTS_SIZE_THRESHOLD
DanLiu2Intel Nov 18, 2025
3bb783d
Merge branch 'master' into serialize-on-plugin-adapter
DanLiu2Intel Nov 18, 2025
800c78e
remove USE_BASE_MODEL_SERIALIZER option
DanLiu2Intel Nov 18, 2025
acafdc6
fix 3720 platfrom compilerType issue and metadata name issue
DanLiu2Intel Nov 18, 2025
b0c6d8a
Merge branch 'master' into serialize-on-plugin-adapter
DanLiu2Intel Nov 19, 2025
5ab6d0d
Merge branch 'master' into serialize-on-plugin-adapter
DanLiu2Intel Nov 21, 2025
0c9ae28
update to use vcl serializer
DanLiu2Intel Nov 21, 2025
b363ff6
Add compileWsOneShot and compileWsIterative for VCLCompilerImpl
WenjingKangIntel Nov 21, 2025
16d591c
clang-format
DanLiu2Intel Nov 21, 2025
5ba9f39
fix comments
DanLiu2Intel Nov 24, 2025
24e2935
Add OPENVINO_ASSERT for one shot weightless compilation to check init…
WenjingKangIntel Nov 24, 2025
a54dae0
fix comments2
DanLiu2Intel Nov 24, 2025
6ea5978
add log for serialize IR
DanLiu2Intel Nov 24, 2025
6d58c92
update compilerType to mlir
DanLiu2Intel Nov 24, 2025
e3d838c
update serializeIR(model, compilerVersion, maxOpsetVersion, true) for…
DanLiu2Intel Nov 25, 2025
70a92a9
fix comments2
DanLiu2Intel Nov 24, 2025
09ae40a
remove ov cache part
DanLiu2Intel Nov 26, 2025
50e8400
fix IEMDK issue
DanLiu2Intel Nov 26, 2025
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 @@ -842,7 +842,7 @@ struct COMPILER_TYPE final : OptionBase<COMPILER_TYPE, ov::intel_npu::CompilerTy
}

static ov::intel_npu::CompilerType defaultValue() {
return ov::intel_npu::CompilerType::DRIVER;
return ov::intel_npu::CompilerType::PLUGIN;
}

static ov::intel_npu::CompilerType parse(std::string_view val) {
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/intel_npu/src/common/src/device_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@ std::string utils::getCompilationPlatform(const std::string_view platform,
std::vector<std::string> availableDevicesNames) {
// Platform parameter has a higher priority than deviceID
if (platform != ov::intel_npu::Platform::AUTO_DETECT) {
std::cout << " return 1 platform from getCompilationPlatform " << std::endl;
return std::string(platform);
}

// Get compilation platform from deviceID
if (!deviceId.empty()) {
std::cout << " return 2 deviceId from getCompilationPlatform " << std::endl;
return utils::getPlatformByDeviceName(deviceId);
}

// Automatic detection of compilation platform
if (availableDevicesNames.empty()) {
OPENVINO_THROW("No NPU devices were found.");
}

std::cout << " return 3 availableDevicesNames from getCompilationPlatform, availableDevicesNames.at(0) is " << availableDevicesNames.at(0) << std::endl;
return utils::getPlatformByDeviceName(availableDevicesNames.at(0));
}

Expand Down
342 changes: 342 additions & 0 deletions src/plugins/intel_npu/src/compiler_adapter/include/compiler.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#pragma once

#include <memory>
#include <mutex>

#include "compiler.h"
#include "intel_npu/common/filtered_config.hpp"
#include "intel_npu/icompiler.hpp"
#include "openvino/core/except.hpp"

namespace intel_npu {

bool isUseBaseModelSerializer(const FilteredConfig& config);
std::string supportVclCompiler(int major, int minor);
class VCLApi;

class VCLCompilerImpl final : public intel_npu::ICompiler {
public:
VCLCompilerImpl();
~VCLCompilerImpl() override;

static std::shared_ptr<VCLCompilerImpl> getInstance() {
static std::mutex mutex;
static std::weak_ptr<VCLCompilerImpl> weak_compiler;

std::lock_guard<std::mutex> lock(mutex);
auto compiler = weak_compiler.lock();
if (!compiler) {
compiler = std::make_shared<VCLCompilerImpl>();
weak_compiler = compiler;
}
return compiler;
}

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

std::vector<std::shared_ptr<NetworkDescription>> compileWsOneShot(const std::shared_ptr<ov::Model>& model,
const Config& config) const override;

NetworkDescription compileWsIterative(const std::shared_ptr<ov::Model>& model,
const Config& config,
size_t callNumber) const override;

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

NetworkMetadata parse(const std::vector<uint8_t>& network, const Config& config) const override;

uint32_t get_version() const override;

std::vector<ov::ProfilingInfo> process_profiling_output(const std::vector<uint8_t>& profData,
const std::vector<uint8_t>& network,
const intel_npu::Config& config) const final override;

bool get_supported_options(std::vector<char>& options) const;

bool is_option_supported(const std::string& option) const;

std::shared_ptr<VCLApi> getLinkedLibrary() const;

private:
vcl_log_handle_t _logHandle = nullptr;
vcl_compiler_handle_t _compilerHandle = nullptr;
vcl_compiler_properties_t _compilerProperties;
vcl_version_info_t _vclVersion;
vcl_version_info_t _vclProfilingVersion;
Logger _logger;
};

} // namespace intel_npu
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#pragma once

#include "openvino/core/model.hpp"

namespace intel_npu {
/**
* @brief Stores the information within the "WeightlessCacheAttribute" as runtime fields that persist upon
* serialization.
* @details Constant nodes (weights) may contain as medatadata the "WeightlessCacheAttribute", that is information
* regarding the offset of the weights within the binary file, as well as the original size and precision. This
* information is required within the "weights separation" flow, therefore this function is here to store it.
* @note Not calling this function in the weights separation flow would lead to this information being lost upon
* serialization. The "WeightlessCacheAttribute" information that is populated upon de-serialization would represent
* metadata corresponding to the serialized stream, not the original weights file. Therefore the compiler would be
* misinformed and lookups of weights offsets could fail.
*
* @param model Both source and target.
*/
void storeWeightlessCacheAttribute(const std::shared_ptr<ov::Model>& model);
} // namespace intel_npu
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ class ZeGraphExtWrappers {
Logger _logger;
};

// Parse the result string of query from format <name_0><name_1><name_2> to unordered_set of string
std::unordered_set<std::string> parseQueryResult(std::vector<char>& data);

} // namespace intel_npu
Loading
Loading