MCPcopy Create free account

hub / github.com/NVlabs/GDPO / functions

Functions2,091 in github.com/NVlabs/GDPO

↓ 3 callersMethod_split_kwargs
Separate the kwargs from the arguments that we support inside `supported_args` and the ones that we don't.
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_base.py:413
↓ 3 callersMethod_validate
(self)
verl-GDPO/verl/trainer/ppo/ray_trainer.py:481
↓ 3 callersFunctionapply_monkey_patch
(config: PretrainedConfig, verbose=True)
verl-GDPO/verl/models/transformers/monkey_patch.py:42
↓ 3 callersFunctionapply_rotary_pos_emb
(q, k, cos, sin, position_ids)
verl-GDPO/verl/models/llama/megatron/layers/parallel_attention.py:123
↓ 3 callersFunctionbuild_memory_buffer
Build the memory buffer given weight_buffer_meta Args: weight_buffer_meta: contains mapping from name to a dictionary containing shape an
verl-GDPO/verl/utils/memory_buffer.py:68
↓ 3 callersFunctioncalc_padded_numel
for cuda memory alignment, make sure alignment by 128-bits
verl-GDPO/verl/utils/memory_buffer.py:51
↓ 3 callersMethodcalculate_loss
Calculate the loss for a batch of an unpacked sample Args: latents (torch.Tensor): The latents sampled f
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/ddpo_trainer.py:326
↓ 3 callersFunctioncheck_model_support_rmpad
(model_type: str)
verl-GDPO/verl/models/registry.py:27
↓ 3 callersFunctionclear_chat_history
(system_prompt)
trl-GDPO/trl-0.18.0-gdpo/trl/scripts/chat.py:307
↓ 3 callersMethodcompute_ref_log_probs
Computes log probabilities of the reference model for a single padded batch of a DPO specific dataset.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/dpo_trainer.py:801
↓ 3 callersFunctioncompute_transformers_input_shapes
(batches, meta_info)
verl-GDPO/verl/utils/megatron/pipeline_parallel.py:22
↓ 3 callersMethodconvert_ids_to_tokens
Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and added tokens.
verl-GDPO/verl/workers/rollout/tokenizer.py:116
↓ 3 callersFunctioncopy
r"""Works like shutil.copy() for file, and shutil.copytree for dir, and supports hdfs. Copy data and mode bits ("cp src dst"). Return the file's
verl-GDPO/verl/utils/hdfs_io.py:84
↓ 3 callersMethoddpo_loss
Compute the DPO loss for a batch of policy and reference model log probabilities. Args: chosen_logps (`torch.FloatTensor
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/dpo_trainer.py:883
↓ 3 callersMethodexecute_all_async
(self, method_name: str, *args, **kwargs)
verl-GDPO/verl/single_controller/ray/base.py:335
↓ 3 callersMethodexecute_all_sync
(self, method_name: str, *args, **kwargs)
verl-GDPO/verl/single_controller/ray/base.py:332
↓ 3 callersMethodexecute_rank_zero_async
(self, method_name: str, *args, **kwargs)
verl-GDPO/verl/single_controller/ray/base.py:322
↓ 3 callersFunctionextract_prompt
r""" Extracts the shared prompt from a preference data example, where the prompt is implicit within both the chosen and rejected completions.
trl-GDPO/trl-0.18.0-gdpo/trl/data_utils.py:330
↓ 3 callersFunctionformat_reward
Reward function that checks if the reasoning process is enclosed within <think> and </think> tags, while the final answer is enclosed within <answer>
trl-GDPO/open-r1/src/open_r1/rewards.py:85
↓ 3 callersMethodforward
( self, model: nn.Module, batch: dict[str, Union[list, torch.LongTensor]] )
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/kto_trainer.py:1039
↓ 3 callersMethodforward
( self, model: nn.Module, batch: dict[str, Union[list, torch.LongTensor]] )
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:1050
↓ 3 callersMethodgenerate_sequences
Generate sequences
verl-GDPO/verl/workers/rollout/base.py:35
↓ 3 callersMethodget
(self)
verl-GDPO/verl/utils/rendezvous/ray_backend.py:30
↓ 3 callersFunctionget_default_kwargs_for_model_parallel_config
()
verl-GDPO/verl/utils/megatron/tensor_parallel.py:32
↓ 3 callersFunctionget_lighteval_tasks
()
trl-GDPO/open-r1/src/open_r1/utils/evaluation.py:62
↓ 3 callersFunctionget_parallel_model_from_config
(config, megatron_config, pre_process=None, post_process=None, value=False)
verl-GDPO/verl/utils/model.py:234
↓ 3 callersFunctionget_reverse_idx
(idx_map)
verl-GDPO/verl/utils/seqlen_balancing.py:259
↓ 3 callersFunctionget_tokenizer
Get the tokenizer for the model.
trl-GDPO/open-r1/src/open_r1/utils/model_utils.py:9
↓ 3 callersFunctionimport_external_libs
(external_libs=None)
verl-GDPO/verl/utils/import_utils.py:41
↓ 3 callersFunctioninit_model_parallel_config
(config: DictConfig)
verl-GDPO/verl/utils/megatron_utils.py:201
↓ 3 callersFunctionis_joblib_available
()
trl-GDPO/trl-0.18.0-gdpo/trl/import_utils.py:91
↓ 3 callersMethodlog
Log `logs` on the various objects watching training, including stored metrics. Args: logs (`dict[str, float]`):
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/dpo_trainer.py:1515
↓ 3 callersFunctionmake_batch_generator
(batches, vpp_size)
verl-GDPO/verl/utils/megatron/pipeline_parallel.py:43
↓ 3 callersFunctionmasked_whiten
Whiten values with masked values.
trl-GDPO/trl-0.18.0-gdpo/trl/core.py:70
↓ 3 callersMethodnull_ref_context
Context manager for handling null reference model (that is, peft adapter manipulation).
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/kto_trainer.py:808
↓ 3 callersMethodnull_ref_context
Context manager for handling null reference model (that is, peft adapter manipulation).
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:874
↓ 3 callersFunctionpack_dataset
r""" Pack sequences in a dataset into chunks of size `seq_length`. Args: dataset (`Dataset` or `DatasetDict`): Dataset to
trl-GDPO/trl-0.18.0-gdpo/trl/data_utils.py:475
↓ 3 callersFunctionprint_prompt_completions_sample
Print out a sample of model completions to the console with multiple reward metrics. This function creates a nicely formatted table showing
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/utils.py:1753
↓ 3 callersFunctionprint_rich_table
(df: pd.DataFrame)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/utils.py:981
↓ 3 callersMethodrank
(self)
verl-GDPO/verl/single_controller/base/worker.py:175
↓ 3 callersMethodsave_checkpoint
(self, step)
verl-GDPO/verl/trainer/fsdp_sft_trainer.py:295
↓ 3 callersFunctionscheduler_step
Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion process from the learned model ou
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_sd_base.py:189
↓ 3 callersMethodset_input_tensor
Set input tensor to be used instead of forward()'s input. When doing pipeline parallelism the input from the previous stage comes fro
verl-GDPO/verl/models/llama/megatron/modeling_llama_megatron.py:457
↓ 3 callersMethodset_progress_bar_config
Sets the progress bar config for the pipeline
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_sd_base.py:127
↓ 3 callersFunctionset_random_seed
(seed)
verl-GDPO/verl/workers/megatron_workers.py:47
↓ 3 callersFunctionsplit_dict_tensor_into_batches
(tensors: TensorDict, batch_size)
verl-GDPO/verl/utils/torch_functional.py:203
↓ 3 callersFunctionsplit_tensor_dict
Splits a dictionary of tensors along the first dimension into `num_chunks` equal parts. Example: >>> x = torch.arange(12).reshape(6,
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/grpo_trainer.py:215
↓ 3 callersMethodtearDownClass
(cls)
trl-GDPO/trl-0.18.0-gdpo/tests/test_vllm_client_server.py:119
↓ 3 callersFunctionthink_format_reward
r""" Reward function that checks if the reasoning process is enclosed within `"<think>"` and `"</think>"` tags. The function returns a reward
trl-GDPO/trl-0.18.0-gdpo/trl/rewards/format_rewards.py:18
↓ 3 callersMethodto_str
(precision)
verl-GDPO/verl/utils/torch_dtypes.py:74
↓ 3 callersFunctionunpair_preference_dataset
r""" Unpair a preference dataset. Args: dataset (`Dataset` or `DatasetDict`): Preference dataset to unpair. The dataset m
trl-GDPO/trl-0.18.0-gdpo/trl/data_utils.py:241
↓ 3 callersFunctionvocab_parallel_log_probs_from_logits
TODO(zhangchi.usc1992): We may change the implementation later
verl-GDPO/verl/utils/megatron/tensor_parallel.py:136
↓ 2 callersMethod__init__
(self, config)
verl-GDPO/verl/workers/megatron_workers.py:410
↓ 2 callersMethod__init__
(self, config)
verl-GDPO/verl/workers/fsdp_workers.py:509
↓ 2 callersMethod__init__
(self, config, **kwargs)
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_value_head.py:27
↓ 2 callersMethod_build_model_optimizer
(self, model_path, megatron_config: ModelParalle
verl-GDPO/verl/workers/megatron_workers.py:124
↓ 2 callersMethod_build_model_optimizer
(self, model_path, fsdp_config,
verl-GDPO/verl/workers/fsdp_workers.py:111
↓ 2 callersMethod_check_failed_endpoint
(self, endpoint)
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/piston_client.py:124
↓ 2 callersMethod_compute_loss
(self, batch)
verl-GDPO/verl/trainer/fsdp_sft_trainer.py:218
↓ 2 callersFunction_compute_response_info
(batch)
verl-GDPO/verl/trainer/ppo/ray_trainer.py:216
↓ 2 callersMethod_forward_micro_batch
(self, micro_batch)
verl-GDPO/verl/workers/critic/dp_critic.py:53
↓ 2 callersMethod_forward_micro_batch
Returns: entropy: # (bs, response_len) log_probs: # (bs, response_len)
verl-GDPO/verl/workers/actor/dp_actor.py:58
↓ 2 callersMethod_generate_and_score_completions
( self, inputs: list[dict[str, Union[torch.Tensor, Any]]] )
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/grpo_trainer.py:1004
↓ 2 callersMethod_get_checkpoint_from_hub
( cls, pretrained_model, pretrained_model_name_or_path, index_filename,
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_base.py:343
↓ 2 callersMethod_get_module
(self, module_name: str)
trl-GDPO/trl-0.18.0-gdpo/trl/import_utils.py:142
↓ 2 callersMethod_get_or_create_base_snapshot
Get or create a snapshot with the necessary dependencies and scripts for evaluation.
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/morph_client.py:337
↓ 2 callersMethod_get_sample_prompt_embeddings
Sample instances from dataset and get prompt embeddings. Used for density ratio classifier training.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:812
↓ 2 callersFunction_init_event_loop
Initialize or get the current event loop.
trl-GDPO/open-r1/src/open_r1/rewards.py:357
↓ 2 callersFunction_is_non_local
(path)
verl-GDPO/verl/utils/fs.py:29
↓ 2 callersMethod_merge_and_maybe_push
(self, output_dir, global_step, model)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/callbacks.py:551
↓ 2 callersMethod_offload_params_to_cpu
(self, pp_rank, to_empty=False)
verl-GDPO/verl/workers/sharding_manager/megatron_vllm.py:102
↓ 2 callersFunction_pad_tensor
(x: Tensor, dim: int, padding_size: int)
verl-GDPO/verl/utils/ulysses.py:103
↓ 2 callersMethod_pad_to_length
(self, input_ids, attention_mask)
verl-GDPO/verl/utils/dataset/rm_dataset.py:99
↓ 2 callersMethod_release_endpoint
(self, endpoint)
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/piston_client.py:98
↓ 2 callersMethod_send_request
(self, endpoint, route, data=None, method="post")
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/piston_client.py:101
↓ 2 callersMethod_set_cos_sin_cache
(self, seq_len, device, dtype)
verl-GDPO/verl/models/llama/megatron/layers/parallel_attention.py:51
↓ 2 callersMethod_sync_fsdp_params_to_vllm
Memory-efficient post-order traversal of FSDP modules to extract full parameters and sync with vLLM.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/grpo_trainer.py:880
↓ 2 callersMethod_sync_target_model
(model, target_model, alpha)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/callbacks.py:107
↓ 2 callersFunction_unpad_tensor
(x: Tensor, dim: int, padding_size: int)
verl-GDPO/verl/utils/ulysses.py:110
↓ 2 callersFunction_unwrap_ray_remote
(cls)
verl-GDPO/verl/single_controller/ray/base.py:414
↓ 2 callersMethod_vectorize_prompt
Replaces processing_class.pad_token_id to embedding_tokenizer.pad_token_id and applies self.embedding_func
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:772
↓ 2 callersFunctionadd_bos_token_if_needed
( bos_token_id: Optional[int], prompt_len_input_ids: int, prompt_tokens: dict[str, list[int]],
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/utils.py:1417
↓ 2 callersFunctionadd_eos_token_if_needed
( eos_token_id: int, chosen_tokens: dict[str, list[int]], rejected_tokens: dict[str, list[int]] )
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/utils.py:1439
↓ 2 callersFunctionall_to_all_tensor
( local_input: Tensor, scatter_dim: int, gather_dim: int, group: Optional[dist.ProcessGroup] =
verl-GDPO/verl/utils/ulysses.py:132
↓ 2 callersMethodallgather_params
allgather params of all pp ranks. Return a list of handles
verl-GDPO/verl/workers/sharding_manager/megatron_vllm.py:118
↓ 2 callersFunctionbatched
Batch data into lists of length n. The last batch may be shorter.
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/utils.py:4
↓ 2 callersMethodbuild_tokenized_answer
Llama tokenizer does satisfy `enc(a + b) = enc(a) + enc(b)`. It does ensure `enc(a + b) = enc(a) + enc(a + b)[len(enc(a)):]`.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/orpo_trainer.py:355
↓ 2 callersMethodbuild_tokenized_answer
Llama tokenizer does satisfy `enc(a + b) = enc(a) + enc(b)`. It does ensure `enc(a + b) = enc(a) + enc(a + b)[len(enc(a)):]`.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/cpo_trainer.py:380
↓ 2 callersFunctioncap_exp
(value, cap=-1)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/utils.py:975
↓ 2 callersMethodcompute_loss
( self, model: Union[PreTrainedModel, nn.Module], inputs: dict[str, Union[torch.Tensor
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/reward_trainer.py:260
↓ 2 callersMethodcompute_reference_log_probs
Computes log probabilities of the reference model for a single padded batch of a KTO specific dataset.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/kto_trainer.py:920
↓ 2 callersMethodcompute_reference_log_probs
Computes log probabilities of the reference model for a single padded batch of a BCO specific dataset.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:967
↓ 2 callersMethodcompute_reward
Compute the reward for a list of histories.
trl-GDPO/trl-0.18.0-gdpo/trl/environment/base_environment.py:367
↓ 2 callersMethodcompute_rewards
(self, prompt_image_pairs, is_async=False)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/ddpo_trainer.py:200
↓ 2 callersFunctionconversations_formatting_function
r""" return a callable function that takes in a "messages" dataset and returns a formatted dataset, based on the tokenizer apply chat template
trl-GDPO/trl-0.18.0-gdpo/trl/extras/dataset_formatting.py:30
↓ 2 callersFunctionconvert_state_dict_to_diffusers
r""" Converts a state dict to new diffusers format. The state dict can be from previous diffusers format (`OLD_DIFFUSERS`), or PEFT format (`P
trl-GDPO/trl-0.18.0-gdpo/trl/models/sd_utils.py:106
↓ 2 callersFunctioncreate_and_sync_state
(param_name, state, is_param)
verl-GDPO/verl/utils/fsdp_utils.py:243
↓ 2 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-GDPO/verl/utils/flops_counter.py:107
↓ 2 callersFunctionextract_xml_answer
(text: str)
trl-GDPO/open-r1/src/open_r1/gsm8k.py:75
↓ 2 callersMethodfit
The training loop of PPO. The driver process only need to call the compute functions of the worker group through RPC to construct the
verl-GDPO/verl/trainer/ppo/ray_trainer.py:664
← previousnext →201–300 of 2,091, ranked by callers