MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / compile

Method compile

deepspeed/inference/engine.py:642–655  ·  view source on GitHub ↗

Compile the module using the specified backend and kwargs.

(self, backend=get_accelerator().get_compile_backend(), compile_kwargs={})

Source from the content-addressed store, hash-verified

640 return self.module.generate(*inputs, **kwargs)
641
642 def compile(self, backend=get_accelerator().get_compile_backend(), compile_kwargs={}) -> None:
643 """
644 Compile the module using the specified backend and kwargs.
645 """
646 if not is_compile_supported():
647 raise RuntimeError("compile is not supported in your version of PyTorch.")
648
649 if self._is_compiled:
650 return
651
652 # Avoid graph breaks
653 deepspeed.utils.nvtx.enable_nvtx = False
654 self.module.compile(backend=backend, **compile_kwargs)
655 self._is_compiled = True
656
657 @property
658 def is_compiled(self) -> bool:

Callers

nothing calls this directly

Calls 3

get_acceleratorFunction · 0.90
is_compile_supportedFunction · 0.90
get_compile_backendMethod · 0.45

Tested by

no test coverage detected