2022-03-11 02:08:10 +00:00
|
|
|
from .cuda import empty_cache, get_current_device, set_to_cuda, synchronize
|
2021-10-28 16:21:23 +00:00
|
|
|
from .activation_checkpoint import checkpoint
|
2022-04-01 08:49:21 +00:00
|
|
|
from .checkpointing import load_checkpoint, save_checkpoint
|
2022-03-04 02:17:45 +00:00
|
|
|
from .common import (clip_grad_norm_fp32, conditional_context, copy_tensor_parallel_attributes, count_zeros_fp32,
|
2022-04-01 08:49:21 +00:00
|
|
|
ensure_path_exists, free_port, is_dp_rank_0, is_model_parallel_parameter, is_no_pp_or_last_stage,
|
|
|
|
is_tp_rank_0, is_using_ddp, is_using_pp, is_using_sequence, multi_tensor_applier,
|
2022-03-22 09:37:16 +00:00
|
|
|
param_is_not_tensor_parallel_duplicate, print_rank_0, switch_virtual_pipeline_parallel_rank,
|
2022-04-11 02:46:08 +00:00
|
|
|
sync_model_param, disposable)
|
2021-12-29 15:32:10 +00:00
|
|
|
from .data_sampler import DataParallelSampler, get_dataloader
|
2022-04-19 08:05:22 +00:00
|
|
|
from .memory import (report_memory_usage, colo_device_memory_used, colo_set_process_memory_fraction,
|
|
|
|
colo_device_memory_capacity, colo_set_cpu_memory_capacity, colo_get_cpu_memory_capacity)
|
2021-10-28 16:21:23 +00:00
|
|
|
from .timer import MultiTimer, Timer
|
2022-03-14 10:01:46 +00:00
|
|
|
from .tensor_detector import TensorDetector
|
2021-10-28 16:21:23 +00:00
|
|
|
|
2021-12-29 15:32:10 +00:00
|
|
|
__all__ = [
|
2022-04-22 10:03:35 +00:00
|
|
|
'checkpoint',
|
|
|
|
'free_port',
|
|
|
|
'print_rank_0',
|
|
|
|
'sync_model_param',
|
|
|
|
'is_dp_rank_0',
|
|
|
|
'is_tp_rank_0',
|
|
|
|
'is_no_pp_or_last_stage',
|
|
|
|
'is_using_ddp',
|
|
|
|
'is_using_pp',
|
|
|
|
'is_using_sequence',
|
|
|
|
'conditional_context',
|
|
|
|
'is_model_parallel_parameter',
|
|
|
|
'clip_grad_norm_fp32',
|
|
|
|
'count_zeros_fp32',
|
|
|
|
'copy_tensor_parallel_attributes',
|
|
|
|
'param_is_not_tensor_parallel_duplicate',
|
|
|
|
'get_current_device',
|
|
|
|
'synchronize',
|
|
|
|
'empty_cache',
|
|
|
|
'set_to_cuda',
|
|
|
|
'report_memory_usage',
|
|
|
|
'colo_device_memory_capacity',
|
|
|
|
'colo_device_memory_used',
|
|
|
|
'colo_set_process_memory_fraction',
|
|
|
|
'Timer',
|
|
|
|
'MultiTimer',
|
|
|
|
'multi_tensor_applier',
|
|
|
|
'DataParallelSampler',
|
|
|
|
'get_dataloader',
|
|
|
|
'switch_virtual_pipeline_parallel_rank',
|
|
|
|
'TensorDetector',
|
|
|
|
'load_checkpoint',
|
|
|
|
'save_checkpoint',
|
|
|
|
'ensure_path_exists',
|
|
|
|
'disposable',
|
|
|
|
'colo_set_cpu_memory_capacity',
|
|
|
|
'colo_get_cpu_memory_capacity',
|
2021-12-29 15:32:10 +00:00
|
|
|
]
|