Skip to content
Open

[WIP] #4733

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion paddlex/inference/models/common/static_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ def _create(
logging.debug("`device_id` has been set to None")

if (
self._option.device_type in ("gpu", "dcu", "npu", "mlu", "gcu", "xpu", "iluvatar_gpu")
self._option.device_type
in ("gpu", "dcu", "npu", "mlu", "gcu", "xpu", "iluvatar_gpu")
and self._option.device_id is None
):
self._option.device_id = 0
Expand Down Expand Up @@ -399,6 +400,7 @@ def _create(
if hasattr(config, "enable_new_executor"):
config.enable_new_executor()
config.set_optimization_level(3)
config.delete_pass("matmul_add_act_fuse_pass")
elif self._option.device_type == "npu":
config.enable_custom_device("npu", self._option.device_id)
if hasattr(config, "enable_new_ir"):
Expand Down