Skip to content

Commit cb30298

Browse files
a31413510TingquanGao
authored andcommitted
multi-hardware modify predict problem
1 parent c956f10 commit cb30298

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

paddlex/inference/models/common/static_infer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,19 @@ def _create(
246246
)
247247
elif self.option.device == "npu":
248248
config.enable_custom_device("npu")
249+
if hasattr(config, "enable_new_executor"):
250+
config.enable_new_executor()
249251
elif self.option.device == "xpu":
250-
pass
252+
if hasattr(config, "enable_new_executor"):
253+
config.enable_new_executor()
251254
elif self.option.device == "mlu":
252255
config.enable_custom_device("mlu")
256+
if hasattr(config, "enable_new_executor"):
257+
config.enable_new_executor()
253258
elif self.option.device == "dcu":
254259
config.enable_use_gpu(100, self.option.device_id)
260+
if hasattr(config, "enable_new_executor"):
261+
config.enable_new_executor()
255262
# XXX: is_compiled_with_rocm() must be True on dcu platform ?
256263
if paddle.is_compiled_with_rocm():
257264
# Delete unsupported passes in dcu

0 commit comments

Comments
 (0)