MCPcopy Create free account

hub / github.com/DLYuanGod/MegaTrain / functions

Functions5,181 in github.com/DLYuanGod/MegaTrain

↓ 9 callersFunctionconvert_to_regular_types
Convert Hydra configs and other special types to regular Python types.
verl/verl/utils/py_functional.py:333
↓ 9 callersMethodcreate
Create agent loop manager.
verl/verl/experimental/agent_loop/agent_loop.py:1066
↓ 9 callersMethoddecode
( self, token_ids: int | list[int] | torch.Tensor | Any, # `Any` = np.ndarray | tf.Tensor
verl/verl/experimental/vla/models/openvla_oft/processing_prismatic.py:250
↓ 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:76
↓ 9 callersMethodget_micro_batch_router_list
Return the list of RouterReplay instances corresponding to the current micro-batch and local (pp_rank, vp_stage) layer range.
verl/verl/utils/megatron/router_replay_utils.py:476
↓ 9 callersFunctionnormalize_peft_param_name
Converts peft model parameter name to base parameter name For example, base_model.model.model.embed_tokens.weight -> model.embed_toke
verl/verl/utils/fsdp_utils.py:768
↓ 9 callersFunctionpreprocess_thd_engine
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:315
↓ 9 callersFunctionrecursive_to_own
(obj)
verl/verl/experimental/vla/workers/env/env_manager.py:134
↓ 9 callersMethodregister_buffer
Simple buffer registration (for standalone use).
infinity/ops/layers.py:94
↓ 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 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:528
↓ 9 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:124
↓ 9 callersMethodstep
(self, actions=None, critic_values=None)
verl/verl/experimental/vla/envs/isaac_env/isaac_env.py:163
↓ 9 callersMethodto
Move model parameters, optimizer states, or both to the specified device. Note that this function executes irrespective of offload co
verl/verl/workers/engine/megatron/transformer_impl.py:496
↓ 9 callersMethodto
Move FSDP model and/or optimizer to CPU or GPU with offload support. Note that this function executes irrespective of offload config.
verl/verl/workers/engine/fsdp/transformer_impl.py:675
↓ 9 callersMethodwrap_generate_sequences
(self)
verl/verl/utils/rollout_skip.py:260
↓ 8 callersMethod_get_gpu_layer
Get the GPU layer template for a given layer index and buffer slot.
infinity/model/cpu_master.py:779
↓ 8 callersMethod_load_layer_to_buffer_async
Load CPU layer params to GPU buffer asynchronously. Uses pre-flattened pinned buffers for efficient DMA transfer.
infinity/model/cpu_master.py:877
↓ 8 callersFunction_maybe_to_cpu
(v)
verl/examples/flowgrpo_trainer/vllm_omni/pipeline_qwenimage.py:31
↓ 8 callersMethod_unflatten_to_layer
Unflatten GPU buffer to the appropriate layer template parameters.
infinity/model/cpu_master.py:914
↓ 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 callersFunctioncompute_advantage
Compute advantage estimates for policy optimization. This function computes advantage estimates using various estimators like GAE, GRPO, REINFORC
verl/verl/trainer/ppo/ray_trainer.py:136
↓ 8 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
↓ 8 callersMethodcompute_rm_score
(self, data: DataProto)
verl/verl/experimental/reward_loop/reward_loop.py:343
↓ 8 callersFunctionconvert_weight_keys
(state_dict: dict[str, torch.Tensor], model: PreTrainedModel)
verl/verl/utils/model.py:242
↓ 8 callersMethodcreate_resource_pool
Create Ray resource pools for distributed training. Initializes resource pools based on the resource pool specification, with each po
verl/verl/single_controller/ray/base.py:191
↓ 8 callersMethodensure_checkpoint_capacity
Remove old checkpoints to make room for a new one, keeping a safety buffer. With max_ckpt_to_keep=1, this does nothing - we keep the
verl/verl/utils/checkpoint/checkpoint_manager.py:144
↓ 8 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:713
↓ 8 callersMethodflush_cache
Flush the cache of the server. This method repeatedly attempts to flush the server cache until successful. The flush operation will n
verl/verl/workers/rollout/sglang_rollout/http_server_engine.py:500
↓ 8 callersMethodget_input_embeddings
(self)
verl/verl/experimental/vla/models/openvla_oft/modeling_prismatic.py:379
↓ 8 callersMethodget_per_tensor_param
Get a generator that yields per-tensor parameters and optional peft config. Returns: Generator[tuple[str, torch.Tensor]]
verl/verl/workers/engine/base.py:150
↓ 8 callersFunctioninit_agent_loop_manager
(config: DictConfig)
verl/tests/experimental/agent_loop/agent_utils.py:29
↓ 8 callersMethodinit_model
(self)
verl/verl/workers/fsdp_workers.py:1645
↓ 8 callersFunctioninitialize_global_process_group
(timeout_second=36000)
verl/verl/utils/distributed.py:60
↓ 8 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
↓ 8 callersFunctionis_transformers_version_in_range
(min_version: Optional[str] = None, max_version: Optional[str] = None)
verl/verl/utils/transformers_compat.py:40
↓ 8 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:800
↓ 8 callersMethodmy_method
(self, a, b="default")
verl/tests/utils/test_rollout_trace_on_cpu.py:50
↓ 8 callersFunctionneed_critic
Given a config, do we need critic.
verl/verl/trainer/ppo/utils.py:96
↓ 8 callersFunctionpad_input
Unified entry point for `pad_input` across CUDA and NPU backends. Dynamically dispatches to the appropriate device-specific implementation:
verl/verl/utils/attention_utils.py:53
↓ 8 callersFunctionprint_model_size
(model: nn.Module, name: str = None)
verl/verl/utils/model.py:188
↓ 8 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:348
↓ 8 callersMethodregister_checkpoint
Register a successfully saved checkpoint and enforce retention limit. Adds the new checkpoint path to tracking and removes excess ol
verl/verl/utils/checkpoint/checkpoint_manager.py:159
↓ 8 callersMethodrun
Run the environment interaction loop. This method orchestrates a pipelined process: 1. Resets environments to specified initi
verl/verl/experimental/vla/env_loop.py:80
↓ 8 callersFunctionsave_param_meta
Save parameter metadata for rebuild.
verl/verl/utils/qat/vllm_patch.py:242
↓ 8 callersFunctionset_expandable_segments
Configure CUDA memory allocator expandable segments setting. Expandable segments can help avoid out-of-memory (OOM) errors by allowing the me
verl/verl/utils/device.py:132
↓ 8 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:298
↓ 8 callersFunctionvalidate_ulysses_config
(num_heads, ulysses_sequence_size)
verl/verl/utils/ulysses.py:333
↓ 7 callersMethod__init__
(self, hidden_size: int = 1024, intermediate_size: int = 4096, hidden_act: str = "gelu_pytorch_tanh")
verl/verl/experimental/vla/models/pi0_torch/model/paligemma_with_expert.py:415
↓ 7 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/trtllm_rollout/trtllm_rollout.py:170
↓ 7 callersMethod_sync_params_to_gpu
Sync CPU master params to GPU modules (call after optimizer step).
infinity/model/cpu_master.py:825
↓ 7 callersMethod_validate
(self)
verl/verl/experimental/vla/rob_ray_trainer.py:561
↓ 7 callersMethodadd
(self, data: DataProto)
verl/tests/single_controller/test_split_resource_pool.py:49
↓ 7 callersMethodannotate
( cls, message: Optional[str] = None, color: Optional[str] = None, domain: Opt
verl/verl/utils/profiler/profile.py:160
↓ 7 callersMethodcheck_weights
(self)
verl/tests/checkpoint_engine/test_utils.py:75
↓ 7 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:86
↓ 7 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:982
↓ 7 callersFunctioncreate_trainer_worker_group
( resource_pool: RayResourcePool, model_config: HFModelConfig, checkpoint_engine_config: CheckpointEngineC
verl/tests/checkpoint_engine/test_utils.py:122
↓ 7 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:585
↓ 7 callersMethodfinalize_interaction
Finalizes the interaction session and releases any associated state or resources. Simulates: release state
verl/verl/interactions/base.py:66
↓ 7 callersMethodfinish
(self)
verl/verl/utils/tracking.py:273
↓ 7 callersMethodgenerate_sequences
Split input batch and dispatch to env loop workers. Args: prompts (DataProto): Input batch. Returns: DataPro
verl/verl/experimental/vla/env_loop.py:61
↓ 7 callersMethodget
Get the checkpoint engine class. Args: backend: The backend of the checkpoint engine. Returns: The checkpoin
verl/verl/checkpoint_engine/base.py:57
↓ 7 callersMethodget_client
(cls)
verl/verl/utils/rollout_trace.py:111
↓ 7 callersMethodget_data_parallel_size
(self)
verl/verl/workers/engine/base.py:160
↓ 7 callersFunctionget_model
Build the model.
verl/verl/utils/megatron_utils.py:59
↓ 7 callersFunctionget_npu_versions
Get the software version and CANN toolkit version for NPU devices. Returns: tuple[str, str]: A tuple of (software_version, cann_version)
verl/verl/utils/device.py:187
↓ 7 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:471
↓ 7 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
↓ 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:213
↓ 7 callersMethodinfer_batch
Perform inference on a batch of data. Args: data: The input data for inference, typically containing tensors and metadat
verl/verl/workers/engine/base.py:133
↓ 7 callersFunctionis_distillation_enabled
Check if distillation is enabled based on the provided configuration.
verl/verl/trainer/distillation/losses.py:39
↓ 7 callersMethodlog
(self, data, step)
verl/verl/utils/logger/aggregate_logger.py:49
↓ 7 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
↓ 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:51
↓ 7 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:489
↓ 7 callersFunctionrebuild_shared_memory
Rebuild tensor from shared memory.
verl/verl/workers/rollout/vllm_rollout/bucketed_weight_transfer.py:65
↓ 7 callersFunctionsimple_timer
Context manager for basic timing without NVTX markers. This utility function measures the execution time of code within its context and accum
verl/verl/utils/profiler/performance.py:155
↓ 7 callersFunctionslice_input_tensor
(x: Tensor, dim: int, padding: bool = True, group: ProcessGroup = None)
verl/verl/utils/ulysses.py:117
↓ 7 callersMethodstep
Perform a single optimization step with bias correction.
infinity/optimizer.py:78
↓ 7 callersMethodstop
(self)
verl/verl/utils/profiler/profile.py:154
↓ 7 callersMethodupdate_actor
(self, data: DataProto)
verl/verl/workers/fsdp_workers.py:1029
↓ 7 callersMethodupdate_weights
( self, weights: Generator[tuple[str, torch.Tensor], None, None], **kwargs, )
verl/tests/checkpoint_engine/test_utils.py:65
↓ 7 callersMethodupdate_weights
Update the weights of the rollout model. Args: weights: A generator that yields the name of the weight tensor and the tensor itse
verl/verl/workers/rollout/base.py:54
↓ 7 callersMethodupdate_weights_from_tensor
Update model weights from tensor data. The HTTP server will only post meta data, and the real weights will be copied directly from GP
verl/verl/workers/rollout/sglang_rollout/http_server_engine.py:348
↓ 6 callersMethod__post_init__
Validate actor configuration parameters.
verl/verl/workers/config/actor.py:196
↓ 6 callersFunction_broadcast_tensor
broadcast tensor across mp_group
verl/verl/models/mcore/saver.py:141
↓ 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:34
↓ 6 callersMethod_load_checkpoint
(self)
verl/verl/trainer/main_ppo_sync.py:716
↓ 6 callersFunction_make_batch
Build a minimal TensorDict accepted by prepare_micro_batches. Args: seq_lens: Effective sequence length for each sample. force_gr
verl/tests/utils/test_prepare_micro_batches_with_group_size.py:34
↓ 6 callersFunction_make_prompt
(tokenizer, text="What is 2+2?")
verl/tests/utils/test_special_adapter_path_integration.py:80
↓ 6 callersMethod_query_dispatch_info
Query the dispatch info for a given mesh name. Args: mesh_name (str): Name of the mesh to query dispatch info for
verl/verl/single_controller/base/worker.py:103
↓ 6 callersFunction_worker_load_layer_to_buffer_async
Load layer weights from shared-memory flat to GPU buffer. Direct shared-memory → GPU copy (non_blocking). Not as fast as pinned → GPU DMA, bu
infinity/model/mp_worker.py:176
↓ 6 callersFunction_worker_unflatten_to_layer
Unflatten GPU buffer to the appropriate layer template parameters.
infinity/model/mp_worker.py:592
↓ 6 callersMethodaggregate_dp
(cls, metric_lists: list["Metric"])
verl/verl/utils/metric/utils.py:139
↓ 6 callersFunctionapply_monkey_patch
Apply monkey patch to the models for ulysses sequence parallel, fused kernel, tiled MLP and prefix grouper. In the end of this function forw
verl/verl/models/transformers/monkey_patch.py:291
↓ 6 callersMethodas_tensor
View buffer as a pinned tensor (no copy).
infinity/csrc/__init__.py:51
↓ 6 callersFunctionauto_set_device
Automatically configure device name for different accelerators. For example, on Ascend NPU, this function defaults the trainer device to "npu"
verl/verl/utils/device.py:149
↓ 6 callersFunctioncalculate_workload
Calculate approximate computational workload for transformer attention. Estimates FLOPs for dense transformer blocks based on sequence length usi
verl/verl/utils/seqlen_balancing.py:27
← previousnext →201–300 of 5,181, ranked by callers