MCPcopy Create free account

hub / github.com/DLYuanGod/MegaTrain / functions

Functions5,181 in github.com/DLYuanGod/MegaTrain

↓ 18 callersMethodall_gather
(self)
verl/tests/single_controller/test_worker_group_torch.py:40
↓ 18 callersMethodapply_chat_template
( self, messages: list[dict[str, Any]], *, tools: Optional[list[dict]] = None,
verl/tests/experimental/agent_loop/test_agent_loop_extra_fields_schema_on_cpu.py:70
↓ 18 callersFunctioncheck_ipc_version_support
Check if the given software and CANN versions support IPC. Compares the software version and CANN toolkit version against minimum required ve
verl/verl/utils/device.py:241
↓ 18 callersMethodcompute_score
(self, data: DataProto)
verl/verl/experimental/reward_loop/reward_loop.py:148
↓ 18 callersMethodget_parameters
Get all parameters, deduplicated by object id to avoid double-optimizing tied weights.
infinity/model/cpu_master.py:1830
↓ 18 callersMethodload_state_dict
(self, state_dict)
verl/verl/workers/engine/torchtitan/utils.py:60
↓ 18 callersFunctionmodel_forward_gen
(vision_model: bool = False)
verl/verl/models/mcore/model_forward.py:38
↓ 18 callersMethodsleep_replicas
Sleep all rollout replicas: free weight and kv_cache device memory.
verl/verl/checkpoint_engine/base.py:399
↓ 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 callersFunctionget_nccl_backend
Get the distributed communication backend based on device type. Returns the appropriate collective communication backend for the detected acc
verl/verl/utils/device.py:116
↓ 17 callersFunctionno_padding_2_padding
Slice response from unpad model output. Args: tensor: a nested tensor or a tensor of shape (total_nnz,*), total_nnz is the to
verl/verl/workers/utils/padding.py:99
↓ 17 callersFunctionoffload_megatron_model_to_cpu
In megatron, the model and optimizer storage are: - bf16 parameter data chunked in model parallel group - fp32 grad chunked in model para
verl/verl/utils/megatron_utils.py:479
↓ 17 callersMethodremove
(cls, name: str)
verl/verl/utils/py_functional.py:291
↓ 16 callersFunction_make_mocks
Create mock rollout and actor engine. Args: peft_config: If not None, get_per_tensor_param returns this as peft_config. Use a
verl/tests/workers/test_engine_workers_lora_sync.py:91
↓ 16 callersFunction_update_weights
Reproduce the update_weights() logic from engine_workers.py. This mirrors the actual code so we can test the branching without importing the
verl/tests/workers/test_engine_workers_lora_sync.py:36
↓ 16 callersFunctionfused_forward_model_gen
(vision_model: bool = False)
verl/verl/models/mcore/model_forward_fused.py:68
↓ 16 callersMethodget_placement_groups
(self, strategy="STRICT_PACK", name=None, device_name="cuda")
verl/verl/single_controller/ray/base.py:130
↓ 16 callersFunctionget_ulysses_sequence_parallel_group
Get ulysses sequence parallel process group.
verl/verl/utils/ulysses.py:38
↓ 16 callersFunctionunion_numpy_dict
(tensor_dict1: dict[str, np.ndarray], tensor_dict2: dict[str, np.ndarray])
verl/verl/protocol.py:188
↓ 15 callersFunctionappend_to_dict
Append values from new_data to lists in data. For each key in new_data, this function appends the corresponding value to a list stored under
verl/verl/utils/py_functional.py:187
↓ 15 callersFunctionbuild_cli_args_from_config
Convert a config dictionary to CLI arguments for vLLM server. Handles different value types appropriately: - None: skipped - bool Tr
verl/verl/workers/rollout/vllm_rollout/utils.py:356
↓ 15 callersMethodget_data_parallel_group
(self)
verl/verl/workers/engine/base.py:166
↓ 15 callersFunctionget_event_loop
()
verl/verl/utils/ray_utils.py:87
↓ 15 callersFunctionget_ulysses_sequence_parallel_world_size
Get ulysses sequence parallel world size.
verl/verl/utils/ulysses.py:46
↓ 15 callersMethodinit_class
Initialize class state shared across all instances.
verl/verl/experimental/reward_loop/reward_manager/base.py:50
↓ 15 callersMethodinit_model
(self)
verl/verl/experimental/vla/fsdp_workers.py:240
↓ 15 callersFunctionis_valid_ipv6_address
(address: str)
verl/verl/utils/net_utils.py:65
↓ 15 callersFunctionload_megatron_model_to_gpu
Load megatron model to GPU. Args: models: The model to load. load_grad: Whether to load gradients. load_frozen_params
verl/verl/utils/megatron_utils.py:520
↓ 15 callersMethodrun_single
(self, data: DataProto)
verl/verl/experimental/reward_loop/reward_manager/limited.py:398
↓ 15 callersFunctionunpad_input
Unified entry point for `unpad_input` across CUDA and NPU backends. Dynamically dispatches to the appropriate device-specific implementation
verl/verl/utils/attention_utils.py:84
↓ 14 callersFunction_create_param_from_subclass_attributes
(custom_param)
verl/verl/utils/vllm/vllm_fp8_utils.py:350
↓ 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:288
↓ 14 callersMethodbackward
(ctx, g_logprobs: torch.Tensor, g_entropy: torch.Tensor)
verl/tests/utils/test_special_linear_cross_entropy_tp.py:128
↓ 14 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
↓ 14 callersMethodget_data_parallel_rank
(self)
verl/verl/workers/engine/base.py:163
↓ 14 callersFunctionload_extern_object
Load an object from a module path. Args: module_path (str): See :func:`load_module`. object_name (str): The name of t
verl/verl/utils/import_utils.py:192
↓ 14 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:44
↓ 13 callersMethodadd
(self, duration: float)
infinity/profiler.py:26
↓ 13 callersFunctioncompute_position_id_with_mask
(mask)
verl/verl/utils/model.py:238
↓ 13 callersMethodcpu
Get CPU tensor.
infinity/runtime/tensor.py:81
↓ 13 callersFunctioncreate_test_data_proto
Helper to create DataProto for testing.
verl/tests/experimental/reward_loop/test_rate_limited_reward_manager_on_cpu.py:124
↓ 13 callersMethodfrom_single_dict
Create a DataProto from a dict of tensors and non_tensors
verl/verl/protocol.py:480
↓ 13 callersMethodgenerate_response
Generates a response for the current turn of interaction. Returns a tuple containing: - should_terminate_sequence (bool): Tru
verl/verl/interactions/base.py:39
↓ 13 callersFunctionleft_right_2_no_padding
Convert TensorDict from left-right padding to no-padding format. Args: data: TensorDict with "input_ids", "attention_mask", "respons
verl/verl/workers/utils/padding.py:23
↓ 13 callersMethodmerge
(self, other)
verl/verl/utils/seqlen_balancing.py:82
↓ 13 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:321
↓ 13 callersFunctionoffload_fsdp_optimizer
(optimizer)
verl/verl/utils/fsdp_utils.py:207
↓ 13 callersFunctionrearrange
Unified entry point for `rearrange` across CUDA and NPU backends. Dynamically dispatches to the appropriate device-specific implementation:
verl/verl/utils/attention_utils.py:69
↓ 13 callersMethodreset
(self)
verl/tests/experimental/reward_loop/test_rate_limited_reward_manager_on_cpu.py:42
↓ 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:237
↓ 13 callersFunctionsplit_resource_pool
Split a RayResourcePool into multiple SubRayResourcePool. resouce_pool can also be a SubRayResourcePool (have been splited) for multiple-time
verl/verl/single_controller/ray/base.py:265
↓ 13 callersMethodupdate_content
(self, search_keyword: Optional[str] = None)
verl/scripts/rollout_viewer.py:292
↓ 12 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:656
↓ 12 callersMethodadd
(self, data: DataProto)
verl/tests/single_controller/test_auto_padding_on_cpu.py:35
↓ 12 callersMethodbackward
(ctx: Any, grad_output: Tensor)
verl/verl/utils/ulysses.py:224
↓ 12 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:847
↓ 12 callersFunctionget_free_port
Find a free port on the given address. By default the socket is closed internally, suitable for immediate use. Set with_alive_sock=True to ke
verl/verl/utils/net_utils.py:73
↓ 12 callersFunctionindex_first_axis
Unified entry point for `index_first_axis` across CUDA and NPU backends. Dynamically dispatches to the appropriate device-specific implement
verl/verl/utils/attention_utils.py:37
↓ 12 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
↓ 12 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:287
↓ 12 callersFunctionneed_reference_policy
Given the config, do we need ref policy.
verl/verl/trainer/ppo/utils.py:75
↓ 12 callersFunctionprepare_micro_batches
Prepare micro batches from data.
verl/verl/workers/engine/utils.py:58
↓ 12 callersMethodregister
(cls, name: str)
verl/verl/utils/py_functional.py:280
↓ 12 callersFunctionset_ulysses_sequence_parallel_group
Set ulysses sequence parallel process group.
verl/verl/utils/ulysses.py:30
↓ 12 callersMethodstart_profile
Start profiling on the replica.
verl/verl/workers/rollout/replica.py:295
↓ 12 callersMethodstop_profile
Stop profiling on the replica.
verl/verl/workers/rollout/replica.py:299
↓ 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:303
↓ 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/verl/experimental/vla/envs/action_utils.py:54
↓ 12 callersMethodupdate
(self, batch)
verl/tests/utils/dataset/test_create_rl_sampler_on_cpu.py:46
↓ 11 callersMethod_create_checkpoint_dir
Create a mock checkpoint directory.
verl/tests/utils/ckpt/test_checkpoint_cleanup_on_cpu.py:56
↓ 11 callersFunction_transfer_and_validate
Spawn sender + receiver processes, then validate received tensors.
verl/tests/utils/test_bucketed_weight_transfer.py:98
↓ 11 callersMethodcheck_this_rank
(self)
verl/verl/utils/profiler/profile.py:140
↓ 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:195
↓ 11 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:405
↓ 11 callersFunctioncreate_shared_memory
Create shared memory for weight transfer. If already exists, attach to it.
verl/verl/workers/rollout/vllm_rollout/bucketed_weight_transfer.py:55
↓ 11 callersMethodgenerate
( self, request_id: str, *, prompt_ids: list[int], sampling_params: di
verl/tests/experimental/agent_loop/test_agent_loop_extra_fields_schema_on_cpu.py:38
↓ 11 callersFunctionis_torch_npu_available
Check if Ascend NPU is available for PyTorch operations. Attempts to detect NPU availability by checking for the torch.npu module and its is_
verl/verl/utils/device.py:22
↓ 11 callersFunctionoffload_megatron_optimizer
(optimizers)
verl/verl/utils/megatron_utils.py:650
↓ 11 callersMethodrecord
Record the current training step based on the new batch. Args: new_batch (DataProto): The new batch of data being processed.
verl/verl/utils/rollout_skip.py:198
↓ 11 callersFunctionreduce_metrics
Reduces a dictionary of metric lists by computing the mean, max, or min of each list. The reduce operation is determined by the key name:
verl/verl/utils/metric/utils.py:25
↓ 11 callersMethodset_loss_fn
(self, loss_fn)
verl/verl/workers/engine_workers.py:166
↓ 11 callersMethodto
Move model and/or optimizer to CPU or GPU.
verl/verl/workers/engine/torchtitan/transformer_impl.py:407
↓ 11 callersMethodupdate_weights
Update weights from trainer to rollout replicas. Args: global_steps: The global steps of the trainer.
verl/verl/checkpoint_engine/base.py:409
↓ 10 callersMethod_handle_apply_chat_template
( processing_class: PreTrainedTokenizer | PreTrainedTokenizerFast | ProcessorMixin, messages:
verl/verl/workers/rollout/schemas.py:225
↓ 10 callersFunctionapply_fsdp2
model: AutoModelForCausalLM
verl/verl/utils/fsdp_utils.py:534
↓ 10 callersMethodcompute_score
(self, **kwargs)
verl/verl/experimental/reward_loop/reward_manager/remote.py:36
↓ 10 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:435
↓ 10 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
↓ 10 callersFunctionimport_external_libs
(external_libs=None)
verl/verl/utils/import_utils.py:81
↓ 10 callersMethodinit_standalone
Init standalone rollout server, create new resource pool for this rollout.
verl/verl/workers/rollout/replica.py:202
↓ 10 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:216
↓ 10 callersMethodrelease_memory_occupation
Release GPU memory occupation temporarily. Args: tags (Optional[List[str]], optional): List of tags to specify which memory to re
verl/verl/workers/rollout/sglang_rollout/http_server_engine.py:533
↓ 10 callersMethodto
(self, device: str, model: bool = True, optimizer: bool = True, grad: bool = True)
verl/verl/workers/engine/automodel/transformer_impl.py:334
↓ 10 callersMethodto
Release or rebuild GPU buffers for MegaTrain. MegaTrain keeps all parameters on CPU. The GPU only holds transient compute buffers (do
verl/verl/workers/engine/megatrain/transformer_impl.py:689
↓ 10 callersMethodtokenizer
(self)
verl/tests/workers/rollout/rollout_trtllm/test_trtllm_rollout_utils.py:134
↓ 10 callersMethodunion
Union with another DataProto. Union batch and meta_info separately. Throw an error if - there are conflict keys in batch and they are
verl/verl/protocol.py:781
↓ 9 callersFunction_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/mcore/loader.py:104
↓ 9 callersFunction_megatron_calc_global_rank
Calculate global rank with support for CP/EP parallelism
verl/verl/models/mcore/saver.py:30
↓ 9 callersMethodbatch_decode
( self, sequences: list[int] | list[list[int]] | torch.Tensor | Any, # `Any` = np.ndarray | t
verl/verl/experimental/vla/models/openvla_oft/processing_prismatic.py:236
↓ 9 callersMethodcheck_enable
(self)
verl/verl/utils/profiler/profile.py:137
← previousnext →101–200 of 5,181, ranked by callers