Przeglądaj źródła

dcu xpu inference support pir (#3604)

* dcu xpu mul support pir

* update
hong 7 miesięcy temu
rodzic
commit
29b7be320b

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

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