MCPcopy Create free account

hub / github.com/NVlabs/GDPO / functions

Functions2,091 in github.com/NVlabs/GDPO

↓ 2 callersFunctionflatten_dict
Flatten dictionary and concatenate nested keys with separator.
trl-GDPO/trl-0.18.0-gdpo/trl/core.py:26
↓ 2 callersMethodforward
Args: input_ids: input ids. shape (batch_size, seq_length) attention_mask: attention_mask. shape (batch_size, seq_le
verl-GDPO/verl/models/llama/megatron/modeling_llama_megatron.py:117
↓ 2 callersMethodforward_backward_batch
(self, data: DataProto, forward_only=False)
verl-GDPO/verl/workers/critic/megatron_critic.py:113
↓ 2 callersMethodforward_backward_batch
We assume: - The model takes input: (input_ids, attention_mask, position_ids). No rmpad for the input - The communication sha
verl-GDPO/verl/workers/actor/megatron_actor.py:218
↓ 2 callersMethodfrom_single_dict
(cls, data: Dict[str, Union[torch.Tensor, np.ndarray]], meta_info=None)
verl-GDPO/verl/protocol.py:266
↓ 2 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-GDPO/verl/utils/ulysses.py:85
↓ 2 callersMethodgenerate
Generate responses for a list of histories.
trl-GDPO/trl-0.18.0-gdpo/trl/environment/base_environment.py:376
↓ 2 callersMethodgenerate
r""" Generate the best of n samples for input queries Args: tokenized_query (`list[int]` or `torch.Tensor` or `list[torch
trl-GDPO/trl-0.18.0-gdpo/trl/extras/best_of_n_sampler.py:78
↓ 2 callersMethodget_all_params
Get all the parameters of the models in all pp ranks Returns: params: List[List[Dict[str, Tensor]]]: a list of parameters in all
verl-GDPO/verl/workers/sharding_manager/megatron_vllm.py:163
↓ 2 callersFunctionget_args
()
trl-GDPO/trl-0.18.0-gdpo/examples/research_projects/stack_llama/scripts/supervised_finetuning.py:33
↓ 2 callersMethodget_batch_logps
Compute the log probabilities of the given labels under the given logits. Args: logits: Logits of the model (unnormalized). Shape
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:1011
↓ 2 callersMethodget_batch_loss_metrics
Compute the KTO loss and other metrics for the given batch of inputs for train or test.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/kto_trainer.py:1327
↓ 2 callersMethodget_batch_loss_metrics
Compute the ORPO loss and other metrics for the given batch of inputs for train or test.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/orpo_trainer.py:773
↓ 2 callersMethodget_batch_loss_metrics
Compute the BCO loss and other metrics for the given batch of inputs for train or test.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:1158
↓ 2 callersMethodget_batch_loss_metrics
Compute the DPO loss and other metrics for the given batch of inputs for train or test.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/dpo_trainer.py:1289
↓ 2 callersMethodget_batch_loss_metrics
Compute the CPO loss and other metrics for the given batch of inputs for train or test.
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/cpo_trainer.py:802
↓ 2 callersFunctionget_callbacks
(train_config, model_config)
trl-GDPO/open-r1/src/open_r1/utils/callbacks.py:85
↓ 2 callersFunctionget_common_default_kwargs_for_parallel_linear
()
verl-GDPO/verl/utils/megatron/tensor_parallel.py:47
↓ 2 callersFunctionget_constant_schedule_with_warmup
( optimizer: Optimizer, num_warmup_steps: int, last_epoch: int = -1, )
verl-GDPO/verl/utils/torch_functional.py:422
↓ 2 callersFunctionget_cosine_scaled_reward
( min_value_wrong: float = -1.0, max_value_wrong: float = -0.5, min_value_correct: float = 0.5,
trl-GDPO/open-r1/src/open_r1/rewards.py:205
↓ 2 callersFunctionget_eos_mask
e.g. end of sentence token=1 response_id: [0, 0, 2, 42, 3, 5, 1, 0, 0] eos_mask: [1, 1, 1, 1, 1, 1, 1, 0, 0]
verl-GDPO/verl/utils/torch_functional.py:139
↓ 2 callersFunctionget_gsm8k_questions
(split = "train")
trl-GDPO/open-r1/src/open_r1/gsm8k.py:86
↓ 2 callersFunctionget_megatron_optimizer
( model, config: OptimizerConfig, no_weight_decay_cond=None, scale_lr_cond=Non
verl-GDPO/verl/utils/megatron/optimizer.py:26
↓ 2 callersFunctionget_model
Get the model
trl-GDPO/open-r1/src/open_r1/utils/model_utils.py:23
↓ 2 callersFunctionget_piston_client_from_env
(session=None)
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/piston_client.py:17
↓ 2 callersFunctionget_reward_funcs
(script_args)
trl-GDPO/open-r1/src/open_r1/rewards.py:646
↓ 2 callersFunctionget_seqlen_balanced_partitions
get order of seq lengths to make partitions balanced, this is used in balacing sum of seqlength across dp ranks and microbatches Paramete
verl-GDPO/verl/utils/seqlen_balancing.py:152
↓ 2 callersFunctionget_stack_exchange_paired
Load the stack-exchange-paired dataset from Hugging Face and convert it to the necessary format. The dataset is converted to a dictionary with th
trl-GDPO/trl-0.18.0-gdpo/examples/research_projects/stack_llama_2/scripts/dpo_llama2.py:103
↓ 2 callersMethodget_trainable_layers
Returns the trainable parameters of the pipeline
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_sd_base.py:139
↓ 2 callersFunctionget_trajectory_tracker
()
verl-GDPO/verl/utils/debug/trajectory_tracker.py:79
↓ 2 callersFunctionget_weight_buffer_meta_from_module
Return a dictionary containing name to a shape and dtype.
verl-GDPO/verl/utils/memory_buffer.py:58
↓ 2 callersFunctioninit_megatron_optim_config
(optim_config: Dict)
verl-GDPO/verl/utils/megatron_utils.py:185
↓ 2 callersFunctioninit_wandb_training
Helper function for setting up Weights & Biases logging tools.
trl-GDPO/open-r1/src/open_r1/utils/wandb_logging.py:4
↓ 2 callersFunctionis_e2b_available
()
trl-GDPO/open-r1/src/open_r1/utils/import_utils.py:22
↓ 2 callersFunctionis_fastapi_available
()
trl-GDPO/trl-0.18.0-gdpo/trl/import_utils.py:51
↓ 2 callersFunctionis_pydantic_available
()
trl-GDPO/trl-0.18.0-gdpo/trl/import_utils.py:67
↓ 2 callersFunctionis_requests_available
()
trl-GDPO/trl-0.18.0-gdpo/trl/import_utils.py:71
↓ 2 callersFunctionis_tensor_parallel_param
(param)
verl-GDPO/verl/utils/megatron/tensor_parallel.py:86
↓ 2 callersFunctionis_uvicorn_available
()
trl-GDPO/trl-0.18.0-gdpo/trl/import_utils.py:79
↓ 2 callersFunctionis_vllm_ascend_available
()
trl-GDPO/trl-0.18.0-gdpo/trl/import_utils.py:87
↓ 2 callersFunctionis_vllm_available
()
verl-GDPO/verl/utils/import_utils.py:33
↓ 2 callersMethodjudge
(self, prompts, completions, gold_completions=None, shuffle_order=True)
trl-GDPO/trl-0.18.0-gdpo/tests/testing_utils.py:113
↓ 2 callersFunctionlist_of_dict_to_dict_of_list
(list_of_dict: list[dict])
verl-GDPO/verl/protocol.py:92
↓ 2 callersMethodload_checkpoint
Light wrapper around accelerate's register_lad_state_pre_hook which is run before loading state
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_sd_base.py:151
↓ 2 callersFunctionload_fsdp_optimizer
(optimizer, device_id)
verl-GDPO/verl/utils/fsdp_utils.py:123
↓ 2 callersMethodload_pair_rm_judge
(self)
trl-GDPO/trl-0.18.0-gdpo/tests/test_judges.py:50
↓ 2 callersMethodload_params_to_cuda
load all model params to cuda
verl-GDPO/verl/workers/sharding_manager/megatron_vllm.py:112
↓ 2 callersMethodlog
(self, data, step)
verl-GDPO/verl/utils/logger/aggregate_logger.py:40
↓ 2 callersMethodloss
( self, advantages: torch.Tensor, clip_range: float, ratio: torch.Tensor,
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/ddpo_trainer.py:394
↓ 2 callersMethodmake_iterator
Make an iterator from the DataProto. This is built upon that TensorDict can be used as a normal Pytorch dataset. See https://pytorch.org/tenso
verl-GDPO/verl/protocol.py:441
↓ 2 callersMethodmake_minibatch_iterator
Make minibatch iterator for updating the actor Args: data (DataProto): a DataProto containing keys ``input_ids``
verl-GDPO/verl/workers/actor/megatron_actor.py:190
↓ 2 callersFunctionmakedirs
r"""Works like os.makedirs() but supports hdfs. Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except tha
verl-GDPO/verl/utils/hdfs_io.py:50
↓ 2 callersFunctionmasked_var
Compute variance of tensor with masked values.
trl-GDPO/trl-0.18.0-gdpo/trl/core.py:51
↓ 2 callersFunctionmatch_score
Compute a similarity score considering element frequency, ignoring order.
verl-GDPO/verl/utils/reward_score/rlla.py:21
↓ 2 callersFunctionmd5_encode
(path: str)
verl-GDPO/verl/utils/fs.py:33
↓ 2 callersMethodmerge
(self, other)
verl-GDPO/verl/utils/seqlen_balancing.py:37
↓ 2 callersFunctionnormalize_pp_vpp_params
Normalize the pp vpp params into a complete named parameters. This is useful when gather parameters from pp ranks and passed to a model with
verl-GDPO/verl/utils/model.py:181
↓ 2 callersFunctionnormalize_string
Basic string normalization.
trl-GDPO/open-r1/scripts/decontaminate.py:36
↓ 2 callersMethodnull_ref_context
Context manager for handling null reference model (that is, peft adapter manipulation).
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/dpo_trainer.py:788
↓ 2 callersMethodoffload_params_to_cpu
(self)
verl-GDPO/verl/workers/reward_model/megatron/reward_model.py:262
↓ 2 callersMethodon_step_end
(self, args, state, control, **kwargs)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/callbacks.py:125
↓ 2 callersMethodon_train_begin
(self, args: TrainingArguments, state: TrainerState, control: TrainerControl, **kwargs)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/callbacks.py:286
↓ 2 callersMethodon_train_end
(self, args, state, control, model=None, **kwargs)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/callbacks.py:568
↓ 2 callersFunctionpack_examples
Pack examples into chunks of size `seq_length`. Args: examples (`dict[str, list[list]]`): Dictionary of examples with ke
trl-GDPO/trl-0.18.0-gdpo/trl/data_utils.py:441
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl-GDPO/trl-0.18.0-gdpo/examples/scripts/rloo/rloo.py:99
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl-GDPO/trl-0.18.0-gdpo/examples/scripts/rloo/rloo_tldr.py:97
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl-GDPO/trl-0.18.0-gdpo/examples/scripts/ppo/ppo_tldr.py:129
↓ 2 callersFunctionprepare_dataset
pre-tokenize the dataset before training; only collate during training
trl-GDPO/trl-0.18.0-gdpo/examples/scripts/ppo/ppo.py:126
↓ 2 callersFunctionprepare_fsdp
(model, accelerator)
trl-GDPO/trl-0.18.0-gdpo/trl/models/utils.py:266
↓ 2 callersFunctionprint_env
()
trl-GDPO/trl-0.18.0-gdpo/trl/scripts/env.py:35
↓ 2 callersMethodprint_green
(self, text)
trl-GDPO/trl-0.18.0-gdpo/trl/scripts/chat.py:268
↓ 2 callersFunctionprocess_vision_info
(messages: list[dict])
trl-GDPO/trl-0.18.0-gdpo/examples/scripts/sft_vlm_gemma3.py:73
↓ 2 callersFunctionreduce_metrics
(metrics: dict)
verl-GDPO/verl/trainer/ppo/ray_trainer.py:210
↓ 2 callersFunctionrun_benchmark_jobs
(training_args: Union["SFTConfig", "GRPOConfig"], model_args: "ModelConfig")
trl-GDPO/open-r1/src/open_r1/utils/evaluation.py:106
↓ 2 callersFunctionrun_catch_exceptions
(task)
trl-GDPO/open-r1/src/open_r1/rewards.py:392
↓ 2 callersMethodrun_code
Execute multiple scripts using MorphCloud via the router. Args: scripts: List of code scripts to execute. la
trl-GDPO/open-r1/src/open_r1/utils/routed_morph.py:48
↓ 2 callersMethodsave_checkpoint
Light wrapper around accelerate's register_save_state_pre_hook which is run before saving state
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_sd_base.py:145
↓ 2 callersMethodsave_pretrained
Saves all of the model weights
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_sd_base.py:133
↓ 2 callersFunctionscore_subtask
Scores all test cases in a subtask. Args: client: PistonClient instance for executing code subtask: Dictionary containing su
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/ioi_scoring.py:164
↓ 2 callersMethodsend_execute
(self, data, language="cms_ioi", max_retries=5)
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/piston_client.py:137
↓ 2 callersMethodset_defaults_with_config
Overrides the parser's default values with those provided via keyword arguments, including for subparsers. Any argument with an upda
trl-GDPO/trl-0.18.0-gdpo/trl/scripts/utils.py:217
↓ 2 callersFunctionset_ulysses_sequence_parallel_group
Set ulysses sequence parallel process group.
verl-GDPO/verl/utils/ulysses.py:29
↓ 2 callersMethodshow_colour_legend
Print the colour legend.
trl-GDPO/trl-0.18.0-gdpo/trl/environment/base_environment.py:192
↓ 2 callersMethodsplit_query_response_tokens
Split the tokens into query and response tokens.
trl-GDPO/trl-0.18.0-gdpo/trl/environment/base_environment.py:131
↓ 2 callersMethodstate_dict
r""" Returns the state dictionary of the model. We add the state dictionary of the value head to the state dictionary of the wrapped m
trl-GDPO/trl-0.18.0-gdpo/trl/models/modeling_value_head.py:201
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/kto_trainer.py:1461
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/orpo_trainer.py:911
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/bco_trainer.py:1274
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/dpo_trainer.py:1458
↓ 2 callersMethodstore_metrics
(self, metrics: dict[str, float], train_eval: Literal["train", "eval"] = "train")
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/cpo_trainer.py:931
↓ 2 callersFunctionstrip_string
(string)
verl-GDPO/verl/utils/reward_score/math.py:165
↓ 2 callersMethodtask_end_check
Check if the current generation sequence has finished.
trl-GDPO/trl-0.18.0-gdpo/trl/environment/base_environment.py:402
↓ 2 callersMethodtasks_end_check
Check if the current generation sequences have finished.
trl-GDPO/trl-0.18.0-gdpo/trl/environment/base_environment.py:391
↓ 2 callersMethodto_dict
Converts the SubtaskResult to a dictionary representation. Returns: dict: Dictionary containing all subtask result data
trl-GDPO/open-r1/src/open_r1/utils/competitive_programming/ioi_scoring.py:91
↓ 2 callersMethodtokenize
(example, processing_class, dataset_text_field, add_special_tokens)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/sft_trainer.py:616
↓ 2 callersMethodtrain
(self)
trl-GDPO/trl-0.18.0-gdpo/trl/trainer/rloo_trainer.py:243
↓ 2 callersMethodupdate_options
(self, options: Dict)
verl-GDPO/verl/single_controller/ray/base.py:139
↓ 2 callersMethodupdate_policy
Update the policy with an iterator of DataProto Args: data (DataProto): an iterator over the DataProto that returns by
verl-GDPO/verl/workers/actor/base.py:54
↓ 2 callersFunctionword_ngrams
Generate word-level n-grams from text.
trl-GDPO/open-r1/scripts/decontaminate.py:45
↓ 1 callersMethod__init__
(self, numel: int, numel_padded: int, dtype: torch.dtype)
verl-GDPO/verl/utils/memory_buffer.py:30
← previousnext →301–400 of 2,091, ranked by callers