Skip to content

Commit 109f003

Browse files
authored
Merge pull request #186 from intel/npu_tile_count_update
Update npu dpu groups to read max tile config.
2 parents a0369b4 + a04677d commit 109f003

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gimpopenvino/plugins/openvino_utils/tools/model_manager.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@
301301

302302
access_token = None
303303

304-
NPU_THRESHOLD = 43000
305-
306304
def does_filename_match_patterns(filename, patterns):
307305
for pattern in patterns:
308306
if fnmatch.fnmatch(filename, pattern):
@@ -384,8 +382,9 @@ def get_npu_driver_version(core):
384382
def get_npu_config(core, architecture):
385383
try:
386384
if architecture == NPUArchitecture.ARCH_4000:
387-
gops_value = core.get_property("NPU", "DEVICE_GOPS")[ov.Type.i8]
388-
return 6 if gops_value > NPU_THRESHOLD else None
385+
return core.get_property("NPU", "NPU_MAX_TILES")
386+
else:
387+
return None
389388
except Exception as e:
390389
logging.error(f"Error retrieving NPU configuration: {str(e)}")
391390
return None
@@ -1218,7 +1217,8 @@ def dl_sd_15_square(self, model_id, only_npu_recompilation=False):
12181217
logging.info(f"Creating NPU model for {model_name}")
12191218

12201219
if "unet_int8" in model_name or "unet_bs1" in model_name:
1221-
config = { "NPU_DPU_GROUPS" : npu_config, "NPU_MAX_TILES": npu_config } if npu_config is not None else None
1220+
config = { "NPU_DPU_GROUPS" : npu_config } if npu_config is not None else None
1221+
12221222

12231223
if "unet_int8" not in model_name:
12241224
model_path_fp16 = os.path.join(install_location, model_fp16, model_name + ".xml")

0 commit comments

Comments
 (0)