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

[NPU] Add compatibility checks before compiling model with compiler in plugin #24502

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

dvpv
Copy link
Contributor

@dvpv dvpv commented May 14, 2024

Details:

  • A Version structured is added in order to have consistency between driver and CIP version formats.
  • Updating the last version of Table of Graph Extension function to 1.6
  • Adding ELF and Static MI Versions fetch methods to Zero Device.
  • Evolving the compiler interface to add methods for fetching ELF and MI Versions.
  • Adding versioning check and Driver Compiler fallback in case of versions mismatch

Tickets:

  • EISW-103348

@dvpv dvpv self-assigned this May 14, 2024
@github-actions github-actions bot added the category: NPU OpenVINO NPU plugin label May 14, 2024
@dvpv dvpv marked this pull request as ready for review May 21, 2024 13:49
@dvpv dvpv requested review from a team as code owners May 21, 2024 13:49
Copy link

@sbutnari sbutnari left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@razvanapetroaie razvanapetroaie left a comment

Choose a reason for hiding this comment

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

I'll try to take a closer look tomorrow.

@@ -163,6 +163,11 @@ bool NPUBackends::isBatchingSupported() const {
return false;
}

bool NPUBackends::isCompilerFallbackRequired() const {
static const uint32_t lastCompatibleVersion = 2196;
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this require manual maintenance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this method will be updated and, in the end removed in the future. This check is added in order to prevent CID fallback for some drivers (that don't have graph extension 1.6) that could use CIP instead. However, CIP is continuously being developed and I don't expect for the compatibility between older drivers and CIP to persist. When the last driver that doesn't contain graph extension 1.6 will be 'not supported' by CIP, we will be able to remove this check altogether.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it work for both linux and windows drivers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated this check to work for both

src/plugins/intel_npu/src/plugin/src/plugin.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/src/plugin.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/src/plugin.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/src/plugin.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/src/plugin.cpp Outdated Show resolved Hide resolved
uint32_t patch;

inline bool isCompatible(const Version& other) const {
return this->major == other.major && this->minor == other.minor; // TODO: needs confirmation
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a reminder to remove this comment upon receiving the confirmation. Perhaps we should do this prior to merging the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

What kind of confirmation do we need here? If we still need such a confirmation after merging the PR, could we open a ticket and remove this comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

We should be able to support backward compatibility by this check. So we need to support cases when driver minor version >= compiler minor version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the check and moved it inside plugin.cpp

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I do not see the check inside plugin.cpp

https://github.com/openvinotoolkit/openvino/pull/24502/files#diff-f1f8f14a46f6bfbbfc9561e65e1a27b99d0e3a554964137190d414557eec728cR549-R572

I see that we checked that versions are not nullpts and then adding them into config. Am I missing something?

@razvanapetroaie
Copy link
Contributor

@ArtemySkrebkov @pereanub @PatrikStepan Could you please have a look?

Copy link
Contributor

@pereanub pereanub left a comment

Choose a reason for hiding this comment

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

Minor comment, but the changes look good!

uint32_t patch;

inline bool isCompatible(const Version& other) const {
return this->major == other.major && this->minor == other.minor; // TODO: needs confirmation
Copy link
Contributor

Choose a reason for hiding this comment

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

What kind of confirmation do we need here? If we still need such a confirmation after merging the PR, could we open a ticket and remove this comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: NPU OpenVINO NPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants