SYMBOL INDEX (1406 symbols across 170 files) FILE: examples/data_preprocess/arth.py function gen_dataset (line 29) | def gen_dataset( function make_prefix (line 79) | def make_prefix(dp): function make_map_fn (line 109) | def make_map_fn(split): function to_dataset (line 134) | def to_dataset(dataset_list): FILE: examples/data_preprocess/countdown.py function gen_dataset (line 15) | def gen_dataset( function make_prefix (line 53) | def make_prefix(dp, template_type): function make_map_fn (line 94) | def make_map_fn(split): FILE: examples/data_preprocess/full_hh_rlhf.py function generate_sft_dataset (line 30) | def generate_sft_dataset(target_hdfs_path_dir, local_dir='~/data/full_hh... function generate_rm_dataset (line 58) | def generate_rm_dataset(target_hdfs_path_dir, local_dir='~/data/full_hh_... function generate_rl_dataset (line 86) | def generate_rl_dataset(target_hdfs_path_dir, local_dir='~/data/full_hh_... FILE: examples/data_preprocess/gsm8k.py function extract_solution (line 26) | def extract_solution(solution_str): function make_map_fn (line 52) | def make_map_fn(split): FILE: examples/data_preprocess/hellaswag.py function preprocess (line 27) | def preprocess(text): function make_map_fn (line 53) | def make_map_fn(split): FILE: examples/data_preprocess/math_dataset.py function extract_solution (line 27) | def extract_solution(solution_str): function make_map_fn (line 48) | def make_map_fn(split): FILE: examples/data_preprocess/multiply.py function gen_dataset (line 29) | def gen_dataset( function extract_solution (line 62) | def extract_solution(solution_str, *args): function make_prefix (line 69) | def make_prefix(dp): function make_map_fn (line 98) | def make_map_fn(split): function to_dataset (line 123) | def to_dataset(dataset_list): FILE: examples/split_placement/main_ppo_split.py function _select_rm_score_fn (line 24) | def _select_rm_score_fn(data_source): class RewardManager (line 33) | class RewardManager(): method __init__ (line 35) | def __init__(self, tokenizer, num_examine) -> None: method __call__ (line 39) | def __call__(self, data: DataProto): function main (line 93) | def main(config): function main_task (line 102) | def main_task(config): FILE: examples/split_placement/split_monkey_patch.py function fit (line 25) | def fit(self): FILE: tests/e2e/arithmetic_sequence/rl/main_trainer.py function make_reward_function (line 35) | def make_reward_function(tokenizer, num_examine): function main (line 92) | def main(config): FILE: tests/e2e/check_results.py function extract_reward_from_line (line 20) | def extract_reward_from_line(line): FILE: tests/e2e/envs/digit_completion/task.py class DigitCompletion (line 19) | class DigitCompletion(object): method __init__ (line 35) | def __init__(self, max_number: int, max_diff: int, max_num_in_response... method __str__ (line 56) | def __str__(self): method get_state (line 61) | def get_state(self): method set_state (line 64) | def set_state(self, state): method prompt_length (line 69) | def prompt_length(self): method response_length (line 73) | def response_length(self): method add (line 78) | def add(self, a, b): method get_all_prompts (line 81) | def get_all_prompts(self): method sample_str_prompts (line 91) | def sample_str_prompts(self): method sample_batch_str_prompts (line 100) | def sample_batch_str_prompts(self, batch_size): function compute_attention_mask (line 107) | def compute_attention_mask(prompts, pad_token_id): function compute_position_id_with_mask (line 113) | def compute_position_id_with_mask(mask): function generate_ground_truth_response (line 117) | def generate_ground_truth_response(prompt: str): function compute_reward (line 137) | def compute_reward(prompt: str, response: str, sequence_reward=1.): FILE: tests/e2e/envs/digit_completion/tokenizer.py class CharTokenizer (line 29) | class CharTokenizer(PreTrainedTokenizer): method __init__ (line 31) | def __init__(self, characters: Sequence[str], model_max_length: int, c... method vocab_size (line 86) | def vocab_size(self) -> int: method get_vocab (line 89) | def get_vocab(self): method _tokenize (line 92) | def _tokenize(self, text: str) -> List[str]: method _convert_token_to_id (line 95) | def _convert_token_to_id(self, token: str) -> int: method _convert_id_to_token (line 98) | def _convert_id_to_token(self, index: int) -> str: method convert_tokens_to_string (line 101) | def convert_tokens_to_string(self, tokens): method build_inputs_with_special_tokens (line 104) | def build_inputs_with_special_tokens(self, method get_special_tokens_mask (line 114) | def get_special_tokens_mask( method get_config (line 132) | def get_config(self) -> Dict: method from_config (line 140) | def from_config(cls, config: Dict) -> "DigitCompletionTokenizer": method save_pretrained (line 147) | def save_pretrained(self, save_directory: Union[str, os.PathLike], **k... method from_pretrained (line 154) | def from_pretrained(cls, save_directory: Union[str, os.PathLike], **kw... FILE: tests/gpu_utility/test_memory_buffers.py function test_memory_buffers (line 27) | def test_memory_buffers(): FILE: tests/gpu_utility/test_ops.py function test_flash_attn_cross_entropy (line 16) | def test_flash_attn_cross_entropy(): FILE: tests/gpu_utility/test_torch_functional.py function test_log_probs_from_logits_response_rmpad (line 20) | def test_log_probs_from_logits_response_rmpad(): function test_lr_scheduler (line 52) | def test_lr_scheduler(): FILE: tests/model/test_transformer.py function test_hf_casual_models (line 32) | def test_hf_casual_models(): function test_hf_value_models (line 91) | def test_hf_value_models(): FILE: tests/model/test_transformers_ulysses.py function sync_model_parameters_global (line 44) | def sync_model_parameters_global(layer): function test_hf_casual_fwd (line 50) | def test_hf_casual_fwd(): function test_hf_casual_fwd_bwd (line 128) | def test_hf_casual_fwd_bwd(): FILE: tests/ray/check_worker_alive/main.py class TestActor (line 27) | class TestActor(Worker): method __init__ (line 29) | def __init__(self) -> None: method foo (line 33) | def foo(self, wait_time): FILE: tests/ray/detached_worker/client.py function compute_position_id_with_mask (line 30) | def compute_position_id_with_mask(mask): FILE: tests/ray/detached_worker/server.py class Trainer (line 49) | class Trainer(MegatronWorker): method __init__ (line 51) | def __init__(self): method init_model (line 73) | def init_model(self): method train_model (line 120) | def train_model(self, data: DataProto) -> DataProto: FILE: tests/ray/test_check_worker_alive.py function test (line 20) | def test(): FILE: tests/ray/test_colocated_workers.py class Actor (line 25) | class Actor(Worker): method __init__ (line 27) | def __init__(self) -> None: method add (line 31) | def add(self, data: DataProto): class Critic (line 37) | class Critic(Worker): method __init__ (line 39) | def __init__(self, config) -> None: method sub (line 44) | def sub(self, data: DataProto): function test_colocated_workers (line 49) | def test_colocated_workers(): FILE: tests/ray/test_data_transfer.py class DummyWorker (line 37) | class DummyWorker(Worker): method __init__ (line 39) | def __init__(self): method do_nothing (line 44) | def do_nothing(self, data): function test_data_transfer (line 52) | def test_data_transfer(): FILE: tests/ray/test_driverfunc_to_worker.py class ModelActor (line 30) | class ModelActor(Worker): method __init__ (line 32) | def __init__(self): class HackSelf (line 36) | class HackSelf(): method __init__ (line 38) | def __init__(self): function get_aux_metrics (line 42) | def get_aux_metrics(self, test_proto): function test (line 55) | def test(): FILE: tests/ray/test_high_level_scheduling_api.py class TestActor (line 24) | class TestActor(Worker): method __init__ (line 26) | def __init__(self, cuda_visible_devices=None) -> None: method get_node_id (line 29) | def get_node_id(self): function test (line 33) | def test(): FILE: tests/ray/test_ray_local_envs.py class TestActor (line 26) | class TestActor(Worker): method __init__ (line 28) | def __init__(self) -> None: method getenv (line 31) | def getenv(self, key): function test_basics (line 36) | def test_basics(): FILE: tests/ray/test_rvdz.py class TestWorker (line 19) | class TestWorker: method __init__ (line 21) | def __init__(self, rank, world_size, group_name): method init (line 27) | def init(self): method test (line 31) | def test(self): function test_rvdz (line 37) | def test_rvdz(): FILE: tests/ray/test_worker_group_basics.py function two_to_all_dispatch_fn (line 26) | def two_to_all_dispatch_fn(worker_group, *args, **kwargs): class TestActor (line 42) | class TestActor(Worker): method __init__ (line 44) | def __init__(self, x) -> None: method foo (line 48) | def foo(self, y): method foo_rank_zero (line 52) | def foo_rank_zero(self, x, y): method foo_one_to_all (line 56) | def foo_one_to_all(self, x, y): method foo_all_to_all (line 60) | def foo_all_to_all(self, x, y): method foo_custom (line 64) | def foo_custom(self, x, y): function remote_call_wg (line 69) | def remote_call_wg(worker_names): function add_one (line 83) | def add_one(data): function test_basics (line 90) | def test_basics(): FILE: tests/ray/test_worker_group_torch.py class TestAllGatherActor (line 29) | class TestAllGatherActor(Worker): method __init__ (line 31) | def __init__(self, size) -> None: method init (line 35) | def init(self): method all_gather (line 40) | def all_gather(self): class TestAllGatherActorV2 (line 50) | class TestAllGatherActorV2(Worker): method __init__ (line 52) | def __init__(self, size) -> None: method all_gather (line 60) | def all_gather(self): function test_all_gather_torch (line 69) | def test_all_gather_torch(): function test_all_gather_torch_v2 (line 93) | def test_all_gather_torch_v2(): FILE: tests/rollout/run_fsdp_vllm.py function main (line 27) | def main(): FILE: tests/rollout/test_vllm_hf_loader.py function levenshtein (line 30) | def levenshtein(s1, s2): function are_lists_similar (line 51) | def are_lists_similar(a, b): function test_vllm_with_hf (line 72) | def test_vllm_with_hf(): FILE: tests/sanity/test_import.py function test_import (line 16) | def test_import(): function test_single_controller_import (line 21) | def test_single_controller_import(): FILE: tests/utility/test_tensor_dict_utilities.py function test_union_tensor_dict (line 26) | def test_union_tensor_dict(): function test_tensor_dict_constructor (line 52) | def test_tensor_dict_constructor(): function test_tensor_dict_make_iterator (line 66) | def test_tensor_dict_make_iterator(): function test_reorder (line 95) | def test_reorder(): function test_chunk_concat (line 106) | def test_chunk_concat(): function test_pop (line 130) | def test_pop(): function test_repeat (line 143) | def test_repeat(): function test_dataproto_pad_unpad (line 168) | def test_dataproto_pad_unpad(): function test_dataproto_fold_unfold (line 206) | def test_dataproto_fold_unfold(): function test_torch_save_data_proto (line 229) | def test_torch_save_data_proto(): function test_len (line 245) | def test_len(): function test_seqlen_balancing (line 265) | def test_seqlen_balancing(): FILE: tests/verl/utils/dataset/test_rl_dataset.py function get_gsm8k_data (line 20) | def get_gsm8k_data(): function test_rl_dataset (line 29) | def test_rl_dataset(): FILE: tests/verl/utils/dataset/test_rm_dataset.py function get_rm_data (line 21) | def get_rm_data(): function test_rm_dataset (line 30) | def test_rm_dataset(): FILE: tests/verl/utils/dataset/test_sft_dataset.py function get_gsm8k_data (line 21) | def get_gsm8k_data(): function test_sft_cot_dataset (line 29) | def test_sft_cot_dataset(): function test_sft_dataset (line 46) | def test_sft_dataset(): FILE: verl/models/llama/megatron/checkpoint_utils/llama_loader.py function _megatron_calc_layer_map (line 21) | def _megatron_calc_layer_map(config): function load_state_dict_to_megatron_llama (line 51) | def load_state_dict_to_megatron_llama(state_dict, wrapped_models, config... FILE: verl/models/llama/megatron/checkpoint_utils/llama_saver.py function _megatron_calc_global_rank (line 28) | def _megatron_calc_global_rank(tp_rank: int = 0, dp_rank: int = 0, pp_ra... function _megatron_calc_layer_map (line 45) | def _megatron_calc_layer_map(config): function merge_megatron_ckpt_llama (line 76) | def merge_megatron_ckpt_llama(wrapped_models, config, is_value_model=Fal... FILE: verl/models/llama/megatron/layers/parallel_attention.py class LlamaRotaryEmbedding (line 35) | class LlamaRotaryEmbedding(nn.Module): method __init__ (line 37) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 51) | def _set_cos_sin_cache(self, seq_len, device, dtype): method forward (line 61) | def forward(self, x, seq_len=None): class LlamaLinearScalingRotaryEmbedding (line 72) | class LlamaLinearScalingRotaryEmbedding(LlamaRotaryEmbedding): method __init__ (line 75) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 79) | def _set_cos_sin_cache(self, seq_len, device, dtype): class LlamaDynamicNTKScalingRotaryEmbedding (line 91) | class LlamaDynamicNTKScalingRotaryEmbedding(LlamaRotaryEmbedding): method __init__ (line 94) | def __init__(self, dim, max_position_embeddings=2048, base=10000, devi... method _set_cos_sin_cache (line 98) | def _set_cos_sin_cache(self, seq_len, device, dtype): function rotate_half (line 116) | def rotate_half(x): function apply_rotary_pos_emb (line 123) | def apply_rotary_pos_emb(q, k, cos, sin, position_ids): function repeat_kv (line 131) | def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: class ParallelLlamaAttention (line 143) | class ParallelLlamaAttention(nn.Module): method __init__ (line 146) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method _init_rope (line 204) | def _init_rope(self): method _shape (line 231) | def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int): method forward (line 234) | def forward( function apply_rotary_pos_emb_rmpad (line 299) | def apply_rotary_pos_emb_rmpad(q, k, cos, sin, position_ids, indices, se... function apply_rotary_pos_emb_rmpad_flash (line 320) | def apply_rotary_pos_emb_rmpad_flash(q, k, cos, sin, cu_seqlens, max_seq... class ParallelLlamaAttentionRmPad (line 338) | class ParallelLlamaAttentionRmPad(ParallelLlamaAttention): method forward (line 340) | def forward(self, FILE: verl/models/llama/megatron/layers/parallel_decoder.py class ParallelLlamaDecoderLayer (line 33) | class ParallelLlamaDecoderLayer(nn.Module): method __init__ (line 35) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method forward (line 44) | def forward( class ParallelLlamaDecoderLayerRmPad (line 99) | class ParallelLlamaDecoderLayerRmPad(nn.Module): method __init__ (line 101) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method forward (line 112) | def forward( FILE: verl/models/llama/megatron/layers/parallel_linear.py class QKVParallelLinear (line 21) | class QKVParallelLinear(tensor_parallel.ColumnParallelLinear): method __init__ (line 23) | def __init__(self, class MergedColumnParallelLinear (line 52) | class MergedColumnParallelLinear(tensor_parallel.ColumnParallelLinear): method __init__ (line 54) | def __init__(self, FILE: verl/models/llama/megatron/layers/parallel_mlp.py class ParallelLlamaMLP (line 31) | class ParallelLlamaMLP(nn.Module): method __init__ (line 33) | def __init__(self, config, megatron_config: ModelParallelConfig = None... method forward (line 71) | def forward(self, x): FILE: verl/models/llama/megatron/layers/parallel_rmsnorm.py class ParallelLlamaRMSNorm (line 25) | class ParallelLlamaRMSNorm(nn.Module): method __init__ (line 27) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method forward (line 41) | def forward(self, hidden_states): FILE: verl/models/llama/megatron/modeling_llama_megatron.py function _make_causal_mask (line 45) | def _make_causal_mask(input_ids_shape: torch.Size, dtype: torch.dtype, d... function _expand_mask (line 58) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... class ParallelLlamaModel (line 72) | class ParallelLlamaModel(nn.Module): method __init__ (line 80) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method _prepare_decoder_attention_mask (line 97) | def _prepare_decoder_attention_mask(self, attention_mask, input_shape,... method forward (line 117) | def forward( class ParallelLlamaForCausalLM (line 155) | class ParallelLlamaForCausalLM(nn.Module): method __init__ (line 157) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method forward (line 174) | def forward( class ParallelLlamaModelRmPad (line 215) | class ParallelLlamaModelRmPad(nn.Module): method __init__ (line 223) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method forward (line 240) | def forward(self, class ParallelLlamaForCausalLMRmPad (line 279) | class ParallelLlamaForCausalLMRmPad(nn.Module): method __init__ (line 281) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method _init_head (line 289) | def _init_head(self): method _forward_head (line 301) | def _forward_head(self, hidden_states): method forward (line 308) | def forward( class ParallelLlamaForValueRmPad (line 366) | class ParallelLlamaForValueRmPad(ParallelLlamaForCausalLMRmPad): method _init_head (line 368) | def _init_head(self): method _forward_head (line 377) | def _forward_head(self, hidden_states): method forward (line 384) | def forward( class ParallelLlamaModelRmPadPP (line 400) | class ParallelLlamaModelRmPadPP(nn.Module): method __init__ (line 410) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method set_input_tensor (line 457) | def set_input_tensor(self, input_tensor): method forward (line 467) | def forward(self, class ParallelLlamaForCausalLMRmPadPP (line 514) | class ParallelLlamaForCausalLMRmPadPP(nn.Module): method __init__ (line 516) | def __init__(self, config: LlamaConfig, megatron_config: ModelParallel... method set_input_tensor (line 531) | def set_input_tensor(self, input_tensor): method _init_head (line 542) | def _init_head(self): method _forward_head (line 554) | def _forward_head(self, hidden_states): method forward (line 562) | def forward( class ParallelLlamaForValueRmPadPP (line 626) | class ParallelLlamaForValueRmPadPP(ParallelLlamaForCausalLMRmPadPP): method _init_head (line 628) | def _init_head(self): method _forward_head (line 637) | def _forward_head(self, hidden_states): method forward (line 644) | def forward( FILE: verl/models/registry.py function check_model_support_rmpad (line 27) | def check_model_support_rmpad(model_type: str): class ModelRegistry (line 46) | class ModelRegistry: method load_model_cls (line 49) | def load_model_cls(model_arch: str, value=False) -> Optional[Type[nn.M... method get_supported_archs (line 65) | def get_supported_archs() -> List[str]: FILE: verl/models/transformers/llama.py function llama_flash_attn_forward (line 27) | def llama_flash_attn_forward( FILE: verl/models/transformers/monkey_patch.py function apply_monkey_patch_to_llama (line 22) | def apply_monkey_patch_to_llama(): function apply_monkey_patch_to_qwen2 (line 28) | def apply_monkey_patch_to_qwen2(): function apply_monkey_patch (line 42) | def apply_monkey_patch(config: PretrainedConfig, verbose=True): function is_transformers_version_in_range (line 66) | def is_transformers_version_in_range(min_version: str, max_version: str)... FILE: verl/models/transformers/qwen2.py function qwen2_flash_attn_forward (line 28) | def qwen2_flash_attn_forward( FILE: verl/models/weight_loader_registry.py function get_weight_loader (line 16) | def get_weight_loader(arch: str): FILE: verl/protocol.py function pad_dataproto_to_divisor (line 40) | def pad_dataproto_to_divisor(data: 'DataProto', size_divisor: int): function unpad_dataproto (line 60) | def unpad_dataproto(data: 'DataProto', pad_size): function union_tensor_dict (line 66) | def union_tensor_dict(tensor_dict1: TensorDict, tensor_dict2: TensorDict... function union_numpy_dict (line 80) | def union_numpy_dict(tensor_dict1: dict[np.ndarray], tensor_dict2: dict[... function list_of_dict_to_dict_of_list (line 92) | def list_of_dict_to_dict_of_list(list_of_dict: list[dict]): function fold_batch_dim (line 104) | def fold_batch_dim(data: 'DataProto', new_batch_size): function unfold_batch_dim (line 124) | def unfold_batch_dim(data: 'DataProto', batch_dims=2): function collate_fn (line 143) | def collate_fn(x: list['DataProtoItem']): class DataProtoItem (line 157) | class DataProtoItem: class DataProto (line 165) | class DataProto: method __post_init__ (line 176) | def __post_init__(self): method __len__ (line 180) | def __len__(self): method __getitem__ (line 189) | def __getitem__(self, item): method __getstate__ (line 194) | def __getstate__(self): method __setstate__ (line 204) | def __setstate__(self, data): method save_to_disk (line 215) | def save_to_disk(self, filepath): method load_from_disk (line 220) | def load_from_disk(filepath) -> 'DataProto': method print_size (line 225) | def print_size(self, prefix=""): method check_consistency (line 242) | def check_consistency(self): method from_single_dict (line 266) | def from_single_dict(cls, data: Dict[str, Union[torch.Tensor, np.ndarr... method from_dict (line 281) | def from_dict(cls, tensors: Dict[str, torch.Tensor], non_tensors=None,... method to (line 316) | def to(self, device) -> 'DataProto': method select (line 330) | def select(self, batch_keys=None, non_tensor_batch_keys=None, meta_inf... method pop (line 365) | def pop(self, batch_keys=None, non_tensor_batch_keys=None, meta_info_k... method rename (line 397) | def rename(self, old_keys=None, new_keys=None) -> 'DataProto': method union (line 423) | def union(self, other: 'DataProto') -> 'DataProto': method make_iterator (line 441) | def make_iterator(self, mini_batch_size, epochs, seed=None, dataloader... method chunk (line 482) | def chunk(self, chunks: int) -> List['DataProto']: method concat (line 515) | def concat(data: List['DataProto']) -> 'DataProto': method reorder (line 539) | def reorder(self, indices): method repeat (line 547) | def repeat(self, repeat_times=2, interleave=True): class DataProtoFuture (line 596) | class DataProtoFuture: method concat (line 613) | def concat(data: List[ray.ObjectRef]) -> 'DataProtoFuture': method chunk (line 617) | def chunk(self, chunks: int) -> List['DataProtoFuture']: method get (line 632) | def get(self): FILE: verl/single_controller/base/decorator.py class Dispatch (line 25) | class Dispatch(Enum): class Execute (line 40) | class Execute(Enum): function _split_args_kwargs_data_proto (line 45) | def _split_args_kwargs_data_proto(chunks, *args, **kwargs): function dispatch_one_to_all (line 60) | def dispatch_one_to_all(worker_group, *args, **kwargs): function dispatch_all_to_all (line 66) | def dispatch_all_to_all(worker_group, *args, **kwargs): function collect_all_to_all (line 70) | def collect_all_to_all(worker_group, output): function dispatch_megatron_compute (line 74) | def dispatch_megatron_compute(worker_group, *args, **kwargs): function collect_megatron_compute (line 103) | def collect_megatron_compute(worker_group, output): function dispatch_megatron_compute_data_proto (line 118) | def dispatch_megatron_compute_data_proto(worker_group, *args, **kwargs): function _concat_data_proto_or_future (line 129) | def _concat_data_proto_or_future(output: List): function collect_megatron_compute_data_proto (line 147) | def collect_megatron_compute_data_proto(worker_group, output): function dispatch_megatron_pp_as_dp (line 161) | def dispatch_megatron_pp_as_dp(worker_group, *args, **kwargs): function collect_megatron_pp_as_dp (line 209) | def collect_megatron_pp_as_dp(worker_group, output): function collect_megatron_pp_only (line 223) | def collect_megatron_pp_only(worker_group, output): function dispatch_megatron_pp_as_dp_data_proto (line 237) | def dispatch_megatron_pp_as_dp_data_proto(worker_group, *args, **kwargs): function collect_megatron_pp_as_dp_data_proto (line 246) | def collect_megatron_pp_as_dp_data_proto(worker_group, output): function dispatch_dp_compute (line 255) | def dispatch_dp_compute(worker_group, *args, **kwargs): function collect_dp_compute (line 265) | def collect_dp_compute(worker_group, output): function dispatch_dp_compute_data_proto (line 272) | def dispatch_dp_compute_data_proto(worker_group, *args, **kwargs): function dispatch_dp_compute_data_proto_with_func (line 279) | def dispatch_dp_compute_data_proto_with_func(worker_group, *args, **kwar... function collect_dp_compute_data_proto (line 289) | def collect_dp_compute_data_proto(worker_group, output): function get_predefined_dispatch_fn (line 300) | def get_predefined_dispatch_fn(dispatch_mode): function get_predefined_execute_fn (line 350) | def get_predefined_execute_fn(execute_mode): function _check_dispatch_mode (line 366) | def _check_dispatch_mode(dispatch_mode): function _check_execute_mode (line 375) | def _check_execute_mode(execute_mode): function _materialize_futures (line 379) | def _materialize_futures(*args, **kwargs): function register (line 394) | def register(dispatch_mode=Dispatch.ALL_TO_ALL, execute_mode=Execute.ALL... FILE: verl/single_controller/base/megatron/worker.py class MegatronWorker (line 20) | class MegatronWorker(Worker): method __init__ (line 22) | def __init__(self, cuda_visible_devices=None) -> None: method get_megatron_global_info (line 25) | def get_megatron_global_info(self): method get_megatron_rank_info (line 33) | def get_megatron_rank_info(self): FILE: verl/single_controller/base/megatron/worker_group.py class MegatronWorkerGroup (line 21) | class MegatronWorkerGroup(WorkerGroup): method __init__ (line 23) | def __init__(self, resource_pool: ResourcePool, **kwargs): method init_megatron (line 28) | def init_megatron(self, default_megatron_kwargs: Dict = None): method get_megatron_rank_info (line 31) | def get_megatron_rank_info(self, rank: int) -> DistRankInfo: method tp_size (line 36) | def tp_size(self): method dp_size (line 41) | def dp_size(self): method pp_size (line 46) | def pp_size(self): method get_megatron_global_info (line 50) | def get_megatron_global_info(self): FILE: verl/single_controller/base/register_center/ray.py class WorkerGroupRegisterCenter (line 19) | class WorkerGroupRegisterCenter: method __init__ (line 21) | def __init__(self, rank_zero_info): method get_rank_zero_info (line 24) | def get_rank_zero_info(self): function create_worker_group_register_center (line 28) | def create_worker_group_register_center(name, info): FILE: verl/single_controller/base/worker.py class DistRankInfo (line 24) | class DistRankInfo: class DistGlobalInfo (line 31) | class DistGlobalInfo: class WorkerHelper (line 37) | class WorkerHelper: method _get_node_ip (line 39) | def _get_node_ip(self): method _get_free_port (line 58) | def _get_free_port(self): method get_availale_master_addr_port (line 63) | def get_availale_master_addr_port(self): method _get_pid (line 66) | def _get_pid(self): class WorkerMeta (line 70) | class WorkerMeta: method __init__ (line 75) | def __init__(self, store) -> None: method to_dict (line 78) | def to_dict(self): class Worker (line 83) | class Worker(WorkerHelper): method __new__ (line 85) | def __new__(cls, *args, **kwargs): method _configure_before_init (line 102) | def _configure_before_init(self, register_center_name: str, rank: int): method __init__ (line 119) | def __init__(self, cuda_visible_devices=None) -> None: method _configure_with_meta (line 147) | def _configure_with_meta(self, meta: WorkerMeta): method get_master_addr_port (line 162) | def get_master_addr_port(self): method get_cuda_visible_devices (line 165) | def get_cuda_visible_devices(self): method world_size (line 171) | def world_size(self): method rank (line 175) | def rank(self): method execute_with_func_generator (line 179) | def execute_with_func_generator(self, func, *args, **kwargs): method execute_func_rank_zero (line 184) | def execute_func_rank_zero(self, func, *args, **kwargs): FILE: verl/single_controller/base/worker_group.py class ResourcePool (line 26) | class ResourcePool: method __init__ (line 28) | def __init__(self, process_on_nodes=None, max_collocate_count: int = 1... method add_node (line 35) | def add_node(self, process_count): method world_size (line 39) | def world_size(self): method __call__ (line 42) | def __call__(self) -> Any: method store (line 46) | def store(self): method local_world_size_list (line 49) | def local_world_size_list(self) -> List[int]: method local_rank_list (line 55) | def local_rank_list(self) -> List[int]: class ClassWithInitArgs (line 60) | class ClassWithInitArgs: method __init__ (line 66) | def __init__(self, cls, *args, **kwargs) -> None: method __call__ (line 77) | def __call__(self) -> Any: function check_workers_alive (line 81) | def check_workers_alive(workers: List, is_alive: Callable, gap_time: flo... class WorkerGroup (line 91) | class WorkerGroup: method __init__ (line 93) | def __init__(self, resource_pool: ResourcePool, **kwargs) -> None: method _is_worker_alive (line 110) | def _is_worker_alive(self, worker): method _block_until_all_workers_alive (line 113) | def _block_until_all_workers_alive(self) -> None: method start_worker_aliveness_check (line 121) | def start_worker_aliveness_check(self, every_n_seconds=1) -> None: method world_size (line 130) | def world_size(self): method _bind_worker_method (line 136) | def _bind_worker_method(self, user_defined_cls, func_generator): FILE: verl/single_controller/ray/base.py function get_random_string (line 29) | def get_random_string(length: int) -> str: function func_generator (line 36) | def func_generator(self, method_name, dispatch_fn, collect_fn, execute_f... class RayResourcePool (line 49) | class RayResourcePool(ResourcePool): method __init__ (line 51) | def __init__(self, method get_placement_groups (line 64) | def get_placement_groups(self, strategy="STRICT_PACK", name=None): function extract_pg_from_exist (line 91) | def extract_pg_from_exist(resource_pools: Dict[str, RayResourcePool], sr... function merge_resource_pool (line 114) | def merge_resource_pool(rp1: RayResourcePool, rp2: RayResourcePool) -> R... class RayClassWithInitArgs (line 128) | class RayClassWithInitArgs(ClassWithInitArgs): method __init__ (line 130) | def __init__(self, cls, *args, **kwargs) -> None: method set_additional_resource (line 136) | def set_additional_resource(self, additional_resource): method update_options (line 139) | def update_options(self, options: Dict): method __call__ (line 142) | def __call__(self, class RayWorkerGroup (line 176) | class RayWorkerGroup(WorkerGroup): method __init__ (line 178) | def __init__(self, method _is_worker_alive (line 205) | def _is_worker_alive(self, worker: ray.actor.ActorHandle): method _init_with_detached_workers (line 209) | def _init_with_detached_workers(self, worker_names): method _init_with_resource_pool (line 214) | def _init_with_resource_pool(self, resource_pool, ray_cls_with_init, b... method worker_names (line 281) | def worker_names(self): method from_detached (line 285) | def from_detached(cls, worker_names=None, ray_cls_with_init=None): method spawn (line 292) | def spawn(self, prefix_set): method execute_rank_zero_sync (line 319) | def execute_rank_zero_sync(self, method_name: str, *args, **kwargs): method execute_rank_zero_async (line 322) | def execute_rank_zero_async(self, method_name: str, *args, **kwargs): method execute_rank_zero (line 326) | def execute_rank_zero(self, method_name: str, *args, **kwargs): method execute_all (line 329) | def execute_all(self, method_name: str, *args, **kwargs): method execute_all_sync (line 332) | def execute_all_sync(self, method_name: str, *args, **kwargs): method execute_all_async (line 335) | def execute_all_async(self, method_name: str, *args, **kwargs): method master_address (line 354) | def master_address(self): method master_port (line 358) | def master_port(self): method workers (line 362) | def workers(self): method world_size (line 366) | def world_size(self): function _bind_workers_method_to_parent (line 380) | def _bind_workers_method_to_parent(cls, key, user_defined_cls): function _unwrap_ray_remote (line 414) | def _unwrap_ray_remote(cls): function create_colocated_worker_cls (line 420) | def create_colocated_worker_cls(class_dict: dict[str, RayClassWithInitAr... FILE: verl/single_controller/ray/megatron.py class NVMegatronRayWorkerGroup (line 25) | class NVMegatronRayWorkerGroup(RayWorkerGroup, MegatronWorkerGroup): method __init__ (line 31) | def __init__(self, resource_pool: RayResourcePool, ray_cls_with_init: ... class MegatronRayWorkerGroup (line 38) | class MegatronRayWorkerGroup(RayWorkerGroup, MegatronWorkerGroup): method __init__ (line 44) | def __init__(self, method init_megatron (line 58) | def init_megatron(self, default_megatron_kwargs: Optional[Dict] = None): FILE: verl/third_party/vllm/__init__.py function get_version (line 18) | def get_version(pkg): FILE: verl/third_party/vllm/vllm_v_0_3_1/arg_utils.py class EngineArgs (line 27) | class EngineArgs: method add_cli_args (line 61) | def add_cli_args(parser: argparse.ArgumentParser) -> argparse.Argument... method from_cli_args (line 178) | def from_cli_args(cls, args: argparse.Namespace) -> 'EngineArgs': method create_engine_configs (line 185) | def create_engine_configs( class AsyncEngineArgs (line 208) | class AsyncEngineArgs(EngineArgs): method add_cli_args (line 215) | def add_cli_args(parser: argparse.ArgumentParser) -> argparse.Argument... FILE: verl/third_party/vllm/vllm_v_0_3_1/config.py class ModelConfig (line 31) | class ModelConfig: method __init__ (line 75) | def __init__( method _verify_load_format (line 109) | def _verify_load_format(self) -> None: method _verify_quantization (line 124) | def _verify_quantization(self) -> None: method _verify_cuda_graph (line 153) | def _verify_cuda_graph(self) -> None: method verify_with_parallel_config (line 163) | def verify_with_parallel_config( method get_sliding_window (line 181) | def get_sliding_window(self) -> Optional[int]: method get_vocab_size (line 184) | def get_vocab_size(self) -> int: method get_hidden_size (line 187) | def get_hidden_size(self) -> int: method get_head_size (line 190) | def get_head_size(self) -> int: method get_total_num_kv_heads (line 194) | def get_total_num_kv_heads(self) -> int: method get_num_kv_heads (line 226) | def get_num_kv_heads(self, parallel_config: "ParallelConfig") -> int: method get_num_layers (line 235) | def get_num_layers(self, parallel_config: "ParallelConfig") -> int: class CacheConfig (line 240) | class CacheConfig: method __init__ (line 251) | def __init__( method _verify_args (line 271) | def _verify_args(self) -> None: method _verify_cache_dtype (line 276) | def _verify_cache_dtype(self) -> None: method verify_with_parallel_config (line 294) | def verify_with_parallel_config( class ParallelConfig (line 313) | class ParallelConfig: method __init__ (line 329) | def __init__( method _verify_args (line 348) | def _verify_args(self) -> None: class SchedulerConfig (line 370) | class SchedulerConfig: method __init__ (line 383) | def __init__( method _verify_args (line 401) | def _verify_args(self) -> None: class DeviceConfig (line 415) | class DeviceConfig: method __init__ (line 417) | def __init__(self, device: str = "cuda") -> None: class LoRAConfig (line 422) | class LoRAConfig: method __post_init__ (line 431) | def __post_init__(self): method verify_with_model_config (line 449) | def verify_with_model_config(self, model_config: ModelConfig): method verify_with_scheduler_config (line 457) | def verify_with_scheduler_config(self, scheduler_config: SchedulerConf... function _get_and_verify_dtype (line 475) | def _get_and_verify_dtype( function _get_and_verify_max_len (line 525) | def _get_and_verify_max_len( FILE: verl/third_party/vllm/vllm_v_0_3_1/llm.py class LLM (line 33) | class LLM: method __init__ (line 87) | def __init__( method init_cache_engine (line 133) | def init_cache_engine(self): method free_cache_engine (line 136) | def free_cache_engine(self): method get_tokenizer (line 139) | def get_tokenizer(self) -> Union[PreTrainedTokenizer, PreTrainedTokeni... method set_tokenizer (line 142) | def set_tokenizer( method generate (line 148) | def generate( method _add_request (line 201) | def _add_request( method _run_engine (line 217) | def _run_engine(self, use_tqdm: bool) -> List[RequestOutput]: method _pre_process_inputs (line 242) | def _pre_process_inputs(self, prompt_token_ids: torch.Tensor) -> List[... method _post_process_outputs (line 250) | def _post_process_outputs(self, outputs: List[RequestOutput]) -> Tuple... method sync_model_weights (line 271) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor]) -... method offload_model_weights (line 274) | def offload_model_weights(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_3_1/llm_engine_sp.py class LLMEngine (line 41) | class LLMEngine: method __init__ (line 70) | def __init__( method _init_tokenizer (line 138) | def _init_tokenizer(self, tokenizer, **tokenizer_init_kwargs): method get_tokenizer_for_seq (line 146) | def get_tokenizer_for_seq(self, sequence: Sequence): method _init_workers_sp (line 149) | def _init_workers_sp(self, model, distributed_init_method: str): method _verify_args (line 172) | def _verify_args(self) -> None: method _init_cache_sp (line 176) | def _init_cache_sp(self) -> None: method init_cache_engine (line 215) | def init_cache_engine(self): method free_cache_engine (line 218) | def free_cache_engine(self): method from_engine_args (line 222) | def from_engine_args(cls, model, tokenizer, engine_args: EngineArgs) -... method add_request (line 238) | def add_request( method abort_request (line 317) | def abort_request(self, request_id: Union[str, Iterable[str]]) -> None: method get_model_config (line 336) | def get_model_config(self) -> ModelConfig: method get_num_unfinished_requests (line 340) | def get_num_unfinished_requests(self) -> int: method has_unfinished_requests (line 344) | def has_unfinished_requests(self) -> bool: method _check_beam_search_early_stopping (line 348) | def _check_beam_search_early_stopping( method _process_sequence_group_outputs (line 385) | def _process_sequence_group_outputs(self, seq_group: SequenceGroup, ou... method _process_model_outputs (line 545) | def _process_model_outputs(self, output: SamplerOutput, scheduler_outp... method step (line 574) | def step(self) -> List[RequestOutput]: method do_log_stats (line 595) | def do_log_stats(self) -> None: method _get_stats (line 600) | def _get_stats(self, scheduler_outputs: Optional[SchedulerOutputs]) ->... method _decode_sequence (line 662) | def _decode_sequence(self, seq: Sequence, prms: SamplingParams) -> None: method _check_stop (line 681) | def _check_stop(self, seq: Sequence, sampling_params: SamplingParams) ... method _finalize_sequence (line 710) | def _finalize_sequence(self, seq: Sequence, sampling_params: SamplingP... method add_lora (line 716) | def add_lora(self, lora_request: LoRARequest) -> bool: method remove_lora (line 720) | def remove_lora(self, lora_id: int) -> bool: method list_loras (line 724) | def list_loras(self) -> List[int]: method sync_model_weights (line 727) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor]) -... method offload_model_weights (line 730) | def offload_model_weights(self) -> None: function initialize_cluster (line 734) | def initialize_cluster( function get_open_port (line 762) | def get_open_port(): FILE: verl/third_party/vllm/vllm_v_0_3_1/model_loader.py function _set_default_torch_dtype (line 38) | def _set_default_torch_dtype(dtype: torch.dtype): function _get_model_architecture (line 46) | def _get_model_architecture(config: PretrainedConfig) -> Type[nn.Module]: function vocab_init (line 87) | def vocab_init(self, function _get_model_weight_loader (line 123) | def _get_model_weight_loader(arch: str): function get_model (line 130) | def get_model(actor_model: Union[PreTrainedModel, Dict], function load_weights (line 181) | def load_weights(actor_weights: Dict, vllm_model: nn.Module): function _get_logits (line 193) | def _get_logits(self, hidden_states: torch.Tensor, embedding: torch.Tensor, function forward (line 206) | def forward( FILE: verl/third_party/vllm/vllm_v_0_3_1/model_runner.py class ModelRunner (line 46) | class ModelRunner(ModelRunner): method __init__ (line 48) | def __init__( method load_model (line 90) | def load_model(self) -> None: method _prepare_sample (line 109) | def _prepare_sample( method prepare_input_tensors (line 174) | def prepare_input_tensors( method execute_model (line 203) | def execute_model( method profile_run (line 235) | def profile_run(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_3_1/parallel_state.py function initialize_model_parallel_from_megatron (line 26) | def initialize_model_parallel_from_megatron( function get_tensor_model_parallel_group (line 108) | def get_tensor_model_parallel_group(): function get_tensor_model_parallel_world_size (line 114) | def get_tensor_model_parallel_world_size(): function get_tensor_model_parallel_rank (line 119) | def get_tensor_model_parallel_rank(): function get_tensor_model_parallel_src_rank (line 124) | def get_tensor_model_parallel_src_rank(): function get_micro_data_parallel_group (line 137) | def get_micro_data_parallel_group(): function get_micro_data_parallel_world_size (line 142) | def get_micro_data_parallel_world_size(): function get_micro_data_parallel_rank (line 146) | def get_micro_data_parallel_rank(): FILE: verl/third_party/vllm/vllm_v_0_3_1/tokenizer.py class TokenizerGroup (line 25) | class TokenizerGroup: method __init__ (line 28) | def __init__(self, tokenizer: PreTrainedTokenizer, enable_lora: bool, ... method encode (line 38) | def encode(self, method encode_async (line 45) | async def encode_async(self, method get_lora_tokenizer (line 52) | def get_lora_tokenizer(self, lora_request: Optional[LoRARequest]) -> "... method pad_token_id (line 67) | def pad_token_id(self): method eos_token_id (line 71) | def eos_token_id(self): FILE: verl/third_party/vllm/vllm_v_0_3_1/weight_loaders.py function parallel_weight_loader (line 22) | def parallel_weight_loader(self, param: torch.Tensor, loaded_weight: tor... function default_weight_loader (line 32) | def default_weight_loader(param: torch.Tensor, loaded_weight: torch.Tens... function gpt2_weight_loader (line 40) | def gpt2_weight_loader(actor_weights: Dict, vllm_model: nn.Module) -> nn... function llama_weight_loader (line 68) | def llama_weight_loader(actor_weights: Dict, vllm_model: nn.Module) -> n... function mistral_weight_loader (line 83) | def mistral_weight_loader(actor_weights: Dict, vllm_model: nn.Module) ->... FILE: verl/third_party/vllm/vllm_v_0_3_1/worker.py class Worker (line 39) | class Worker: method __init__ (line 47) | def __init__( method init_model (line 89) | def init_model(self, cupy_port: Optional[int] = None): method load_model (line 117) | def load_model(self): method profile_num_available_blocks (line 121) | def profile_num_available_blocks( method init_cache_engine (line 168) | def init_cache_engine(self, cache_config: CacheConfig) -> None: method free_cache_engine (line 176) | def free_cache_engine(self): method warm_up_model (line 181) | def warm_up_model(self) -> None: method cache_swap (line 188) | def cache_swap( method execute_model (line 215) | def execute_model( method sync_model_weights (line 247) | def sync_model_weights(self, actor_weights: Dict): method offload_model_weights (line 250) | def offload_model_weights(self) -> None: method add_lora (line 260) | def add_lora(self, lora_request: LoRARequest) -> bool: method remove_lora (line 263) | def remove_lora(self, lora_id: int) -> bool: method list_loras (line 266) | def list_loras(self) -> Set[int]: function _init_distributed_environment (line 270) | def _init_distributed_environment( function _pad_to_alignment (line 298) | def _pad_to_alignment(x: List[int], multiple_of: int, pad: int) -> List[... function _pad_to_max (line 302) | def _pad_to_max(x: List[int], max_len: int, pad: int) -> List[int]: function _check_if_gpu_supports_dtype (line 306) | def _check_if_gpu_supports_dtype(torch_dtype: torch.dtype): FILE: verl/third_party/vllm/vllm_v_0_4_2/arg_utils.py function nullable_str (line 33) | def nullable_str(val: str): class EngineArgs (line 40) | class EngineArgs: method add_cli_args (line 106) | def add_cli_args(parser: argparse.ArgumentParser) -> argparse.Argument... method from_cli_args (line 223) | def from_cli_args(cls, args: argparse.Namespace) -> 'EngineArgs': method create_engine_config (line 230) | def create_engine_config( FILE: verl/third_party/vllm/vllm_v_0_4_2/config.py class ModelConfig (line 37) | class ModelConfig(ModelConfig): method __init__ (line 98) | def __init__( class LoadFormat (line 147) | class LoadFormat(str, enum.Enum): class LoadConfig (line 158) | class LoadConfig: method __post_init__ (line 180) | def __post_init__(self): method _verify_load_format (line 186) | def _verify_load_format(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_4_2/dtensor_weight_loaders.py function gemma_dtensor_weight_loader (line 26) | def gemma_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function gptbigcode_dtensor_load_weights (line 74) | def gptbigcode_dtensor_load_weights(actor_weights: Dict, vllm_model: nn.... function starcoder2_dtensor_load_weights (line 89) | def starcoder2_dtensor_load_weights(actor_weights: Dict, vllm_model: nn.... function llama_dtensor_weight_loader (line 120) | def llama_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function qwen2_dtensor_weight_loader (line 164) | def qwen2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function gpt2_dtensor_weight_loader (line 201) | def gpt2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modul... function redistribute_dtensor (line 205) | def redistribute_dtensor(param_name: str, loaded_weights: DTensor, paral... function _process_parameter_names (line 218) | def _process_parameter_names(name): function load_dtensor_weights (line 252) | def load_dtensor_weights(actor_weights: Dict, vllm_model: nn.Module): function _get_model_weight_loader (line 260) | def _get_model_weight_loader(arch: str): function update_dtensor_weight_loader (line 268) | def update_dtensor_weight_loader(): FILE: verl/third_party/vllm/vllm_v_0_4_2/hf_weight_loader.py function update_hf_weight_loader (line 25) | def update_hf_weight_loader(): function gemma_load_weights (line 30) | def gemma_load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]): function load_hf_weights (line 79) | def load_hf_weights(actor_weights: Dict, vllm_model: nn.Module): FILE: verl/third_party/vllm/vllm_v_0_4_2/llm.py class LLM (line 35) | class LLM: method __init__ (line 89) | def __init__( method init_cache_engine (line 137) | def init_cache_engine(self): method free_cache_engine (line 140) | def free_cache_engine(self): method get_tokenizer (line 143) | def get_tokenizer(self) -> Union[PreTrainedTokenizer, PreTrainedTokeni... method set_tokenizer (line 146) | def set_tokenizer( method generate (line 152) | def generate( method _add_request (line 232) | def _add_request( method _run_engine (line 248) | def _run_engine(self, use_tqdm: bool) -> List[RequestOutput]: method _pre_process_inputs (line 273) | def _pre_process_inputs(self, prompt_token_ids: torch.Tensor) -> List[... method _post_process_outputs (line 281) | def _post_process_outputs(self, request_outputs: List[RequestOutput]) ... method sync_model_weights (line 302) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... method offload_model_weights (line 305) | def offload_model_weights(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_4_2/llm_engine_sp.py class LLMEngine (line 43) | class LLMEngine(LLMEngine): method __init__ (line 74) | def __init__( method _init_tokenizer (line 229) | def _init_tokenizer(self, tokenizer, **tokenizer_init_kwargs): method init_cache_engine (line 236) | def init_cache_engine(self): method free_cache_engine (line 241) | def free_cache_engine(self): method from_engine_args (line 247) | def from_engine_args( method sync_model_weights (line 279) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... method offload_model_weights (line 282) | def offload_model_weights(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_4_2/megatron_weight_loaders.py function parallel_weight_loader (line 27) | def parallel_weight_loader(self, param: torch.Tensor, loaded_weight: tor... function default_weight_loader (line 37) | def default_weight_loader(param: torch.Tensor, loaded_weight: torch.Tens... function gpt2_weight_loader (line 45) | def gpt2_weight_loader(actor_weights: Dict, vllm_model: nn.Module) -> nn... function llama_megatron_weight_loader (line 73) | def llama_megatron_weight_loader(actor_weights: Dict, vllm_model: nn.Mod... function llama_megatron_core_te_weight_loader (line 85) | def llama_megatron_core_te_weight_loader(actor_weights: Dict, vllm_model... function llama_megatron_core_weight_loader (line 116) | def llama_megatron_core_weight_loader(actor_weights: Dict, vllm_model: n... function _replace_name (line 146) | def _replace_name(megatron_name, name_mapping): function llama_megatron_core_te_weight_loader (line 169) | def llama_megatron_core_te_weight_loader(actor_weights: Dict, vllm_model... function llama_megatron_core_weight_loader (line 200) | def llama_megatron_core_weight_loader(actor_weights: Dict, vllm_model: n... function _replace_name (line 230) | def _replace_name(megatron_name, name_mapping): function mistral_megatron_weight_loader (line 253) | def mistral_megatron_weight_loader(actor_weights: Dict, vllm_model: nn.M... function load_megatron_weights (line 290) | def load_megatron_weights(actor_weights: Dict, vllm_model: nn.Module): function _get_model_weight_loader (line 298) | def _get_model_weight_loader(arch: str): function update_megatron_weight_loader (line 305) | def update_megatron_weight_loader(): function vocab_init (line 316) | def vocab_init(self, FILE: verl/third_party/vllm/vllm_v_0_4_2/model_loader.py function get_model (line 34) | def get_model(actor_model: Union[PreTrainedModel, Dict], model_config: M... function get_model_loader (line 55) | def get_model_loader(load_config: LoadConfig) -> BaseModelLoader: class DummyModelLoader (line 94) | class DummyModelLoader(BaseModelLoader): method __init__ (line 97) | def __init__(self, load_config: LoadConfig): method load_model (line 103) | def load_model(self, *, model_config: ModelConfig, device_config: Devi... class MegatronLoader (line 115) | class MegatronLoader(BaseModelLoader): method __init__ (line 118) | def __init__(self, load_config: LoadConfig): method _get_weights_iterator (line 124) | def _get_weights_iterator(actor_model: Union[PreTrainedModel, Dict]): method load_model (line 133) | def load_model(self, actor_model: Union[PreTrainedModel, class HFLoader (line 161) | class HFLoader(BaseModelLoader): method __init__ (line 164) | def __init__(self, load_config: LoadConfig): method _get_weights_iterator (line 170) | def _get_weights_iterator(self, actor_model: Union[PreTrainedModel, Di... method load_model (line 178) | def load_model(self, actor_model: Union[PreTrainedModel, class DTensorLoader (line 200) | class DTensorLoader(BaseModelLoader): method __init__ (line 203) | def __init__(self, load_config: LoadConfig): method _get_weights_iterator (line 209) | def _get_weights_iterator(actor_model: Union[PreTrainedModel, Dict]): method load_model (line 218) | def load_model(self, actor_model: Union[PreTrainedModel, function _get_logits (line 250) | def _get_logits(self, hidden_states: torch.Tensor, embedding: torch.Tensor, FILE: verl/third_party/vllm/vllm_v_0_4_2/model_runner.py class BatchType (line 39) | class BatchType(IntEnum): class ModelRunner (line 48) | class ModelRunner(ModelRunner): method __init__ (line 50) | def __init__( method load_model (line 105) | def load_model(self) -> None: method prepare_input_tensors (line 147) | def prepare_input_tensors( method execute_model (line 238) | def execute_model( FILE: verl/third_party/vllm/vllm_v_0_4_2/parallel_state.py function initialize_parallel_state (line 35) | def initialize_parallel_state( function ensure_model_parallel_initialized (line 66) | def ensure_model_parallel_initialized( function model_parallel_is_initialized (line 92) | def model_parallel_is_initialized(): function initialize_model_parallel_for_vllm (line 98) | def initialize_model_parallel_for_vllm(tensor_model_parallel_size: int, function initialize_model_parallel (line 172) | def initialize_model_parallel( function get_device_mesh (line 263) | def get_device_mesh(): function get_tensor_model_parallel_group (line 273) | def get_tensor_model_parallel_group(): function get_tensor_model_parallel_world_size (line 279) | def get_tensor_model_parallel_world_size(): function get_tensor_model_parallel_rank (line 284) | def get_tensor_model_parallel_rank(): function get_tensor_model_parallel_src_rank (line 289) | def get_tensor_model_parallel_src_rank(): FILE: verl/third_party/vllm/vllm_v_0_4_2/spmd_gpu_executor.py class SPMDGPUExecutor (line 33) | class SPMDGPUExecutor(ExecutorBase): method __init__ (line 36) | def __init__( method _init_executor (line 63) | def _init_executor(self, model, distributed_init_method) -> None: method _init_workers_sp (line 69) | def _init_workers_sp(self, model, distributed_init_method: str): method determine_num_available_blocks (line 97) | def determine_num_available_blocks(self) -> Tuple[int, int]: method initialize_cache (line 117) | def initialize_cache(self, num_gpu_blocks: int, num_cpu_blocks: int) -... method init_cache_engine (line 140) | def init_cache_engine(self) -> None: method free_cache_engine (line 143) | def free_cache_engine(self) -> None: method execute_model (line 146) | def execute_model(self, execute_model_req) -> List[SamplerOutput]: method add_lora (line 154) | def add_lora(self, lora_request: LoRARequest) -> bool: method remove_lora (line 158) | def remove_lora(self, lora_id: int) -> bool: method list_loras (line 162) | def list_loras(self) -> Set[int]: method check_health (line 165) | def check_health(self) -> None: method offload_model_weights (line 171) | def offload_model_weights(self) -> None: method sync_model_weights (line 174) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... function initialize_cluster (line 178) | def initialize_cluster( function get_open_port (line 202) | def get_open_port(): class SPMDGPUExecutorAsync (line 209) | class SPMDGPUExecutorAsync(SPMDGPUExecutor, ExecutorAsyncBase): method execute_model_async (line 211) | async def execute_model_async(self, execute_model_req: ExecuteModelReq... method check_health_async (line 215) | async def check_health_async(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_4_2/tokenizer.py class TokenizerGroup (line 25) | class TokenizerGroup: method __init__ (line 28) | def __init__(self, tokenizer: PreTrainedTokenizer, enable_lora: bool, ... method ping (line 35) | def ping(self) -> bool: method get_max_input_len (line 39) | def get_max_input_len(self, lora_request: Optional[LoRARequest] = None... method encode (line 43) | def encode(self, method encode_async (line 50) | async def encode_async(self, method get_lora_tokenizer (line 57) | def get_lora_tokenizer(self, lora_request: Optional[LoRARequest]) -> "... method pad_token_id (line 72) | def pad_token_id(self): method eos_token_id (line 76) | def eos_token_id(self): FILE: verl/third_party/vllm/vllm_v_0_4_2/worker.py class Worker (line 42) | class Worker(Worker): method __init__ (line 50) | def __init__( method init_device (line 105) | def init_device(self) -> None: method determine_num_available_blocks (line 142) | def determine_num_available_blocks(self) -> Tuple[int, int]: method _init_cache_engine (line 199) | def _init_cache_engine(self): method free_cache_engine (line 203) | def free_cache_engine(self): method execute_model (line 209) | def execute_model(self, execute_model_req: Optional[ExecuteModelReques... method sync_model_weights (line 237) | def sync_model_weights(self, actor_weights: Dict, load_format: str): method offload_model_weights (line 246) | def offload_model_weights(self) -> None: function init_worker_distributed_environment (line 257) | def init_worker_distributed_environment( FILE: verl/third_party/vllm/vllm_v_0_5_4/arg_utils.py function nullable_str (line 43) | def nullable_str(val: str): class EngineArgs (line 50) | class EngineArgs: method add_cli_args (line 140) | def add_cli_args(parser: argparse.ArgumentParser) -> argparse.Argument... method from_cli_args (line 257) | def from_cli_args(cls, args: argparse.Namespace) -> 'EngineArgs': method create_engine_config (line 264) | def create_engine_config( FILE: verl/third_party/vllm/vllm_v_0_5_4/config.py class ModelConfig (line 38) | class ModelConfig(ModelConfig): method __init__ (line 99) | def __init__( class LoadFormat (line 181) | class LoadFormat(str, enum.Enum): class LoadConfig (line 193) | class LoadConfig: method __post_init__ (line 221) | def __post_init__(self): method _verify_load_format (line 232) | def _verify_load_format(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_5_4/dtensor_weight_loaders.py function gemma_dtensor_weight_loader (line 27) | def gemma_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function gptbigcode_dtensor_load_weights (line 64) | def gptbigcode_dtensor_load_weights(actor_weights: Dict, vllm_model: nn.... function starcoder2_dtensor_load_weights (line 79) | def starcoder2_dtensor_load_weights(actor_weights: Dict, vllm_model: nn.... function llama_dtensor_weight_loader (line 110) | def llama_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function qwen2_dtensor_weight_loader (line 154) | def qwen2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function deepseekv2_dtensor_weight_loader (line 194) | def deepseekv2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn... function gpt2_dtensor_weight_loader (line 270) | def gpt2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modul... function redistribute_dtensor (line 274) | def redistribute_dtensor(param_name: str, loaded_weights: DTensor, paral... function _process_parameter_names (line 287) | def _process_parameter_names(name): function load_dtensor_weights (line 323) | def load_dtensor_weights(actor_weights: Dict, vllm_model: nn.Module): function _get_model_weight_loader (line 331) | def _get_model_weight_loader(arch: str): function update_dtensor_weight_loader (line 339) | def update_dtensor_weight_loader(): FILE: verl/third_party/vllm/vllm_v_0_5_4/hf_weight_loader.py function update_hf_weight_loader (line 25) | def update_hf_weight_loader(): function load_hf_weights (line 30) | def load_hf_weights(actor_weights: Dict, vllm_model: nn.Module): FILE: verl/third_party/vllm/vllm_v_0_5_4/llm.py class LLM (line 43) | class LLM(LLM): method __init__ (line 97) | def __init__( method init_cache_engine (line 151) | def init_cache_engine(self): method free_cache_engine (line 154) | def free_cache_engine(self): method get_tokenizer (line 157) | def get_tokenizer(self) -> Union[PreTrainedTokenizer, PreTrainedTokeni... method set_tokenizer (line 160) | def set_tokenizer( method _run_engine (line 166) | def _run_engine(self, *, use_tqdm: bool) -> List[Union[RequestOutput, ... method _post_process_outputs (line 214) | def _post_process_outputs(self, request_outputs: List[RequestOutput]) ... method sync_model_weights (line 235) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... method offload_model_weights (line 238) | def offload_model_weights(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_5_4/llm_engine_sp.py class LLMEngine (line 46) | class LLMEngine(LLMEngine): method __init__ (line 77) | def __init__( method _init_tokenizer (line 263) | def _init_tokenizer(self, tokenizer, **tokenizer_init_kwargs): method init_cache_engine (line 270) | def init_cache_engine(self): method free_cache_engine (line 275) | def free_cache_engine(self): method _get_executor_cls (line 281) | def _get_executor_cls(cls, engine_config: EngineConfig) -> Type[Execut... method from_engine_args (line 293) | def from_engine_args( method sync_model_weights (line 324) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... method offload_model_weights (line 327) | def offload_model_weights(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_5_4/megatron_weight_loaders.py function parallel_weight_loader (line 27) | def parallel_weight_loader(self, param: torch.Tensor, loaded_weight: tor... function default_weight_loader (line 37) | def default_weight_loader(param: torch.Tensor, loaded_weight: torch.Tens... function gpt2_weight_loader (line 45) | def gpt2_weight_loader(actor_weights: Dict, vllm_model: nn.Module) -> nn... function llama_megatron_weight_loader (line 73) | def llama_megatron_weight_loader(actor_weights: Dict, vllm_model: nn.Mod... function llama_megatron_core_te_weight_loader (line 85) | def llama_megatron_core_te_weight_loader(actor_weights: Dict, vllm_model... function llama_megatron_core_weight_loader (line 116) | def llama_megatron_core_weight_loader(actor_weights: Dict, vllm_model: n... function _replace_name (line 146) | def _replace_name(megatron_name, name_mapping): function llama_megatron_core_te_weight_loader (line 169) | def llama_megatron_core_te_weight_loader(actor_weights: Dict, vllm_model... function llama_megatron_core_weight_loader (line 200) | def llama_megatron_core_weight_loader(actor_weights: Dict, vllm_model: n... function _replace_name (line 230) | def _replace_name(megatron_name, name_mapping): function mistral_megatron_weight_loader (line 253) | def mistral_megatron_weight_loader(actor_weights: Dict, vllm_model: nn.M... function load_megatron_weights (line 290) | def load_megatron_weights(actor_weights: Dict, vllm_model: nn.Module): function _get_model_weight_loader (line 298) | def _get_model_weight_loader(arch: str): function update_megatron_weight_loader (line 305) | def update_megatron_weight_loader(): FILE: verl/third_party/vllm/vllm_v_0_5_4/model_loader.py function get_model (line 35) | def get_model(actor_model: Union[PreTrainedModel, Dict], function get_model_loader (line 64) | def get_model_loader(load_config: LoadConfig) -> BaseModelLoader: class DummyModelLoader (line 103) | class DummyModelLoader(BaseModelLoader): method __init__ (line 106) | def __init__(self, load_config: LoadConfig): method load_model (line 112) | def load_model(self, *, model_config: ModelConfig, device_config: Devi... class MegatronLoader (line 125) | class MegatronLoader(BaseModelLoader): method __init__ (line 128) | def __init__(self, load_config: LoadConfig): method _get_weights_iterator (line 134) | def _get_weights_iterator(actor_model: Union[PreTrainedModel, Dict]): method load_model (line 143) | def load_model(self, actor_model: Union[PreTrainedModel, Dict], model_... class HFLoader (line 172) | class HFLoader(BaseModelLoader): method __init__ (line 175) | def __init__(self, load_config: LoadConfig): method _get_weights_iterator (line 181) | def _get_weights_iterator(self, actor_model: Union[PreTrainedModel, Di... method load_model (line 189) | def load_model(self, actor_model: Union[PreTrainedModel, Dict], model_... class DTensorLoader (line 212) | class DTensorLoader(BaseModelLoader): method __init__ (line 215) | def __init__(self, load_config: LoadConfig): method _get_weights_iterator (line 221) | def _get_weights_iterator(actor_model: Union[PreTrainedModel, Dict]): method load_model (line 230) | def load_model(self, actor_model: Union[PreTrainedModel, Dict], model_... function _get_logits (line 263) | def _get_logits(self, hidden_states: torch.Tensor, embedding: torch.Tensor, function logitsprocessor_init (line 279) | def logitsprocessor_init(self, FILE: verl/third_party/vllm/vllm_v_0_5_4/model_runner.py class BatchType (line 43) | class BatchType(IntEnum): class ModelRunner (line 52) | class ModelRunner(ModelRunner): method __init__ (line 54) | def __init__( method load_model (line 89) | def load_model(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_5_4/parallel_state.py function initialize_parallel_state (line 37) | def initialize_parallel_state( function ensure_model_parallel_initialized (line 68) | def ensure_model_parallel_initialized( function model_parallel_is_initialized (line 95) | def model_parallel_is_initialized(): function initialize_model_parallel_for_vllm (line 101) | def initialize_model_parallel_for_vllm(tensor_model_parallel_size: int, function initialize_model_parallel (line 191) | def initialize_model_parallel( function get_device_mesh (line 272) | def get_device_mesh(): function get_tensor_model_parallel_group (line 282) | def get_tensor_model_parallel_group(): function get_tensor_model_parallel_world_size (line 288) | def get_tensor_model_parallel_world_size(): function get_tensor_model_parallel_rank (line 293) | def get_tensor_model_parallel_rank(): function get_tensor_model_parallel_src_rank (line 298) | def get_tensor_model_parallel_src_rank(): FILE: verl/third_party/vllm/vllm_v_0_5_4/spmd_gpu_executor.py class SPMDGPUExecutor (line 34) | class SPMDGPUExecutor(ExecutorBase): method __init__ (line 37) | def __init__( method _init_executor (line 66) | def _init_executor(self, model, distributed_init_method) -> None: method _init_workers_sp (line 72) | def _init_workers_sp(self, model, distributed_init_method: str): method determine_num_available_blocks (line 107) | def determine_num_available_blocks(self) -> Tuple[int, int]: method initialize_cache (line 127) | def initialize_cache(self, num_gpu_blocks: int, num_cpu_blocks: int) -... method init_cache_engine (line 150) | def init_cache_engine(self) -> None: method free_cache_engine (line 153) | def free_cache_engine(self) -> None: method execute_model (line 156) | def execute_model(self, execute_model_req) -> List[SamplerOutput]: method add_lora (line 164) | def add_lora(self, lora_request: LoRARequest) -> bool: method remove_lora (line 168) | def remove_lora(self, lora_id: int) -> bool: method list_loras (line 172) | def list_loras(self) -> Set[int]: method check_health (line 175) | def check_health(self) -> None: method add_prompt_adapter (line 183) | def add_prompt_adapter(self, prompt_adapter_request: PromptAdapterRequ... method list_prompt_adapters (line 188) | def list_prompt_adapters(self) -> Set[int]: method pin_lora (line 191) | def pin_lora(self, lora_id: int) -> bool: method pin_prompt_adapter (line 195) | def pin_prompt_adapter(self, prompt_adapter_id: int) -> bool: method remove_prompt_adapter (line 200) | def remove_prompt_adapter(self, prompt_adapter_id: int) -> bool: method offload_model_weights (line 206) | def offload_model_weights(self) -> None: method sync_model_weights (line 209) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... function initialize_cluster (line 213) | def initialize_cluster( function get_open_port (line 237) | def get_open_port(): class SPMDGPUExecutorAsync (line 244) | class SPMDGPUExecutorAsync(SPMDGPUExecutor, ExecutorAsyncBase): method execute_model_async (line 246) | async def execute_model_async(self, execute_model_req: ExecuteModelReq... method check_health_async (line 250) | async def check_health_async(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_5_4/tokenizer.py class TokenizerGroup (line 25) | class TokenizerGroup: method __init__ (line 28) | def __init__(self, tokenizer: PreTrainedTokenizer, enable_lora: bool, ... method ping (line 35) | def ping(self) -> bool: method get_max_input_len (line 39) | def get_max_input_len(self, lora_request: Optional[LoRARequest] = None... method encode (line 43) | def encode(self, method encode_async (line 50) | async def encode_async(self, method get_lora_tokenizer (line 57) | def get_lora_tokenizer(self, lora_request: Optional[LoRARequest]) -> "... method pad_token_id (line 72) | def pad_token_id(self): method eos_token_id (line 76) | def eos_token_id(self): FILE: verl/third_party/vllm/vllm_v_0_5_4/worker.py class Worker (line 44) | class Worker(Worker): method __init__ (line 52) | def __init__( method init_device (line 134) | def init_device(self) -> None: method determine_num_available_blocks (line 171) | def determine_num_available_blocks(self) -> Tuple[int, int]: method _init_cache_engine (line 229) | def _init_cache_engine(self): method free_cache_engine (line 233) | def free_cache_engine(self): method execute_model (line 239) | def execute_model(self, method sync_model_weights (line 266) | def sync_model_weights(self, actor_weights: Dict, load_format: str): method offload_model_weights (line 275) | def offload_model_weights(self) -> None: function init_worker_distributed_environment (line 286) | def init_worker_distributed_environment( FILE: verl/third_party/vllm/vllm_v_0_6_3/arg_utils.py class EngineArgs (line 27) | class EngineArgs(EngineArgs): method __post_init__ (line 30) | def __post_init__(self): method create_model_config (line 33) | def create_model_config(self) -> ModelConfig: method create_load_config (line 62) | def create_load_config(self) -> LoadConfig: method create_engine_config (line 70) | def create_engine_config(self) -> EngineConfig: FILE: verl/third_party/vllm/vllm_v_0_6_3/config.py class LoadFormat (line 34) | class LoadFormat(str, enum.Enum): class ModelConfig (line 44) | class ModelConfig(ModelConfig): method __init__ (line 46) | def __init__(self, hf_config: PretrainedConfig, *args, **kwargs) -> None: class LoadConfig (line 52) | class LoadConfig: method __post_init__ (line 80) | def __post_init__(self): method _verify_load_format (line 91) | def _verify_load_format(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_6_3/dtensor_weight_loaders.py function gemma_dtensor_weight_loader (line 24) | def gemma_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function gptbigcode_dtensor_load_weights (line 61) | def gptbigcode_dtensor_load_weights(actor_weights: Dict, vllm_model: nn.... function starcoder2_dtensor_load_weights (line 76) | def starcoder2_dtensor_load_weights(actor_weights: Dict, vllm_model: nn.... function llama_dtensor_weight_loader (line 107) | def llama_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function qwen2_dtensor_weight_loader (line 151) | def qwen2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modu... function qwen2vl_dtensor_weight_loader (line 188) | def qwen2vl_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Mo... function deepseekv2_dtensor_weight_loader (line 228) | def deepseekv2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn... function gpt2_dtensor_weight_loader (line 308) | def gpt2_dtensor_weight_loader(actor_weights: Dict, vllm_model: nn.Modul... function redistribute_dtensor (line 312) | def redistribute_dtensor(param_name: str, loaded_weights: DTensor, paral... function _process_parameter_names (line 326) | def _process_parameter_names(name): function load_dtensor_weights (line 363) | def load_dtensor_weights(actor_weights: Dict, vllm_model: nn.Module): function _get_model_weight_loader (line 371) | def _get_model_weight_loader(arch: str): function update_dtensor_weight_loader (line 379) | def update_dtensor_weight_loader(): FILE: verl/third_party/vllm/vllm_v_0_6_3/hf_weight_loader.py function update_hf_weight_loader (line 22) | def update_hf_weight_loader(): function load_hf_weights (line 27) | def load_hf_weights(actor_weights: Dict, vllm_model: nn.Module): FILE: verl/third_party/vllm/vllm_v_0_6_3/llm.py class LLM (line 31) | class LLM(LLM): method __init__ (line 85) | def __init__( method init_cache_engine (line 145) | def init_cache_engine(self): method free_cache_engine (line 148) | def free_cache_engine(self): method get_tokenizer (line 151) | def get_tokenizer(self) -> Union[PreTrainedTokenizer, PreTrainedTokeni... method set_tokenizer (line 154) | def set_tokenizer( method _run_engine (line 160) | def _run_engine(self, *, use_tqdm: bool) -> List[Union[RequestOutput, ... method _post_process_outputs (line 174) | def _post_process_outputs(self, request_outputs: List[RequestOutput]) ... method sync_model_weights (line 196) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... method offload_model_weights (line 199) | def offload_model_weights(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_6_3/llm_engine_sp.py class LLMEngine (line 61) | class LLMEngine(LLMEngine): method __init__ (line 95) | def __init__( method _init_tokenizer (line 337) | def _init_tokenizer(self, tokenizer, **tokenizer_init_kwargs): method init_cache_engine (line 344) | def init_cache_engine(self): method free_cache_engine (line 349) | def free_cache_engine(self): method _get_executor_cls (line 355) | def _get_executor_cls(cls, engine_config: EngineConfig) -> Type[Execut... method from_engine_args (line 372) | def from_engine_args( method sync_model_weights (line 404) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... method offload_model_weights (line 407) | def offload_model_weights(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_6_3/megatron_weight_loaders.py function parallel_weight_loader (line 26) | def parallel_weight_loader(self, param: torch.Tensor, loaded_weight: tor... function default_weight_loader (line 37) | def default_weight_loader(param: torch.Tensor, loaded_weight: torch.Tens... function gpt2_weight_loader (line 46) | def gpt2_weight_loader(actor_weights: Dict, vllm_model: nn.Module) -> nn... function llama_megatron_weight_loader (line 74) | def llama_megatron_weight_loader(actor_weights: Dict, vllm_model: nn.Mod... function llama_megatron_core_te_weight_loader (line 86) | def llama_megatron_core_te_weight_loader(actor_weights: Dict, vllm_model... function llama_megatron_core_weight_loader (line 117) | def llama_megatron_core_weight_loader(actor_weights: Dict, vllm_model: n... function _replace_name (line 147) | def _replace_name(megatron_name, name_mapping): function llama_megatron_core_te_weight_loader (line 170) | def llama_megatron_core_te_weight_loader(actor_weights: Dict, vllm_model... function llama_megatron_core_weight_loader (line 201) | def llama_megatron_core_weight_loader(actor_weights: Dict, vllm_model: n... function _replace_name (line 231) | def _replace_name(megatron_name, name_mapping): function mistral_megatron_weight_loader (line 254) | def mistral_megatron_weight_loader(actor_weights: Dict, vllm_model: nn.M... function load_megatron_weights (line 291) | def load_megatron_weights(actor_weights: Dict, vllm_model: nn.Module): function _get_model_weight_loader (line 299) | def _get_model_weight_loader(arch: str): function update_megatron_weight_loader (line 306) | def update_megatron_weight_loader(): FILE: verl/third_party/vllm/vllm_v_0_6_3/model_loader.py function get_model (line 33) | def get_model( function get_model_loader (line 65) | def get_model_loader(load_config: LoadConfig) -> BaseModelLoader: class DummyModelLoader (line 104) | class DummyModelLoader(BaseModelLoader): method __init__ (line 107) | def __init__(self, load_config: LoadConfig): method download_model (line 113) | def download_model(self, model_config: ModelConfig) -> None: method load_model (line 116) | def load_model( class MegatronLoader (line 135) | class MegatronLoader(BaseModelLoader): method __init__ (line 138) | def __init__(self, load_config: LoadConfig): method download_model (line 144) | def download_model(self, model_config: ModelConfig) -> None: method _get_weights_iterator (line 147) | def _get_weights_iterator(actor_model: Union[PreTrainedModel, Dict]): method load_model (line 156) | def load_model( class HFLoader (line 190) | class HFLoader(BaseModelLoader): method __init__ (line 193) | def __init__(self, load_config: LoadConfig): method download_model (line 199) | def download_model(self, model_config: ModelConfig) -> None: method _get_weights_iterator (line 202) | def _get_weights_iterator(self, actor_model: Union[PreTrainedModel, Di... method load_model (line 210) | def load_model( class DTensorLoader (line 238) | class DTensorLoader(BaseModelLoader): method __init__ (line 241) | def __init__(self, load_config: LoadConfig): method download_model (line 247) | def download_model(self, model_config: ModelConfig) -> None: method _get_weights_iterator (line 250) | def _get_weights_iterator(actor_model: Union[PreTrainedModel, Dict]): method load_model (line 259) | def load_model( function _get_logits (line 297) | def _get_logits(self, hidden_states: torch.Tensor, embedding: torch.Tensor, function logitsprocessor_init (line 313) | def logitsprocessor_init( FILE: verl/third_party/vllm/vllm_v_0_6_3/model_runner.py class BatchType (line 51) | class BatchType(IntEnum): class ModelRunner (line 60) | class ModelRunner(ModelRunner): method __init__ (line 62) | def __init__( method load_model (line 101) | def load_model(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_6_3/parallel_state.py function initialize_parallel_state (line 38) | def initialize_parallel_state( function ensure_model_parallel_initialized (line 71) | def ensure_model_parallel_initialized( function model_parallel_is_initialized (line 98) | def model_parallel_is_initialized(): function initialize_model_parallel_for_vllm (line 104) | def initialize_model_parallel_for_vllm( function initialize_model_parallel (line 199) | def initialize_model_parallel( function get_device_mesh (line 281) | def get_device_mesh(): function get_tensor_model_parallel_group (line 291) | def get_tensor_model_parallel_group(): function get_tensor_model_parallel_world_size (line 297) | def get_tensor_model_parallel_world_size(): function get_tensor_model_parallel_rank (line 302) | def get_tensor_model_parallel_rank(): function get_tensor_model_parallel_src_rank (line 307) | def get_tensor_model_parallel_src_rank(): FILE: verl/third_party/vllm/vllm_v_0_6_3/spmd_gpu_executor.py class SPMDGPUExecutor (line 42) | class SPMDGPUExecutor(ExecutorBase): method __init__ (line 45) | def __init__( method _init_executor (line 74) | def _init_executor(self, model, distributed_init_method) -> None: method _init_workers_sp (line 80) | def _init_workers_sp(self, model, distributed_init_method: str): method determine_num_available_blocks (line 114) | def determine_num_available_blocks(self) -> Tuple[int, int]: method initialize_cache (line 134) | def initialize_cache(self, num_gpu_blocks: int, num_cpu_blocks: int) -... method init_cache_engine (line 156) | def init_cache_engine(self) -> None: method free_cache_engine (line 159) | def free_cache_engine(self) -> None: method execute_model (line 162) | def execute_model(self, execute_model_req) -> List[SamplerOutput]: method add_lora (line 170) | def add_lora(self, lora_request: LoRARequest) -> bool: method remove_lora (line 174) | def remove_lora(self, lora_id: int) -> bool: method list_loras (line 178) | def list_loras(self) -> Set[int]: method check_health (line 181) | def check_health(self) -> None: method add_prompt_adapter (line 189) | def add_prompt_adapter(self, prompt_adapter_request: PromptAdapterRequ... method list_prompt_adapters (line 193) | def list_prompt_adapters(self) -> Set[int]: method pin_lora (line 196) | def pin_lora(self, lora_id: int) -> bool: method pin_prompt_adapter (line 200) | def pin_prompt_adapter(self, prompt_adapter_id: int) -> bool: method remove_prompt_adapter (line 204) | def remove_prompt_adapter(self, prompt_adapter_id: int) -> bool: method offload_model_weights (line 209) | def offload_model_weights(self) -> None: method sync_model_weights (line 212) | def sync_model_weights(self, actor_weights: Dict[str, torch.Tensor], l... function initialize_cluster (line 216) | def initialize_cluster( function get_open_port (line 240) | def get_open_port(): class SPMDGPUExecutorAsync (line 247) | class SPMDGPUExecutorAsync(SPMDGPUExecutor, ExecutorAsyncBase): method execute_model_async (line 249) | async def execute_model_async(self, execute_model_req: ExecuteModelReq... method check_health_async (line 253) | async def check_health_async(self) -> None: FILE: verl/third_party/vllm/vllm_v_0_6_3/tokenizer.py class TokenizerGroup (line 23) | class TokenizerGroup(TokenizerGroup): method __init__ (line 26) | def __init__(self, tokenizer: PreTrainedTokenizer, enable_lora: bool, ... method pad_token_id (line 35) | def pad_token_id(self): method eos_token_id (line 39) | def eos_token_id(self): FILE: verl/third_party/vllm/vllm_v_0_6_3/worker.py class Worker (line 53) | class Worker(Worker): method __init__ (line 61) | def __init__( method init_device (line 140) | def init_device(self) -> None: method determine_num_available_blocks (line 177) | def determine_num_available_blocks(self) -> Tuple[int, int]: method _init_cache_engine (line 235) | def _init_cache_engine(self): method free_cache_engine (line 239) | def free_cache_engine(self): method execute_model (line 245) | def execute_model(self, method sync_model_weights (line 274) | def sync_model_weights(self, actor_weights: Dict, load_format: str): method offload_model_weights (line 283) | def offload_model_weights(self) -> None: function init_worker_distributed_environment (line 294) | def init_worker_distributed_environment( FILE: verl/trainer/fsdp_sft_trainer.py function extract_step (line 51) | def extract_step(path): class FSDPSFTTrainer (line 58) | class FSDPSFTTrainer(object): method __init__ (line 60) | def __init__(self, config, device_mesh: DeviceMesh): method _normalize_config_bsz (line 81) | def _normalize_config_bsz(self): method _build_dataloader (line 92) | def _build_dataloader(self): method _build_model_optimizer (line 139) | def _build_model_optimizer(self): method _compute_loss (line 218) | def _compute_loss(self, batch): method training_step (line 252) | def training_step(self, batch: TensorDict): method validation_step (line 288) | def validation_step(self, batch: TensorDict): method save_checkpoint (line 295) | def save_checkpoint(self, step): method fit (line 313) | def fit(self): function main (line 360) | def main(config): FILE: verl/trainer/main_eval.py function select_reward_fn (line 27) | def select_reward_fn(data_source): function main (line 35) | def main(config): FILE: verl/trainer/main_generation.py function main (line 40) | def main(config): FILE: verl/trainer/main_ppo.py function _select_rm_score_fn (line 24) | def _select_rm_score_fn(data_source): class RewardManager (line 37) | class RewardManager(): method __init__ (line 41) | def __init__(self, tokenizer, num_examine) -> None: method __call__ (line 45) | def __call__(self, data: DataProto): function main (line 98) | def main(config): function main_task (line 107) | def main_task(config): FILE: verl/trainer/ppo/core_algos.py class AdaptiveKLController (line 28) | class AdaptiveKLController: method __init__ (line 34) | def __init__(self, init_kl_coef, target_kl, horizon): method update (line 39) | def update(self, current_kl, n_steps): class FixedKLController (line 46) | class FixedKLController: method __init__ (line 49) | def __init__(self, kl_coef): method update (line 52) | def update(self, current_kl, n_steps): function get_kl_controller (line 56) | def get_kl_controller(config): function compute_gae_advantage_return (line 70) | def compute_gae_advantage_return(token_level_rewards: torch.Tensor, valu... function compute_grpo_outcome_advantage (line 111) | def compute_grpo_outcome_advantage(token_level_rewards: torch.Tensor, function compute_rewards (line 158) | def compute_rewards(token_level_scores, old_log_prob, ref_log_prob, kl_r... function compute_policy_loss (line 163) | def compute_policy_loss(old_log_prob, log_prob, advantages, eos_mask, cl... function compute_entropy_loss (line 197) | def compute_entropy_loss(logits, eos_mask): function compute_value_loss (line 216) | def compute_value_loss(vpreds, returns, values, eos_mask, cliprange_value): function kl_penalty (line 242) | def kl_penalty(logprob: torch.FloatTensor, ref_logprob: torch.FloatTenso... FILE: verl/trainer/ppo/ray_trainer.py class Role (line 41) | class Role(Enum): class ResourcePoolManager (line 55) | class ResourcePoolManager: method create_resource_pool (line 64) | def create_resource_pool(self): method get_resource_pool (line 75) | def get_resource_pool(self, role: Role) -> RayResourcePool: function apply_kl_penalty (line 84) | def apply_kl_penalty(data: DataProto, kl_ctrl: core_algos.AdaptiveKLCont... function compute_advantage (line 116) | def compute_advantage(data: DataProto, adv_estimator, gamma=1.0, lam=1.0... function reduce_metrics (line 150) | def reduce_metrics(metrics: dict): function _compute_response_info (line 156) | def _compute_response_info(batch): function compute_data_metrics (line 172) | def compute_data_metrics(batch, use_critic=True): function compute_timing_metrics (line 260) | def compute_timing_metrics(batch, timing_raw): function _timer (line 285) | def _timer(name: str, timing_raw: Dict[str, float]): class RayPPOTrainer (line 291) | class RayPPOTrainer(object): method __init__ (line 298) | def __init__(self, method _create_dataloader (line 342) | def _create_dataloader(self): method _validate (line 392) | def _validate(self): method init_workers (line 444) | def init_workers(self): method _save_checkpoint (line 516) | def _save_checkpoint(self): method _balance_batch (line 530) | def _balance_batch(self, batch: DataProto, metrics, logging_prefix='gl... method fit (line 547) | def fit(self): FILE: verl/utils/config.py function update_dict_with_config (line 20) | def update_dict_with_config(dictionary: Dict, config: DictConfig): FILE: verl/utils/dataset/rl_dataset.py function collate_fn (line 31) | def collate_fn(data_list: list[dict]) -> dict: class RLHFDataset (line 58) | class RLHFDataset(Dataset): method __init__ (line 63) | def __init__(self, method _download (line 91) | def _download(self): method _read_files_and_tokenize (line 96) | def _read_files_and_tokenize(self): method __len__ (line 117) | def __len__(self): method __getitem__ (line 120) | def __getitem__(self, item): FILE: verl/utils/dataset/rm_dataset.py function download_files_distributed (line 27) | def download_files_distributed(download_fn): class RMDataset (line 40) | class RMDataset(Dataset): method __init__ (line 42) | def __init__(self, method _download (line 70) | def _download(self): method _read_files_and_tokenize (line 85) | def _read_files_and_tokenize(self): method __len__ (line 96) | def __len__(self): method _pad_to_length (line 99) | def _pad_to_length(self, input_ids, attention_mask): method __getitem__ (line 114) | def __getitem__(self, item): FILE: verl/utils/dataset/sft_dataset.py class SFTDataset (line 34) | class SFTDataset(Dataset): method __init__ (line 39) | def __init__(self, method _download (line 69) | def _download(self): method _read_files_and_tokenize (line 73) | def _read_files_and_tokenize(self): method __len__ (line 107) | def __len__(self): method __getitem__ (line 110) | def __getitem__(self, item): FILE: verl/utils/debug/performance.py function log_gpu_memory_usage (line 20) | def log_gpu_memory_usage(head: str, logger: logging.Logger = None, level... FILE: verl/utils/debug/trajectory_tracker.py function save_to_hdfs (line 33) | def save_to_hdfs(data: io.BytesIO, name, hdfs_dir, verbose): class TrajectoryTracker (line 50) | class TrajectoryTracker(): method __init__ (line 52) | def __init__(self, hdfs_dir, verbose) -> None: method dump (line 59) | def dump(self, data: io.BytesIO, name): method wait_for_hdfs (line 63) | def wait_for_hdfs(self): function dump_data (line 69) | def dump_data(data, name): function get_trajectory_tracker (line 79) | def get_trajectory_tracker(): function process (line 94) | def process(iter): FILE: verl/utils/distributed.py function initialize_global_process_group (line 18) | def initialize_global_process_group(timeout_second=36000): FILE: verl/utils/flops_counter.py function get_device_flops (line 21) | def get_device_flops(unit="T"): class FlopsCounter (line 51) | class FlopsCounter: method __init__ (line 61) | def __init__(self, config: PretrainedConfig): method _estimate_unknown_flops (line 69) | def _estimate_unknown_flops(self, tokens_sum, batch_seqlens, delta_time): method _estimate_qwen2_flops (line 72) | def _estimate_qwen2_flops(self, tokens_sum, batch_seqlens, delta_time): method estimate_flops (line 107) | def estimate_flops(self, batch_seqlens, delta_time): FILE: verl/utils/fs.py function _is_non_local (line 29) | def _is_non_local(path): function md5_encode (line 33) | def md5_encode(path: str) -> str: function get_local_temp_path (line 37) | def get_local_temp_path(hdfs_path: str, cache_dir: str) -> str: function copy_local_path_from_hdfs (line 55) | def copy_local_path_from_hdfs(src: str, cache_dir=None, filelock='.file.... FILE: verl/utils/fsdp_utils.py function init_fn (line 29) | def init_fn(x: torch.nn.Module): function get_init_weight_context_manager (line 36) | def get_init_weight_context_manager(use_meta_tensor=True): function get_fsdp_wrap_policy (line 48) | def get_fsdp_wrap_policy(module, config=None): function offload_fsdp_grad (line 79) | def offload_fsdp_grad(module): function load_fsdp_grad (line 86) | def load_fsdp_grad(module, device_id): function offload_fsdp_param_and_grad (line 93) | def offload_fsdp_param_and_grad(module, offload_grad=False): function load_fsdp_param_and_grad (line 103) | def load_fsdp_param_and_grad(module, device_id, load_grad=False): function offload_fsdp_optimizer (line 113) | def offload_fsdp_optimizer(optimizer): function load_fsdp_optimizer (line 123) | def load_fsdp_optimizer(optimizer, device_id): function meta_device_init (line 134) | def meta_device_init(): function parallel_load_safetensors (line 165) | def parallel_load_safetensors(filepath): function parallel_init_module_fn (line 221) | def parallel_init_module_fn(module: torch.nn.Module, shard_states: Dict[... FILE: verl/utils/hdfs_io.py function exists (line 27) | def exists(path: str, **kwargs) -> bool: function _exists (line 43) | def _exists(file_path: str): function makedirs (line 50) | def makedirs(name, mode=0o777, exist_ok=False, **kwargs) -> None: function _mkdir (line 75) | def _mkdir(file_path: str) -> bool: function copy (line 84) | def copy(src: str, dst: str, **kwargs) -> bool: function _copy (line 113) | def _copy(from_path: str, to_path: str, timeout: int = None) -> bool: function _run_cmd (line 135) | def _run_cmd(cmd: str, timeout=None): function _hdfs_cmd (line 139) | def _hdfs_cmd(cmd: str) -> str: function _is_non_local (line 143) | def _is_non_local(path: str): FILE: verl/utils/import_utils.py function is_megatron_core_available (line 24) | def is_megatron_core_available(): function is_vllm_available (line 33) | def is_vllm_available(): function import_external_libs (line 41) | def import_external_libs(external_libs=None): FILE: verl/utils/logger/aggregate_logger.py function concat_dict_to_str (line 21) | def concat_dict_to_str(dict: Dict, step): class LocalLogger (line 30) | class LocalLogger: method __init__ (line 32) | def __init__(self, remote_logger=None, enable_wandb=False, print_to_co... method flush (line 37) | def flush(self): method log (line 40) | def log(self, data, step): FILE: verl/utils/logging_utils.py function set_basic_config (line 18) | def set_basic_config(level): FILE: verl/utils/megatron/memory.py class MemoryBuffer (line 18) | class MemoryBuffer: method __init__ (line 20) | def __init__(self, numel, numel_padded, dtype): method zero (line 29) | def zero(self): method get (line 33) | def get(self, shape, start_index): FILE: verl/utils/megatron/optimizer.py function get_megatron_optimizer (line 26) | def get_megatron_optimizer( FILE: verl/utils/megatron/optimizer_config.py class OptimizerConfig (line 23) | class OptimizerConfig: FILE: verl/utils/megatron/pipeline_parallel.py function compute_transformers_input_shapes (line 22) | def compute_transformers_input_shapes(batches, meta_info): function make_batch_generator (line 43) | def make_batch_generator(batches, vpp_size): FILE: verl/utils/megatron/sequence_parallel.py function mark_parameter_as_sequence_parallel (line 21) | def mark_parameter_as_sequence_parallel(parameter): function is_sequence_parallel_param (line 25) | def is_sequence_parallel_param(param): function pad_to_sequence_parallel (line 29) | def pad_to_sequence_parallel(unpad_tokens: torch.Tensor): FILE: verl/utils/megatron/tensor_parallel.py function update_kwargs_with_config (line 27) | def update_kwargs_with_config(dictionary: Dict, config: ModelParallelCon... function get_default_kwargs_for_model_parallel_config (line 32) | def get_default_kwargs_for_model_parallel_config(): function get_default_model_parallel_config (line 43) | def get_default_model_parallel_config(): function get_common_default_kwargs_for_parallel_linear (line 47) | def get_common_default_kwargs_for_parallel_linear(): function get_default_kwargs_for_column_parallel_linear (line 58) | def get_default_kwargs_for_column_parallel_linear(): function get_default_kwargs_for_row_parallel_linear (line 72) | def get_default_kwargs_for_row_parallel_linear(): function get_default_kwargs_for_parallel_embedding (line 77) | def get_default_kwargs_for_parallel_embedding(): function is_tensor_parallel_param (line 86) | def is_tensor_parallel_param(param): function get_tensor_parallel_partition_dim (line 90) | def get_tensor_parallel_partition_dim(param): function get_tensor_parallel_partition_stride (line 95) | def get_tensor_parallel_partition_stride(param): class _VocabParallelEntropy (line 100) | class _VocabParallelEntropy(torch.autograd.Function): method forward (line 103) | def forward(ctx, vocab_parallel_logits: torch.Tensor) -> torch.Tensor: method backward (line 118) | def backward(ctx, grad_output: torch.Tensor) -> torch.Tensor: function vocab_parallel_entropy (line 124) | def vocab_parallel_entropy(vocab_parallel_logits: torch.Tensor) -> torch... function vocab_parallel_log_probs_from_logits (line 136) | def vocab_parallel_log_probs_from_logits(logits, labels): function vocab_parallel_log_probs_from_logits_response_rmpad (line 141) | def vocab_parallel_log_probs_from_logits_response_rmpad(input_ids, atten... function vocab_parallel_compute_entropy_loss (line 168) | def vocab_parallel_compute_entropy_loss(logits, eos_mask): FILE: verl/utils/megatron_utils.py function get_model (line 34) | def get_model(model_provider_func, model_type=ModelType.encoder_or_decod... function unwrap_model (line 122) | def unwrap_model(model, module_instances=ALL_MODULE_WRAPPER_CLASSNAMES): function convert_config (line 140) | def convert_config(hf_config: PretrainedConfig, megatron_config) -> Tran... function init_megatron_optim_config (line 185) | def init_megatron_optim_config(optim_config: Dict) -> OptimizerConfig: function init_model_parallel_config (line 201) | def init_model_parallel_config(config: DictConfig) -> ModelParallelConfig: class FakeTimers (line 215) | class FakeTimers: method __init__ (line 218) | def __init__(self): method __call__ (line 222) | def __call__(self, *args: Any, **kwds: Any) -> Any: function offload_megatron_param_and_grad (line 226) | def offload_megatron_param_and_grad(module_list: nn.ModuleList, offload_... function load_megatron_param_and_grad (line 241) | def load_megatron_param_and_grad(module_list: nn.ModuleList, device_id, ... FILE: verl/utils/memory_buffer.py class MemoryBuffer (line 24) | class MemoryBuffer: method __init__ (line 30) | def __init__(self, numel: int, numel_padded: int, dtype: torch.dtype): method zero (line 36) | def zero(self): method get (line 40) | def get(self, shape, start_index): function calc_padded_numel (line 51) | def calc_padded_numel(shape: torch.Size, dtype: torch.dtype): function get_weight_buffer_meta_from_module (line 58) | def get_weight_buffer_meta_from_module(module: nn.Module) -> Dict[str, D... function build_memory_buffer (line 68) | def build_memory_buffer(weight_buffer_meta: Dict[str, Dict]) -> Dict[tor... function build_memory_reference_from_module (line 97) | def build_memory_reference_from_module(module: torch.nn.Module, function build_memory_reference (line 113) | def build_memory_reference(weight_buffer_meta: Dict[str, Dict], memory_b... class MemoryBufferModuleWrapper (line 140) | class MemoryBufferModuleWrapper: method __init__ (line 146) | def __init__(self, module: nn.Module): method get_memory_buffers (line 153) | def get_memory_buffers(self): method get_weight_buffer_meta (line 156) | def get_weight_buffer_meta(self): class MegatronMemoryBufferForRollout (line 160) | class MegatronMemoryBufferForRollout(object): method __init__ (line 175) | def __init__(self, transform_memory_param_fn): method initialize_weight_buffer (line 181) | def initialize_weight_buffer(self, weight_buffer_meta_pp: List[Dict[st... method build_memory_reference (line 199) | def build_memory_reference(self): method named_parameters (line 205) | def named_parameters(self): method weight_buffers (line 209) | def weight_buffers(self): method memory_buffers (line 213) | def memory_buffers(self): FILE: verl/utils/model.py class LambdaLayer (line 28) | class LambdaLayer(nn.Module): method __init__ (line 30) | def __init__(self, fn): method forward (line 34) | def forward(self, *args, **kwargs): function squeeze (line 38) | def squeeze(x): function update_model_config (line 42) | def update_model_config(module_config, override_config_kwargs): function get_huggingface_actor_config (line 47) | def get_huggingface_actor_config(model_name: str, override_config_kwargs... function create_huggingface_actor (line 58) | def create_huggingface_actor(model_name: str, override_config_kwargs=Non... function create_huggingface_critic (line 81) | def create_huggingface_critic(model_name: str, override_config_kwargs=No... function get_model_size (line 102) | def get_model_size(model: nn.Module, scale='auto'): function print_model_size (line 129) | def print_model_size(model: nn.Module, name: str = None): function create_random_mask (line 136) | def create_random_mask(input_ids: torch.Tensor, function compute_position_id_with_mask (line 177) | def compute_position_id_with_mask(mask): function normalize_pp_vpp_params (line 181) | def normalize_pp_vpp_params(params, num_hidden_layers, layer_name='layer... function get_parallel_model_from_config (line 234) | def get_parallel_model_from_config(config, megatron_config, pre_process=... function _get_parallel_model_architecture_from_config (line 243) | def _get_parallel_model_architecture_from_config(config: PretrainedConfi... function load_megatron_model_weights (line 253) | def load_megatron_model_weights(config, function pad_packed_inputs (line 299) | def pad_packed_inputs(unpad_tokens: torch.Tensor, cu_seqlens, max_seqlen... FILE: verl/utils/py_functional.py function union_two_dict (line 22) | def union_two_dict(dict1: Dict, dict2: Dict): function append_to_dict (line 41) | def append_to_dict(data: Dict, new_data: Dict): class NestedNamespace (line 48) | class NestedNamespace(SimpleNamespace): method __init__ (line 50) | def __init__(self, dictionary, **kwargs): FILE: verl/utils/ray_utils.py function parallel_put (line 23) | def parallel_put(data_list, max_workers=None): FILE: verl/utils/rendezvous/ray_backend.py class NCCLIDStore (line 25) | class NCCLIDStore: method __init__ (line 27) | def __init__(self, nccl_id): method get (line 30) | def get(self): function get_nccl_id_store_by_name (line 34) | def get_nccl_id_store_by_name(name): function create_nccl_communicator_in_ray (line 47) | def create_nccl_communicator_in_ray(rank: int, FILE: verl/utils/reward_score/countdown.py function extract_solution (line 7) | def extract_solution(solution_str): function validate_equation (line 28) | def validate_equation(equation_str, available_numbers): function evaluate_equation (line 44) | def evaluate_equation(equation_str): function compute_score (line 59) | def compute_score(solution_str, ground_truth, method='strict', format_sc... FILE: verl/utils/reward_score/gsm8k.py function extract_solution (line 18) | def extract_solution(solution_str, method='strict'): function compute_score (line 44) | def compute_score(solution_str, ground_truth, method='strict', format_sc... FILE: verl/utils/reward_score/math.py function compute_score (line 17) | def compute_score(solution_str, ground_truth) -> float: function is_equiv (line 32) | def is_equiv(str1, str2, verbose=False): function remove_boxed (line 49) | def remove_boxed(s): function last_boxed_only_string (line 63) | def last_boxed_only_string(string): function fix_fracs (line 93) | def fix_fracs(string): function fix_a_slash_b (line 125) | def fix_a_slash_b(string): function remove_right_units (line 140) | def remove_right_units(string): function fix_sqrt (line 150) | def fix_sqrt(string): function strip_string (line 165) | def strip_string(string): FILE: verl/utils/reward_score/multiply.py function extract_solution (line 5) | def extract_solution(solution_str): function compute_score (line 27) | def compute_score(solution_str, ground_truth, method='strict', format_sc... FILE: verl/utils/seqlen_balancing.py function karmarkar_karp (line 25) | def karmarkar_karp(seqlen_list: List[int], k_partitions: int, equal_size... function greedy_partition (line 133) | def greedy_partition(seqlen_list: List[int], k_partitions: int, equal_si... function get_seqlen_balanced_partitions (line 152) | def get_seqlen_balanced_partitions(seqlen_list: List[int], k_partitions:... function log_seqlen_unbalance (line 186) | def log_seqlen_unbalance(seqlen_list: List[int], partitions: List[List[i... function ceildiv (line 220) | def ceildiv(a, b): function rearrange_micro_batches (line 224) | def rearrange_micro_batches(batch: TensorDict, max_token_len, dp_group=N... function get_reverse_idx (line 259) | def get_reverse_idx(idx_map): FILE: verl/utils/tokenizer.py function set_pad_token_id (line 20) | def set_pad_token_id(tokenizer): function hf_tokenizer (line 35) | def hf_tokenizer(name_or_path, correct_pad_token=True, correct_gemma2=Tr... FILE: verl/utils/torch_dtypes.py class PrecisionType (line 27) | class PrecisionType(object): method supported_type (line 43) | def supported_type(precision: Union[str, int]) -> bool: method supported_types (line 47) | def supported_types() -> list[str]: method is_fp16 (line 51) | def is_fp16(precision): method is_fp32 (line 55) | def is_fp32(precision): method is_bf16 (line 59) | def is_bf16(precision): method to_dtype (line 63) | def to_dtype(precision): method to_str (line 74) | def to_str(precision): FILE: verl/utils/torch_functional.py function gather_from_labels (line 34) | def gather_from_labels(data, label): function logprobs_from_logits (line 49) | def logprobs_from_logits(logits, labels): function logprobs_from_logits_flash_attn (line 65) | def logprobs_from_logits_flash_attn(logits, labels): function logprobs_from_logits_naive (line 70) | def logprobs_from_logits_naive(logits, labels): function logprobs_of_labels_v2 (line 76) | def logprobs_of_labels_v2(logits: torch.FloatTensor, labels): function clip_by_value (line 86) | def clip_by_value(x, tensor_min, tensor_max): function entropy_from_logits (line 95) | def entropy_from_logits(logits: torch.Tensor): function masked_sum (line 102) | def masked_sum(values, mask, axis=None): function masked_mean (line 107) | def masked_mean(values, mask, axis=None): function masked_var (line 112) | def masked_var(values, mask, unbiased=True): function masked_whiten (line 130) | def masked_whiten(values, mask, shift_mean=True): function get_eos_mask (line 139) | def get_eos_mask(response_id: torch.Tensor, eos_token: int = 2, dtype=to... function compute_grad_norm (line 151) | def compute_grad_norm(model: nn.Module): function broadcast_dict_tensor (line 160) | def broadcast_dict_tensor(tensors: Union[Dict[str, torch.Tensor], Tensor... function allgather_dict_tensors (line 169) | def allgather_dict_tensors(tensors: Union[Dict[str, torch.Tensor], Tenso... function split_dict_tensor_into_batches (line 203) | def split_dict_tensor_into_batches(tensors: TensorDict, batch_size) -> L... function pad_sequence_to_length (line 209) | def pad_sequence_to_length(tensors, max_seq_len, pad_token_id, left_pad=... function tokenize_and_postprocess_data (line 225) | def tokenize_and_postprocess_data(prompt: str, function remove_pad_token (line 269) | def remove_pad_token(input_ids: torch.Tensor, attention_mask: torch.Tens... function log_probs_from_logits_response (line 284) | def log_probs_from_logits_response(input_ids, logits, response_length): function log_probs_from_logits_response_rmpad (line 300) | def log_probs_from_logits_response_rmpad(input_ids, attention_mask, logi... function log_probs_from_logits_all_rmpad (line 328) | def log_probs_from_logits_all_rmpad(input_ids_rmpad, logits_rmpad, indic... function post_process_logits (line 359) | def post_process_logits(input_ids, logits, temperature, top_k, top_p): function get_cosine_schedule_with_warmup (line 379) | def get_cosine_schedule_with_warmup( function get_constant_schedule_with_warmup (line 422) | def get_constant_schedule_with_warmup( function prepare_decoder_attention_mask (line 434) | def prepare_decoder_attention_mask(attention_mask, input_shape, inputs_e... function _make_causal_mask (line 456) | def _make_causal_mask(input_ids_shape: torch.Size, dtype: torch.dtype, d... function _expand_mask (line 469) | def _expand_mask(mask: torch.Tensor, dtype: torch.dtype, tgt_len: Option... function get_unpad_data (line 483) | def get_unpad_data(attention_mask): FILE: verl/utils/tracking.py class Tracking (line 24) | class Tracking(object): method __init__ (line 27) | def __init__(self, project_name, experiment_name, default_backend: Uni... method log (line 59) | def log(self, data, step, backend=None): class _MlflowLoggingAdapter (line 65) | class _MlflowLoggingAdapter: method log (line 67) | def log(self, data, step): function _compute_mlflow_params_from_objects (line 72) | def _compute_mlflow_params_from_objects(params) -> Dict[str, Any]: function _transform_params_to_json_serializable (line 79) | def _transform_params_to_json_serializable(x, convert_list_to_dict: bool): function _flatten_dict (line 99) | def _flatten_dict(raw: Dict[str, Any], *, sep: str) -> Dict[str, Any]: FILE: verl/utils/ulysses.py function set_ulysses_sequence_parallel_group (line 29) | def set_ulysses_sequence_parallel_group(group: dist.ProcessGroup): function get_ulysses_sequence_parallel_group (line 37) | def get_ulysses_sequence_parallel_group() -> Optional[dist.ProcessGroup]: function get_ulysses_sequence_parallel_world_size (line 45) | def get_ulysses_sequence_parallel_world_size(group: ProcessGroup = None)... function get_ulysses_sequence_parallel_rank (line 53) | def get_ulysses_sequence_parallel_rank(group: ProcessGroup = None) -> int: function gather_seq_scatter_heads (line 61) | def gather_seq_scatter_heads( function gather_heads_scatter_seq (line 85) | def gather_heads_scatter_seq(x: Tensor, head_dim: int, seq_dim: int, gro... function _pad_tensor (line 103) | def _pad_tensor(x: Tensor, dim: int, padding_size: int) -> Tensor: function _unpad_tensor (line 110) | def _unpad_tensor(x: Tensor, dim: int, padding_size: int) -> Tensor: function slice_input_tensor (line 116) | def slice_input_tensor(x: Tensor, dim: int, padding: bool = True, group:... function all_to_all_tensor (line 132) | def all_to_all_tensor( function all_gather_tensor (line 154) | def all_gather_tensor(local_tensor: Tensor, group: Optional[dist.Process... class SeqAllToAll (line 164) | class SeqAllToAll(torch.autograd.Function): method forward (line 167) | def forward( method backward (line 182) | def backward(ctx: Any, *grad_output: Tensor) -> Tuple[None, Tensor, No... class Gather (line 197) | class Gather(torch.autograd.Function): method forward (line 200) | def forward(ctx: Any, method backward (line 226) | def backward(ctx: Any, grad_output: Tensor) -> Any: function gather_outpus_and_unpad (line 233) | def gather_outpus_and_unpad(x: Tensor, function ulysses_pad_and_slice_inputs (line 252) | def ulysses_pad_and_slice_inputs(input_ids_rmpad: torch.Tensor, FILE: verl/workers/actor/base.py class BasePPOActor (line 26) | class BasePPOActor(ABC): method __init__ (line 28) | def __init__(self, config): method compute_log_prob (line 39) | def compute_log_prob(self, data: DataProto) -> torch.Tensor: method update_policy (line 54) | def update_policy(self, data: DataProto) -> Dict: FILE: verl/workers/actor/dp_actor.py class DataParallelPPOActor (line 39) | class DataParallelPPOActor(BasePPOActor): method __init__ (line 41) | def __init__( method _forward_micro_batch (line 58) | def _forward_micro_batch(self, micro_batch, temperature) -> Tuple[torc... method _optimizer_step (line 143) | def _optimizer_step(self): method compute_log_prob (line 153) | def compute_log_prob(self, data: DataProto) -> torch.Tensor: method update_policy (line 203) | def update_policy(self, data: DataProto): FILE: verl/workers/actor/megatron_actor.py class MegatronPPOActor (line 48) | class MegatronPPOActor(BasePPOActor): method __init__ (line 50) | def __init__(self, config, model_config, megatron_config: ModelParalle... method compute_log_prob (line 129) | def compute_log_prob(self, data: DataProto) -> torch.Tensor: method make_minibatch_iterator (line 190) | def make_minibatch_iterator(self, data: DataProto) -> Iterable[DataPro... method forward_backward_batch (line 218) | def forward_backward_batch(self, data: DataProto, forward_only=False, ... method update_policy (line 329) | def update_policy(self, dataloader: Iterable[DataProto]) -> Dict: FILE: verl/workers/critic/base.py class BasePPOCritic (line 26) | class BasePPOCritic(ABC): method __init__ (line 28) | def __init__(self, config): method compute_values (line 33) | def compute_values(self, data: DataProto) -> torch.Tensor: method update_critic (line 38) | def update_critic(self, data: DataProto): FILE: verl/workers/critic/dp_critic.py class DataParallelPPOCritic (line 39) | class DataParallelPPOCritic(BasePPOCritic): method __init__ (line 41) | def __init__(self, config, critic_module: nn.Module, critic_optimizer:... method _forward_micro_batch (line 53) | def _forward_micro_batch(self, micro_batch): method _optimizer_step (line 103) | def _optimizer_step(self): method compute_values (line 113) | def compute_values(self, data: DataProto) -> torch.Tensor: method update_critic (line 146) | def update_critic(self, data: DataProto): FILE: verl/workers/critic/megatron_critic.py class MegatronPPOCritic (line 41) | class MegatronPPOCritic(BasePPOCritic): method __init__ (line 43) | def __init__(self, config, model_config, megatron_config, critic_modul... method compute_values (line 77) | def compute_values(self, data: DataProto) -> DataProto: method make_minibatch_iterator (line 106) | def make_minibatch_iterator(self, data: DataProto) -> Iterable[DataPro... method forward_backward_batch (line 113) | def forward_backward_batch(self, data: DataProto, forward_only=False): method update_critic (line 204) | def update_critic(self, dataloader: Iterable[DataProto]): FILE: verl/workers/fsdp_workers.py class ActorRolloutRefWorker (line 47) | class ActorRolloutRefWorker(Worker): method __init__ (line 53) | def __init__(self, config: DictConfig, role: str): method _build_model_optimizer (line 111) | def _build_model_optimizer(self, method _build_rollout (line 250) | def _build_rollout(self): method init_model (line 285) | def init_model(self): method update_actor (line 356) | def update_actor(self, data: DataProto): method generate_sequences (line 401) | def generate_sequences(self, prompts: DataProto): method compute_ref_log_prob (line 449) | def compute_ref_log_prob(self, data: DataProto): method save_checkpoint (line 478) | def save_checkpoint(self, local_path, hdfs_path=None): class CriticWorker (line 507) | class CriticWorker(Worker): method __init__ (line 509) | def __init__(self, config): method _build_critic_model_optimizer (line 540) | def _build_critic_model_optimizer(self, config): method init_model (line 652) | def init_model(self): method compute_values (line 674) | def compute_values(self, data: DataProto): method update_critic (line 699) | def update_critic(self, data: DataProto): method save_checkpoint (line 736) | def save_checkpoint(self, local_path, hdfs_path=None): class RewardModelWorker (line 765) | class RewardModelWorker(Worker): method __init__ (line 770) | def __init__(self, config): method _build_model (line 793) | def _build_model(self, config): method init_model (line 851) | def init_model(self): method _forward_micro_batch (line 857) | def _forward_micro_batch(self, micro_batch): method _expand_to_token_level (line 911) | def _expand_to_token_level(self, data: DataProto, scores: torch.Tensor): method _switch_chat_template (line 926) | def _switch_chat_template(self, data: DataProto): method compute_rm_score (line 984) | def compute_rm_score(self, data: DataProto): FILE: verl/workers/megatron_workers.py function set_random_seed (line 47) | def set_random_seed(seed): class ActorRolloutRefWorker (line 63) | class ActorRolloutRefWorker(MegatronWorker): method __init__ (line 69) | def __init__(self, config: DictConfig, role: str): method _build_model_optimizer (line 124) | def _build_model_optimizer(self, method _build_rollout (line 216) | def _build_rollout(self): method init_model (line 261) | def init_model(self): method update_actor (line 326) | def update_actor(self, data: DataProto): method generate_sequences (line 345) | def generate_sequences(self, prompts: DataProto): method compute_ref_log_prob (line 376) | def compute_ref_log_prob(self, data: DataProto): method load_checkpoint (line 395) | def load_checkpoint(self, checkpoint_path): method load_pretrained_model (line 399) | def load_pretrained_model(self, checkpoint_path): method save_checkpoint (line 403) | def save_checkpoint(self, checkpoint_path): class CriticWorker (line 408) | class CriticWorker(MegatronWorker): method __init__ (line 410) | def __init__(self, config): method _build_critic_model_optimizer (line 446) | def _build_critic_model_optimizer(self, method init_model (line 514) | def init_model(self): method compute_values (line 551) | def compute_values(self, data: DataProto): method update_critic (line 559) | def update_critic(self, data: DataProto): method load_checkpoint (line 568) | def load_checkpoint(self, checkpoint_path): method save_checkpoint (line 572) | def save_checkpoint(self, checkpoint_path): class RewardModelWorker (line 576) | class RewardModelWorker(MegatronWorker): method __init__ (line 581) | def __init__(self, config): method _build_rm_model (line 614) | def _build_rm_model(self, model_path, megatron_config: ModelParallelCo... method init_model (line 672) | def init_model(self): method compute_rm_score (line 723) | def compute_rm_score(self, data: DataProto): FILE: verl/workers/reward_model/base.py class BasePPORewardModel (line 23) | class BasePPORewardModel(ABC): method __init__ (line 25) | def __init__(self, config): method compute_reward (line 29) | def compute_reward(self, data: DataProto) -> DataProto: FILE: verl/workers/reward_model/megatron/reward_model.py class MegatronRewardModel (line 37) | class MegatronRewardModel(BasePPORewardModel): method __init__ (line 39) | def __init__(self, method re_encode_by_rm_tokenizer (line 58) | def re_encode_by_rm_tokenizer(self, data: DataProto) -> DataProto: method compute_reward (line 123) | def compute_reward(self, data: DataProto) -> DataProto: method forward_batch (line 185) | def forward_batch(self, data: DataProto): method offload_params_to_cpu (line 262) | def offload_params_to_cpu(self): method load_params_to_cuda (line 270) | def load_params_to_cuda(self): FILE: verl/workers/rollout/base.py class BaseRollout (line 23) | class BaseRollout(ABC): method __init__ (line 25) | def __init__(self): method generate_sequences (line 35) | def generate_sequences(self, prompts: DataProto) -> DataProto: FILE: verl/workers/rollout/hf_rollout.py class HFRollout (line 35) | class HFRollout(BaseRollout): method __init__ (line 37) | def __init__(self, module: nn.Module, config): method generate_sequences (line 42) | def generate_sequences(self, prompts: DataProto) -> DataProto: method _generate_minibatch (line 51) | def _generate_minibatch(self, prompts: DataProto) -> DataProto: FILE: verl/workers/rollout/naive/naive_rollout.py class NaiveRollout (line 36) | class NaiveRollout(BaseRollout): method __init__ (line 38) | def __init__(self, module: nn.Module, config): method generate_sequences (line 52) | def generate_sequences(self, prompts: DataProto) -> DataProto: FILE: verl/workers/rollout/tokenizer.py class HybridEngineBaseTokenizer (line 23) | class HybridEngineBaseTokenizer(ABC): method vocab_size (line 28) | def vocab_size(self): method pad_token_id (line 36) | def pad_token_id(self): method eos_token_id (line 44) | def eos_token_id(self): method all_special_ids (line 53) | def all_special_ids(self) -> List[int]: method all_special_tokens (line 61) | def all_special_tokens(self) -> List[str]: method encode (line 70) | def encode(self, text): method decode (line 86) | def decode( method convert_ids_to_tokens (line 116) | def convert_ids_to_tokens(self, method get_added_vocab (line 135) | def get_added_vocab(self) -> Dict[str, int]: method convert_tokens_to_string (line 147) | def convert_tokens_to_string(self, tokens: List[str]) -> str: method is_fast (line 161) | def is_fast(self): FILE: verl/workers/rollout/vllm_rollout/vllm_rollout.py function _pre_process_inputs (line 49) | def _pre_process_inputs(pad_token_id, prompt_token_ids: torch.Tensor) ->... class vLLMRollout (line 57) | class vLLMRollout(BaseRollout): method __init__ (line 59) | def __init__(self, actor_module: nn.Module, config: DictConfig, tokeni... method update_sampling_params (line 126) | def update_sampling_params(self, **kwargs): method generate_sequences (line 142) | def generate_sequences(self, prompts: DataProto, **kwargs) -> DataProto: FILE: verl/workers/sharding_manager/base.py class BaseShardingManager (line 21) | class BaseShardingManager: method __enter__ (line 23) | def __enter__(self): method __exit__ (line 26) | def __exit__(self, exc_type, exc_value, traceback): method preprocess_data (line 29) | def preprocess_data(self, data: DataProto) -> DataProto: method postprocess_data (line 32) | def postprocess_data(self, data: DataProto) -> DataProto: FILE: verl/workers/sharding_manager/fsdp_ulysses.py class FSDPUlyssesShardingManager (line 33) | class FSDPUlyssesShardingManager(BaseShardingManager): method __init__ (line 38) | def __init__(self, device_mesh: DeviceMesh): method __enter__ (line 43) | def __enter__(self): method __exit__ (line 51) | def __exit__(self, exc_type, exc_value, traceback): method preprocess_data (line 58) | def preprocess_data(self, data: DataProto) -> DataProto: method postprocess_data (line 80) | def postprocess_data(self, data: DataProto) -> DataProto: FILE: verl/workers/sharding_manager/fsdp_vllm.py class FSDPVLLMShardingManager (line 34) | class FSDPVLLMShardingManager(BaseShardingManager): method __init__ (line 36) | def __init__(self, method __enter__ (line 69) | def __enter__(self): method __exit__ (line 93) | def __exit__(self, exc_type, exc_value, traceback): method preprocess_data (line 112) | def preprocess_data(self, data: DataProto) -> DataProto: method postprocess_data (line 121) | def postprocess_data(self, data: DataProto) -> DataProto: FILE: verl/workers/sharding_manager/megatron_vllm.py class AllGatherPPModel (line 35) | class AllGatherPPModel: method __init__ (line 37) | def __init__(self, model_provider) -> None: method _build_param_buffer (line 82) | def _build_param_buffer(self, pp_rank): method _build_param_references (line 88) | def _build_param_references(self, pp_rank, maintain_weight=False): method _load_params_to_cuda (line 92) | def _load_params_to_cuda(self, pp_rank, to_empty=False): method _offload_params_to_cpu (line 102) | def _offload_params_to_cpu(self, pp_rank, to_empty=False): method load_params_to_cuda (line 112) | def load_params_to_cuda(self, to_empty=False): method allgather_params (line 118) | def allgather_params(self): method forward (line 127) | def forward(self, *inputs, **kwargs): method __call__ (line 146) | def __call__(self, *inputs, **kwargs): method eval (line 149) | def eval(self): method train (line 153) | def train(self): method offload_params_to_cpu (line 157) | def offload_params_to_cpu(self, to_empty=False): method get_all_params (line 163) | def get_all_params(self): method update_this_rank_models (line 186) | def update_this_rank_models(self, new_models): method this_rank_models (line 191) | def this_rank_models(self): method pp_size (line 195) | def pp_size(self): method pp_rank (line 199) | def pp_rank(self): method pp_group (line 203) | def pp_group(self): method pp_models (line 207) | def pp_models(self): class MegatronVLLMShardingManager (line 238) | class MegatronVLLMShardingManager(BaseShardingManager): method __init__ (line 240) | def __init__(self, module: AllGatherPPModel, inference_engine: LLM, mo... method default_tp_concat_fn (line 267) | def default_tp_concat_fn(self, name, param, infer_params, model_config): method _post_process_params (line 318) | def _post_process_params(self, params): method __enter__ (line 345) | def __enter__(self): method __exit__ (line 360) | def __exit__(self, exc_type, exc_value, traceback): method preprocess_data (line 378) | def preprocess_data(self, data: DataProto) -> DataProto: method postprocess_data (line 394) | def postprocess_data(self, data: DataProto) -> DataProto: function get_micro_data_parallel_group (line 418) | def get_micro_data_parallel_group(): function get_micro_data_parallel_world_size (line 423) | def get_micro_data_parallel_world_size(): function get_micro_data_parallel_rank (line 427) | def get_micro_data_parallel_rank():