Coverage for / home / jenkins / .local / lib / python3.10 / site-packages / hyper_parallel / core / activation_memory / __init__.py: 100%
7 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-11-15 07:18 +0800
« prev ^ index » next coverage.py v7.13.1, created at 2026-11-15 07:18 +0800
1# Copyright 2026 Huawei Technologies Co., Ltd
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# ============================================================================
15"""Activation checkpointing related interfaces (PyTorch backend only)."""
16from .checkpoint import CheckpointError
17from .pinned_memory_pool import PinnedMemoryPool
18from .recompute_state import get_recompute_state, is_recomputing
19from .swap import SwapManager
20from .wrapper import (
21 ActivationWrapper,
22 AsyncSaveOnCpu,
23 CheckpointExcludeWrapper,
24 CheckpointWrapper,
25 SwapWrapper,
26 base_check_fn,
27 ckpt_wrapper,
28)
29from .api import (
30 CheckpointPolicy,
31 clear_recompute_session,
32 checkpoint,
33 checkpoint_exclude_wrapper,
34 checkpoint_wrapper,
35 recompute_handle,
36 recompute_handle_collector_ctx,
37 recompute_session_ctx,
38 reentrant_checkpoint_scope,
39 swap,
40 swap_tensor_wrapper,
41 swap_wrapper,
42)
44__all__ = [
45 "ActivationWrapper",
46 "AsyncSaveOnCpu",
47 "CheckpointError",
48 "CheckpointExcludeWrapper",
49 "CheckpointPolicy",
50 "CheckpointWrapper",
51 "PinnedMemoryPool",
52 "SwapManager",
53 "SwapWrapper",
54 "base_check_fn",
55 "clear_recompute_session",
56 "checkpoint",
57 "checkpoint_exclude_wrapper",
58 "checkpoint_wrapper",
59 "ckpt_wrapper",
60 "get_recompute_state",
61 "is_recomputing",
62 "recompute_handle",
63 "recompute_handle_collector_ctx",
64 "recompute_session_ctx",
65 "reentrant_checkpoint_scope",
66 "swap",
67 "swap_tensor_wrapper",
68 "swap_wrapper",
69]