Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/McGill-NLP/the-markovian-thinker
/ functions
Functions
2,081 in github.com/McGill-NLP/the-markovian-thinker
⨍
Functions
2,081
◇
Types & classes
332
↳
Endpoints
60
↓ 6 callers
Function
combined_int_check
(val)
verl/utils/reward_score/prime_code/testing_util.py:77
↓ 6 callers
Function
compute_has_eos
(batch: DataProto, eos_token_id: int, return_numpy: bool = True)
verl/trainer/ppo/metric_utils.py:463
↓ 6 callers
Method
compute_ref_log_prob
(self, data: DataProto)
verl/workers/roles/actor.py:42
↓ 6 callers
Method
finish
(self)
verl/utils/tracking.py:204
↓ 6 callers
Method
flush_cache
(self)
verl/workers/rollout/sglang_rollout/sglang_rollout.py:159
↓ 6 callers
Function
gather_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/utils/ulysses.py:243
↓ 6 callers
Method
get
Get the value associated with the given key. If the key does not exist, return the default value. Args: key (str): The attribute
verl/base_config.py:40
↓ 6 callers
Function
is_transformers_version_in_range
(min_version: Optional[str] = None, max_version: Optional[str] = None)
verl/models/transformers/monkey_patch.py:317
↓ 6 callers
Function
load_reward_manager
Load and initialize a reward manager based on the configuration. Args: config: PPO trainer configuration object containing reward_mo
verl/trainer/ppo/reward.py:93
↓ 6 callers
Function
logprobs_from_logits
Compute per-token log-probabilities for the given labels. Uses a Flash-Attention–based cross-entropy (if available) for efficient backward,
verl/utils/torch_functional.py:64
↓ 6 callers
Function
postprocess_packed_seqs
Postprocess packed sequences
verl/models/mcore/util.py:105
↓ 6 callers
Function
truncatefn
(s, length=300)
verl/utils/reward_score/prime_code/testing_util.py:39
↓ 6 callers
Function
validate_ulysses_config
(num_heads, ulysses_sequence_size)
verl/utils/ulysses.py:324
↓ 5 callers
Method
__init__
(self, config: Qwen2Config, megatron_config: ModelParallelConfig)
verl/models/qwen2/megatron/modeling_qwen2_megatron.py:83
↓ 5 callers
Method
__init__
(self, config: LlamaConfig, megatron_config: ModelParallelConfig)
verl/models/llama/megatron/modeling_llama_megatron.py:82
↓ 5 callers
Function
_broadcast_tensor
broadcast tensor across mp_group
verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:129
↓ 5 callers
Function
_broadcast_tensor
broadcast tensor across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:129
↓ 5 callers
Method
_clear_search
(self)
scripts/rollout_viewer.py:474
↓ 5 callers
Function
_hdfs_cmd
(cmd: str)
verl/utils/hdfs_io.py:144
↓ 5 callers
Function
_run_cmd
(cmd: str, timeout=None)
verl/utils/hdfs_io.py:140
↓ 5 callers
Function
_stable_update_value
(v)
verl/tasks/task.py:39
↓ 5 callers
Function
all_gather_data_proto
(data: DataProto, process_group)
verl/protocol.py:1100
↓ 5 callers
Function
apply_fsdp2
model: AutoModelForCausalLM
verl/utils/fsdp_utils.py:506
↓ 5 callers
Function
apply_monkey_patch
Apply monkey patch to the models for ulysses sequence parallel and fused kernel. In the end of this function forward function of the model i
verl/models/transformers/monkey_patch.py:195
↓ 5 callers
Function
broadcast_pyobj
from https://github.com/sgl-project/sglang/blob/844e2f227ab0cce6ef818a719170ce37b9eb1e1b/python/sglang/srt/utils.py#L905 Broadcast inputs from sr
verl/workers/rollout/sglang_rollout/utils.py:26
↓ 5 callers
Method
check
(self)
verl/utils/profiler/profile.py:86
↓ 5 callers
Function
check_and_construct_configs
Check and disable incompatible configurations for older Megatron version. Args: original_config (dict): The original model configura
verl/models/mcore/config_converter.py:137
↓ 5 callers
Function
clean_traceback
(error_traceback)
verl/utils/reward_score/prime_code/testing_util.py:81
↓ 5 callers
Function
compute_reward
Compute reward for a batch of data. Args: data: DataProto object containing the input data. reward_fn: Reward function to com
verl/trainer/ppo/reward.py:151
↓ 5 callers
Function
convert_to_regular_types
Convert Hydra configs and other special types to regular Python types.
verl/utils/py_functional.py:307
↓ 5 callers
Function
copy
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/utils/hdfs_io.py:84
↓ 5 callers
Method
estimate_flops
Estimate the FLOPS based on the number of valid tokens in the current batch and the time taken. Args: batch_seqlens (Lis
verl/utils/flops_counter.py:326
↓ 5 callers
Function
flash_attn_supports_top_left_mask
Fallback implementation for older transformers versions. Returns False to disable features that require this function.
verl/utils/transformers_compat.py:26
↓ 5 callers
Function
fsdp2_load_full_state_dict
Loads the full state dict (could be only on rank 0) into the sharded model. This is done by broadcasting the parameters from rank 0 to all ot
verl/utils/fsdp_utils.py:450
↓ 5 callers
Function
get_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/utils/fsdp_utils.py:72
↓ 5 callers
Function
get_init_weight_context_manager
(use_meta_tensor=True, mesh: DeviceMesh = None)
verl/utils/fsdp_utils.py:56
↓ 5 callers
Method
get_instance
(cls)
verl/utils/rollout_trace.py:52
↓ 5 callers
Function
get_response_mask
end of sentence token can be int or list: 1 or [1, 2] e.g. response_id = torch.tensor([[20, 10, 34, 1, 0, 0, 0],
verl/utils/torch_functional.py:226
↓ 5 callers
Function
get_supported_model
(model_type: str)
verl/models/mcore/registry.py:146
↓ 5 callers
Function
pad_dataproto_to_divisor
Pad a DataProto to size divisible by size_divisor Args: size_divisor (int): size divisor Returns: data: (DataProto): the pad
verl/protocol.py:70
↓ 5 callers
Function
patch_vlm_for_ulysses_input_slicing
Applies a monkey patch to the forward method of a given model class to enable Ulysses sequence parallelism input slicing.
verl/models/transformers/monkey_patch.py:113
↓ 5 callers
Function
print_model_size
(model: nn.Module, name: str = None)
verl/utils/model.py:169
↓ 5 callers
Function
reduce_metrics
Reduces a dictionary of metric lists by computing the mean of each list. Args: metrics: A dictionary mapping metric names to lists o
verl/trainer/ppo/metric_utils.py:30
↓ 5 callers
Method
resume_memory_occupation
Resume GPU occupation.
verl/workers/rollout/sglang_rollout/sglang_rollout.py:141
↓ 5 callers
Function
unpad_dataproto
Unpad the data proto with pad_size. i.e. `data[:-pad_size]`
verl/protocol.py:137
↓ 5 callers
Method
update_result_options
(self, offset: int = 0, sort_desc: Optional[bool] = None)
scripts/rollout_viewer.py:268
↓ 4 callers
Method
__init__
(self)
verl/single_controller/ray/base.py:771
↓ 4 callers
Method
__init__
(self, config: McoreCriticConfig)
verl/workers/megatron_workers.py:845
↓ 4 callers
Method
__init__
(self, config: FSDPCriticConfig)
verl/workers/fsdp_workers.py:971
↓ 4 callers
Method
__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None)
verl/models/llama/megatron/layers/parallel_attention.py:39
↓ 4 callers
Method
_balance_batch
Reorder the data on single controller such that each dp rank gets similar total tokens
verl/trainer/ppo/ray_trainer.py:1021
↓ 4 callers
Function
_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:168
↓ 4 callers
Function
_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/mcore/saver.py:180
↓ 4 callers
Function
_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:168
↓ 4 callers
Function
_compute_response_info
Computes information about prompts and responses from a batch. This is an internal helper function that extracts masks and lengths for promp
verl/trainer/ppo/metric_utils.py:50
↓ 4 callers
Function
_get_cpu_tensor
(tensor: torch.Tensor)
verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:122
↓ 4 callers
Function
_get_cpu_tensor
(tensor: torch.Tensor)
verl/models/mcore/saver.py:134
↓ 4 callers
Function
_get_cpu_tensor
(tensor: torch.Tensor)
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:122
↓ 4 callers
Function
_get_gpt_model
(model)
verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader_depracated.py:67
↓ 4 callers
Function
_get_gpt_model
(model)
verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader.py:67
↓ 4 callers
Function
_get_gpt_model
(model)
verl/models/mcore/loader.py:68
↓ 4 callers
Function
_get_gpt_model
(model)
verl/models/llama/megatron/checkpoint_utils/llama_loader.py:69
↓ 4 callers
Function
_get_gpt_model
(model)
verl/models/llama/megatron/checkpoint_utils/llama_loader_depracated.py:69
↓ 4 callers
Function
_is_non_local
(path: str)
verl/utils/hdfs_io.py:148
↓ 4 callers
Function
_iter_opts
(opt)
verl/utils/megatron_utils.py:394
↓ 4 callers
Function
_pre_process_inputs
( pad_token_id, prompt_token_ids: torch.Tensor, )
verl/workers/rollout/sglang_rollout/sglang_rollout.py:174
↓ 4 callers
Function
_timer
Inner function that handles the core timing logic. Args: name (str): The name/identifier for this timing measurement. timing_raw
verl/utils/profiler/performance.py:140
↓ 4 callers
Method
_update_input_ids
Update the input_ids, attention_mask, position_ids, and loss_mask of the request in additive manner.
verl/workers/rollout/schemas.py:296
↓ 4 callers
Method
add_assistant_message
( self, processing_class: PreTrainedTokenizer | PreTrainedTokenizerFast | ProcessorMixin,
verl/workers/rollout/schemas.py:392
↓ 4 callers
Function
agg_loss_with_trace_lengths
( loss_mat: torch.Tensor, loss_mask: torch.Tensor, loss_agg_mode: str, trace_lengths: Optional[torch.Tenso
verl/trainer/ppo/core_algos.py:742
↓ 4 callers
Method
backward
(ctx: Any, grad_output: Tensor)
verl/utils/ulysses.py:224
↓ 4 callers
Function
create_rl_dataset
Create a dataset. Arguments: data_paths: List of paths to data files. data_config: The data config. tokenizer (Tokenizer)
verl/trainer/main_ppo.py:288
↓ 4 callers
Function
forward_base_model
r""" Copy paste Qwen2VL's forward https://github.com/linkedin/Liger-Kernel/blob/main/src/liger_kernel/transformers/model/qwen2_vl.py ```
verl/models/transformers/qwen2_vl.py:343
↓ 4 callers
Function
fsdp2_clip_grad_norm_
torch.nn.utils.clip_grad_norm_ cann't run on cpu parameter DTensor
verl/utils/fsdp_utils.py:552
↓ 4 callers
Function
get_cosine_schedule_with_warmup
Create a schedule with a learning rate that decreases following the values of the cosine function between the initial lr set in the optimizer
verl/utils/torch_functional.py:562
↓ 4 callers
Function
get_hf_model_checkpoint_path
(checkpoint_path)
verl/utils/megatron_utils.py:514
↓ 4 callers
Function
get_hf_model_path
(config, local_cache_path="~/.cache/verl/rlhf")
verl/utils/model.py:448
↓ 4 callers
Function
get_model
Build the model.
verl/utils/megatron_utils.py:49
↓ 4 callers
Method
get_placement_groups
(self, strategy="STRICT_PACK", name=None, device_name="cuda")
verl/single_controller/ray/base.py:109
↓ 4 callers
Function
get_rope_index
Gets the position ids for Qwen2-VL, it should be generated before sharding the sequence. The batch dim has been removed and the input_ids sho
verl/models/transformers/qwen2_vl.py:55
↓ 4 callers
Function
hf_to_mcore_config
Convert huggingface PretrainedConfig to mcore TransformerConfig. Args: hf_config: The huggingface PretrainedConfig. dtype: The dt
verl/models/mcore/registry.py:156
↓ 4 callers
Function
import_external_libs
(external_libs=None)
verl/utils/import_utils.py:72
↓ 4 callers
Method
initialize
(self, **kwargs)
verl/models/mcore/model_initializer.py:141
↓ 4 callers
Function
is_digit
(s)
verl/utils/reward_score/prime_math/grader.py:109
↓ 4 callers
Method
load_from_disk
(filepath)
verl/protocol.py:400
↓ 4 callers
Function
load_fsdp_optimizer
(optimizer, device_id)
verl/utils/fsdp_utils.py:215
↓ 4 callers
Function
load_mcore_dist_weights
(parallel_model, dist_weight_path, is_value_model=False)
verl/utils/model.py:538
↓ 4 callers
Function
load_megatron_gptmodel_weights
Load weights for mcore GPT model.
verl/utils/model.py:486
↓ 4 callers
Function
make_megatron_module
( wrap_config: McoreModuleWrapperConfig, tf_config: TransformerConfig, hf_config: PretrainedConfig
verl/utils/megatron_utils.py:172
↓ 4 callers
Function
maybe_recover_orig_prompt_and_response
Separate original prompt from partial response that may be included in the prompt. This method handles cases where the prompt contains parti
verl/workers/reward_manager/vineppo.py:11
↓ 4 callers
Function
normalize_answer
(s)
verl/utils/reward_score/search_r1_like_qa_em.py:23
↓ 4 callers
Method
on_batch_end
Generate data using the provided data generation strategy. Note: This method is intended to change the dataset after each training ba
verl/experimental/dynamic_dataset/dynamicgen_dataset.py:106
↓ 4 callers
Function
prepare_dynamic_batch
Prepare a batch for dynamic batching. Args: data (DataProto): The input data. max_token_len (int): The maximum token length
verl/utils/seqlen_balancing.py:340
↓ 4 callers
Function
process_validation_metrics
Process validation metrics into a structured format with statistical analysis. This function organizes validation metrics by data source and
verl/trainer/ppo/metric_utils.py:680
↓ 4 callers
Function
reduce_timing
Reduce timing information across all processes. This function uses distributed communication to gather and sum the timing information from al
verl/utils/profiler/performance.py:198
↓ 4 callers
Method
release_memory_occupation
Release GPU occupation temporarily.
verl/workers/rollout/sglang_rollout/sglang_rollout.py:133
↓ 4 callers
Function
rotate_half
Rotates half the hidden dims of the input.
verl/models/qwen2/megatron/layers/parallel_attention.py:123
↓ 4 callers
Function
rotate_half
Rotates half the hidden dims of the input.
verl/models/llama/megatron/layers/parallel_attention.py:152
↓ 4 callers
Method
run
Execute the main PPO training workflow. This method sets up the distributed training environment, initializes workers, datasets, and
verl/trainer/main_ppo.py:201
↓ 4 callers
Method
sample_level_repeat
Repeat each row of the batch data a specified number of times. Args: repeat_times (torch.tensor, list, tuple, ndarray):
verl/protocol.py:958
← previous
next →
101–200 of 2,081, ranked by callers