MCPcopy Create free account

hub / github.com/ChenxinAn-fdu/POLARIS / functions

Functions1,563 in github.com/ChenxinAn-fdu/POLARIS

↓ 274 callersMethodget
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/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/verl/protocol.py:380
↓ 84 callersMethodget
(self)
verl/verl/protocol.py:789
↓ 84 callersFunctionprint_rank_0
If distributed is initialized, print only on rank 0.
verl/verl/utils/megatron_utils.py:378
↓ 79 callersFunctionlog_gpu_memory_usage
(head: str, logger: logging.Logger = None, level=logging.DEBUG, rank: int = 0)
verl/verl/utils/debug/performance.py:42
↓ 73 callersMethodupdate
(self, current_kl, n_steps)
verl/verl/trainer/ppo/core_algos.py:53
↓ 59 callersFunction_timer
(name: str, timing_raw: Dict[str, float])
verl/verl/trainer/ppo/ray_trainer.py:280
↓ 59 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/verl/protocol.py:511
↓ 56 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/verl/protocol.py:646
↓ 46 callersMethodfrom_pretrained
(cls, save_directory: Union[str, os.PathLike], **kwargs)
verl/tests/e2e/envs/digit_completion/tokenizer.py:149
↓ 41 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/verl/protocol.py:344
↓ 35 callersFunctioncopy_to_local
Copy src from hdfs to local if src is on hdfs or directly return src. If cache_dir is None, we will use the default cache dir of the system. Note
verl/verl/utils/fs.py:59
↓ 35 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/verl/workers/rollout/tokenizer.py:90
↓ 35 callersMethodget
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/verl/utils/megatron/memory.py:29
↓ 34 callersMethodinit
(self)
verl/tests/ray_gpu/test_rvdz.py:26
↓ 32 callersMethodgetenv
(self, key)
verl/tests/ray_cpu/test_ray_local_envs.py:31
↓ 32 callersMethodsleep
Sleep engine to offload model weights and discard kv cache.
verl/verl/workers/rollout/async_server.py:103
↓ 30 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/verl/protocol.py:568
↓ 26 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/verl/protocol.py:684
↓ 26 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/verl/utils/torch_functional.py:245
↓ 25 callersFunctionhf_tokenizer
Create a huggingface pretrained tokenizer which correctness handles eos and pad tokens. Args: name (str): The name of the tokenizer.
verl/verl/utils/tokenizer.py:36
↓ 22 callersMethodcreate
Create a tool instance. Args: instance_id: The instance id of the tool. Returns: The instance id of the tool
verl/verl/tools/base_tool.py:41
↓ 22 callersMethodsub
(self, x)
verl/tests/ray_cpu/test_fused_workers.py:40
↓ 21 callersFunctionoffload_fsdp_model_to_cpu
(model: FSDP, empty_cache: bool = True)
verl/verl/utils/fsdp_utils.py:121
↓ 21 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/verl/protocol.py:394
↓ 20 callersMethodstep
(self)
verl/verl/utils/debug/profile.py:66
↓ 19 callersMethodlog
(self, data, step, backend=None)
verl/verl/utils/tracking.py:112
↓ 19 callersMethodrepeat
Repeat the batch data a specified number of times. Args: repeat_times (int): Number of times to repeat the data.
verl/verl/protocol.py:713
↓ 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/verl/utils/ulysses.py:62
↓ 17 callersMethodexecute_all_sync
(self, method_name: str, *args, **kwargs)
verl/verl/single_controller/ray/base.py:395
↓ 16 callersFunctionconvert_config
(hf_config: PretrainedConfig, megatron_config)
verl/verl/utils/megatron_utils.py:148
↓ 16 callersFunctionload_fsdp_model_to_gpu
(model: FSDP)
verl/verl/utils/fsdp_utils.py:152
↓ 16 callersMethodto_dtype
(precision)
verl/verl/utils/torch_dtypes.py:63
↓ 15 callersMethodnamed_parameters
(self)
verl/verl/utils/memory_buffer.py:205
↓ 14 callersMethodbackward
(ctx: Any, grad_output: Tensor)
verl/verl/utils/ulysses.py:224
↓ 14 callersFunctioncompute_position_id_with_mask
(mask)
verl/verl/utils/model.py:204
↓ 13 callersFunctioncopy
r"""Works like shutil.copy() for file, and shutil.copytree for dir, and supports hdfs. Copy data and mode bits ("cp src dst"). Return the file's
verl/verl/utils/hdfs_io.py:84
↓ 13 callersMethodencode
Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary. Args: text (`str`, `List[str]` or
verl/verl/workers/rollout/tokenizer.py:74
↓ 13 callersMethodgenerate_sequences
Generate sequences
verl/verl/workers/rollout/base.py:33
↓ 13 callersFunctionmakedirs
r"""Works like os.makedirs() but supports hdfs. Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except tha
verl/verl/utils/hdfs_io.py:50
↓ 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/verl/utils/megatron_utils.py:229
↓ 13 callersMethodpostprocess_data
(self, data: DataProto)
verl/verl/workers/sharding_manager/base.py:31
↓ 13 callersMethodsave_pretrained
(self, save_directory: Union[str, os.PathLike], **kwargs)
verl/tests/e2e/envs/digit_completion/tokenizer.py:142
↓ 13 callersFunctionunwrap_model
(model, module_instances=ALL_MODULE_WRAPPER_CLASSNAMES)
verl/verl/utils/megatron_utils.py:133
↓ 12 callersFunctionfsdp_version
(model)
verl/verl/utils/fsdp_utils.py:369
↓ 12 callersFunctionget_ulysses_sequence_parallel_world_size
Get ulysses sequence parallel world size.
verl/verl/utils/ulysses.py:46
↓ 12 callersMethodpreprocess_data
(self, data: DataProto)
verl/verl/workers/sharding_manager/base.py:28
↓ 11 callersFunctionappend_to_dict
(data: Dict, new_data: Dict)
verl/verl/utils/py_functional.py:158
↓ 11 callersMethodget_megatron_rank_info
(self)
verl/verl/single_controller/base/megatron/worker.py:32
↓ 11 callersFunctionreduce_metrics
(metrics: Dict[str, List[Any]])
verl/verl/trainer/ppo/metric_utils.py:28
↓ 11 callersMethodsave
(self)
verl/verl/utils/debug/profile.py:75
↓ 11 callersMethodtrain
(self)
verl/verl/workers/sharding_manager/megatron_vllm.py:194
↓ 10 callersMethod_validate
(self)
verl/verl/utils/debug/profile.py:49
↓ 10 callersFunctionagg_loss
Aggregate the loss matrix into a scalar. Args: loss_mat: `(torch.Tensor)` shape: (bs, response_length) loss_mask:
verl/verl/trainer/ppo/core_algos.py:316
↓ 10 callersMethodfrom_config
(cls, config: Dict)
verl/tests/e2e/envs/digit_completion/tokenizer.py:135
↓ 10 callersFunctionget_model
Build the model.
verl/verl/utils/megatron_utils.py:41
↓ 10 callersFunctionget_ulysses_sequence_parallel_group
Get ulysses sequence parallel process group.
verl/verl/utils/ulysses.py:38
↓ 10 callersFunctionload_megatron_model_to_gpu
(models, load_grad=True)
verl/verl/utils/megatron_utils.py:263
↓ 10 callersFunctionmasked_mean
Compute mean of tensor with a masked values.
verl/verl/utils/torch_functional.py:122
↓ 10 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/verl/utils/ulysses.py:257
↓ 10 callersMethodwake_up
Wake up engine to load model weights and build kv cache.
verl/verl/workers/rollout/async_server.py:98
↓ 9 callersFunction_megatron_calc_global_rank
Calculate global rank with support for CP/EP parallelism
verl/verl/models/mcore/saver.py:28
↓ 9 callersMethodfrom_single_dict
Create a DataProto from a dict of tensors and non_tensors
verl/verl/protocol.py:328
↓ 9 callersFunctiongather_outpus_and_unpad
( x: Tensor, gather_dim: int, unpad_dim: int = None, padding_size: int = 0, grad_scaler: b
verl/verl/utils/ulysses.py:237
↓ 9 callersMethodget_rng_state
()
verl/verl/utils/checkpoint/checkpoint_manager.py:107
↓ 9 callersFunctionload_extern_type
Load a external data type based on the file path and type name
verl/verl/utils/import_utils.py:62
↓ 9 callersFunctionoffload_fsdp_optimizer
(optimizer)
verl/verl/utils/fsdp_utils.py:179
↓ 9 callersFunctionrearrange_micro_batches
Split the batch into a list of micro_batches, where the max_token_len is smaller than max_token_len and the number of valid tokens in each micro b
verl/verl/utils/seqlen_balancing.py:216
↓ 8 callersMethodeval
(self)
verl/verl/workers/sharding_manager/megatron_vllm.py:190
↓ 8 callersFunctioninitialize_global_process_group
(timeout_second=36000)
verl/verl/utils/distributed.py:19
↓ 8 callersMethodrank
(self)
verl/verl/single_controller/base/worker.py:220
↓ 8 callersMethodstart
(self)
verl/verl/utils/debug/profile.py:61
↓ 7 callersFunction_megatron_calc_global_rank
given TP,DP,PP rank to get the global rank.
verl/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/verl/models/llama/megatron/checkpoint_utils/llama_saver.py:27
↓ 7 callersFunctionapply_monkey_patch
Replace _flash_attention_forward to _ulysses_flash_attention_forward
verl/verl/models/transformers/monkey_patch.py:109
↓ 7 callersFunctionclean_traceback
(error_traceback)
verl/verl/utils/reward_score/prime_code/testing_util.py:80
↓ 7 callersFunctionfunc
(*args, **kwargs)
verl/verl/single_controller/ray/base.py:44
↓ 7 callersFunctionoffload_megatron_optimizer
(optimizers)
verl/verl/utils/megatron_utils.py:357
↓ 7 callersMethodreorder
Note that this operation is in-place
verl/verl/protocol.py:705
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader_depracated.py:92
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/mcore/loader.py:97
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/llama/megatron/checkpoint_utils/llama_loader_depracated.py:94
↓ 6 callersFunction_fetch_tensor
fetch tensor
verl/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader.py:92
↓ 6 callersFunction_fetch_tensor
fetch tensor
verl/verl/models/llama/megatron/checkpoint_utils/llama_loader.py:94
↓ 6 callersFunction_repeat_interleave
(value: Union[torch.Tensor, np.ndarray], repeats: int)
verl/verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py:70
↓ 6 callersMethodadd
(self, data: DataProto)
verl/tests/ray_cpu/test_auto_padding.py:35
↓ 6 callersMethodadd
(self, idx: int, val: int)
verl/verl/utils/seqlen_balancing.py:31
↓ 6 callersFunctioncombined_int_check
(val)
verl/verl/utils/reward_score/prime_code/testing_util.py:76
↓ 6 callersFunctioncopy_local_path_from_hdfs
Deprecated. Please use copy_to_local instead.
verl/verl/utils/fs.py:73
↓ 6 callersFunctioncreate_random_mask
Create a random mask given input_ids. Support left padding and right padding. Process: - Sample valid token length - Sample left_padding l
verl/verl/utils/model.py:161
↓ 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/verl/utils/ulysses.py:86
↓ 6 callersFunctionhf_processor
Create a huggingface processor to process multimodal data. Args: name_or_path (str): The name of the processor. Returns: tra
verl/verl/utils/tokenizer.py:64
↓ 6 callersMethodinit_workers
Init resource pool and worker group
verl/verl/trainer/ppo/ray_trainer.py:702
↓ 6 callersFunctionis_non_local
(path)
verl/verl/utils/fs.py:33
↓ 6 callersFunctionlogprobs_from_logits
See: https://github.com/pytorch/pytorch/issues/563#issuecomment-330103591
verl/verl/utils/torch_functional.py:53
↓ 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/verl/models/transformers/monkey_patch.py:36
↓ 6 callersMethodsubmit_chat_completions
Submit a chat completion request to chat scheduler and wait until it is done. To submit multiple requests in parallel, please use `generate_se
verl/verl/workers/rollout/async_server.py:309
↓ 6 callersFunctiontruncatefn
(s, length=300)
verl/verl/utils/reward_score/prime_code/testing_util.py:39
↓ 5 callersMethod__init__
(self, config: Qwen2Config, megatron_config: ModelParallelConfig)
verl/verl/models/qwen2/megatron/modeling_qwen2_megatron.py:82
↓ 5 callersMethod__init__
(self, config: LlamaConfig, megatron_config: ModelParallelConfig)
verl/verl/models/llama/megatron/modeling_llama_megatron.py:82
next →1–100 of 1,563, ranked by callers