MCPcopy Create free account

hub / github.com/CarlanLark/Lp-Reg-dev / functions

Functions1,299 in github.com/CarlanLark/Lp-Reg-dev

↓ 301 callersMethodget
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/utils/memory_buffer.py:43
↓ 154 callersMethodto
move the batch to device Args: device (torch.device, str): torch device Returns: DataProto: the current Data
verl/protocol.py:380
↓ 84 callersFunctionprint_rank_0
If distributed is initialized, print only on rank 0.
verl/utils/megatron_utils.py:387
↓ 77 callersFunctionlog_gpu_memory_usage
(head: str, logger: logging.Logger = None, level=logging.DEBUG, rank: int = 0)
verl/utils/debug/performance.py:42
↓ 50 callersMethodchunk
Split the batch among dim=0 into chunks. The meta_info is passed to each DataProto after split. Args: chunks (int): the number of
verl/protocol.py:646
↓ 45 callersMethodupdate
(self, current_kl, n_steps)
verl/trainer/ppo/core_algos.py:55
↓ 38 callersMethodpop
Pop a subset of the DataProto via `batch_keys` and `meta_info_keys` Args: batch_keys (list, optional): a list of strings indicati
verl/protocol.py:511
↓ 37 callersMethodget
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/utils/megatron/memory.py:29
↓ 28 callersMethodconcat
Concat a list of DataProto. The batch is concatenated among dim=0. The meta_info is assumed to be identical and will use the first one.
verl/protocol.py:684
↓ 27 callersFunctioncopy_to_local
Copy files/directories from HDFS to local cache with validation. Args: src (str): Source path - HDFS path (hdfs://...) or local filesyste
verl/utils/fs.py:94
↓ 25 callersFunction_timer
(name: str, timing_raw: Dict[str, float])
verl/trainer/ppo/ray_trainer.py:258
↓ 22 callersMethoddecode
Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special tokens and clean up tokeniz
verl/workers/rollout/tokenizer.py:90
↓ 18 callersFunctiongather_seq_scatter_heads
A func to sync embedding input with alltoall in sequence parallel gather sequence dimension and scatter head dim: e.g. seq_dim: 1, head_d
verl/utils/ulysses.py:62
↓ 18 callersMethodget
(self)
verl/utils/rendezvous/ray_backend.py:28
↓ 17 callersMethodget
(self)
verl/protocol.py:790
↓ 17 callersMethodselect
Select a subset of the DataProto via batch_keys and meta_info_keys Args: batch_keys (list, optional): a list of strings indicatin
verl/protocol.py:394
↓ 17 callersMethodvalues
(cls)
verl/utils/py_functional.py:196
↓ 16 callersFunctionconvert_config
(hf_config: PretrainedConfig, megatron_config)
verl/utils/megatron_utils.py:157
↓ 16 callersMethodregister
(cls, name: str)
verl/utils/py_functional.py:221
↓ 15 callersMethodfrom_dict
Create a DataProto from a dict of tensors. This assumes that 1. All the tensor in tensors have the same dim0 2. Only dim0 is the batch
verl/protocol.py:344
↓ 15 callersFunctionhf_tokenizer
Create a huggingface pretrained tokenizer which correctness handles eos and pad tokens. Args: name (str): The name of the tokenizer.
verl/utils/tokenizer.py:36
↓ 15 callersMethodnamed_parameters
(self)
verl/utils/memory_buffer.py:205
↓ 15 callersFunctionpad_sequence_to_length
pad a 2D tensors (e.g. responses, logprobs) in the last dim to max_seq_length. input shape: [bs, seq_length] output shape: [bs, max_seq_l
verl/utils/torch_functional.py:245
↓ 14 callersFunctionoffload_fsdp_model_to_cpu
(model: FSDP, empty_cache: bool = True)
verl/utils/fsdp_utils.py:128
↓ 14 callersMethodrepeat
Repeat the batch data a specified number of times. Args: repeat_times (int): Number of times to repeat the data.
verl/protocol.py:714
↓ 14 callersMethodunion
Union with another DataProto. Union batch and meta_info separately. Throw an error if - there are conflict keys in batch and they are
verl/protocol.py:568
↓ 13 callersFunctionfsdp_version
(model)
verl/utils/fsdp_utils.py:376
↓ 13 callersFunctionoffload_megatron_model_to_cpu
In megatron, the model and optimizer storage are: - bf16 parameter data chunked in model parallel group - fp32 grad chunked in model para
verl/utils/megatron_utils.py:238
↓ 13 callersFunctionunwrap_model
(model, module_instances=ALL_MODULE_WRAPPER_CLASSNAMES)
verl/utils/megatron_utils.py:142
↓ 12 callersFunctionagg_loss
Aggregate the loss matrix into a scalar. Args: loss_mat: `(torch.Tensor)` shape: (bs, response_length) loss_mask:
verl/trainer/ppo/core_algos.py:320
↓ 12 callersFunctionload_fsdp_model_to_gpu
(model: FSDP)
verl/utils/fsdp_utils.py:159
↓ 12 callersMethodpostprocess_data
(self, data: DataProto)
verl/workers/sharding_manager/base.py:31
↓ 12 callersMethodto_dtype
(precision)
verl/utils/torch_dtypes.py:63
↓ 11 callersMethodget_megatron_rank_info
(self)
verl/single_controller/base/megatron/worker.py:32
↓ 11 callersMethodlog
(self, data, step, backend=None)
verl/utils/tracking.py:114
↓ 10 callersMethodcreate
Create a tool instance. Args: instance_id: The instance id of the tool. Returns: The instance id of the tool
verl/tools/base_tool.py:41
↓ 10 callersFunctionfunc
(*args, **kwargs)
verl/single_controller/ray/base.py:44
↓ 10 callersFunctionget_ulysses_sequence_parallel_group
Get ulysses sequence parallel process group.
verl/utils/ulysses.py:38
↓ 10 callersFunctionget_ulysses_sequence_parallel_world_size
Get ulysses sequence parallel world size.
verl/utils/ulysses.py:46
↓ 10 callersFunctionload_megatron_model_to_gpu
(models, load_grad=True)
verl/utils/megatron_utils.py:272
↓ 10 callersMethodpreprocess_data
(self, data: DataProto)
verl/workers/sharding_manager/base.py:28
↓ 10 callersMethodsleep
Sleep engine to offload model weights and discard kv cache.
verl/workers/rollout/async_server.py:103
↓ 10 callersMethodtrain
(self)
verl/workers/sharding_manager/megatron_vllm.py:194
↓ 9 callersFunction_megatron_calc_global_rank
Calculate global rank with support for CP/EP parallelism
verl/models/mcore/saver.py:28
↓ 9 callersFunctioncompute_position_id_with_mask
(mask)
verl/utils/model.py:204
↓ 9 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:74
↓ 9 callersMethodget_rng_state
()
verl/utils/checkpoint/checkpoint_manager.py:107
↓ 9 callersMethodsave
(self)
verl/utils/debug/profile.py:75
↓ 9 callersMethodstep
(self)
verl/utils/debug/profile.py:66
↓ 9 callersMethodwake_up
Wake up engine to load model weights and build kv cache.
verl/workers/rollout/async_server.py:98
↓ 8 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/models/mcore/loader.py:97
↓ 8 callersMethodadd
(self, idx: int, val: int)
verl/utils/seqlen_balancing.py:30
↓ 8 callersMethodrank
(self)
verl/single_controller/base/worker.py:208
↓ 7 callersFunction_megatron_calc_global_rank
given TP,DP,PP rank to get the global rank.
verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:27
↓ 7 callersFunction_megatron_calc_global_rank
given TP,DP,PP rank to get the global rank.
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:27
↓ 7 callersFunctionappend_to_dict
(data: Dict, new_data: Dict)
verl/utils/py_functional.py:159
↓ 7 callersMethodeval
(self)
verl/workers/sharding_manager/megatron_vllm.py:190
↓ 7 callersFunctiongather_outpus_and_unpad
( x: Tensor, gather_dim: int, unpad_dim: int = None, padding_size: int = 0, grad_scaler: b
verl/utils/ulysses.py:237
↓ 7 callersFunctionoffload_fsdp_optimizer
(optimizer)
verl/utils/fsdp_utils.py:186
↓ 7 callersFunctionoffload_megatron_optimizer
(optimizers)
verl/utils/megatron_utils.py:366
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader_depracated.py:92
↓ 6 callersFunction_broadcast_tensor
broadcast tensor across mp_group
verl/models/mcore/saver.py:129
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_loader_depracated.py:94
↓ 6 callersFunction_fetch_tensor
fetch tensor
verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader.py:92
↓ 6 callersFunction_fetch_tensor
fetch tensor
verl/models/llama/megatron/checkpoint_utils/llama_loader.py:94
↓ 6 callersMethod_forward_micro_batch
Returns: entropy: # (bs, response_len) log_probs: # (bs, response_len) top_k_log_probs: # (bs, response_l
verl/workers/actor/dp_actor.py:112
↓ 6 callersFunctioncombined_int_check
(val)
verl/utils/reward_score/prime_code/testing_util.py:76
↓ 6 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:86
↓ 6 callersMethodgenerate_sequences
(self, batch: DataProto, **sampling_params)
verl/trainer/naive_chat_scheduler.py:31
↓ 6 callersFunctionget_model
Build the model.
verl/utils/megatron_utils.py:43
↓ 6 callersFunctionget_response_mask
end of sentence token can be int or list: 1 or [1, 2] e.g. response_id = torch.tensor([[20, 10, 34, 1, 0, 0, 0],
verl/utils/torch_functional.py:155
↓ 6 callersFunctionis_non_local
(path)
verl/utils/fs.py:34
↓ 6 callersFunctionlogprobs_from_logits
See: https://github.com/pytorch/pytorch/issues/563#issuecomment-330103591
verl/utils/torch_functional.py:54
↓ 6 callersFunctionmasked_mean
Compute mean of tensor with a masked values.
verl/utils/torch_functional.py:123
↓ 6 callersFunctionrearrange_micro_batches
Split a batch into micro-batches by total token count, with optional DP sync and padding. Args: batch (TensorDict): must include "at
verl/utils/seqlen_balancing.py:215
↓ 6 callersMethodremove
(cls, name: str)
verl/utils/py_functional.py:232
↓ 6 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=2, repeats=n_rep). The hidden states go from (batch, seqlen, num_key_value_heads, he
verl/models/transformers/monkey_patch.py:36
↓ 6 callersFunctiontruncatefn
(s, length=300)
verl/utils/reward_score/prime_code/testing_util.py:39
↓ 6 callersFunctionulysses_pad_and_slice_inputs
Pad and slice input_ids to be divisible by sp_size Pad position_ids to be divisible by sp_size. Note both input_ids_rmpad and position_i
verl/utils/ulysses.py:257
↓ 5 callersMethod__init__
(self, config: Qwen2Config, megatron_config: ModelParallelConfig)
verl/models/qwen2/megatron/modeling_qwen2_megatron.py:82
↓ 5 callersMethod__init__
(self, config: LlamaConfig, megatron_config: ModelParallelConfig)
verl/models/llama/megatron/modeling_llama_megatron.py:82
↓ 5 callersFunction_broadcast_tensor
broadcast tensor across mp_group
verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:119
↓ 5 callersFunction_broadcast_tensor
broadcast tensor across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:119
↓ 5 callersFunction_hdfs_cmd
(cmd: str)
verl/utils/hdfs_io.py:144
↓ 5 callersFunction_repeat_interleave
(value: Union[torch.Tensor, np.ndarray], repeats: int)
verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py:68
↓ 5 callersFunction_run_cmd
(cmd: str, timeout=None)
verl/utils/hdfs_io.py:140
↓ 5 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids)
verl/models/qwen2/megatron/layers/parallel_attention.py:126
↓ 5 callersMethodcheck
(self)
verl/utils/debug/profile.py:58
↓ 5 callersFunctionclean_traceback
(error_traceback)
verl/utils/reward_score/prime_code/testing_util.py:80
↓ 5 callersMethodinit_model
(self)
verl/workers/fsdp_workers.py:1028
↓ 5 callersFunctionload_reward_manager
(config, tokenizer, num_examine, **reward_kwargs)
verl/trainer/ppo/reward.py:60
↓ 5 callersMethodstart
(self)
verl/utils/debug/profile.py:61
↓ 5 callersFunctionvalidate_ulysses_config
(num_heads, ulysses_sequence_size)
verl/utils/ulysses.py:294
↓ 4 callersMethod__init__
(self)
verl/single_controller/ray/base.py:526
↓ 4 callersMethod__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None)
verl/models/llama/megatron/layers/parallel_attention.py:39
↓ 4 callersFunction_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:158
↓ 4 callersFunction_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/mcore/saver.py:168
↓ 4 callersFunction_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:158
↓ 4 callersFunction_get_base_transformer_config
Create a base TransformerConfig with common parameters across different model architectures. TODO: (ycl) use dataclass or converter config?
verl/models/mcore/config_converter.py:26
↓ 4 callersFunction_get_cpu_tensor
(tensor: torch.Tensor)
verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:112
next →1–100 of 1,299, ranked by callers