MCPcopy Create free account

hub / github.com/Unakar/Logic-RL / functions

Functions858 in github.com/Unakar/Logic-RL

↓ 3 callersFunctionapply_monkey_patch
(config: PretrainedConfig, verbose=True)
verl/models/transformers/monkey_patch.py:42
↓ 3 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids)
verl/models/llama/megatron/layers/parallel_attention.py:123
↓ 3 callersFunctionbuild_memory_buffer
Build the memory buffer given weight_buffer_meta Args: weight_buffer_meta: contains mapping from name to a dictionary containing shape an
verl/utils/memory_buffer.py:68
↓ 3 callersFunctioncalc_padded_numel
for cuda memory alignment, make sure alignment by 128-bits
verl/utils/memory_buffer.py:51
↓ 3 callersFunctioncheck_model_support_rmpad
(model_type: str)
verl/models/registry.py:27
↓ 3 callersFunctioncompute_transformers_input_shapes
(batches, meta_info)
verl/utils/megatron/pipeline_parallel.py:22
↓ 3 callersMethodexecute_rank_zero_async
(self, method_name: str, *args, **kwargs)
verl/single_controller/ray/base.py:322
↓ 3 callersMethodfit
The training loop of PPO. The driver process only need to call the compute functions of the worker group through RPC to construct the
verl/trainer/ppo/ray_trainer.py:581
↓ 3 callersMethodfrom_detached
(cls, worker_names=None, ray_cls_with_init=None)
verl/single_controller/ray/base.py:285
↓ 3 callersFunctionget_constant_schedule_with_warmup
( optimizer: Optimizer, num_warmup_steps: int, last_epoch: int = -1, )
verl/utils/torch_functional.py:422
↓ 3 callersFunctionget_default_kwargs_for_model_parallel_config
()
verl/utils/megatron/tensor_parallel.py:32
↓ 3 callersFunctionget_megatron_optimizer
( model, config: OptimizerConfig, no_weight_decay_cond=None, scale_lr_cond=Non
verl/utils/megatron/optimizer.py:26
↓ 3 callersFunctionget_parallel_model_from_config
(config, megatron_config, pre_process=None, post_process=None, value=False)
verl/utils/model.py:234
↓ 3 callersFunctionimport_external_libs
(external_libs=None)
verl/utils/import_utils.py:41
↓ 3 callersFunctioninit_megatron_optim_config
(optim_config: Dict)
verl/utils/megatron_utils.py:185
↓ 3 callersMethodinit_workers
Init resource pool and worker group
verl/trainer/ppo/ray_trainer.py:476
↓ 3 callersFunctioninitialize_global_process_group
(timeout_second=36000)
verl/utils/distributed.py:18
↓ 3 callersFunctionmake_batch_generator
(batches, vpp_size)
verl/utils/megatron/pipeline_parallel.py:43
↓ 3 callersFunctionmake_map_fn
(split)
examples/data_preprocess/hellaswag.py:53
↓ 3 callersFunctionpad_dataproto_to_divisor
Pad a DataProto to size divisible by size_divisor Args: size_divisor (int): size divisor Returns: data: (DataProto): the pad
verl/protocol.py:40
↓ 3 callersMethodreorder
Note that this operation is in-place
verl/protocol.py:539
↓ 3 callersMethodsave_checkpoint
(self, step)
verl/trainer/fsdp_sft_trainer.py:295
↓ 3 callersMethodset_input_tensor
Set input tensor to be used instead of forward()'s input. When doing pipeline parallelism the input from the previous stage comes fro
verl/models/llama/megatron/modeling_llama_megatron.py:457
↓ 3 callersFunctionset_random_seed
(seed)
verl/workers/megatron_workers.py:47
↓ 3 callersFunctionsplit_dict_tensor_into_batches
(tensors: TensorDict, batch_size)
verl/utils/torch_functional.py:203
↓ 3 callersMethodsub
(self, data: DataProto)
tests/ray/test_colocated_workers.py:44
↓ 3 callersMethodto_str
(precision)
verl/utils/torch_dtypes.py:74
↓ 3 callersFunctionunion_numpy_dict
(tensor_dict1: dict[np.ndarray], tensor_dict2: dict[np.ndarray])
verl/protocol.py:80
↓ 3 callersFunctionunion_tensor_dict
Union two tensordicts.
verl/protocol.py:66
↓ 3 callersFunctionunpad_dataproto
(data: 'DataProto', pad_size)
verl/protocol.py:60
↓ 3 callersFunctionvocab_parallel_log_probs_from_logits
TODO(zhangchi.usc1992): We may change the implementation later
verl/utils/megatron/tensor_parallel.py:136
↓ 2 callersMethod__init__
(self, config)
verl/workers/megatron_workers.py:410
↓ 2 callersMethod__init__
(self, config)
verl/workers/fsdp_workers.py:509
↓ 2 callersMethod_build_model_optimizer
(self, model_path, megatron_config: ModelParalle
verl/workers/megatron_workers.py:124
↓ 2 callersMethod_build_model_optimizer
(self, model_path, fsdp_config,
verl/workers/fsdp_workers.py:111
↓ 2 callersMethod_compute_loss
(self, batch)
verl/trainer/fsdp_sft_trainer.py:218
↓ 2 callersFunction_compute_response_info
(batch)
verl/trainer/ppo/ray_trainer.py:168
↓ 2 callersMethod_forward_micro_batch
(self, micro_batch)
verl/workers/critic/dp_critic.py:53
↓ 2 callersMethod_forward_micro_batch
Returns: entropy: # (bs, response_len) log_probs: # (bs, response_len)
verl/workers/actor/dp_actor.py:58
↓ 2 callersFunction_is_non_local
(path)
verl/utils/fs.py:29
↓ 2 callersMethod_offload_params_to_cpu
(self, pp_rank, to_empty=False)
verl/workers/sharding_manager/megatron_vllm.py:102
↓ 2 callersFunction_pad_tensor
(x: Tensor, dim: int, padding_size: int)
verl/utils/ulysses.py:103
↓ 2 callersMethod_pad_to_length
(self, input_ids, attention_mask)
verl/utils/dataset/rm_dataset.py:99
↓ 2 callersMethod_save_checkpoint
(self)
verl/trainer/ppo/ray_trainer.py:550
↓ 2 callersMethod_set_cos_sin_cache
(self, seq_len, device, dtype)
verl/models/llama/megatron/layers/parallel_attention.py:51
↓ 2 callersFunction_unpad_tensor
(x: Tensor, dim: int, padding_size: int)
verl/utils/ulysses.py:110
↓ 2 callersFunction_unwrap_ray_remote
(cls)
verl/single_controller/ray/base.py:414
↓ 2 callersMethodadd
(self, data: DataProto)
tests/ray/test_colocated_workers.py:31
↓ 2 callersMethodadd
(self, a, b)
tests/e2e/envs/digit_completion/task.py:78
↓ 2 callersMethodall_gather
(self)
tests/ray/test_worker_group_torch.py:40
↓ 2 callersFunctionall_to_all_tensor
( local_input: Tensor, scatter_dim: int, gather_dim: int, group: Optional[dist.ProcessGroup] =
verl/utils/ulysses.py:132
↓ 2 callersMethodallgather_params
allgather params of all pp ranks. Return a list of handles
verl/workers/sharding_manager/megatron_vllm.py:118
↓ 2 callersFunctionapply_kl_penalty
(data: DataProto, kl_ctrl: core_algos.AdaptiveKLController, kl_penalty='kl')
verl/trainer/ppo/ray_trainer.py:85
↓ 2 callersFunctioncompute_advantage
(data: DataProto, adv_estimator, gamma=1.0, lam=1.0, num_repeat=1)
verl/trainer/ppo/ray_trainer.py:117
↓ 2 callersFunctioncompute_data_metrics
(batch, use_critic=True)
verl/trainer/ppo/ray_trainer.py:184
↓ 2 callersMethodcompute_ref_log_prob
(self, data: DataProto)
verl/workers/fsdp_workers.py:449
↓ 2 callersMethodcompute_rm_score
(self, data: DataProto)
verl/workers/fsdp_workers.py:984
↓ 2 callersMethodcompute_values
(self, data: DataProto)
verl/workers/fsdp_workers.py:674
↓ 2 callersFunctioncreate_and_sync_state
(param_name, state, is_param)
verl/utils/fsdp_utils.py:243
↓ 2 callersFunctioncreate_colocated_worker_cls
This function should return a class instance that delegates the calls to every cls in cls_dict
verl/single_controller/ray/base.py:420
↓ 2 callersMethodencode
Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary. Args: text (`str`, `List[str]` or
verl/workers/rollout/tokenizer.py:70
↓ 2 callersMethodestimate_flops
Estimate the FLOPS based on the number of valid tokens in the current batch and the time taken. Args: batch_seqlens (Lis
verl/utils/flops_counter.py:107
↓ 2 callersMethodforward
Args: input_ids: input ids. shape (batch_size, seq_length) attention_mask: attention_mask. shape (batch_size, seq_le
verl/models/llama/megatron/modeling_llama_megatron.py:117
↓ 2 callersMethodforward_backward_batch
(self, data: DataProto, forward_only=False)
verl/workers/critic/megatron_critic.py:113
↓ 2 callersMethodforward_backward_batch
We assume: - The model takes input: (input_ids, attention_mask, position_ids). No rmpad for the input - The communication sha
verl/workers/actor/megatron_actor.py:218
↓ 2 callersFunctiongather_heads_scatter_seq
A func to sync attention result with alltoall in sequence parallel gather head dimension and scatter seq dim: e.g. seq_dim: 1, head_dim:
verl/utils/ulysses.py:85
↓ 2 callersMethodget_all_params
Get all the parameters of the models in all pp ranks Returns: params: List[List[Dict[str, Tensor]]]: a list of parameters in all
verl/workers/sharding_manager/megatron_vllm.py:163
↓ 2 callersFunctionget_common_default_kwargs_for_parallel_linear
()
verl/utils/megatron/tensor_parallel.py:47
↓ 2 callersFunctionget_cosine_schedule_with_warmup
Create a schedule with a learning rate that decreases following the values of the cosine function between the initial lr set in the optimizer
verl/utils/torch_functional.py:379
↓ 2 callersFunctionget_eos_mask
e.g. end of sentence token=1 response_id: [0, 0, 2, 42, 3, 5, 1, 0, 0] eos_mask: [1, 1, 1, 1, 1, 1, 1, 0, 0]
verl/utils/torch_functional.py:139
↓ 2 callersFunctionget_gsm8k_data
()
tests/verl/utils/dataset/test_sft_dataset.py:21
↓ 2 callersFunctionget_random_num
()
examples/data_preprocess/multiply.py:39
↓ 2 callersFunctionget_random_num
()
examples/data_preprocess/arth.py:45
↓ 2 callersFunctionget_seqlen_balanced_partitions
get order of seq lengths to make partitions balanced, this is used in balacing sum of seqlength across dp ranks and microbatches Paramete
verl/utils/seqlen_balancing.py:152
↓ 2 callersFunctionget_trajectory_tracker
()
verl/utils/debug/trajectory_tracker.py:79
↓ 2 callersFunctionget_weight_buffer_meta_from_module
Return a dictionary containing name to a shape and dtype.
verl/utils/memory_buffer.py:58
↓ 2 callersMethodinit
(self)
tests/ray/test_worker_group_torch.py:35
↓ 2 callersFunctionis_tensor_parallel_param
(param)
verl/utils/megatron/tensor_parallel.py:86
↓ 2 callersFunctionis_vllm_available
()
verl/utils/import_utils.py:33
↓ 2 callersFunctionjudge_string
(input_str, reformat_gold_conditions, wrong_reason, finish_patterns)
eval_kk/kk_processor.py:20
↓ 2 callersFunctionlast_boxed_only_string
(string)
verl/utils/reward_score/math.py:63
↓ 2 callersFunctionlist_of_dict_to_dict_of_list
(list_of_dict: list[dict])
verl/protocol.py:92
↓ 2 callersFunctionload_fsdp_optimizer
(optimizer, device_id)
verl/utils/fsdp_utils.py:123
↓ 2 callersMethodload_params_to_cuda
load all model params to cuda
verl/workers/sharding_manager/megatron_vllm.py:112
↓ 2 callersMethodlog
(self, data, step)
verl/utils/logger/aggregate_logger.py:40
↓ 2 callersFunctionlog_probs_from_logits_all_rmpad
Compute the log_probs from logits with rmpad input_ids and logits. Note that logits_rmpad = model(input_ids_rmpad). For each sentences, there is a
verl/utils/torch_functional.py:328
↓ 2 callersFunctionlogprobs_from_logits_naive
(logits, labels)
verl/utils/torch_functional.py:70
↓ 2 callersFunctionmake_map_fn
(split)
examples/data_preprocess/countdown.py:94
↓ 2 callersFunctionmake_map_fn
(split)
examples/data_preprocess/kk.py:46
↓ 2 callersFunctionmake_map_fn
(split)
examples/data_preprocess/gsm8k.py:52
↓ 2 callersFunctionmake_map_fn
(split)
examples/data_preprocess/multiply.py:98
↓ 2 callersFunctionmake_map_fn
(split)
examples/data_preprocess/arth.py:109
↓ 2 callersFunctionmake_map_fn
(split)
examples/data_preprocess/math_dataset.py:48
↓ 2 callersMethodmake_minibatch_iterator
Make minibatch iterator for updating the actor Args: data (DataProto): a DataProto containing keys ``input_ids``
verl/workers/actor/megatron_actor.py:190
↓ 2 callersFunctionmd5_encode
(path: str)
verl/utils/fs.py:33
↓ 2 callersMethodmerge
(self, other)
verl/utils/seqlen_balancing.py:37
↓ 2 callersFunctionnormalize_pp_vpp_params
Normalize the pp vpp params into a complete named parameters. This is useful when gather parameters from pp ranks and passed to a model with
verl/utils/model.py:181
↓ 2 callersMethodoffload_params_to_cpu
(self)
verl/workers/reward_model/megatron/reward_model.py:262
↓ 2 callersFunctionpreprocess
(text)
examples/data_preprocess/hellaswag.py:27
↓ 2 callersMethodpreprocess_data
AllGather data from sp region This is because the data is first sharded along the FSDP dimension as we utilize the DP_COMPUTE
verl/workers/sharding_manager/fsdp_ulysses.py:58
← previousnext →101–200 of 858, ranked by callers