Compile the module using the specified backend and kwargs.
(self, backend=get_accelerator().get_compile_backend(), compile_kwargs={})
| 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: |
nothing calls this directly
no test coverage detected