utils.rst 1.8 KB
Newer Older
jerrrrry's avatar
jerrrrry committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Utilities
============

Last updated: 05/19/2025 (API docstrings are auto-generated).

This section documents the utility functions and classes in the VERL library.

Python Functional Utilities
------------------------------

.. automodule:: verl.utils.py_functional
   :members: append_to_dict

File System Utilities
------------------------

.. automodule:: verl.utils.fs
   :members: copy_to_local

Tracking Utilities
---------------------

.. automodule:: verl.utils.tracking
   :members: Tracking

Metrics Utilities
---------------------

.. automodule::  verl.utils.metric
   :members: reduce_metrics

Checkpoint Management
------------------------

.. automodule:: verl.utils.checkpoint.checkpoint_manager
   :members: find_latest_ckpt_path

.. automodule:: verl.utils.checkpoint.fsdp_checkpoint_manager
   :members: FSDPCheckpointManager

Dataset Utilities
---------------------

.. automodule:: verl.utils.dataset.rl_dataset
   :members: RLHFDataset, collate_fn

Torch Functional Utilities
-----------------------------

.. automodule:: verl.utils.torch_functional
   :members: get_constant_schedule_with_warmup, masked_whiten, masked_mean, logprobs_from_logits

Sequence Length Balancing
----------------------------

.. automodule:: verl.utils.seqlen_balancing
   :members: get_reverse_idx, rearrange_micro_batches

Ulysses Utilities
--------------------

.. automodule:: verl.utils.ulysses
   :members: gather_outputs_and_unpad, ulysses_pad_and_slice_inputs

FSDP Utilities
------------------

.. automodule:: verl.utils.fsdp_utils
   :members: get_fsdp_wrap_policy, get_init_weight_context_manager, init_fn, load_fsdp_model_to_gpu, load_fsdp_optimizer, offload_fsdp_model_to_cpu, offload_fsdp_optimizer,

Debug Utilities
-------------------

.. automodule:: verl.utils.profiler
   :members: log_gpu_memory_usage, GPUMemoryLogger