diff --git a/deepspeed/runtime/engine.py b/deepspeed/runtime/engine.py index 61e6da2663cf..71cca217074e 100755 --- a/deepspeed/runtime/engine.py +++ b/deepspeed/runtime/engine.py @@ -3675,7 +3675,11 @@ def compile(self, backend=get_accelerator().get_compile_backend(), compile_kwarg if self.is_compiled: return - self.module.compile(backend=backend, **compile_kwargs) + if 'backend' in compile_kwargs: + logger.warning("The `backend` in `compile_kwargs` will be overridden. Use the `backend` argument instead.") + + # create new dict to avoid modifying original dict + self.module.compile(**{**compile_kwargs, 'backend': backend}) self._is_compiled = True @property