[EISW-89820] [releases/2023/0] Rename VPUX to NPU (#19002)

* Change `VPUX` occurences to `NPU`

* Change library for `NPU` device in `api_conformance_helpers.hpp`

* Rename `MYRIAD plugin`

* Switch `HARDWARE_AWARE_IGNORED_PATTERNS` VPU to NPU

* Rename DEVICE_KEEMBAY to DEVICE_NPU

* Rename VPUX_DEVICE_NAME to NPU_DEVICE_NAME

* Rename vpu_patterns to npu_patterns

* Change VPUX occurences to NPU after review

* Remove VPUX device comment

* Change VPUX/vpu to NPU in tests/time_tests

* Rename VPU to NPU in docs after review

* Rename VPU to NPU in tools/pot after review

* Renamed vpu.json to npu.json in tools/pot after review

* Restore CommonTestUtils::DEVICE_KEEMBAY

---------

Co-authored-by: MirceaDan99 <mircea-aurelian.dan@intel.com>
This commit is contained in:
Stefania Hergane
2023-08-08 23:19:25 +03:00
committed by GitHub
parent cac7e2e1c4
commit a6351294e7
43 changed files with 714 additions and 716 deletions

View File

@@ -215,7 +215,7 @@ IE::Parameter AutoExecutableNetwork::GetMetric(const std::string& name) const {
iie.what());
}
real = (std::max)(requests, optimalBatchSize);
} else if (deviceInfo.deviceName.find("VPUX") != std::string::npos) {
} else if (deviceInfo.deviceName.find("NPU") != std::string::npos) {
real = 8u;
} else {
real = upperBoundStreamsNum ? 2 * upperBoundStreamsNum : defaultNumForTPUT;

View File

@@ -644,10 +644,10 @@ void AutoSchedule::TryToLoadNetWork(AutoLoadContext& context, const std::string&
}
// need to reload network, unregister it's priority
// there maybe potential issue.
// for example they are dGPU, VPUX, iGPU, customer want to LoadNetwork with
// configure 0 dGPU, 1 VPUX, if dGPU load failed,
// the result will be not sure, maybe two network are loaded into VPUX,
// maybe 0 is loaded to VPUX, 1 is loaded to iGPU
// for example they are dGPU, NPU, iGPU, customer want to LoadNetwork with
// configure 0 dGPU, 1 NPU, if dGPU load failed,
// the result will be not sure, maybe two network are loaded into NPU,
// maybe 0 is loaded to NPU, 1 is loaded to iGPU
_autoSContext->_plugin->UnregisterPriority(_autoSContext->_modelPriority, context.deviceInfo.uniqueName);
// remove the current device from deviceList
auto eraseDevice = deviceChecker().checkAndReturnIfDeviceInList(device, deviceList, true);

View File

@@ -533,7 +533,7 @@ std::list<DeviceInformation> MultiDeviceInferencePlugin::GetValidDevice(
std::list<DeviceInformation> dGPU;
std::list<DeviceInformation> iGPU;
std::list<DeviceInformation> MYRIAD;
std::list<DeviceInformation> VPUX;
std::list<DeviceInformation> NPU;
for (auto& item : metaDevices) {
if (item.deviceName.find("CPU") == 0) {
@@ -544,8 +544,8 @@ std::list<DeviceInformation> MultiDeviceInferencePlugin::GetValidDevice(
MYRIAD.push_back(item);
continue;
}
if (item.deviceName.find("VPUX") == 0) {
VPUX.push_back(item);
if (item.deviceName.find("NPU") == 0) {
NPU.push_back(item);
continue;
}
if (item.deviceName.find("GPU") == 0) {
@@ -566,14 +566,14 @@ std::list<DeviceInformation> MultiDeviceInferencePlugin::GetValidDevice(
}
}
// Priority of selecting device: dGPU > VPUX > iGPU > MYRIAD > CPU
// Priority of selecting device: dGPU > NPU > iGPU > MYRIAD > CPU
std::list<DeviceInformation> devices;
if (networkPrecision == "INT8") {
devices.splice(devices.end(), VPUX);
devices.splice(devices.end(), NPU);
devices.splice(devices.end(), dGPU);
} else {
devices.splice(devices.end(), dGPU);
devices.splice(devices.end(), VPUX);
devices.splice(devices.end(), NPU);
}
devices.splice(devices.end(), iGPU);
devices.splice(devices.end(), MYRIAD);

View File

@@ -7,7 +7,7 @@ namespace MultiDevicePlugin {
// AUTO will enable the blocklist if
// 1.No device priority passed to AUTO/MULTI.(eg. core.compile_model(model, "AUTO", configs);)
// 2.No valid device parsed out from device priority (eg. core.compile_model(model, "AUTO:-CPU,-GPU", configs);).
const std::set<std::string> PluginConfig::_deviceBlocklist = {"VPUX", "GNA", "notIntelGPU"};
const std::set<std::string> PluginConfig::_deviceBlocklist = {"NPU", "GNA", "notIntelGPU"};
PluginConfig::PluginConfig() {
set_default();

View File

@@ -43,27 +43,27 @@ public:
ov::SoPtr<IExecutableNetworkInternal> mockExeNetwork;
ov::SoPtr<IExecutableNetworkInternal> mockExeNetworkGPU_0;
ov::SoPtr<IExecutableNetworkInternal> mockExeNetworkGPU_1;
ov::SoPtr<IExecutableNetworkInternal> mockExeNetworkVPUX;
ov::SoPtr<IExecutableNetworkInternal> mockExeNetworkNPU;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternal;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternalGPU_0;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternalGPU_1;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternalVPUX;
std::shared_ptr<NiceMock<MockIInferRequestInternal>> inferReqInternalNPU;
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> mockIExeNet;
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> mockIExeNetGPU_0;
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> mockIExeNetGPU_1;
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> mockIExeNetVPUX;
std::shared_ptr<NiceMock<MockIExecutableNetworkInternal>> mockIExeNetNPU;
std::shared_ptr<mockAsyncInferRequest> mockInferrequest;
std::shared_ptr<mockAsyncInferRequest> mockInferrequestGPU_0;
std::shared_ptr<mockAsyncInferRequest> mockInferrequestGPU_1;
std::shared_ptr<mockAsyncInferRequest> mockInferrequestVPUX;
std::shared_ptr<mockAsyncInferRequest> mockInferrequestNPU;
std::shared_ptr<ImmediateExecutor> mockExecutor;
std::shared_ptr<ImmediateExecutor> mockExecutorGPU_0;
std::shared_ptr<ImmediateExecutor> mockExecutorGPU_1;
std::shared_ptr<ImmediateExecutor> mockExecutorVPUX;
std::shared_ptr<ImmediateExecutor> mockExecutorNPU;
size_t optimalNum;
@@ -110,19 +110,19 @@ public:
inferReqInternal.reset();
inferReqInternalGPU_0.reset();
inferReqInternalGPU_1.reset();
inferReqInternalVPUX.reset();
inferReqInternalNPU.reset();
mockIExeNet.reset();
mockIExeNetGPU_0.reset();
mockIExeNetGPU_1.reset();
mockIExeNetVPUX.reset();
mockIExeNetNPU.reset();
mockIExeNet.reset();
mockIExeNetGPU_0.reset();
mockIExeNetGPU_1.reset();
mockIExeNetVPUX.reset();
mockIExeNetNPU.reset();
mockExecutor.reset();
mockExecutorGPU_0.reset();
mockExecutorGPU_1.reset();
mockExecutorVPUX.reset();
mockExecutorNPU.reset();
}
void SetUp() override {
@@ -136,8 +136,8 @@ public:
mockIExeNetGPU_1 = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>();
mockExeNetworkGPU_1 = {mockIExeNetGPU_1, {}};
mockIExeNetVPUX = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>();
mockExeNetworkVPUX = {mockIExeNetVPUX, {}};
mockIExeNetNPU = std::make_shared<NiceMock<MockIExecutableNetworkInternal>>();
mockExeNetworkNPU = {mockIExeNetNPU, {}};
// prepare mockicore and cnnNetwork for loading
core = std::make_shared<NiceMock<MockICore>>();
@@ -150,7 +150,7 @@ public:
IE_SET_METRIC(SUPPORTED_CONFIG_KEYS, supportConfigs, {});
ON_CALL(*core, GetMetric(_, StrEq(METRIC_KEY(SUPPORTED_CONFIG_KEYS)), _)).WillByDefault(Return(supportConfigs));
ON_CALL(*core, GetConfig(_, StrEq(ov::compilation_num_threads.name()))).WillByDefault(Return(12));
std::vector<std::string> availableDevs = {"CPU", "GPU.0", "GPU.1", "VPUX"};
std::vector<std::string> availableDevs = {"CPU", "GPU.0", "GPU.1", "NPU"};
ON_CALL(*core, GetAvailableDevices()).WillByDefault(Return(availableDevs));
std::vector<std::string> metrics = {METRIC_KEY(SUPPORTED_CONFIG_KEYS)};
@@ -173,7 +173,7 @@ public:
::testing::Matcher<const std::string&>(StrEq(CommonTestUtils::DEVICE_KEEMBAY)),
::testing::Matcher<const Config&>(_))).WillByDefault(InvokeWithoutArgs([this]() {
std::this_thread::sleep_for(std::chrono::milliseconds(200));
return mockExeNetworkVPUX; }));
return mockExeNetworkNPU; }));
ON_CALL(*core, LoadNetwork(::testing::Matcher<const InferenceEngine::CNNNetwork&>(_),
::testing::Matcher<const std::string&>(StrEq(CommonTestUtils::DEVICE_CPU)),
@@ -224,9 +224,9 @@ public:
ON_CALL(*mockIExeNetGPU_1.get(), GetMetric(StrEq(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS))))
.WillByDefault(Return(optimalNum));
inferReqInternalVPUX = std::make_shared<NiceMock<MockIInferRequestInternal>>();
mockExecutorVPUX = std::make_shared<ImmediateExecutor>();
ON_CALL(*mockIExeNetVPUX.get(), GetMetric(StrEq(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS))))
inferReqInternalNPU = std::make_shared<NiceMock<MockIInferRequestInternal>>();
mockExecutorNPU = std::make_shared<ImmediateExecutor>();
ON_CALL(*mockIExeNetNPU.get(), GetMetric(StrEq(METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS))))
.WillByDefault(Return(optimalNum));
}
};
@@ -275,12 +275,12 @@ TEST_P(AutoRuntimeFallback, releaseResource) {
std::this_thread::sleep_for(std::chrono::milliseconds(0));
return mockInferrequestGPU_1; }));
}
} else if (deviceName == "VPUX") {
mockInferrequestVPUX = std::make_shared<mockAsyncInferRequest>(
inferReqInternalVPUX, mockExecutorVPUX, nullptr, ifThrow);
ON_CALL(*mockIExeNetVPUX.get(), CreateInferRequest()).WillByDefault(InvokeWithoutArgs([this]() {
} else if (deviceName == "NPU") {
mockInferrequestNPU = std::make_shared<mockAsyncInferRequest>(
inferReqInternalNPU, mockExecutorNPU, nullptr, ifThrow);
ON_CALL(*mockIExeNetNPU.get(), CreateInferRequest()).WillByDefault(InvokeWithoutArgs([this]() {
std::this_thread::sleep_for(std::chrono::milliseconds(0));
return mockInferrequestVPUX; }));
return mockInferrequestNPU; }));
} else {
return;
}
@@ -321,10 +321,10 @@ const std::vector<ConfigParams> testConfigs = {
ConfigParams{{{"GPU.0", false}, {"CPU", true}}, 2, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"CPU", true}}, 2, true, true, false, false},
// 3 devices
ConfigParams{{{"GPU.0", false}, {"GPU.1", false}, {"VPUX", false}}, 1, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"VPUX", false}}, 2, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"VPUX", false}}, 3, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"VPUX", true}}, 3, true, true, false, false},
ConfigParams{{{"GPU.0", false}, {"GPU.1", false}, {"NPU", false}}, 1, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"NPU", false}}, 2, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"NPU", false}}, 3, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"NPU", true}}, 3, true, true, false, false},
//CPU_HELP does not throw
ConfigParams{{{"GPU.0", false}, {"GPU.1", false}, {"CPU", false}}, 2, true, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"CPU", false}}, 2, true, false, false, false},
@@ -345,10 +345,10 @@ const std::vector<ConfigParams> testConfigs = {
ConfigParams{{{"GPU.0", false}, {"CPU", true}}, 2, false, true, false, false},
ConfigParams{{{"GPU.0", true}, {"CPU", true}}, 2, false, true, false, false},
// 3 devices
ConfigParams{{{"GPU.0", false}, {"GPU.1", false}, {"VPUX", false}}, 1, false, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"VPUX", false}}, 1, false, true, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"VPUX", false}}, 1, false, true, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"VPUX", true}}, 1, false, true, false, false},
ConfigParams{{{"GPU.0", false}, {"GPU.1", false}, {"NPU", false}}, 1, false, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"NPU", false}}, 1, false, true, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"NPU", false}}, 1, false, true, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"NPU", true}}, 1, false, true, false, false},
//CPU_HELP does not throw
ConfigParams{{{"GPU.0", false}, {"GPU.1", false}, {"CPU", false}}, 2, false, false, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"CPU", false}}, 2, false, false, false, false},
@@ -358,8 +358,8 @@ const std::vector<ConfigParams> testConfigs = {
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"CPU", true}}, 2, false, true, false, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", true}, {"CPU", true}}, 2, false, true, false, false},
// loadFail and CreateInferRequestFail
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"VPUX", false}}, 3, true, false, true, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"VPUX", false}}, 3, true, false, false, true},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"NPU", false}}, 3, true, false, true, false},
ConfigParams{{{"GPU.0", true}, {"GPU.1", false}, {"NPU", false}}, 3, true, false, false, true},
};
INSTANTIATE_TEST_SUITE_P(smoke_AutoRuntimeFallback, AutoRuntimeFallback,

View File

@@ -217,7 +217,7 @@ TEST_P(AutoLoadFailedTest, LoadCNNetWork) {
metaDevices.push_back(std::move(devInfo));
// set the return value of SelectDevice
// for example if there are three device, if will return GPU on the first call, and then MYRIAD
// for example if there are three device, if will return GPU on the first call, and then NPU
// at last CPU
ON_CALL(*plugin, SelectDevice(Property(&std::vector<DeviceInformation>::size, Eq(selDevsSize)), _, _))
.WillByDefault(Return(metaDevices[deviceConfigs.size() - selDevsSize]));
@@ -272,12 +272,12 @@ TEST_P(AutoLoadFailedTest, LoadCNNetWork) {
// { true, false, GENERAL, 3 device, 2, 3, 2}
//
// there are three devices for loading
// CPU load for accelerator success, but GPU will load faild and then select MYRIAD and load again
// CPU load for accelerator success, but GPU will load faild and then select NPU and load again
// LoadExeNetworkImpl will not throw exception and can continue to run,
// it will select twice, first select GPU, second select MYRIAD
// it will load network three times(CPU, GPU, MYRIAD)
// it will select twice, first select GPU, second select NPU
// it will load network three times(CPU, GPU, NPU)
// the inference request num is loadSuccessCount * optimalNum, in this test case optimalNum is 2
// so inference request num is 4 (CPU 2, MYRIAD 2)
// so inference request num is 4 (CPU 2, NPU 2)
//
const std::vector<ConfigParams> testConfigs = {ConfigParams {true, false, GENERAL, {DeviceParams {CommonTestUtils::DEVICE_GPU, true},
DeviceParams {CommonTestUtils::DEVICE_KEEMBAY, true},

View File

@@ -254,12 +254,12 @@ TEST_P(ExecNetworkGetMetricOptimalNumInferReq, OPTIMAL_NUMBER_OF_INFER_REQUESTS)
InferenceEngine::PluginConfigParams::THROUGHPUT}}, actualCustomerNum, ""});
// enable autoBatch
IE_SET_METRIC(OPTIMAL_BATCH_SIZE, gpuOptimalBatchNum, 8);
IE_SET_METRIC(OPTIMAL_BATCH_SIZE, keembayOptimalBatchNum, 1);
IE_SET_METRIC(OPTIMAL_BATCH_SIZE, npuOptimalBatchNum, 1);
IE_SET_METRIC(RANGE_FOR_STREAMS, rangeOfStreams, std::make_tuple<unsigned int, unsigned int>(1, 3));
ON_CALL(*core.get(), GetMetric(StrEq(CommonTestUtils::DEVICE_GPU), StrEq(METRIC_KEY(OPTIMAL_BATCH_SIZE)), _))
.WillByDefault(RETURN_MOCK_VALUE(gpuOptimalBatchNum));
ON_CALL(*core.get(), GetMetric(StrEq(CommonTestUtils::DEVICE_KEEMBAY), StrEq(METRIC_KEY(OPTIMAL_BATCH_SIZE)), _))
.WillByDefault(RETURN_MOCK_VALUE(keembayOptimalBatchNum));
.WillByDefault(RETURN_MOCK_VALUE(npuOptimalBatchNum));
ON_CALL(*core.get(), GetMetric(_, StrEq(METRIC_KEY(RANGE_FOR_STREAMS)), _))
.WillByDefault(RETURN_MOCK_VALUE(rangeOfStreams));
ON_CALL(*core.get(), GetConfig(_, StrEq(CONFIG_KEY(PERFORMANCE_HINT))))

View File

@@ -32,8 +32,8 @@ using ::testing::_;
using Config = std::map<std::string, std::string>;
using namespace MockMultiDevice;
const std::vector<std::string> availableDevs = {"CPU", "GPU", "VPUX"};
const std::vector<std::string> availableDevsWithId = {"CPU", "GPU.0", "GPU.1", "VPUX"};
const std::vector<std::string> availableDevs = {"CPU", "GPU", "NPU"};
const std::vector<std::string> availableDevsWithId = {"CPU", "GPU.0", "GPU.1", "NPU"};
using Params = std::tuple<std::string, std::string>;
using ConfigParams = std::tuple<
std::vector<std::string>, // Available devices retrieved from Core
@@ -141,8 +141,8 @@ const std::vector<Params> testConfigsWithId = {Params{" ", " "},
Params{"CPU,,GPU", "CPU,GPU.0,GPU.1"},
Params{"CPU, ,GPU", "CPU, ,GPU.0,GPU.1"},
Params{"CPU,GPU,GPU.1", "CPU,GPU.0,GPU.1"},
Params{"CPU,GPU,VPUX,INVALID_DEVICE", "CPU,GPU.0,GPU.1,VPUX,INVALID_DEVICE"},
Params{"VPUX,GPU,CPU,-GPU.0", "VPUX,GPU.1,CPU"},
Params{"CPU,GPU,NPU,INVALID_DEVICE", "CPU,GPU.0,GPU.1,NPU,INVALID_DEVICE"},
Params{"NPU,GPU,CPU,-GPU.0", "NPU,GPU.1,CPU"},
Params{"-GPU.0,GPU,CPU", "GPU.1,CPU"},
Params{"-GPU.0,GPU", "GPU.1"},
Params{"-GPU,GPU.0", "GPU.0"},
@@ -176,10 +176,10 @@ const std::vector<Params> testConfigs = {Params{" ", " "},
Params{"CPU,GPU,GPU.0", "CPU,GPU"},
Params{"CPU,GPU,GPU.1", "CPU,GPU,GPU.1"},
Params{"CPU,GPU.1,GPU", "CPU,GPU.1,GPU"},
Params{"CPU,VPUX", "CPU,VPUX"},
Params{"CPU,-VPUX", "CPU"},
Params{"CPU,NPU", "CPU,NPU"},
Params{"CPU,-NPU", "CPU"},
Params{"CPU,-INVALID_DEVICE", "CPU"},
Params{"CPU,GPU,VPUX", "CPU,GPU,VPUX"}};
Params{"CPU,GPU,NPU", "CPU,GPU,NPU"}};
const std::vector<Params> testConfigsWithIdNotInteldGPU = {Params{" ", " "},
Params{"", "CPU,GPU.0"},
@@ -189,8 +189,8 @@ const std::vector<Params> testConfigsWithIdNotInteldGPU = {Params{" ", " "},
Params{"CPU,,GPU", "CPU,GPU.0,GPU.1"},
Params{"CPU, ,GPU", "CPU, ,GPU.0,GPU.1"},
Params{"CPU,GPU,GPU.1", "CPU,GPU.0,GPU.1"},
Params{"CPU,GPU,VPUX,INVALID_DEVICE", "CPU,GPU.0,GPU.1,VPUX,INVALID_DEVICE"},
Params{"VPUX,GPU,CPU,-GPU.0", "VPUX,GPU.1,CPU"},
Params{"CPU,GPU,NPU,INVALID_DEVICE", "CPU,GPU.0,GPU.1,NPU,INVALID_DEVICE"},
Params{"NPU,GPU,CPU,-GPU.0", "NPU,GPU.1,CPU"},
Params{"-GPU.0,GPU,CPU", "GPU.1,CPU"},
Params{"-GPU.0,GPU", "GPU.1"},
Params{"-GPU,GPU.0", "GPU.0"},

View File

@@ -86,7 +86,7 @@ public:
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, cpuCability, {"FP32", "FP16", "INT8", "BIN"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, gpuCability, {"FP32", "FP16", "BATCHED_BLOB", "BIN"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, myriadCability, {"FP16"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, vpuxCability, {"INT8"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, npuCability, {"INT8"});
ON_CALL(*core, GetMetric(StrEq(CommonTestUtils::DEVICE_CPU),
StrEq(METRIC_KEY(OPTIMIZATION_CAPABILITIES)), _)).WillByDefault(RETURN_MOCK_VALUE(cpuCability));
ON_CALL(*core, GetMetric(HasSubstr("GPU"),
@@ -94,7 +94,7 @@ public:
ON_CALL(*core, GetMetric(StrEq("MYRIAD"),
StrEq(METRIC_KEY(OPTIMIZATION_CAPABILITIES)), _)).WillByDefault(RETURN_MOCK_VALUE(myriadCability));
ON_CALL(*core, GetMetric(StrEq(CommonTestUtils::DEVICE_KEEMBAY),
StrEq(METRIC_KEY(OPTIMIZATION_CAPABILITIES)), _)).WillByDefault(RETURN_MOCK_VALUE(vpuxCability));
StrEq(METRIC_KEY(OPTIMIZATION_CAPABILITIES)), _)).WillByDefault(RETURN_MOCK_VALUE(npuCability));
ON_CALL(*core, GetMetric(HasSubstr("GPU"),
StrEq(METRIC_KEY(DEVICE_ARCHITECTURE)), _)).WillByDefault(Return("GPU: vendor=0x8086 arch=0"));
ON_CALL(*core, GetMetric(StrEq("GPU"),
@@ -127,13 +127,13 @@ TEST_P(KeyNetworkPriorityTest, SelectDevice) {
{"GPU.0", {}, 2, "01", "iGPU_01", 1},
{"GPU.1", {}, 2, "01", "dGPU_01", 2},
{"MYRIAD", {}, 2, "01", "MYRIAD_01", 3},
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "VPUX_01", 4}};
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "NPU_01", 4}};
} else {
metaDevices = {{CommonTestUtils::DEVICE_CPU, {}, 2, "", "CPU_01", 0},
{"GPU.0", {}, 2, "01", "iGPU_01", 0},
{"GPU.1", {}, 2, "01", "dGPU_01", 0},
{"MYRIAD", {}, 2, "01", "MYRIAD_01", 0},
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "VPUX_01", 0}};
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "NPU_01", 0}};
}
EXPECT_CALL(*plugin, SelectDevice(_, _, _)).Times(sizeOfConfigs);
@@ -156,13 +156,13 @@ TEST_P(KeyNetworkPriorityTest, MultiThreadsSelectDevice) {
{"GPU.0", {}, 2, "01", "iGPU_01", 1},
{"GPU.1", {}, 2, "01", "dGPU_01", 2},
{"MYRIAD", {}, 2, "01", "MYRIAD_01", 3},
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "VPUX_01", 4}};
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "NPU_01", 4}};
} else {
metaDevices = {{CommonTestUtils::DEVICE_CPU, {}, 2, "", "CPU_01", 0},
{"GPU.0", {}, 2, "01", "iGPU_01", 0},
{"GPU.1", {}, 2, "01", "dGPU_01", 0},
{"MYRIAD", {}, 2, "01", "MYRIAD_01", 0},
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "VPUX_01", 0}};
{CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "NPU_01", 0}};
}
EXPECT_CALL(*plugin, SelectDevice(_, _, _)).Times(sizeOfConfigs * 2);
@@ -225,27 +225,27 @@ const std::vector<ConfigParams> testConfigs = {
PriorityParams {1, "iGPU_01"},
PriorityParams {2, "CPU_01"},
PriorityParams {3, "MYRIAD_01"}}},
ConfigParams {"INT8", false, {PriorityParams {0, "VPUX_01"},
ConfigParams {"INT8", false, {PriorityParams {0, "NPU_01"},
PriorityParams {1, "CPU_01"},
PriorityParams {2, "CPU_01"},
PriorityParams {2, "CPU_01"}}},
ConfigParams {"INT8", false, {PriorityParams {2, "VPUX_01"},
ConfigParams {"INT8", false, {PriorityParams {2, "NPU_01"},
PriorityParams {3, "CPU_01"},
PriorityParams {4, "CPU_01"},
PriorityParams {5, "CPU_01"}}},
ConfigParams {"INT8", false, {PriorityParams {2, "VPUX_01"},
PriorityParams {0, "VPUX_01"},
ConfigParams {"INT8", false, {PriorityParams {2, "NPU_01"},
PriorityParams {0, "NPU_01"},
PriorityParams {2, "CPU_01"},
PriorityParams {2, "CPU_01"}}},
ConfigParams {"INT8", false, {PriorityParams {2, "VPUX_01"},
PriorityParams {0, "VPUX_01"},
ConfigParams {"INT8", false, {PriorityParams {2, "NPU_01"},
PriorityParams {0, "NPU_01"},
PriorityParams {2, "CPU_01"},
PriorityParams {3, "CPU_01"}}},
ConfigParams {"INT8", false, {PriorityParams {0, "VPUX_01"},
ConfigParams {"INT8", false, {PriorityParams {0, "NPU_01"},
PriorityParams {1, "CPU_01"},
PriorityParams {2, "CPU_01"},
PriorityParams {3, "CPU_01"},
PriorityParams {0, "VPUX_01"},
PriorityParams {0, "NPU_01"},
PriorityParams {1, "CPU_01"},
PriorityParams {2, "CPU_01"},
PriorityParams {3, "CPU_01"}}},
@@ -277,8 +277,8 @@ const std::vector<ConfigParams> testConfigs = {
// {CommonTestUtils::DEVICE_GPU, {}, 2, "01", "iGPU_01", 1},
// {CommonTestUtils::DEVICE_GPU, {}, 2, "01", "dGPU_01", 2},
// {"MYRIAD", {}, 2, "01", "MYRIAD_01", 3},
// {CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "VPUX_01", 4}};
// cpu > igpu > dgpu > MYRIAD > VPUX
// {CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "NPU_01", 4}};
// cpu > igpu > dgpu > MYRIAD > NPU
ConfigParams {"FP32", true, {PriorityParams {0, "CPU_01"},
PriorityParams {1, "iGPU_01"},
PriorityParams {2, "dGPU_01"},
@@ -304,29 +304,29 @@ const std::vector<ConfigParams> testConfigs = {
PriorityParams {2, "dGPU_01"},
PriorityParams {3, "MYRIAD_01"}}},
ConfigParams {"INT8", true, {PriorityParams {0, "CPU_01"},
PriorityParams {1, "VPUX_01"},
PriorityParams {2, "VPUX_01"},
PriorityParams {2, "VPUX_01"}}},
PriorityParams {1, "NPU_01"},
PriorityParams {2, "NPU_01"},
PriorityParams {2, "NPU_01"}}},
ConfigParams {"INT8", true, {PriorityParams {2, "CPU_01"},
PriorityParams {3, "VPUX_01"},
PriorityParams {4, "VPUX_01"},
PriorityParams {5, "VPUX_01"}}},
PriorityParams {3, "NPU_01"},
PriorityParams {4, "NPU_01"},
PriorityParams {5, "NPU_01"}}},
ConfigParams {"INT8", true, {PriorityParams {2, "CPU_01"},
PriorityParams {0, "CPU_01"},
PriorityParams {2, "VPUX_01"},
PriorityParams {2, "VPUX_01"}}},
PriorityParams {2, "NPU_01"},
PriorityParams {2, "NPU_01"}}},
ConfigParams {"INT8", true, {PriorityParams {2, "CPU_01"},
PriorityParams {0, "CPU_01"},
PriorityParams {2, "VPUX_01"},
PriorityParams {3, "VPUX_01"}}},
PriorityParams {2, "NPU_01"},
PriorityParams {3, "NPU_01"}}},
ConfigParams {"INT8", true, {PriorityParams {0, "CPU_01"},
PriorityParams {1, "VPUX_01"},
PriorityParams {2, "VPUX_01"},
PriorityParams {3, "VPUX_01"},
PriorityParams {1, "NPU_01"},
PriorityParams {2, "NPU_01"},
PriorityParams {3, "NPU_01"},
PriorityParams {0, "CPU_01"},
PriorityParams {1, "VPUX_01"},
PriorityParams {2, "VPUX_01"},
PriorityParams {3, "VPUX_01"}}},
PriorityParams {1, "NPU_01"},
PriorityParams {2, "NPU_01"},
PriorityParams {3, "NPU_01"}}},
ConfigParams {"BIN", true, {PriorityParams {0, "CPU_01"},
PriorityParams {1, "iGPU_01"},
PriorityParams {2, "dGPU_01"},

View File

@@ -39,10 +39,8 @@ using namespace MockMultiDevice;
// const char cpuFullDeviceName[] = "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz";
const char igpuFullDeviceName[] = "Intel(R) Gen9 HD Graphics (iGPU)";
const char dgpuFullDeviceName[] = "Intel(R) Iris(R) Xe MAX Graphics (dGPU)";
// const char myriadFullDeviceName[] = "Intel Movidius Myriad X VPU";
// const char vpuxFullDeviceName[] = "";
const std::vector<std::string> availableDevs = {"CPU", "GPU.0", "GPU.1", "VPUX"};
const std::vector<std::string> availableDevsNoID = {"CPU", "GPU", "VPUX"};
const std::vector<std::string> availableDevs = {"CPU", "GPU.0", "GPU.1", "NPU"};
const std::vector<std::string> availableDevsNoID = {"CPU", "GPU", "NPU"};
using ConfigParams = std::tuple<
std::string, // Priority devices
std::vector<DeviceInformation>, // expect metaDevices
@@ -201,62 +199,62 @@ TEST_P(ParseMetaDeviceNoIDTest, ParseMetaDevices) {
// ConfigParams {devicePriority, expect metaDevices, ifThrowException}
const std::vector<ConfigParams> testConfigs = {
// ConfigParams {"CPU,GPU,MYRIAD,VPUX",
// ConfigParams {"CPU,GPU,MYRIAD,NPU",
// {{"CPU", {}, -1, "", "CPU_", 0},
// {"GPU.0", {}, -1, "0", std::string(igpuFullDeviceName) + "_0", 1},
// {"GPU.1", {}, -1, "1", std::string(dgpuFullDeviceName) + "_1", 1},
// {"MYRIAD.9.2-ma2480", {}, -1, "9.2-ma2480", "MYRIAD_9.2-ma2480", 2},
// {"MYRIAD.9.1-ma2480", {}, -1, "9.1-ma2480", "MYRIAD_9.1-ma2480", 2},
// {"VPUX", {}, -1, "", "VPUX_", 3}}, false},
// ConfigParams {"VPUX,MYRIAD,GPU,CPU",
// {{"VPUX", {}, -1, "", "VPUX_", 0},
// {"NPU", {}, -1, "", "NPU_", 3}}, false},
// ConfigParams {"NPU,MYRIAD,GPU,CPU",
// {{"NPU", {}, -1, "", "NPU_", 0},
// {"MYRIAD.9.2-ma2480", {}, -1, "9.2-ma2480", "MYRIAD_9.2-ma2480", 1},
// {"MYRIAD.9.1-ma2480", {}, -1, "9.1-ma2480", "MYRIAD_9.1-ma2480", 1},
// {"GPU.0", {}, -1, "0", std::string(igpuFullDeviceName) + "_0", 2},
// {"GPU.1", {}, -1, "1", std::string(dgpuFullDeviceName) + "_1", 2},
// {"CPU", {}, -1, "", "CPU_", 3}}, false},
// ConfigParams {"CPU(1),GPU(2),MYRIAD(3),VPUX(4)",
// ConfigParams {"CPU(1),GPU(2),MYRIAD(3),NPU(4)",
// {{"CPU", {}, 1, "", "CPU_", 0},
// {"GPU.0", {}, 2, "0", std::string(igpuFullDeviceName) + "_0", 1},
// {"GPU.1", {}, 2, "1", std::string(dgpuFullDeviceName) + "_1", 1},
// {"MYRIAD.9.2-ma2480", {}, 3, "9.2-ma2480", "MYRIAD_9.2-ma2480", 2},
// {"MYRIAD.9.1-ma2480", {}, 3, "9.1-ma2480", "MYRIAD_9.1-ma2480", 2},
// {"VPUX", {}, 4, "", "VPUX_", 3}}, false},
// {"NPU", {}, 4, "", "NPU_", 3}}, false},
//
ConfigParams {"CPU,GPU,VPUX",
ConfigParams {"CPU,GPU,NPU",
{{"CPU", {}, -1, "", "CPU_", 0},
{"GPU.0", {}, -1, "", std::string(igpuFullDeviceName) + "_0", 1},
{"GPU.1", {}, -1, "", std::string(dgpuFullDeviceName) + "_1", 1},
{"VPUX", {}, -1, "", "VPUX_", 2}}, false},
ConfigParams {"VPUX,GPU,CPU",
{{"VPUX", {}, -1, "", "VPUX_", 0},
{"NPU", {}, -1, "", "NPU_", 2}}, false},
ConfigParams {"NPU,GPU,CPU",
{{"NPU", {}, -1, "", "NPU_", 0},
{"GPU.0", {}, -1, "", std::string(igpuFullDeviceName) + "_0", 1},
{"GPU.1", {}, -1, "", std::string(dgpuFullDeviceName) + "_1", 1},
{"CPU", {}, -1, "", "CPU_", 2}}, false},
ConfigParams {"CPU(1),GPU(2),VPUX(4)",
ConfigParams {"CPU(1),GPU(2),NPU(4)",
{{"CPU", {}, 1, "", "CPU_", 0},
{"GPU.0", {}, 2, "", std::string(igpuFullDeviceName) + "_0", 1},
{"GPU.1", {}, 2, "", std::string(dgpuFullDeviceName) + "_1", 1},
{"VPUX", {}, 4, "", "VPUX_", 2}}, false},
{"NPU", {}, 4, "", "NPU_", 2}}, false},
ConfigParams {"CPU(-1),GPU,VPUX", {}, true},
ConfigParams {"CPU(NA),GPU,VPUX", {}, true},
ConfigParams {"CPU(-1),GPU,NPU", {}, true},
ConfigParams {"CPU(NA),GPU,NPU", {}, true},
ConfigParams {"CPU(3),GPU.1,VPUX",
ConfigParams {"CPU(3),GPU.1,NPU",
{{"CPU", {}, 3, "", "CPU_", 0},
{"GPU.1", {}, -1, "", std::string(dgpuFullDeviceName) + "_1", 1},
{"VPUX", {}, -1, "", "VPUX_", 2}}, false},
ConfigParams {"VPUX,GPU.1,CPU(3)",
{{"VPUX", {}, -1, "", "VPUX_", 0},
{"NPU", {}, -1, "", "NPU_", 2}}, false},
ConfigParams {"NPU,GPU.1,CPU(3)",
{{"NPU", {}, -1, "", "NPU_", 0},
{"GPU.1", {}, -1, "", std::string(dgpuFullDeviceName) + "_1", 1},
{"CPU", {}, 3, "", "CPU_", 2}}, false}
};
const std::vector<ConfigParams> testConfigsNoID = {
ConfigParams {"CPU,GPU,VPUX",
ConfigParams {"CPU,GPU,NPU",
{{"CPU", {}, -1, "", "CPU_", 0},
{"GPU", {}, -1, "0", std::string(igpuFullDeviceName) + "_0", 1},
{"VPUX", {}, -1, "", "VPUX_", 2}}, false},
{"NPU", {}, -1, "", "NPU_", 2}}, false},
};

View File

@@ -47,10 +47,10 @@ const DeviceInformation CPU_INFO = {CommonTestUtils::DEVICE_CPU, {}, 2, "01", "C
const DeviceInformation IGPU_INFO = {"GPU.0", {}, 2, "01", "iGPU_01"};
const DeviceInformation DGPU_INFO = {"GPU.1", {}, 2, "01", "dGPU_01"};
const DeviceInformation MYRIAD_INFO = {"MYRIAD", {}, 2, "01", "MYRIAD_01" };
const DeviceInformation KEEMBAY_INFO = {CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "VPUX_01" };
const DeviceInformation NPU_INFO = {CommonTestUtils::DEVICE_KEEMBAY, {}, 2, "01", "NPU_01" };
const std::vector<DeviceInformation> fp32DeviceVector = {DGPU_INFO, IGPU_INFO, CPU_INFO, MYRIAD_INFO};
const std::vector<DeviceInformation> fp16DeviceVector = {DGPU_INFO, IGPU_INFO, MYRIAD_INFO, CPU_INFO};
const std::vector<DeviceInformation> int8DeviceVector = {KEEMBAY_INFO, DGPU_INFO, IGPU_INFO, CPU_INFO};
const std::vector<DeviceInformation> int8DeviceVector = {NPU_INFO, DGPU_INFO, IGPU_INFO, CPU_INFO};
const std::vector<DeviceInformation> binDeviceVector = {DGPU_INFO, IGPU_INFO, CPU_INFO};
const std::vector<DeviceInformation> batchedblobDeviceVector = {DGPU_INFO, IGPU_INFO};
std::map<std::string, const std::vector<DeviceInformation>> devicesMap = {{"FP32", fp32DeviceVector},
@@ -59,8 +59,8 @@ std::map<std::string, const std::vector<DeviceInformation>> devicesMap = {{"FP32
{"BIN", binDeviceVector},
{"BATCHED_BLOB", batchedblobDeviceVector}
};
const std::vector<DeviceInformation> totalDevices = {DGPU_INFO, IGPU_INFO, MYRIAD_INFO, CPU_INFO, KEEMBAY_INFO};
const std::vector<DeviceInformation> reverseTotalDevices = {KEEMBAY_INFO, CPU_INFO, MYRIAD_INFO, IGPU_INFO, DGPU_INFO};
const std::vector<DeviceInformation> totalDevices = {DGPU_INFO, IGPU_INFO, MYRIAD_INFO, CPU_INFO, NPU_INFO};
const std::vector<DeviceInformation> reverseTotalDevices = {NPU_INFO, CPU_INFO, MYRIAD_INFO, IGPU_INFO, DGPU_INFO};
const std::vector<std::string> netPrecisions = {"FP32", "FP16", "INT8", "BIN", "BATCHED_BLOB"};
std::vector<ConfigParams> testConfigs;
@@ -238,7 +238,7 @@ public:
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, cpuCability, {"FP32", "FP16", "INT8", "BIN"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, gpuCability, {"FP32", "FP16", "BATCHED_BLOB", "BIN", "INT8"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, myriadCability, {"FP16"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, vpuxCability, {"INT8"});
IE_SET_METRIC(OPTIMIZATION_CAPABILITIES, npuCability, {"INT8"});
IE_SET_METRIC(DEVICE_ARCHITECTURE, gpuArchitecture, "GPU: vendor=0x8086 arch=0");
IE_SET_METRIC(DEVICE_TYPE, dGpuType, Metrics::DeviceType::discrete);
IE_SET_METRIC(DEVICE_TYPE, iGpuType, Metrics::DeviceType::integrated);
@@ -250,7 +250,7 @@ public:
ON_CALL(*core, GetMetric(StrEq("MYRIAD"),
StrEq(METRIC_KEY(OPTIMIZATION_CAPABILITIES)), _)).WillByDefault(RETURN_MOCK_VALUE(myriadCability));
ON_CALL(*core, GetMetric(StrEq(CommonTestUtils::DEVICE_KEEMBAY),
StrEq(METRIC_KEY(OPTIMIZATION_CAPABILITIES)), _)).WillByDefault(RETURN_MOCK_VALUE(vpuxCability));
StrEq(METRIC_KEY(OPTIMIZATION_CAPABILITIES)), _)).WillByDefault(RETURN_MOCK_VALUE(npuCability));
ON_CALL(*core, GetMetric(HasSubstr("GPU"),
StrEq(METRIC_KEY(DEVICE_ARCHITECTURE)), _)).WillByDefault(RETURN_MOCK_VALUE(gpuArchitecture));
ON_CALL(*core, GetMetric(StrEq("GPU"),