MCPcopy Create free account

hub / github.com/Alibaba-NLP/VRAG / functions

Functions1,037 in github.com/Alibaba-NLP/VRAG

↓ 226 callersMethodget
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
VRAG-RL/verl/utils/memory_buffer.py:43
↓ 130 callersMethodto
move the batch to device Args: device (torch.device, str): torch device Returns: DataProto: the current Data
VRAG-RL/verl/protocol.py:357
↓ 84 callersMethodget
(self)
VRAG-RL/verl/protocol.py:801
↓ 51 callersFunctionlog_gpu_memory_usage
(head: str, logger: logging.Logger = None, level=logging.DEBUG, rank: int = 0)
VRAG-RL/verl/utils/debug/performance.py:20
↓ 44 callersFunctionprint_rank_0
If distributed is initialized, print only on rank 0.
VRAG-RL/verl/utils/megatron_utils.py:257
↓ 33 callersMethodpop
Pop a subset of the DataProto via `batch_keys` and `meta_info_keys` Args: batch_keys (list, optional): a list of strings indicati
VRAG-RL/verl/protocol.py:487
↓ 31 callersMethodupdate
(self, current_kl, n_steps)
VRAG-RL/verl/trainer/ppo/core_algos.py:52
↓ 23 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
VRAG-RL/verl/protocol.py:603
↓ 22 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
VRAG-RL/verl/utils/fs.py:58
↓ 19 callersMethoddecode
Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special tokens and clean up tokeniz
VRAG-RL/verl/workers/rollout/tokenizer.py:86
↓ 18 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
VRAG-RL/verl/protocol.py:322
↓ 16 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.
VRAG-RL/verl/protocol.py:636
↓ 16 callersFunctionconvert_config
(hf_config: PretrainedConfig, megatron_config)
VRAG-RL/verl/utils/megatron_utils.py:154
↓ 15 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
VRAG-RL/verl/utils/ulysses.py:61
↓ 14 callersFunctionhf_tokenizer
Create a huggingface pretrained tokenizer which correctness handles eos and pad tokens. Args: name (str): The name of the tokenizer.
VRAG-RL/verl/utils/tokenizer.py:35
↓ 14 callersMethodsearch
(self, query)
demo/vrag_agent.py:59
↓ 13 callersMethodselect
Select a subset of the DataProto via batch_keys and meta_info_keys Args: batch_keys (list, optional): a list of strings indicatin
VRAG-RL/verl/protocol.py:371
↓ 12 callersFunction_timer
(name: str, timing_raw: Dict[str, float])
VRAG-RL/verl/trainer/ppo/ray_trainer.py:242
↓ 12 callersMethodrepeat
Repeat the batch data a specified number of times. Args: repeat_times (int): Number of times to repeat the data.
VRAG-RL/verl/protocol.py:668
↓ 11 callersMethodto_dtype
(precision)
VRAG-RL/verl/utils/torch_dtypes.py:63
↓ 10 callersFunctionget_ulysses_sequence_parallel_world_size
Get ulysses sequence parallel world size.
VRAG-RL/verl/utils/ulysses.py:45
↓ 10 callersMethodnamed_parameters
(self)
VRAG-RL/verl/utils/memory_buffer.py:208
↓ 10 callersFunctionoffload_fsdp_model_to_cpu
(model: FSDP, empty_cache: bool = True)
VRAG-RL/verl/utils/fsdp_utils.py:115
↓ 9 callersMethodgenerate
(self,messages)
VRAG-RL/scripts/data_construct_pipeline.py:118
↓ 9 callersMethodget_megatron_rank_info
(self)
VRAG-RL/verl/single_controller/base/megatron/worker.py:31
↓ 9 callersMethodget_rng_state
()
VRAG-RL/verl/utils/checkpoint/checkpoint_manager.py:97
↓ 9 callersFunctionget_ulysses_sequence_parallel_group
Get ulysses sequence parallel process group.
VRAG-RL/verl/utils/ulysses.py:37
↓ 9 callersFunctionload_fsdp_model_to_gpu
(model: FSDP)
VRAG-RL/verl/utils/fsdp_utils.py:136
↓ 9 callersMethodpreprocess_data
(self, data: DataProto)
VRAG-RL/verl/workers/sharding_manager/base.py:29
↓ 8 callersMethodadd
(self, idx: int, val: int)
VRAG-RL/verl/utils/seqlen_balancing.py:33
↓ 8 callersMethodlog
(self, data, step, backend=None)
VRAG-RL/verl/utils/tracking.py:92
↓ 8 callersFunctionmasked_mean
Compute mean of tensor with a masked values.
VRAG-RL/verl/utils/torch_functional.py:118
↓ 8 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
VRAG-RL/verl/utils/torch_functional.py:242
↓ 8 callersMethodpostprocess_data
(self, data: DataProto)
VRAG-RL/verl/workers/sharding_manager/base.py:32
↓ 8 callersMethodtrain
(self)
VRAG-RL/verl/workers/sharding_manager/megatron_vllm.py:169
↓ 7 callersFunction_megatron_calc_global_rank
given TP,DP,PP rank to get the global rank.
VRAG-RL/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.
VRAG-RL/verl/models/llama/megatron/checkpoint_utils/llama_saver.py:30
↓ 7 callersFunctionappend_to_dict
(data: Dict, new_data: Dict)
VRAG-RL/verl/utils/py_functional.py:41
↓ 7 callersFunctionclean_traceback
(error_traceback)
VRAG-RL/verl/utils/reward_score/prime_code/testing_util.py:101
↓ 7 callersMethodeval
(self)
VRAG-RL/verl/workers/sharding_manager/megatron_vllm.py:165
↓ 7 callersFunctionoffload_fsdp_optimizer
(optimizer)
VRAG-RL/verl/utils/fsdp_utils.py:152
↓ 7 callersMethodsave_pretrained
(self, output_path)
search_engine/models/GVE/models.py:191
↓ 7 callersFunctionunwrap_model
(model, module_instances=ALL_MODULE_WRAPPER_CLASSNAMES)
VRAG-RL/verl/utils/megatron_utils.py:136
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
VRAG-RL/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader.py:100
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
VRAG-RL/verl/models/llama/megatron/checkpoint_utils/llama_loader.py:104
↓ 6 callersMethodbatch_decode
This method forwards all its arguments to Qwen2TokenizerFast's [`~PreTrainedTokenizer.batch_decode`]. Please refer to the docstring o
search_engine/models/GVE/qwen25vl/qwen25vl_processor.py:179
↓ 6 callersFunctioncombined_int_check
(val)
VRAG-RL/verl/utils/reward_score/prime_code/testing_util.py:97
↓ 6 callersMethodencode
Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary. Args: text (`str`, `List[str]` or
VRAG-RL/verl/workers/rollout/tokenizer.py:70
↓ 6 callersMethodencode
(self, texts)
search_engine/models/GVE/models.py:133
↓ 6 callersMethodget
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
VRAG-RL/verl/utils/megatron/memory.py:33
↓ 6 callersFunctionlogprobs_from_logits
See: https://github.com/pytorch/pytorch/issues/563#issuecomment-330103591
VRAG-RL/verl/utils/torch_functional.py:48
↓ 6 callersFunctionrepeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=1, repeats=n_rep). The hidden states go from (batch, num_key_value_heads, seqlen, he
VRAG-RL/verl/models/qwen2/megatron/layers/parallel_attention.py:131
↓ 6 callersFunctiontruncatefn
(s, length=300)
VRAG-RL/verl/utils/reward_score/prime_code/testing_util.py:42
↓ 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
VRAG-RL/verl/utils/ulysses.py:252
↓ 6 callersMethodunion
Union with another DataProto. Union batch and meta_info separately. Throw an error if - there are conflict keys in batch and they are
VRAG-RL/verl/protocol.py:545
↓ 5 callersMethod__init__
(self, config: Qwen2Config, megatron_config: ModelParallelConfig)
VRAG-RL/verl/models/qwen2/megatron/modeling_qwen2_megatron.py:81
↓ 5 callersMethod__init__
(self, config: LlamaConfig, megatron_config: ModelParallelConfig)
VRAG-RL/verl/models/llama/megatron/modeling_llama_megatron.py:82
↓ 5 callersMethod_encode_by_sub_batch
(self, texts, sub_batch_size=None)
search_engine/models/GVE/models.py:86
↓ 5 callersFunction_hdfs_cmd
(cmd: str)
VRAG-RL/verl/utils/hdfs_io.py:139
↓ 5 callersFunction_run_cmd
(cmd: str, timeout=None)
VRAG-RL/verl/utils/hdfs_io.py:135
↓ 5 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids)
VRAG-RL/verl/models/qwen2/megatron/layers/parallel_attention.py:123
↓ 5 callersFunctionauto_scroll_to_bottom
注入 JS 自动滚动左列容器到底部
demo/vimrag_app.py:670
↓ 5 callersFunctionbroadcast_dict_tensor
TODO: optimize this. Technically, we only need one broadcast
VRAG-RL/verl/utils/torch_functional.py:179
↓ 5 callersMethodcreate_attention_mask
Create attention mask from input ids.
VRAG-RL/vrag_agent/tensor_helper.py:32
↓ 5 callersFunctiondist_gather_tensor
(t: Optional[torch.Tensor])
search_engine/models/GVE/model_utils.py:35
↓ 5 callersFunctionfunc
(*args, **kwargs)
VRAG-RL/verl/single_controller/ray/base.py:38
↓ 5 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:
VRAG-RL/verl/utils/ulysses.py:85
↓ 5 callersFunctiongather_outpus_and_unpad
(x: Tensor, gather_dim: int, unpad_dim: int = None,
VRAG-RL/verl/utils/ulysses.py:233
↓ 5 callersFunctionget_eos_mask
end of sentence token can be int or list: 1 or [1, 2] e.g. eos_token=1 response_id: [0, 0, 2, 42, 3, 5, 1, 0, 0] eos_mask: [1, 1,
VRAG-RL/verl/utils/torch_functional.py:150
↓ 5 callersFunctionget_init_weight_context_manager
(use_meta_tensor=True, mesh: DeviceMesh = None)
VRAG-RL/verl/utils/fsdp_utils.py:39
↓ 5 callersFunctionget_micro_data_parallel_world_size
()
VRAG-RL/verl/workers/sharding_manager/megatron_vllm.py:439
↓ 5 callersFunctionget_model
Build the model.
VRAG-RL/verl/utils/megatron_utils.py:42
↓ 5 callersMethodinit_model
(self)
VRAG-RL/verl/workers/fsdp_workers.py:783
↓ 5 callersFunctionis_non_local
(path)
VRAG-RL/verl/utils/fs.py:32
↓ 5 callersFunctionis_transformers_version_in_range
(min_version: str, max_version: str)
VRAG-RL/verl/models/transformers/monkey_patch.py:73
↓ 5 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
VRAG-RL/verl/utils/seqlen_balancing.py:224
↓ 5 callersFunctionrefresh_graph
刷新 Memory Graph 可视化
demo/vimrag_app.py:660
↓ 5 callersMethodto_dict
(self)
VRAG-RL/verl/single_controller/base/worker.py:76
↓ 5 callersFunctionupdate_model_config
(module_config, override_config_kwargs)
VRAG-RL/verl/utils/model.py:42
↓ 4 callersFunction_broadcast_tensor
broadcast tensor across mp_group
VRAG-RL/verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:123
↓ 4 callersFunction_broadcast_tensor
broadcast tensor across mp_group
VRAG-RL/verl/models/llama/megatron/checkpoint_utils/llama_saver.py:126
↓ 4 callersFunction_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
VRAG-RL/verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:162
↓ 4 callersFunction_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
VRAG-RL/verl/models/llama/megatron/checkpoint_utils/llama_saver.py:165
↓ 4 callersFunction_get_cpu_tensor
(tensor: torch.Tensor)
VRAG-RL/verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:116
↓ 4 callersFunction_get_cpu_tensor
(tensor: torch.Tensor)
VRAG-RL/verl/models/llama/megatron/checkpoint_utils/llama_saver.py:119
↓ 4 callersFunction_get_gpt_model
(model)
VRAG-RL/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader.py:66
↓ 4 callersFunction_get_gpt_model
(model)
VRAG-RL/verl/models/llama/megatron/checkpoint_utils/llama_loader.py:70
↓ 4 callersFunction_is_non_local
(path: str)
VRAG-RL/verl/utils/hdfs_io.py:143
↓ 4 callersFunction_repeat_interleave
(value: Union[torch.Tensor, np.ndarray], repeats: int)
VRAG-RL/verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py:58
↓ 4 callersMethod_save_index_and_metadata
内部方法,用于保存索引和元数据。
search_engine/search_engine.py:256
↓ 4 callersFunction_split_args_kwargs_data_proto
(chunks, *args, **kwargs)
VRAG-RL/verl/single_controller/base/decorator.py:45
↓ 4 callersFunctionallgather_dict_tensors
TODO: optimize this. - We can use async ops - We can use only one allgather Args: tensors: size: group:
VRAG-RL/verl/utils/torch_functional.py:188
↓ 4 callersFunctionapply_monkey_patch
(config: PretrainedConfig, verbose=True)
VRAG-RL/verl/models/transformers/monkey_patch.py:49
↓ 4 callersFunctionbuild_memory_reference_from_module
(module: torch.nn.Module, memory_buffers: Dict[torch.dtype, MemoryBuffe
VRAG-RL/verl/utils/memory_buffer.py:100
↓ 4 callersFunctioncheck_model_support_rmpad
(model_type: str)
VRAG-RL/verl/models/registry.py:25
↓ 4 callersFunctioncompute_position_id_with_mask
(mask)
VRAG-RL/verl/utils/model.py:194
↓ 4 callersMethodconcatenate_with_padding
Concatenate tensors and handle padding.
VRAG-RL/vrag_agent/tensor_helper.py:40
↓ 4 callersMethoddump
(self, data: io.BytesIO, name)
VRAG-RL/verl/utils/debug/trajectory_tracker.py:59
↓ 4 callersMethodestimate_flops
Estimate the FLOPS based on the number of valid tokens in the current batch and the time taken. Args: batch_seqlens (Lis
VRAG-RL/verl/utils/flops_counter.py:114
↓ 4 callersMethodexecute_rank_zero_async
(self, method_name: str, *args, **kwargs)
VRAG-RL/verl/single_controller/ray/base.py:342
next →1–100 of 1,037, ranked by callers