MCPcopy Create free account

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

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

↓ 17 callersFunctioncheck_correctness
Check correctness of code generation with a global timeout. The global timeout is to catch some extreme/rare cases not handled by the timeouts
verl/verl/utils/reward_score/prime_code/utils.py:41
↓ 17 callersFunctioncompute_rollout_correction_and_rejection_mask
Unified interface for computing IS weights and rejection masks. This function combines IS weight calculation (truncated) and rejection sampling (
verl/verl/trainer/ppo/rollout_corr_helper.py:553
↓ 17 callersMethoddump
(self, outputs: DataProto)
verl/verl/utils/rollout_skip.py:105
↓ 17 callersMethodfrom_single_dict
Create a DataProto from a dict of tensors and non_tensors
verl/verl/protocol.py:487
↓ 17 callersMethodmerge
(self, other)
verl/verl/utils/seqlen_balancing.py:48
↓ 17 callersMethodput
(self, key: str, value: str, path: Optional[str] = None)
demo/qwen_agent/tools/storage.py:75
↓ 17 callersMethodspawn
Spawn to a dictionary of worker groups, each with a subset of method with prefix. Args: prefix_set: Set of prefixes to create wor
verl/verl/single_controller/ray/base.py:604
↓ 17 callersMethodstart_profile
Start profiling for the current rank in the current training step.
verl/verl/workers/fsdp_workers.py:1112
↓ 17 callersMethodstop_profile
Stop profiling for the current rank in the current training step.
verl/verl/workers/fsdp_workers.py:1117
↓ 17 callersMethodunion
(self, other: "ProfilerConfig")
verl/verl/utils/profiler/config.py:126
↓ 16 callersMethodcompute_ref_log_prob
(self, data: DataProto)
verl/recipe/spin/fsdp_workers.py:169
↓ 16 callersFunctionconvert_config
[Deprecated] convert config Args: hf_config (PretrainedConfig): _description_ megatron_config (_type_): _description_ Return
verl/verl/utils/megatron_utils.py:319
↓ 16 callersFunctioncreate_rl_dataset
Create a dataset. Arguments: data_paths: List of paths to data files. data_config: The data config. tokenizer (Tokenizer)
verl/verl/trainer/main_ppo.py:369
↓ 16 callersFunctiongather_outputs_and_unpad
Gather a tensor across a process group and optionally unpad its padded elements. Args: x (Tensor): Input tensor to gather. g
verl/verl/utils/ulysses.py:243
↓ 16 callersFunctionget_ulysses_sequence_parallel_world_size
Get ulysses sequence parallel world size.
verl/verl/utils/ulysses.py:46
↓ 16 callersFunctionoffload_fsdp_optimizer
(optimizer)
verl/verl/utils/fsdp_utils.py:204
↓ 16 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/verl/utils/seqlen_balancing.py:261
↓ 16 callersFunctionset_expandable_segments
Enable or disable expandable segments for cuda. Args: enable (bool): Whether to enable expandable segments. Used to avoid OOM.
verl/verl/utils/device.py:88
↓ 16 callersFunctionunion_numpy_dict
(tensor_dict1: dict[str, np.ndarray], tensor_dict2: dict[str, np.ndarray])
verl/verl/protocol.py:187
↓ 15 callersMethod_validate
(self)
verl/recipe/spin/spin_trainer.py:487
↓ 15 callersMethodinit_class
This is used to do heavy initialization work that should shared across all instances. It's only called once. Args: config (DictCo
verl/verl/experimental/agent_loop/agent_loop.py:210
↓ 15 callersFunctionmasked_mean
Compute the mean of `values` over elements selected by `mask`. Args: values (Tensor): Input tensor. mask (Tensor): Boolean o
verl/verl/utils/torch_functional.py:171
↓ 15 callersMethodrun_single
(self, data: DataProto)
verl/verl/experimental/reward/reward_loop/limited.py:348
↓ 15 callersMethodsearch
(query: str)
demo/qwen_agent/tools/web_search.py:51
↓ 15 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:296
↓ 14 callersMethod_make_request
Make a HTTP request with retry logic and consistent error handling. Args: endpoint (str): The API endpoint to call (without leadi
verl/verl/workers/rollout/sglang_rollout/http_server_engine.py:290
↓ 14 callersFunctioncreate_rl_sampler
Create a sampler for the dataset. Arguments: data_config: The data config. dataset (Dataset): The dataset. Returns:
verl/verl/trainer/main_ppo.py:419
↓ 14 callersMethodexecute_all_sync
Execute a method on all workers synchronously. Args: method_name: Name of the method to execute *args: Positional arg
verl/verl/single_controller/ray/base.py:739
↓ 14 callersFunctionmodel_forward_gen
(vision_model: bool = False)
verl/verl/models/mcore/model_forward.py:28
↓ 14 callersMethodstop
(self)
verl/verl/utils/profiler/profile.py:100
↓ 13 callersMethod_preprocess_prompt_to_async_rollout_requests
(self, prompts: DataProto, n: int = 1)
verl/verl/workers/rollout/sglang_rollout/sglang_rollout.py:1431
↓ 13 callersMethodall_gather
(self)
verl/tests/single_controller/test_worker_group_torch.py:39
↓ 13 callersFunctioncreate_test_data_proto
Helper to create DataProto for testing.
verl/tests/experimental/reward/test_rate_limited_reward_manager_on_cpu.py:123
↓ 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:73
↓ 13 callersFunctionfused_forward_model_gen
(vision_model: bool = False)
verl/verl/models/mcore/model_forward_fused.py:65
↓ 13 callersFunctionget_nccl_backend
Return nccl backend type based on the device type. Returns: nccl backend type string.
verl/verl/utils/device.py:76
↓ 13 callersFunctionload_extern_type
Load a external data type based on the file path and type name
verl/verl/utils/import_utils.py:83
↓ 13 callersFunctionlocal_mkdir_safe
_summary_ Thread-safe directory creation function that ensures the directory is created even if multiple processes attempt to create it simult
verl/verl/utils/fs.py:277
↓ 13 callersFunctionlogprobs_from_logits
Compute per-token log-probabilities for the given labels. Uses a Flash-Attention–based cross-entropy (if available) for efficient backward,
verl/verl/utils/torch_functional.py:64
↓ 13 callersFunctionshould_save_ckpt_esi
Determine if checkpoint should be saved based on capacity esi expiration. Args: max_steps_duration: Max estimated time (seconds) req
verl/verl/utils/checkpoint/checkpoint_manager.py:207
↓ 13 callersMethodto_tensordict
Convert this DataProto to TensorDict. Note that this requires tensordict version at least 0.10 Returns:
verl/verl/protocol.py:1109
↓ 13 callersMethodupdate_content
(self, search_keyword: Optional[str] = None)
verl/scripts/rollout_viewer.py:292
↓ 12 callersMethodadd
(self, data: DataProto)
verl/tests/single_controller/test_auto_padding_on_cpu.py:35
↓ 12 callersFunctioncompute_reward
(response)
verl/recipe/genrm_remote/reward_function.py:68
↓ 12 callersMethodcompute_rm_score
(self, data: DataProto)
verl/recipe/spin/fsdp_workers.py:542
↓ 12 callersMethodcompute_values
(self, data: DataProto)
verl/verl/workers/fsdp_workers.py:1488
↓ 12 callersFunctionfn
(batch, **kwargs)
verl/tests/utils/test_rollout_skip_on_cpu.py:48
↓ 12 callersMethodgenerate_response
(self, instance_id, messages, **kwargs)
verl/tests/workers/rollout/test_sglang_multi_interaction.py:52
↓ 12 callersMethodgenerate_sequences
Split input batch and dispatch to agent loop workers. Args: prompts (BatchMeta): Input batch. Returns: Batch
verl/recipe/transfer_queue/agent_loop.py:24
↓ 12 callersMethodgenerate_sequences
Batch generate sequences in sync mode. Args: prompts: The input prompts. Returns: The output sequences.
verl/verl/workers/rollout/base.py:69
↓ 12 callersMethodget_data_parallel_group
(self)
verl/verl/workers/engine/base.py:145
↓ 12 callersFunctionget_ulysses_sequence_parallel_group
Get ulysses sequence parallel process group.
verl/verl/utils/ulysses.py:38
↓ 12 callersFunctionneed_reference_policy
Given a role worker mapping, do we need ref policy.
verl/verl/trainer/ppo/utils.py:72
↓ 12 callersFunctionprint_traceback
(is_error: bool = True)
demo/qwen_agent/utils/utils.py:84
↓ 12 callersFunctionskip_whitespace
(s, pos)
verl/recipe/collabllm/collabllm_interation.py:235
↓ 12 callersFunctionskip_whitespace
(s, pos)
verl/recipe/collabllm/utils.py:81
↓ 12 callersFunctiontemp_env_var
Context manager for temporarily setting an environment variable. This context manager ensures that environment variables are properly set and res
verl/verl/utils/py_functional.py:281
↓ 12 callersFunctionto_tensor
Copied from ManiSkill! Maps any given sequence to a torch tensor on the CPU/GPU. If physx gpu is not enabled then we use CPU, otherwise G
verl/recipe/vla/envs/action_utils.py:54
↓ 12 callersMethodupdate
(self, batch)
verl/tests/utils/dataset/test_create_rl_sampler_on_cpu.py:46
↓ 12 callersMethodupdate_actor
(self, data: DataProto)
verl/verl/workers/roles/actor.py:144
↓ 12 callersMethodupdate_critic
(self, data: DataProto)
verl/verl/workers/fsdp_workers.py:1508
↓ 11 callersMethod_async_rollout_a_request
( self, req: AsyncRolloutRequest, do_sample: bool = True, is_validate: bool =
verl/verl/workers/rollout/sglang_rollout/sglang_rollout.py:812
↓ 11 callersMethodbackward
(ctx, g_logprobs: torch.Tensor, g_entropy: torch.Tensor)
verl/tests/utils/test_special_linear_cross_entropy_tp.py:128
↓ 11 callersMethodbackward
(ctx: Any, grad_output: Tensor)
verl/verl/utils/ulysses.py:224
↓ 11 callersFunctioncompute_throughout_metrics
Computes throughput metrics for PPO training. This function calculates performance metrics related to token processing speed, including
verl/verl/trainer/ppo/metric_utils.py:269
↓ 11 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:181
↓ 11 callersMethodgenerate
( self, prompt_ids: list[int], sampling_params: dict[str, Any], request_id: st
verl/verl/workers/engine_workers.py:208
↓ 11 callersFunctionget_reverse_idx
Build the inverse of an index mapping. Args: idx_map (Sequence[int]): Sequence where idx_map[i] = j. Returns: List[int]
verl/verl/utils/seqlen_balancing.py:337
↓ 11 callersFunctionimport_external_libs
(external_libs=None)
verl/verl/utils/import_utils.py:72
↓ 11 callersFunctioninitialize_global_process_group
(timeout_second=36000)
verl/verl/utils/distributed.py:54
↓ 11 callersMethodis_mp_src_rank_with_outputs
Whether the current rank is the first rank in model parallel group that contains model outputs
verl/verl/workers/engine/base.py:194
↓ 11 callersFunctionoffload_megatron_optimizer
(optimizers)
verl/verl/utils/megatron_utils.py:547
↓ 11 callersFunctionpreprocess_packed_seqs
Preprocess packed sequences CP splits sequence into CP*2 chunks, and each GPU gets 2 chunks (GPU0 gets first and last chunks, GPU1 gets s
verl/verl/models/mcore/util.py:25
↓ 10 callersMethod_handle_apply_chat_template
( processing_class: PreTrainedTokenizer | PreTrainedTokenizerFast | ProcessorMixin, messages:
verl/verl/workers/rollout/schemas.py:225
↓ 10 callersFunctionapply_monkey_patch
Apply monkey patch to the models for ulysses sequence parallel and fused kernel. In the end of this function forward function of the model i
verl/verl/models/transformers/monkey_patch.py:248
↓ 10 callersMethodcall
The interface for calling tools. Each tool needs to implement this function, which is the workflow of the tool. Args: pa
demo/qwen_agent/tools/base.py:126
↓ 10 callersFunctioncompute_data_metrics
Computes various metrics from a batch of data for PPO training. This function calculates metrics related to scores, rewards, advantages, ret
verl/verl/trainer/ppo/metric_utils.py:80
↓ 10 callersFunctioncompute_timing_metrics
Computes timing metrics for different processing stages in PPO training. This function calculates both raw timing metrics (in seconds) and p
verl/verl/trainer/ppo/metric_utils.py:227
↓ 10 callersMethodget_placement_groups
(self, strategy="STRICT_PACK", name=None, device_name="cuda")
verl/verl/single_controller/ray/base.py:110
↓ 10 callersMethodget_type_and_value
(self)
demo/qwen_agent/llm/schema.py:116
↓ 10 callersFunctionrollout_trace_attr
A context manager to add attributes to a trace for the configured backend. Args: sample_index: Sample index for the trace. step:
verl/verl/utils/rollout_trace.py:121
↓ 9 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/mcore/loader.py:104
↓ 9 callersMethod_make_async_request
Make an async HTTP request with retry logic and consistent error handling. Args: endpoint (str): The API endpoint to call (withou
verl/verl/workers/rollout/sglang_rollout/http_server_engine.py:658
↓ 9 callersFunction_megatron_calc_global_rank
Calculate global rank with support for CP/EP parallelism
verl/verl/models/mcore/saver.py:30
↓ 9 callersMethod_save_checkpoint
(self)
verl/recipe/spin/spin_trainer.py:694
↓ 9 callersFunction_timer
(name: str, timing_raw: dict[str, float])
verl/recipe/spin/spin_trainer.py:323
↓ 9 callersMethodcancel
(self)
verl/recipe/fully_async_policy/agent_loop/agent_loop.py:310
↓ 9 callersFunctionconvert_weight_keys
(state_dict: dict[str, torch.Tensor], model: PreTrainedModel)
verl/verl/utils/model.py:228
↓ 9 callersFunctioncreate_colocated_worker_cls
This function should return a class instance that delegates the calls to every cls in cls_dict
verl/verl/single_controller/ray/base.py:874
↓ 9 callersMethoddecode
( self, token_ids: int | list[int] | torch.Tensor | Any, # `Any` = np.ndarray | tf.Tensor
verl/recipe/vla/models/openvla_oft/processing_prismatic.py:250
↓ 9 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/verl/utils/flops_counter.py:379
↓ 9 callersFunctionfind_latest_ckpt_path
Return the most recent checkpoint directory based on a tracker file. Args: path (str): Base directory containing the checkpoint trac
verl/verl/utils/checkpoint/checkpoint_manager.py:167
↓ 9 callersMethodfinish
(self)
verl/verl/utils/tracking.py:245
↓ 9 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
↓ 9 callersFunctionget_fsdp_wrap_policy
Get FSDP wrap policy for the module. Args: module: The module to get wrap policy for config: Configuration for wrap policy
verl/verl/utils/fsdp_utils.py:73
↓ 9 callersFunctionget_reward_manager_cls
Get the reward manager class with a given name. Args: name: `(str)` The name of the reward manager. Returns: `(t
verl/verl/workers/reward_manager/registry.py:43
↓ 9 callersMethodinit_model
Override init_model to use FlowRLActor instead of DataParallelPPOActor.
verl/recipe/flowrl/flowrl_fsdp_worker.py:385
↓ 9 callersMethodinit_model
(self)
verl/verl/workers/roles/actor.py:98
↓ 9 callersFunctioninitialize_interactions_from_config
Initialize interactions from configuration file. Args: interaction_config_file: Path to the interaction configuration file. Returns:
verl/verl/interactions/utils/interaction_registry.py:42
↓ 9 callersMethodmake_iterator
r"""Make an iterator from the DataProto. This is built upon that TensorDict can be used as a normal Pytorch dataset. See https://pytorch.org/t
verl/verl/protocol.py:807
← previousnext →101–200 of 4,735, ranked by callers