Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Unakar/Logic-RL
/ functions
Functions
858 in github.com/Unakar/Logic-RL
⨍
Functions
858
◇
Types & classes
113
↳
Endpoints
30
↓ 144 callers
Method
get
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/utils/memory_buffer.py:40
↓ 95 callers
Method
to
move the batch to device Args: device (torch.device, str): torch device Returns: DataProto: the current Data
verl/protocol.py:316
↓ 45 callers
Function
log_gpu_memory_usage
(head: str, logger: logging.Logger = None, level=logging.DEBUG, rank: int = 0)
verl/utils/debug/performance.py:20
↓ 34 callers
Method
update
(self, current_kl, n_steps)
verl/trainer/ppo/core_algos.py:52
↓ 28 callers
Method
from_dict
Create a DataProto from a dict of tensors. This assumes that 1. All the tensor in tensors have the same dim0 2. Only dim0 is the batch
verl/protocol.py:281
↓ 23 callers
Method
from_pretrained
(cls, save_directory: Union[str, os.PathLike], **kwargs)
tests/e2e/envs/digit_completion/tokenizer.py:154
↓ 22 callers
Function
copy_local_path_from_hdfs
Copy src from hdfs to local if src is on hdfs or directly return src. If cache_dir is None, we will use the default cache dir of the system. Note
verl/utils/fs.py:55
↓ 19 callers
Function
hf_tokenizer
Create a huggingface pretrained tokenizer. Args: name (str): The name of the tokenizer. correct_pad_token (bool): Whether to corr
verl/utils/tokenizer.py:35
↓ 17 callers
Method
execute_all_sync
(self, method_name: str, *args, **kwargs)
verl/single_controller/ray/base.py:332
↓ 17 callers
Method
named_parameters
(self)
verl/utils/memory_buffer.py:205
↓ 16 callers
Method
getenv
(self, key)
tests/ray/test_ray_local_envs.py:31
↓ 15 callers
Method
chunk
Split the batch among dim=0 into chunks. The meta_info is passed to each DataProto after split. Args: chunks (int): the number of
verl/protocol.py:482
↓ 15 callers
Method
init
(self)
tests/ray/test_rvdz.py:27
↓ 15 callers
Method
pop
Pop a subset of the DataProto via `batch_keys` and `meta_info_keys` Args: batch_keys (list, optional): a list of strings indicati
verl/protocol.py:365
↓ 14 callers
Method
concat
Concat a list of DataProto. The batch is concatenated among dim=0. The meta_info is assumed to be identical and will use the first one.
verl/protocol.py:515
↓ 14 callers
Method
to_dtype
(precision)
verl/utils/torch_dtypes.py:63
↓ 13 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
↓ 12 callers
Function
makedirs
r"""Works like os.makedirs() but supports hdfs. Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except tha
verl/utils/hdfs_io.py:50
↓ 12 callers
Method
select
Select a subset of the DataProto via batch_keys and meta_info_keys Args: batch_keys (list, optional): a list of strings indicatin
verl/protocol.py:330
↓ 11 callers
Method
get
(self)
verl/protocol.py:632
↓ 11 callers
Function
masked_mean
Compute mean of tensor with a masked values.
verl/utils/torch_functional.py:107
↓ 10 callers
Function
_timer
(name: str, timing_raw: Dict[str, float])
verl/trainer/ppo/ray_trainer.py:315
↓ 10 callers
Function
pad_sequence_to_length
pad a 2D tensors (e.g. responses, logprobs) in the last dim to max_seq_length. input shape: [bs, seq_length] output shape: [bs, max_seq_l
verl/utils/torch_functional.py:209
↓ 9 callers
Method
get_megatron_rank_info
(self)
verl/single_controller/base/megatron/worker.py:33
↓ 9 callers
Function
get_ulysses_sequence_parallel_group
Get ulysses sequence parallel process group.
verl/utils/ulysses.py:37
↓ 9 callers
Function
offload_fsdp_param_and_grad
(module, offload_grad=False)
verl/utils/fsdp_utils.py:93
↓ 9 callers
Method
preprocess_data
(self, data: DataProto)
verl/workers/sharding_manager/base.py:29
↓ 9 callers
Method
union
Union with another DataProto. Union batch and meta_info separately. Throw an error if - there are conflict keys in batch and they are
verl/protocol.py:423
↓ 8 callers
Function
compute_position_id_with_mask
(mask)
verl/utils/model.py:177
↓ 8 callers
Method
postprocess_data
(self, data: DataProto)
verl/workers/sharding_manager/base.py:32
↓ 8 callers
Method
save_pretrained
(self, save_directory: Union[str, os.PathLike], **kwargs)
tests/e2e/envs/digit_completion/tokenizer.py:147
↓ 7 callers
Function
_megatron_calc_global_rank
given TP,DP,PP rank to get the global rank.
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:28
↓ 7 callers
Function
append_to_dict
(data: Dict, new_data: Dict)
verl/utils/py_functional.py:41
↓ 7 callers
Method
backward
(ctx: Any, grad_output: Tensor)
verl/utils/ulysses.py:226
↓ 7 callers
Method
from_config
(cls, config: Dict)
tests/e2e/envs/digit_completion/tokenizer.py:140
↓ 7 callers
Function
get_ulysses_sequence_parallel_world_size
Get ulysses sequence parallel world size.
verl/utils/ulysses.py:45
↓ 7 callers
Function
load_fsdp_param_and_grad
(module, device_id, load_grad=False)
verl/utils/fsdp_utils.py:103
↓ 7 callers
Method
train
(self)
verl/workers/sharding_manager/megatron_vllm.py:153
↓ 6 callers
Function
_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_loader.py:97
↓ 6 callers
Method
_validate
(self)
verl/trainer/ppo/ray_trainer.py:422
↓ 6 callers
Function
create_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/utils/model.py:136
↓ 6 callers
Method
decode
Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special tokens and clean up tokeniz
verl/workers/rollout/tokenizer.py:86
↓ 6 callers
Method
eval
(self)
verl/workers/sharding_manager/megatron_vllm.py:149
↓ 6 callers
Function
gather_outpus_and_unpad
(x: Tensor, gather_dim: int, unpad_dim: int = None,
verl/utils/ulysses.py:233
↓ 6 callers
Function
gather_seq_scatter_heads
A func to sync embedding input with alltoall in sequence parallel gather sequence dimension and scatter head dim: e.g. seq_dim: 1, head_d
verl/utils/ulysses.py:61
↓ 6 callers
Method
get
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/utils/megatron/memory.py:33
↓ 6 callers
Function
get_model
Build the model.
verl/utils/megatron_utils.py:34
↓ 6 callers
Method
log
(self, data, step, backend=None)
verl/utils/tracking.py:59
↓ 6 callers
Function
logprobs_from_logits
See: https://github.com/pytorch/pytorch/issues/563#issuecomment-330103591
verl/utils/torch_functional.py:49
↓ 6 callers
Function
rearrange_micro_batches
Split the batch into a list of micro_batches, where the max_token_len is smaller than max_token_len and the number of valid tokens in each micro b
verl/utils/seqlen_balancing.py:224
↓ 6 callers
Method
repeat
Repeat the batch data a specified number of times. Args: repeat_times (int): Number of times to repeat the data.
verl/protocol.py:547
↓ 6 callers
Function
ulysses_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/utils/ulysses.py:252
↓ 5 callers
Method
__init__
(self, config: LlamaConfig, megatron_config: ModelParallelConfig)
verl/models/llama/megatron/modeling_llama_megatron.py:80
↓ 5 callers
Function
_hdfs_cmd
(cmd: str)
verl/utils/hdfs_io.py:139
↓ 5 callers
Function
_run_cmd
(cmd: str, timeout=None)
verl/utils/hdfs_io.py:135
↓ 5 callers
Function
broadcast_dict_tensor
TODO: optimize this. Technically, we only need one broadcast
verl/utils/torch_functional.py:160
↓ 5 callers
Method
dump
(self, data: io.BytesIO, name)
verl/utils/debug/trajectory_tracker.py:59
↓ 5 callers
Function
get_micro_data_parallel_world_size
()
verl/workers/sharding_manager/megatron_vllm.py:423
↓ 5 callers
Method
get_placement_groups
(self, strategy="STRICT_PACK", name=None)
verl/single_controller/ray/base.py:64
↓ 5 callers
Method
init_model
(self)
verl/workers/fsdp_workers.py:652
↓ 5 callers
Function
unwrap_model
(model, module_instances=ALL_MODULE_WRAPPER_CLASSNAMES)
verl/utils/megatron_utils.py:122
↓ 5 callers
Function
update_model_config
(module_config, override_config_kwargs)
verl/utils/model.py:42
↓ 4 callers
Function
_broadcast_tensor
broadcast tensor across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:131
↓ 4 callers
Function
_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:170
↓ 4 callers
Function
_get_cpu_tensor
(tensor: torch.Tensor)
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:124
↓ 4 callers
Function
_get_gpt_model
(model)
verl/models/llama/megatron/checkpoint_utils/llama_loader.py:63
↓ 4 callers
Function
_is_non_local
(path: str)
verl/utils/hdfs_io.py:143
↓ 4 callers
Function
_split_args_kwargs_data_proto
(chunks, *args, **kwargs)
verl/single_controller/base/decorator.py:45
↓ 4 callers
Method
add
(self, idx: int, val: int)
verl/utils/seqlen_balancing.py:33
↓ 4 callers
Function
allgather_dict_tensors
TODO: optimize this. - We can use async ops - We can use only one allgather Args: tensors: size: group:
verl/utils/torch_functional.py:169
↓ 4 callers
Function
build_memory_reference_from_module
(module: torch.nn.Module, memory_buffers: Dict[torch.dtype, MemoryBuffe
verl/utils/memory_buffer.py:97
↓ 4 callers
Method
compute_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/workers/actor/base.py:39
↓ 4 callers
Function
compute_reward
We compute dense reward here so that we can directly train RL without SFT
tests/e2e/envs/digit_completion/task.py:137
↓ 4 callers
Method
execute_all_async
(self, method_name: str, *args, **kwargs)
verl/single_controller/ray/base.py:335
↓ 4 callers
Method
from_single_dict
(cls, data: Dict[str, Union[torch.Tensor, np.ndarray]], meta_info=None)
verl/protocol.py:266
↓ 4 callers
Function
func
(*args, **kwargs)
verl/single_controller/ray/base.py:38
↓ 4 callers
Method
generate_sequences
Generate sequences
verl/workers/rollout/base.py:35
↓ 4 callers
Method
get
(self)
verl/utils/rendezvous/ray_backend.py:30
↓ 4 callers
Function
get_fsdp_wrap_policy
(module, config=None)
verl/utils/fsdp_utils.py:48
↓ 4 callers
Function
get_init_weight_context_manager
(use_meta_tensor=True)
verl/utils/fsdp_utils.py:36
↓ 4 callers
Function
get_micro_data_parallel_group
()
verl/workers/sharding_manager/megatron_vllm.py:418
↓ 4 callers
Method
get_resource_pool
Get the resource pool of the worker_cls
verl/trainer/ppo/ray_trainer.py:76
↓ 4 callers
Function
get_reverse_idx
(idx_map)
verl/utils/seqlen_balancing.py:259
↓ 4 callers
Function
init_model_parallel_config
(config: DictConfig)
verl/utils/megatron_utils.py:201
↓ 4 callers
Function
load_megatron_model_weights
(config, model_config, parallel_model,
verl/utils/model.py:253
↓ 4 callers
Method
make_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/protocol.py:441
↓ 4 callers
Function
offload_fsdp_optimizer
(optimizer)
verl/utils/fsdp_utils.py:113
↓ 4 callers
Function
print_model_size
(model: nn.Module, name: str = None)
verl/utils/model.py:129
↓ 4 callers
Function
reduce_metrics
(metrics: dict)
verl/trainer/ppo/ray_trainer.py:162
↓ 4 callers
Function
repeat_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/models/llama/megatron/layers/parallel_attention.py:131
↓ 4 callers
Function
rotate_half
Rotates half the hidden dims of the input.
verl/models/llama/megatron/layers/parallel_attention.py:116
↓ 4 callers
Function
set_ulysses_sequence_parallel_group
Set ulysses sequence parallel process group.
verl/utils/ulysses.py:29
↓ 4 callers
Method
to_dict
(self)
verl/single_controller/base/worker.py:78
↓ 3 callers
Method
__init__
(self)
verl/single_controller/ray/base.py:442
↓ 3 callers
Method
__init__
(self, dim, max_position_embeddings=2048, base=10000, device=None)
verl/models/llama/megatron/layers/parallel_attention.py:37
↓ 3 callers
Function
_broadcast_tp_shard_tensor
broadcast tensor in tp shards across mp_group
verl/models/llama/megatron/checkpoint_utils/llama_loader.py:178
↓ 3 callers
Method
_build_param_references
(self, pp_rank, maintain_weight=False)
verl/workers/sharding_manager/megatron_vllm.py:88
↓ 3 callers
Function
_concat_data_proto_or_future
(output: List)
verl/single_controller/base/decorator.py:129
↓ 3 callers
Function
_get_gpt_model
(model)
verl/models/llama/megatron/checkpoint_utils/llama_saver.py:93
↓ 3 callers
Function
_pre_process_inputs
(pad_token_id, prompt_token_ids: torch.Tensor)
verl/workers/rollout/vllm_rollout/vllm_rollout.py:49
next →
1–100 of 858, ranked by callers