Skip to content

Commit ca8b1fe

Browse files
oralubenloadamstjruwasetohtana
authored
Handle when backend is also in compile_kwargs (#6502)
cc @tohtana Co-authored-by: Logan Adams <[email protected]> Co-authored-by: Olatunji Ruwase <[email protected]> Co-authored-by: Masahiro Tanaka <[email protected]>
1 parent 5cbbff4 commit ca8b1fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deepspeed/runtime/engine.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3675,7 +3675,11 @@ def compile(self, backend=get_accelerator().get_compile_backend(), compile_kwarg
36753675
if self.is_compiled:
36763676
return
36773677

3678-
self.module.compile(backend=backend, **compile_kwargs)
3678+
if 'backend' in compile_kwargs:
3679+
logger.warning("The `backend` in `compile_kwargs` will be overridden. Use the `backend` argument instead.")
3680+
3681+
# create new dict to avoid modifying original dict
3682+
self.module.compile(**{**compile_kwargs, 'backend': backend})
36793683
self._is_compiled = True
36803684

36813685
@property

0 commit comments

Comments
 (0)