MCPcopy Create free account

hub / github.com/McGill-NLP/the-markovian-thinker / functions

Functions2,081 in github.com/McGill-NLP/the-markovian-thinker

↓ 2 callersMethodgenerate_state_dict
(self)
verl/utils/checkpoint/megatron_checkpoint_manager.py:231
↓ 2 callersMethodget
(self)
verl/protocol.py:1090
↓ 2 callersFunctionget_checkpoint_tracker_filename
Tracker file rescords the latest chckpoint during training to restart from.
verl/utils/checkpoint/checkpoint_manager.py:199
↓ 2 callersMethodget_client
(cls)
verl/utils/rollout_trace.py:92
↓ 2 callersFunctionget_common_default_kwargs_for_parallel_linear
()
verl/utils/megatron/tensor_parallel.py:52
↓ 2 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/trainer/ppo/reward.py:42
↓ 2 callersFunctionget_dynamic_pipeline_shards
Calculate the pipeline sharding configuration for Megatron-LM. Args: layer_num: Total number of layers in the model. pp_size: Num
verl/model_merger/megatron_model_merger.py:49
↓ 2 callersFunctionget_entropy_reduction_enum
Get the enum for the reduction method of cross entropy.
verl/utils/kernel/kernels.py:99
↓ 2 callersFunctionget_generation_config
( model: str, trust_remote_code: bool = False, )
verl/utils/model.py:79
↓ 2 callersMethodget_generation_prompt_ids
Get the generation prompt ids for rollout engine. Because rollout engine(SGLang) requires the ids to be a list, we need to convert t
verl/workers/rollout/schemas.py:345
↓ 2 callersFunctionget_huggingface_actor_config
(model_name: str, override_config_kwargs=None, trust_remote_code=False)
verl/utils/model.py:67
↓ 2 callersFunctionget_mcore_weight_converter
Get the weight converter for given model architecture.
verl/models/mcore/registry.py:230
↓ 2 callersFunctionget_megatron_last_lr
Get the last learning rate from the optimizer parameter scheduler.
verl/utils/megatron/optimizer.py:104
↓ 2 callersFunctionget_megatron_optimizer
( model, config: OptimizerConfig, no_weight_decay_cond=None, scale_lr_cond=None, lr_mult=1
verl/utils/megatron/optimizer.py:47
↓ 2 callersFunctionget_megatron_optimizer_param_scheduler
Get the optimizer parameter scheduler for Megatron.
verl/utils/megatron/optimizer.py:64
↓ 2 callersFunctionget_model_config
(model)
verl/utils/megatron_utils.py:45
↓ 2 callersFunctionget_named_tensor_buckets
Group tensors into buckets based on a specified size in megabytes. Args: iterable: An iterator of tuples containing tensor names and
verl/workers/rollout/sglang_rollout/utils.py:71
↓ 2 callersFunctionget_npu_profiler
Generate and return an NPU profiler object. Args: option (DictConfig): The options to control npu profiler. role (str
verl/utils/profiler/mstx_profile.py:89
↓ 2 callersFunctionget_random_string
(length: int)
verl/single_controller/ray/base.py:33
↓ 2 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/utils/seqlen_balancing.py:150
↓ 2 callersFunctionget_trajectory_tracker
()
verl/utils/debug/trajectory_tracker.py:79
↓ 2 callersMethodget_transformers_auto_model_class
(self)
scripts/legacy_model_merger.py:110
↓ 2 callersMethodget_transformers_auto_model_class
(self)
verl/model_merger/base_model_merger.py:191
↓ 2 callersFunctiongrade_answer
The answer will be considered correct if: (a) it normalizes to the same string as the ground truth answer OR (b) sympy can simplify t
verl/utils/reward_score/prime_math/__init__.py:246
↓ 2 callersFunctionhighlight_keyword
(content: str, keyword: Optional[str])
scripts/rollout_viewer.py:100
↓ 2 callersFunctioninit_megatron_optim_config
(optim_config: dict)
verl/utils/megatron/optimizer.py:24
↓ 2 callersMethodinit_workers
Initialize distributed training workers using Ray backend. Creates: 1. Ray resource pools from configuration 2. Worker groups
verl/trainer/ppo/ray_trainer.py:780
↓ 2 callersFunctioninitialize_tools_from_config
(tools_config_file)
verl/tools/utils/tool_registry.py:82
↓ 2 callersFunctionis_ipv6
Check if the given string is an IPv6 address Args: ip_str: The IP address string to check Returns: bool: Returns True i
verl/utils/net_utils.py:47
↓ 2 callersMethodis_padding_enabled
Check if padding is enabled for the DataProto. Returns: bool: True if padding is enabled, False otherwise.
verl/protocol.py:768
↓ 2 callersFunctionis_tensor_parallel_param
(param)
verl/utils/megatron/tensor_parallel.py:95
↓ 2 callersFunctionkl_penalty
Compute KL divergence given logprob and ref_logprob. Copied from https://github.com/huggingface/trl/blob/main/trl/trainer/ppo_trainer.py#L1104
verl/trainer/ppo/core_algos.py:1432
↓ 2 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/utils/reward_score/math_dapo.py:20
↓ 2 callersFunctionlayered_summon_lora_params
(fsdp_module)
verl/utils/fsdp_utils.py:568
↓ 2 callersFunctionlist_of_dict_to_dict_of_list
(list_of_dict: list[dict])
verl/protocol.py:237
↓ 2 callersFunctionload_dist_checkpointing
(sharded_state_dict, ckpt_dir)
verl/utils/megatron/dist_checkpointing.py:46
↓ 2 callersFunctionload_megatron_optimizer
(optimizers)
verl/utils/megatron_utils.py:486
↓ 2 callersFunctionload_path
(p: Path, data: dict, mask_strs: str, idx: int, pbar)
scripts/rollout_viewer.py:54
↓ 2 callersFunctionload_state_dict_to_megatron_gptmodel
Load merged state_dict to sharded Megatron module in training.
verl/models/mcore/loader.py:56
↓ 2 callersFunctionload_valuehead_model
(local_path, torch_dtype, model_config, trust_remote_code)
verl/utils/model.py:623
↓ 2 callersMethodlog
(self, func, *args, **kwargs)
verl/utils/profiler/performance.py:109
↓ 2 callersMethodlog_in_single_table
(self, loggers, samples, step)
verl/utils/tracking.py:291
↓ 2 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/protocol.py:728
↓ 2 callersMethodmake_minibatch_iterator
Make minibatch iterator for updating the actor Args: data (DataProto): a DataProto containing keys ``input_ids``
verl/workers/actor/megatron_actor.py:278
↓ 2 callersFunctionmark_end_range
End a mark range in the profiler. Args: range_id (str): The id of the mark range to end.
verl/utils/profiler/nvtx_profile.py:48
↓ 2 callersFunctionmark_start_range
Start a mark range in the profiler. Args: message (str, optional): The message to be displayed in the profiler. Defaults to N
verl/utils/profiler/nvtx_profile.py:27
↓ 2 callersFunctionmath_equal
Exact match of math if and only if: 1. numerical equal: both can convert to float and are equal 2. symbolic equal: both can convert to sy
verl/utils/reward_score/prime_math/grader.py:174
↓ 2 callersMethodmaybe_filter_out_long_prompts
(self, dataframe: datasets.Dataset = None)
verl/utils/dataset/rl_dataset.py:143
↓ 2 callersFunctionmaybe_patch_fsdp_module
(model)
verl/utils/fsdp_utils.py:488
↓ 2 callersFunctionmcp2openai
Convert a MCP Tool to an OpenAI ChatCompletionTool.
verl/tools/utils/mcp_clients/utils.py:45
↓ 2 callersFunctionmd5_encode
Generate an MD5 hash of a path string. This function is used to create unique identifiers for paths, typically for creating cache directories
verl/utils/fs.py:46
↓ 2 callersFunctionnormalize
(answer, pi)
verl/utils/reward_score/prime_math/grader.py:121
↓ 2 callersFunctionnormalize_model_name
Transform the model name in each model_chunk in each pp stage into the name in inference engine
verl/utils/model.py:318
↓ 2 callersMethodoffload
Offload.
verl/utils/activation_offload.py:173
↓ 2 callersMethodoffload_params_to_cpu
(self)
verl/workers/reward_model/megatron/reward_model.py:337
↓ 2 callersMethodon_group_commit_forward
On group commit forward.
verl/utils/activation_offload.py:161
↓ 2 callersMethodoptimizer_zero_grad
Zero out gradients of all parameters before starting a new backward pass.
verl/workers/engine/base.py:104
↓ 2 callersFunctionpad_2d_list_to_length
pad a 2D list (e.g. responses, logprobs) to a 2D tensor.
verl/utils/torch_functional.py:307
↓ 2 callersFunctionparse_repo_id
Split a repo_id like "owner/name" into (owner, name).
scripts/hf_clone_branch_to_repo.py:39
↓ 2 callersFunctionpatch_vllm_moe_model_weight_loader
(model)
verl/utils/vllm/patch.py:56
↓ 2 callersFunctionpearson_correlation_coefficient
(tensor1: torch.Tensor, tensor2: torch.Tensor, mask: torch.Tensor)
verl/utils/debug/metrics.py:48
↓ 2 callersFunctionper_tensor_generator
( actor_module, model_config, weight_converter, transformer_config, layer_name_mapping,
verl/utils/megatron_utils.py:810
↓ 2 callersFunctionpostprocess_packed_seqs_for_dict_output
_summary_ For fused kernels, the output is a dictionary with keys like 'log_probs', 'entropy', etc. This function post-processes each tensor i
verl/models/mcore/util.py:228
↓ 2 callersFunctionprocess_image
(image: dict | Image.Image)
verl/utils/dataset/vision_utils.py:23
↓ 2 callersFunctionprocess_video
Converts a video dict into a [n_frames, 3, H, W] tensor Add video sample FPS in a future MR
verl/utils/dataset/vision_utils.py:62
↓ 2 callersFunctionray_noset_visible_devices
(env_vars=os.environ)
verl/utils/ray_utils.py:25
↓ 2 callersFunctionrecover_left_padding
Recover left padding from result return result
verl/models/mcore/util.py:206
↓ 2 callersMethodreload
Reload.
verl/utils/activation_offload.py:188
↓ 2 callersFunctionremove_boxed
Remove the LaTeX boxed command from a string. Args: s: String with format "\\boxed{content}" Returns: The content inside the
verl/utils/reward_score/math_dapo.py:50
↓ 2 callersFunctionremove_left_padding
Remove left padding from input_ids, attention_mask and position_ids return new_input_ids, new_attention_mask, new_position_ids
verl/models/mcore/util.py:165
↓ 2 callersMethodreorder
Note that this operation is in-place
verl/protocol.py:867
↓ 2 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/models/qwen2/megatron/layers/parallel_attention.py:138
↓ 2 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/models/llama/megatron/layers/parallel_attention.py:167
↓ 2 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:38
↓ 2 callersFunctionrollout_trace_attr
A context manager to add attributes to a trace for the configured backend.
verl/utils/rollout_trace.py:105
↓ 2 callersFunctionrotate_half
Rotates half the hidden dims of the input.
verl/models/transformers/kimi_vl.py:35
↓ 2 callersMethodrun
Run agent loop to interact with LLM server and environment. Args: sampling_params (Dict[str, Any]): LLM sampling params.
verl/experimental/agent_loop/agent_loop.py:295
↓ 2 callersMethodsave_hf_model_and_tokenizer
(self, merged_state_dict)
verl/model_merger/megatron_model_merger.py:413
↓ 2 callersFunctionset_ulysses_sequence_parallel_group
Set ulysses sequence parallel process group.
verl/utils/ulysses.py:30
↓ 2 callersMethodshard_data
Shard or partition data for distributed training or parallel execution. Args: data: Data structure to be sharded across
verl/workers/engine/base.py:128
↓ 2 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/utils/checkpoint/checkpoint_manager.py:206
↓ 2 callersMethodsleep
Offload model weights and discard kv cache.
verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py:505
↓ 2 callersMethodsleep
Sleep all rollout server instances.
verl/experimental/agent_loop/agent_loop.py:909
↓ 2 callersFunctionsplit_tuple
Split the elements in a tuple/interval, while handling well-formatted commas in large numbers
verl/utils/reward_score/prime_math/__init__.py:227
↓ 2 callersFunctionstrip_string
(string)
verl/utils/reward_score/math.py:162
↓ 2 callersFunctionstripped_string_compare
(s1, s2)
verl/utils/reward_score/prime_code/testing_util.py:571
↓ 2 callersFunctionsupport_distributed_convert
(hf_config: AutoConfig)
scripts/converter_hf_to_mcore.py:407
↓ 2 callersFunctiontemp_env_var
Context manager for temporarily setting an environment variable. This context manager ensures that environment variables are properly set and res
verl/utils/py_functional.py:277
↓ 2 callersFunctionulysses_pad
(input_ids_rmpad: torch.Tensor, position_ids_rmpad: Optional[torch.Tensor] = None, sp_size: int = 1)
verl/utils/ulysses.py:278
↓ 2 callersMethodunshard_data
Reconstruct or gather sharded data back to a unified format. Args: data: Sharded data structure to reconstruct.
verl/workers/engine/base.py:140
↓ 2 callersMethodupdate_critic
(self, data: DataProto)
verl/workers/fsdp_workers.py:1307
↓ 2 callersMethodupdate_policy
Update the policy with an iterator of DataProto Args: data (DataProto): an iterator over the DataProto that returns by
verl/workers/actor/base.py:54
↓ 2 callersMethodupload_to_huggingface
(self)
scripts/legacy_model_merger.py:218
↓ 2 callersMethodupload_to_huggingface
(self)
verl/model_merger/base_model_merger.py:302
↓ 2 callersMethodvalidate
Validate critic configuration with runtime parameters. Args: n_gpus: Total number of GPUs available train_batch_size:
verl/workers/config/critic.py:93
↓ 2 callersFunctionvocab_parallel_log_probs_from_logits
TODO(zhangchi.usc1992): We may change the implementation later
verl/utils/megatron/tensor_parallel.py:154
↓ 1 callersMethod__enter__
(self)
verl/utils/activation_offload.py:73
↓ 1 callersMethod__enter__
(self)
verl/workers/engine/fsdp/engine_impl.py:691
↓ 1 callersMethod__exit__
(self, *args: Any)
verl/utils/activation_offload.py:77
↓ 1 callersMethod__exit__
(self, exc_type, exc_value, traceback)
verl/workers/engine/fsdp/engine_impl.py:699
← previousnext →401–500 of 2,081, ranked by callers