Coverage for  / home / jenkins / .local / lib / python3.10 / site-packages / hyper_parallel / data / batching / __init__.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-12-05 05:12 +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"""Batch collation, dynamic packing, and DataLoader construction.""" 

16 

17from hyper_parallel.data.batching.build_collate_fn import ( 

18 build_default_collate_fn, 

19 build_sft_collate_fn, 

20 build_indexed_collate_fn, 

21 build_omni_collate_fn, 

22 build_online_text_collate_fn, 

23) 

24from hyper_parallel.data.batching.build_dataloader import ( 

25 DynamicBatchDataLoader, 

26 FixedBatchDataLoader, 

27 OmniPackingLoader, 

28 RepeatingDataLoader, 

29 TokenBatchLoader, 

30 build_dataloader, 

31 calculate_num_micro_batches, 

32) 

33from hyper_parallel.data.batching.get_batch import OmniParallelBatch, TextParallelBatch 

34from hyper_parallel.data.batching.packing import ( 

35 FirstFitPackingSelector, 

36 PackingSelector, 

37 SamplePacker, 

38) 

39from hyper_parallel.data.batching.runtime_input import ( 

40 RuntimeInputAdapter, 

41 RuntimeInputContext, 

42) 

43 

44__all__ = [ 

45 "FirstFitPackingSelector", 

46 "DynamicBatchDataLoader", 

47 "FixedBatchDataLoader", 

48 "OmniParallelBatch", 

49 "OmniPackingLoader", 

50 "PackingSelector", 

51 "RepeatingDataLoader", 

52 "TextParallelBatch", 

53 "RuntimeInputAdapter", 

54 "RuntimeInputContext", 

55 "SamplePacker", 

56 "TokenBatchLoader", 

57 "build_default_collate_fn", 

58 "build_sft_collate_fn", 

59 "build_dataloader", 

60 "build_indexed_collate_fn", 

61 "build_omni_collate_fn", 

62 "build_online_text_collate_fn", 

63 "calculate_num_micro_batches", 

64]