(self, *inputs, **kwargs)
| 526 | self.module.float() |
| 527 | |
| 528 | def _create_cuda_graph(self, *inputs, **kwargs): |
| 529 | # warmup to create the workspace and cublas handle |
| 530 | cuda_stream = get_accelerator().Stream() |
| 531 | cuda_stream.wait_stream(get_accelerator().current_stream()) |
| 532 | with get_accelerator().stream(cuda_stream): |
| 533 | for i in range(3): |
| 534 | ret = self.module(*inputs, **kwargs) |
| 535 | get_accelerator().current_stream().wait_stream(cuda_stream) |
| 536 | |
| 537 | # create cuda_graph and assign static_inputs and static_outputs |
| 538 | self._cuda_graphs = get_accelerator().create_graph() |
| 539 | self.static_inputs = inputs |
| 540 | self.static_kwargs = kwargs |
| 541 | |
| 542 | with get_accelerator().capture_to_graph(self._cuda_graphs): |
| 543 | self.static_output = self.module(*self.static_inputs, **self.static_kwargs) |
| 544 | |
| 545 | self.cuda_graph_created = True |
| 546 | |
| 547 | def _graph_replay(self, *inputs, **kwargs): |
| 548 | for i in range(len(inputs)): |
no test coverage detected