MCPcopy Create free account

hub / github.com/AMAP-ML/Thinking-with-Map / functions

Functions4,735 in github.com/AMAP-ML/Thinking-with-Map

↓ 9 callersMethodnew
Function to create a new training engine instance based on the provided config. Args: key: A configuration object contain
verl/verl/workers/engine/base.py:258
↓ 9 callersFunctionperform_api_call
Performs a single batch search for multiple queries (original search tool behavior). Args: url: The URL of API. query: query
verl/verl/tools/utils/api_utils.py:253
↓ 9 callersMethodrelease
Release the tool instance. Args: instance_id: The instance id of the tool.
verl/verl/tools/base_tool.py:87
↓ 9 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
verl/verl/models/transformers/kimi_vl.py:79
↓ 9 callersMethodrun
Run the environment interaction loop. This method orchestrates a pipelined process: 1. Resets environments to specified initi
verl/recipe/vla/env_loop.py:78
↓ 9 callersMethodsleep
(self)
verl/recipe/fully_async_policy/agent_loop/agent_loop.py:323
↓ 9 callersMethodstart
(self, **kwargs)
verl/verl/utils/profiler/mstx_profile.py:192
↓ 8 callersMethod_balance_batch
Reorder the data on single controller such that each dp rank gets similar total tokens
verl/recipe/spin/spin_trainer.py:806
↓ 8 callersFunction_create_param_from_subclass_attributes
(custom_param)
verl/verl/utils/vllm/vllm_fp8_utils.py:230
↓ 8 callersMethod_load_checkpoint
(self)
verl/recipe/spin/spin_trainer.py:749
↓ 8 callersFunction_sh
(cmd: str)
verl/verl/tools/utils/api_utils.py:57
↓ 8 callersFunctionall_gather_data_proto
(data: DataProto, process_group)
verl/verl/protocol.py:1229
↓ 8 callersFunctionapply_fsdp2
model: AutoModelForCausalLM
verl/verl/utils/fsdp_utils.py:507
↓ 8 callersFunctionapply_rotary_pos_emb
Applies Rotary Position Embedding to the query and key tensors. Args: q (`torch.Tensor`): The query tensor. k (`torch.Tensor`): T
verl/verl/models/transformers/kimi_vl.py:43
↓ 8 callersFunctioncheck_mutually_exclusive
Validate mutually exclusive micro batch size configuration options. Ensures that users don't set both deprecated micro_batch_size and
verl/verl/utils/config.py:117
↓ 8 callersFunctionconvert_to_regular_types
Convert Hydra configs and other special types to regular Python types.
verl/verl/utils/py_functional.py:311
↓ 8 callersFunctioncount_tokens
(text: str)
demo/qwen_agent/utils/tokenization_qwen.py:245
↓ 8 callersMethodflush_cache
(self)
verl/verl/workers/rollout/sglang_rollout/sglang_rollout.py:158
↓ 8 callersMethodget_data_parallel_size
(self)
verl/verl/workers/engine/base.py:139
↓ 8 callersFunctionget_init_weight_context_manager
(use_meta_tensor=True, mesh: DeviceMesh = None)
verl/verl/utils/fsdp_utils.py:57
↓ 8 callersMethodinit_model
(self)
verl/recipe/spin/fsdp_workers.py:401
↓ 8 callersFunctionis_valid_ipv6_address
(address: str)
verl/verl/workers/rollout/utils.py:26
↓ 8 callersFunctionmake_batch_generator
Creates a batch generator suitable for Megatron pipeline parallelism, handling virtual pipeline parallelism (VPP). If VPP is used (vpp_s
verl/verl/utils/megatron/pipeline_parallel.py:49
↓ 8 callersFunctionmerge_generate_cfgs
(base_generate_cfg: Optional[dict], new_generate_cfg: Optional[dict])
demo/qwen_agent/utils/utils.py:479
↓ 8 callersMethodmy_method
(self, a, b="default")
verl/tests/utils/test_rollout_trace_on_cpu.py:50
↓ 8 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/verl/protocol.py:73
↓ 8 callersFunctionpatch_vllm_moe_model_weight_loader
(model)
verl/verl/utils/vllm/patch.py:70
↓ 8 callersFunctionprepare_dynamic_batch
Prepare a batch for dynamic batching. Args: data (DataProto): The input data. max_token_len (int): The maximum token length
verl/verl/utils/seqlen_balancing.py:355
↓ 8 callersFunctionprint_model_size
(model: nn.Module, name: str = None)
verl/verl/utils/model.py:174
↓ 8 callersMethodrank
Get the rank of this worker in the distributed setup.
verl/verl/single_controller/base/worker.py:322
↓ 8 callersMethodsleep
Sleep all rollout replica instances.
verl/verl/experimental/reward/reward_model.py:108
↓ 8 callersMethodtokenizer
Load a simple tokenizer for testing.
verl/tests/experimental/reward/test_rate_limited_reward_manager_on_cpu.py:159
↓ 8 callersMethodtype
(self)
demo/qwen_agent/llm/schema.py:122
↓ 8 callersFunctionunpad_dataproto
Unpad the data proto with pad_size. i.e. `data[:-pad_size]`
verl/verl/protocol.py:101
↓ 8 callersMethodvalidate
Validate actor configuration with runtime parameters.
verl/verl/workers/config/actor.py:160
↓ 8 callersFunctionvalidate_ulysses_config
(num_heads, ulysses_sequence_size)
verl/verl/utils/ulysses.py:324
↓ 7 callersMethod__init__
Initialize SearchTool with configuration and schema. Args: config: Configuration dictionary containing tool settings
verl/verl/tools/map_tool.py:666
↓ 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:29
↓ 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:29
↓ 7 callersMethodadd
(self, data: DataProto)
verl/tests/single_controller/test_split_resource_pool.py:44
↓ 7 callersMethodannotate
( cls, message: Optional[str] = None, color: Optional[str] = None, domain: Opt
verl/verl/utils/profiler/profile.py:231
↓ 7 callersMethodapi_call
(self, query: str, query_type: str)
verl/tool_server/api_server_redis.py:495
↓ 7 callersFunctionapply_kl_penalty
Apply KL penalty to the token-level rewards. This function computes the KL divergence between the reference policy and current policy, then a
verl/recipe/transfer_queue/ray_trainer.py:165
↓ 7 callersFunctioncompute_advantage
(data: DataProto, beta=1.0)
verl/recipe/sppo/sppo_ray_trainer.py:68
↓ 7 callersMethodcompute_log_prob
Compute the log probability of the responses given input_ids, attention_mask and position_ids Args: data (DataProto): a DataProto
verl/recipe/vla/dp_rob.py:175
↓ 7 callersFunctioncompute_response_mask
Compute the attention mask for the response part of the sequence. This function extracts the portion of the attention mask that corresponds to th
verl/recipe/vla/rob_ray_trainer.py:50
↓ 7 callersFunctioncompute_reward
Compute reward for a batch of data. Args: data: DataProto object containing the input data. reward_fn: Reward function to com
verl/verl/trainer/ppo/reward.py:190
↓ 7 callersMethodconvert_tokens_to_ids
(self, tokens: Union[bytes, str, List[Union[bytes, str]]])
demo/qwen_agent/utils/tokenization_qwen.py:135
↓ 7 callersFunctioncopy_local_path_from_hdfs
Deprecated. Please use copy_to_local instead.
verl/verl/utils/fs.py:232
↓ 7 callersFunctionextract_multi_modal_inputs
Extract and process multi-modal inputs from a batch. Args: batch_data (list[dict[str, torch.Tensor]]): The batch containing potentia
verl/verl/utils/model.py:688
↓ 7 callersFunctionextract_text_from_message
( msg: Message, add_upload_info: bool, lang: Literal['auto', 'en', 'zh'] = 'auto', )
demo/qwen_agent/utils/utils.py:443
↓ 7 callersMethodfinalize_interaction
Finalizes the interaction session and releases any associated state or resources. Simulates: release state
verl/verl/interactions/base.py:66
↓ 7 callersFunctionget_free_port
(address: str)
verl/verl/workers/rollout/utils.py:34
↓ 7 callersMethodget_input_embeddings
(self)
verl/recipe/vla/models/openvla_oft/modeling_prismatic.py:379
↓ 7 callersFunctionget_seqlen_balanced_partitions
Calculates partitions of indices from seqlen_list such that the sum of sequence lengths in each partition is balanced. Uses the Karmarkar-Kar
verl/verl/utils/seqlen_balancing.py:161
↓ 7 callersFunctionhas_chinese_chars
(data: Any)
demo/qwen_agent/utils/utils.py:95
↓ 7 callersFunctionis_transformers_version_in_range
(min_version: Optional[str] = None, max_version: Optional[str] = None)
verl/verl/utils/transformers_compat.py:40
↓ 7 callersFunctionlast_boxed_only_string
Extract the last LaTeX boxed expression from a string. Args: string: Input string containing LaTeX code Returns: The last bo
verl/verl/utils/reward_score/math_dapo.py:20
↓ 7 callersMethodload_checkpoint
(self, local_path, del_local_after_load=True)
verl/recipe/prime/prime_fsdp_workers.py:365
↓ 7 callersMethodlog
(self, data, step)
verl/verl/utils/logger/aggregate_logger.py:49
↓ 7 callersFunctionnormalize_final_answer
Normalize a final answer to a quantitative reasoning question. Args: final_answer: The answer string to normalize Returns: N
verl/verl/utils/reward_score/math_dapo.py:124
↓ 7 callersFunctionparallel_put
Puts a list of data into the Ray object store in parallel using a thread pool. Args: data_list (List[Any]): A list of Python objects
verl/verl/utils/ray_utils.py:49
↓ 7 callersFunctionprepare_inputs
(tokenizer, prompts, max_prompt_length)
verl/tests/workers/rollout/utils_sglang.py:95
↓ 7 callersFunctionprocess_validation_metrics
Process validation metrics into a structured format with statistical analysis. This function organizes validation metrics by data source and
verl/verl/trainer/ppo/metric_utils.py:382
↓ 7 callersFunctionremove_boxed
Remove the LaTeX boxed command from a string. Args: s: String with format "\\boxed{content}" Returns: The content inside the
verl/verl/utils/reward_score/math_dapo.py:50
↓ 7 callersFunctionrestore_dynamic_batch
Restore a batch from dynamic batching. Args: data (torch.Tensor): The input data. batch_idx_list (List[List[int]]): The list
verl/verl/utils/seqlen_balancing.py:394
↓ 7 callersMethodresume_memory_occupation
Resume GPU occupation.
verl/verl/workers/rollout/sglang_rollout/sglang_rollout.py:147
↓ 7 callersMethodsave_checkpoint
(self, local_path, hdfs_path=None, global_step=0, max_ckpt_to_keep=None)
verl/recipe/prime/prime_fsdp_workers.py:350
↓ 7 callersMethodstep
(self, actions=None)
verl/recipe/vla/envs/isaac_env/isaac_env.py:163
↓ 7 callersMethodto_dict
(self)
demo/qwen_agent/tools/doc_parser.py:40
↓ 7 callersMethodtruncate
(s, max_length=256)
demo/qwen_agent/tools/python_executor.py:183
↓ 7 callersFunctionupdate_model_config
Update the module config with the override_config_kwargs. Args: module_config: The module config from Huggingface Transformers. ov
verl/verl/utils/model.py:59
↓ 7 callersMethodwake_up
(self)
verl/verl/workers/sharding_manager/fsdp_sglang.py:129
↓ 7 callersMethodwrap_generate_sequences
(self)
verl/verl/utils/rollout_skip.py:67
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader_depracated.py:104
↓ 6 callersFunction_broadcast_tensor
broadcast tensor across mp_group
verl/verl/models/mcore/saver.py:141
↓ 6 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/llama/megatron/checkpoint_utils/llama_loader_depracated.py:106
↓ 6 callersMethod_dump_generations
Dump rollout/validation samples as JSONL.
verl/recipe/transfer_queue/ray_trainer.py:560
↓ 6 callersFunction_fetch_tensor
fetch tensor
verl/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader.py:104
↓ 6 callersFunction_fetch_tensor
fetch tensor
verl/verl/models/llama/megatron/checkpoint_utils/llama_loader.py:106
↓ 6 callersFunction_get_base_transformer_config
Create a base TransformerConfig with common parameters across different model architectures. TODO: (ycl) use dataclass or converter config?
verl/verl/models/mcore/config_converter.py:32
↓ 6 callersMethodadd_assistant_message
( self, processing_class: PreTrainedTokenizer | PreTrainedTokenizerFast | ProcessorMixin,
verl/verl/workers/rollout/schemas.py:395
↓ 6 callersFunctioncombined_int_check
(val)
verl/verl/utils/reward_score/prime_code/testing_util.py:77
↓ 6 callersMethodcompute_log_prob
Compute logits given a batch of data. Args: data (DataProto): a batch of data represented by DataProto. It must contain key ```in
verl/verl/workers/actor/base.py:39
↓ 6 callersMethodcreate_resource_pool
(self)
verl/recipe/spin/spin_trainer.py:59
↓ 6 callersFunctionformat_as_text_message
( msg: Message, add_upload_info: bool, lang: Literal['auto', 'en', 'zh'] = 'auto', )
demo/qwen_agent/utils/utils.py:425
↓ 6 callersFunctionfsdp2_load_full_state_dict
Loads the full state dict (could be only on rank 0) into the sharded model. This is done by broadcasting the parameters from rank 0 to all ot
verl/verl/utils/fsdp_utils.py:451
↓ 6 callersMethodgenerate
Generate text using the SGLang server. Args: prompt (Optional[str], optional): Text prompt for generation. Defaults to None.
verl/verl/workers/rollout/sglang_rollout/http_server_engine.py:424
↓ 6 callersFunctionget_basename_from_url
(path_or_url: str)
demo/qwen_agent/utils/utils.py:108
↓ 6 callersFunctionget_custom_reward_fn
Load and return a custom reward function from external file. Dynamically imports a reward function from a specified file path and wraps it wi
verl/verl/trainer/ppo/reward.py:61
↓ 6 callersFunctionget_generation_config
( model: str, trust_remote_code: bool = False, )
verl/verl/utils/model.py:84
↓ 6 callersMethodget_instance
(cls)
verl/verl/utils/rollout_trace.py:60
↓ 6 callersMethodget_n_gpus
Get the number of gpus in this cluster.
verl/recipe/spin/spin_trainer.py:76
↓ 6 callersFunctionget_rollout_config
( max_response_length, max_prompt_length, dtype, tensor_parallel_size, tool_config_path=No
verl/tests/workers/rollout/utils_sglang.py:125
↓ 6 callersFunctionget_supported_model
(model_type: str)
verl/verl/models/mcore/registry.py:169
↓ 6 callersFunctionget_version
(pkg)
verl/verl/workers/rollout/vllm_rollout/__init__.py:20
↓ 6 callersFunctionhf_to_mcore_config
Convert huggingface PretrainedConfig to mcore TransformerConfig. Args: hf_config: The huggingface PretrainedConfig. dtype: The dt
verl/verl/models/mcore/registry.py:179
↓ 6 callersFunctionis_non_local
Check if a path is a non-local (HDFS) path. Args: path (str): The path to check. Returns: bool: True if the path is an HDFS
verl/verl/utils/fs.py:34
↓ 6 callersMethodload_checkpoint
(self)
verl/verl/trainer/fsdp_sft_trainer.py:607
↓ 6 callersFunctionload_fsdp_optimizer
(optimizer, device_id)
verl/verl/utils/fsdp_utils.py:216
← previousnext →201–300 of 4,735, ranked by callers