Diff Coverage

Diff: origin/master...HEAD, staged and unstaged changes

Source File Diff Coverage (%) Missing Lines
hyper_parallel/core/activation_checkpoint/__init__.py 100%  
hyper_parallel/core/activation_checkpoint/activation_checkpoint.py 75.0% 74-76
hyper_parallel/core/activation_checkpoint/recompute_state.py 100%  
hyper_parallel/platform/mindspore/activation_checkpoint/__init__.py 100%  
hyper_parallel/platform/mindspore/activation_checkpoint/activation_swap.py 100%  
hyper_parallel/platform/mindspore/activation_checkpoint/checkpoint_exclude_wrapper.py 97.7% 38
hyper_parallel/platform/mindspore/platform.py 100%  
hyper_parallel/platform/platform.py 66.7% 1412
hyper_parallel/core/activation_checkpoint/activation_checkpoint.py
70
71
72
73
74
75
76
77
78
79
80
        self._stack.__enter__()
        try:
            for ctx in self._ctxs:
                self._stack.enter_context(ctx)
        except BaseException as exc:
            self._stack.__exit__(type(exc), exc, exc.__traceback__)
            raise
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        return self._stack.__exit__(exc_type, exc_val, exc_tb)
hyper_parallel/platform/mindspore/activation_checkpoint/checkpoint_exclude_wrapper.py
34
35
36
37
38
39
40
41
42
    def pop(self, wrapper_id: int) -> Any:
        """Return the matching forward output during recomputation."""
        outputs = self._outputs.get(wrapper_id)
        if not outputs:
            raise RuntimeError("No cached forward output is available for this checkpoint exclusion wrapper")
        output = outputs.popleft()
        if not outputs:
            self._outputs.pop(wrapper_id)
        return output
hyper_parallel/platform/platform.py
1408
1409
1410
1411
1412
1413
1414
1415
1416

        Returns:
            The wrapped module or callable.
        """
        raise NotImplementedError("checkpoint_exclude_wrapper is currently only supported on MindSpore")

    @staticmethod
    def swap_wrapper(module, policy_fn=None, group_swap=False):
        """Wrap a module with activation swap functionality.