Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added MockNPU/CPU, FakeNPU/CPU and functional tests #25236

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

AsyaPronina
Copy link
Contributor

@AsyaPronina AsyaPronina commented Jun 26, 2024

Details:

  • This PR adds mock plugins to test NPUW against
  • This PR adds 9 functional behavior tests for NPUW

Tickets:

  • ticket-id

@AsyaPronina AsyaPronina requested review from a team as code owners June 26, 2024 15:10
@github-actions github-actions bot added category: build OpenVINO cmake script / infra category: NPU OpenVINO NPU plugin labels Jun 26, 2024
}
T med() const {
std::vector<T> cpy(records);
std::nth_element(cpy.begin(), cpy.begin() + cpy.size()/2, cpy.end());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting why do we need intermediate vector? just use c.begin() c.end() in nth_element call

Copy link
Contributor Author

@AsyaPronina AsyaPronina Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed that file!

@AsyaPronina AsyaPronina force-pushed the npuw_tests branch 2 times, most recently from dc2c45b to c07488a Compare July 15, 2024 10:25
};


} // anonymous namespace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing line at the end of file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was also removed! Will be pushed in next PR!

@AsyaPronina AsyaPronina changed the title Added MockNPU/CPU, FakeNPU/CPU, functional tests and unit tests Added MockNPU/CPU, FakeNPU/CPu and functional tests Jul 15, 2024
@AsyaPronina AsyaPronina force-pushed the npuw_tests branch 2 times, most recently from 934ed93 to fa552db Compare July 15, 2024 17:13
@AsyaPronina AsyaPronina changed the title Added MockNPU/CPU, FakeNPU/CPu and functional tests Added MockNPU/CPU, FakeNPU/CPU and functional tests Jul 15, 2024
@AsyaPronina AsyaPronina force-pushed the npuw_tests branch 9 times, most recently from 3da60b5 to 0ab903f Compare July 22, 2024 16:56
@AsyaPronina AsyaPronina force-pushed the npuw_tests branch 2 times, most recently from 55b25f1 to 2e34b83 Compare July 25, 2024 11:57
@AsyaPronina AsyaPronina requested review from a team as code owners July 25, 2024 11:57
@github-actions github-actions bot added the category: CPU OpenVINO CPU plugin label Jul 25, 2024
@dmatveev dmatveev self-assigned this Jul 26, 2024
@AsyaPronina AsyaPronina force-pushed the npuw_tests branch 2 times, most recently from 9688cb7 to 7c196a2 Compare July 30, 2024 18:11
@github-actions github-actions bot removed the category: CPU OpenVINO CPU plugin label Jul 30, 2024
@AsyaPronina AsyaPronina requested a review from sbutnari July 30, 2024 18:17
@dmatveev dmatveev added this to the 2024.4 milestone Aug 1, 2024
@dmatveev dmatveev added the category: NPUW NPUW plugin label Aug 1, 2024
@github-actions github-actions bot removed the category: NPUW NPUW plugin label Aug 2, 2024
Comment on lines +19 to +22
auto param = std::make_shared<ov::opset11::Parameter>(ov::element::i64, ov::PartialShape{1, 3, 2, 2});
param->set_friendly_name("input");
auto const_value = ov::opset11::Constant::create(ov::element::i64, ov::Shape{1, 1, 1, 1}, {1});
const_value->set_friendly_name("const_val");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, why i64 for this simple arith? Not the most obvious choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just was copied from some network implementations in tests..

Comment on lines +32 to +35
EXPECT_CALL(*npu_plugin, get_property).Times(AnyNumber());
EXPECT_CALL(*npu_plugin, get_property(std::string("AVAILABLE_DEVICES"), _)).Times(1);
EXPECT_CALL(*cpu_plugin, get_property).Times(AnyNumber());
EXPECT_CALL(*cpu_plugin, get_property(std::string("AVAILABLE_DEVICES"), _)).Times(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these mocks or the real plugins tested?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are mock plugins, will rename them, thanks!

Comment on lines +24 to +25
std::shared_ptr<MockNpuPlugin> npu_plugin;
std::shared_ptr<MockCpuPlugin> cpu_plugin;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'd recommend renaming these two to mock_npu_plugin / mock_cpu_plugin to avoid disambiguation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will do! Will update in the following PR!

@dmatveev dmatveev added this pull request to the merge queue Aug 7, 2024
Merged via the queue into openvinotoolkit:master with commit bc5e902 Aug 7, 2024
111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: build OpenVINO cmake script / infra category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants