-
Notifications
You must be signed in to change notification settings - Fork 206
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
StaticLLMPipeline: Decide when to enable NPUW_DQ_FULL property #1258
Merged
smirnov-alexey
merged 4 commits into
openvinotoolkit:master
from
smirnov-alexey:as/npuw_dq_full
Nov 28, 2024
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
70712ef
Decide when to enable NPUW_DQ_FULL property
smirnov-alexey 807564d
Fix internal properties usage
smirnov-alexey 0b5bada
Switch from internal properties to device capabilities
smirnov-alexey 0f1348b
Merge branch 'master' into as/npuw_dq_full
smirnov-alexey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -457,6 +457,7 @@ void merge_config_with(ov::AnyMap& lhs, const ov::AnyMap& rhs) { | |||||||||||||||
struct NPUDesc { | ||||||||||||||||
std::string arch; | ||||||||||||||||
int64_t max_tiles; | ||||||||||||||||
bool compiler_dq; | ||||||||||||||||
}; | ||||||||||||||||
|
||||||||||||||||
std::optional<NPUDesc> extract_npu_descriptor(ov::Core& core) { | ||||||||||||||||
|
@@ -466,7 +467,14 @@ std::optional<NPUDesc> extract_npu_descriptor(ov::Core& core) { | |||||||||||||||
} | ||||||||||||||||
const auto arch = core.get_property("NPU", ov::device::architecture); | ||||||||||||||||
const auto max_tiles = core.get_property("NPU", ov::intel_npu::max_tiles); | ||||||||||||||||
return std::make_optional(NPUDesc{arch, max_tiles}); | ||||||||||||||||
|
||||||||||||||||
bool compiler_dq = false; | ||||||||||||||||
const auto device_caps = core.get_property("NPU", ov::device::capabilities); | ||||||||||||||||
if (std::find(device_caps.begin(), device_caps.end(), | ||||||||||||||||
"COMPILER_DYNAMIC_QUANTIZATION") != device_caps.end()) { | ||||||||||||||||
compiler_dq = true; | ||||||||||||||||
} | ||||||||||||||||
Comment on lines
+471
to
+476
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
return std::make_optional(NPUDesc{arch, max_tiles, compiler_dq}); | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
ov::AnyMap get_baseline_common_config() { | ||||||||||||||||
|
@@ -508,6 +516,9 @@ ov::AnyMap get_default_prefill_config(const std::shared_ptr<ov::Model>& model, | |||||||||||||||
npudesc->max_tiles != -1) { | ||||||||||||||||
config.emplace("NPU_DPU_GROUPS", npudesc->max_tiles); | ||||||||||||||||
} | ||||||||||||||||
if (npudesc.has_value() && npudesc->compiler_dq) { | ||||||||||||||||
config.emplace("NPUW_DQ_FULL", "NO"); | ||||||||||||||||
} | ||||||||||||||||
return config; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
|
@@ -523,6 +534,9 @@ ov::AnyMap get_default_generate_config(const std::shared_ptr<ov::Model>& model, | |||||||||||||||
if (npudesc.has_value() && npudesc->arch == "4000") { | ||||||||||||||||
config.emplace("NPU_DPU_GROUPS", 4); | ||||||||||||||||
} | ||||||||||||||||
if (npudesc.has_value() && npudesc->compiler_dq) { | ||||||||||||||||
config.emplace("NPUW_DQ_FULL", "NO"); | ||||||||||||||||
} | ||||||||||||||||
return config; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is worth to have default values here, probably even incorrect (e.g., 0 as max_tiles)