Skip to content

Commit

Permalink
Override compile_kwargs['backend'] with backend in engine.compile
Browse files Browse the repository at this point in the history
  • Loading branch information
oraluben committed Sep 10, 2024
1 parent fc22d96 commit 3c39011
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deepspeed/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c39011

Please sign in to comment.