Coverage for  / home / jenkins / .local / lib / python3.10 / site-packages / hyper_parallel / platform / torch / activation_checkpoint / __init__.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-08-21 04:29 +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""" 

16from .checkpoint_wrapper import CheckpointWrapper, ckpt_wrapper 

17from .checkpoint_exclude_wrapper import CheckpointExcludeWrapper, checkpoint_exclude_wrapper 

18from .activation_swap import swap_wrapper, swap_tensor_wrapper 

19from .checkpoint import ( 

20 CheckpointError, 

21 checkpoint, 

22 clear_recompute_session, 

23 recompute_handle, 

24 recompute_handle_collector_ctx, 

25 recompute_session_ctx, 

26) 

27 

28__all__ = [ 

29 "CheckpointWrapper", 

30 "ckpt_wrapper", 

31 "CheckpointExcludeWrapper", 

32 "checkpoint_exclude_wrapper", 

33 "swap_wrapper", 

34 "swap_tensor_wrapper", 

35 "CheckpointError", 

36 "checkpoint", 

37 "clear_recompute_session", 

38 "recompute_handle", 

39 "recompute_handle_collector_ctx", 

40 "recompute_session_ctx", 

41]