浏览代码

dcu xpu inference support pir (#3604)

* dcu xpu mul support pir

* update
hong 7 月之前
父节点
当前提交
29b7be320b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      paddlex/inference/models/common/static_infer.py

+ 4 - 0
paddlex/inference/models/common/static_infer.py

@@ -412,6 +412,8 @@ class PaddleInfer(StaticInfer):
                 if hasattr(config, "enable_new_executor"):
                     config.enable_new_executor()
             elif self._option.device_type == "xpu":
+                if hasattr(config, "enable_new_ir"):
+                    config.enable_new_ir(self._option.enable_new_ir)
                 if hasattr(config, "enable_new_executor"):
                     config.enable_new_executor()
             elif self._option.device_type == "mlu":
@@ -431,6 +433,8 @@ class PaddleInfer(StaticInfer):
                     name = "PaddleX_" + self._option.model_name
                     gcu_passes.append_passes_for_legacy_ir(pass_builder, name)
             elif self._option.device_type == "dcu":
+                if hasattr(config, "enable_new_ir"):
+                    config.enable_new_ir(self._option.enable_new_ir)
                 config.enable_use_gpu(100, self._option.device_id)
                 if hasattr(config, "enable_new_executor"):
                     config.enable_new_executor()