Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ChenxinAn-fdu/POLARIS
/ functions
Functions
1,563 in github.com/ChenxinAn-fdu/POLARIS
⨍
Functions
1,563
◇
Types & classes
217
↳
Endpoints
49
↓ 274 callers
Method
get
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/verl/utils/memory_buffer.py:43
↓ 154 callers
Method
to
move the batch to device Args: device (torch.device, str): torch device Returns: DataProto: the current Data
verl/verl/protocol.py:380
↓ 84 callers
Method
get
(self)
verl/verl/protocol.py:789
↓ 84 callers
Function
print_rank_0
If distributed is initialized, print only on rank 0.
verl/verl/utils/megatron_utils.py:378
↓ 79 callers
Function
log_gpu_memory_usage
(head: str, logger: logging.Logger = None, level=logging.DEBUG, rank: int = 0)
verl/verl/utils/debug/performance.py:42
↓ 73 callers
Method
update
(self, current_kl, n_steps)
verl/verl/trainer/ppo/core_algos.py:53
↓ 59 callers
Function
_timer
(name: str, timing_raw: Dict[str, float])
verl/verl/trainer/ppo/ray_trainer.py:280
↓ 59 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/verl/protocol.py:511
↓ 56 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/verl/protocol.py:646
↓ 46 callers
Method
from_pretrained
(cls, save_directory: Union[str, os.PathLike], **kwargs)
verl/tests/e2e/envs/digit_completion/tokenizer.py:149
↓ 41 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/verl/protocol.py:344
↓ 35 callers
Function
copy_to_local
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/verl/utils/fs.py:59
↓ 35 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/verl/workers/rollout/tokenizer.py:90
↓ 35 callers
Method
get
Return a tensor with the input `shape` as a view into the 1-D data starting at `start_index`.
verl/verl/utils/megatron/memory.py:29
↓ 34 callers
Method
init
(self)
verl/tests/ray_gpu/test_rvdz.py:26
↓ 32 callers
Method
getenv
(self, key)
verl/tests/ray_cpu/test_ray_local_envs.py:31
↓ 32 callers
Method
sleep
Sleep engine to offload model weights and discard kv cache.
verl/verl/workers/rollout/async_server.py:103
↓ 30 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/verl/protocol.py:568
↓ 26 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/verl/protocol.py:684
↓ 26 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/verl/utils/torch_functional.py:245
↓ 25 callers
Function
hf_tokenizer
Create a huggingface pretrained tokenizer which correctness handles eos and pad tokens. Args: name (str): The name of the tokenizer.
verl/verl/utils/tokenizer.py:36
↓ 22 callers
Method
create
Create a tool instance. Args: instance_id: The instance id of the tool. Returns: The instance id of the tool
verl/verl/tools/base_tool.py:41
↓ 22 callers
Method
sub
(self, x)
verl/tests/ray_cpu/test_fused_workers.py:40
↓ 21 callers
Function
offload_fsdp_model_to_cpu
(model: FSDP, empty_cache: bool = True)
verl/verl/utils/fsdp_utils.py:121
↓ 21 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/verl/protocol.py:394
↓ 20 callers
Method
step
(self)
verl/verl/utils/debug/profile.py:66
↓ 19 callers
Method
log
(self, data, step, backend=None)
verl/verl/utils/tracking.py:112
↓ 19 callers
Method
repeat
Repeat the batch data a specified number of times. Args: repeat_times (int): Number of times to repeat the data.
verl/verl/protocol.py:713
↓ 18 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/verl/utils/ulysses.py:62
↓ 17 callers
Method
execute_all_sync
(self, method_name: str, *args, **kwargs)
verl/verl/single_controller/ray/base.py:395
↓ 16 callers
Function
convert_config
(hf_config: PretrainedConfig, megatron_config)
verl/verl/utils/megatron_utils.py:148
↓ 16 callers
Function
load_fsdp_model_to_gpu
(model: FSDP)
verl/verl/utils/fsdp_utils.py:152
↓ 16 callers
Method
to_dtype
(precision)
verl/verl/utils/torch_dtypes.py:63
↓ 15 callers
Method
named_parameters
(self)
verl/verl/utils/memory_buffer.py:205
↓ 14 callers
Method
backward
(ctx: Any, grad_output: Tensor)
verl/verl/utils/ulysses.py:224
↓ 14 callers
Function
compute_position_id_with_mask
(mask)
verl/verl/utils/model.py:204
↓ 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/verl/utils/hdfs_io.py:84
↓ 13 callers
Method
encode
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:74
↓ 13 callers
Method
generate_sequences
Generate sequences
verl/verl/workers/rollout/base.py:33
↓ 13 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/verl/utils/hdfs_io.py:50
↓ 13 callers
Function
offload_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:229
↓ 13 callers
Method
postprocess_data
(self, data: DataProto)
verl/verl/workers/sharding_manager/base.py:31
↓ 13 callers
Method
save_pretrained
(self, save_directory: Union[str, os.PathLike], **kwargs)
verl/tests/e2e/envs/digit_completion/tokenizer.py:142
↓ 13 callers
Function
unwrap_model
(model, module_instances=ALL_MODULE_WRAPPER_CLASSNAMES)
verl/verl/utils/megatron_utils.py:133
↓ 12 callers
Function
fsdp_version
(model)
verl/verl/utils/fsdp_utils.py:369
↓ 12 callers
Function
get_ulysses_sequence_parallel_world_size
Get ulysses sequence parallel world size.
verl/verl/utils/ulysses.py:46
↓ 12 callers
Method
preprocess_data
(self, data: DataProto)
verl/verl/workers/sharding_manager/base.py:28
↓ 11 callers
Function
append_to_dict
(data: Dict, new_data: Dict)
verl/verl/utils/py_functional.py:158
↓ 11 callers
Method
get_megatron_rank_info
(self)
verl/verl/single_controller/base/megatron/worker.py:32
↓ 11 callers
Function
reduce_metrics
(metrics: Dict[str, List[Any]])
verl/verl/trainer/ppo/metric_utils.py:28
↓ 11 callers
Method
save
(self)
verl/verl/utils/debug/profile.py:75
↓ 11 callers
Method
train
(self)
verl/verl/workers/sharding_manager/megatron_vllm.py:194
↓ 10 callers
Method
_validate
(self)
verl/verl/utils/debug/profile.py:49
↓ 10 callers
Function
agg_loss
Aggregate the loss matrix into a scalar. Args: loss_mat: `(torch.Tensor)` shape: (bs, response_length) loss_mask:
verl/verl/trainer/ppo/core_algos.py:316
↓ 10 callers
Method
from_config
(cls, config: Dict)
verl/tests/e2e/envs/digit_completion/tokenizer.py:135
↓ 10 callers
Function
get_model
Build the model.
verl/verl/utils/megatron_utils.py:41
↓ 10 callers
Function
get_ulysses_sequence_parallel_group
Get ulysses sequence parallel process group.
verl/verl/utils/ulysses.py:38
↓ 10 callers
Function
load_megatron_model_to_gpu
(models, load_grad=True)
verl/verl/utils/megatron_utils.py:263
↓ 10 callers
Function
masked_mean
Compute mean of tensor with a masked values.
verl/verl/utils/torch_functional.py:122
↓ 10 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/verl/utils/ulysses.py:257
↓ 10 callers
Method
wake_up
Wake up engine to load model weights and build kv cache.
verl/verl/workers/rollout/async_server.py:98
↓ 9 callers
Function
_megatron_calc_global_rank
Calculate global rank with support for CP/EP parallelism
verl/verl/models/mcore/saver.py:28
↓ 9 callers
Method
from_single_dict
Create a DataProto from a dict of tensors and non_tensors
verl/verl/protocol.py:328
↓ 9 callers
Function
gather_outpus_and_unpad
( x: Tensor, gather_dim: int, unpad_dim: int = None, padding_size: int = 0, grad_scaler: b
verl/verl/utils/ulysses.py:237
↓ 9 callers
Method
get_rng_state
()
verl/verl/utils/checkpoint/checkpoint_manager.py:107
↓ 9 callers
Function
load_extern_type
Load a external data type based on the file path and type name
verl/verl/utils/import_utils.py:62
↓ 9 callers
Function
offload_fsdp_optimizer
(optimizer)
verl/verl/utils/fsdp_utils.py:179
↓ 9 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/verl/utils/seqlen_balancing.py:216
↓ 8 callers
Method
eval
(self)
verl/verl/workers/sharding_manager/megatron_vllm.py:190
↓ 8 callers
Function
initialize_global_process_group
(timeout_second=36000)
verl/verl/utils/distributed.py:19
↓ 8 callers
Method
rank
(self)
verl/verl/single_controller/base/worker.py:220
↓ 8 callers
Method
start
(self)
verl/verl/utils/debug/profile.py:61
↓ 7 callers
Function
_megatron_calc_global_rank
given TP,DP,PP rank to get the global rank.
verl/verl/models/qwen2/megatron/checkpoint_utils/qwen2_saver.py:27
↓ 7 callers
Function
_megatron_calc_global_rank
given TP,DP,PP rank to get the global rank.
verl/verl/models/llama/megatron/checkpoint_utils/llama_saver.py:27
↓ 7 callers
Function
apply_monkey_patch
Replace _flash_attention_forward to _ulysses_flash_attention_forward
verl/verl/models/transformers/monkey_patch.py:109
↓ 7 callers
Function
clean_traceback
(error_traceback)
verl/verl/utils/reward_score/prime_code/testing_util.py:80
↓ 7 callers
Function
func
(*args, **kwargs)
verl/verl/single_controller/ray/base.py:44
↓ 7 callers
Function
offload_megatron_optimizer
(optimizers)
verl/verl/utils/megatron_utils.py:357
↓ 7 callers
Method
reorder
Note that this operation is in-place
verl/verl/protocol.py:705
↓ 6 callers
Function
_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader_depracated.py:92
↓ 6 callers
Function
_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/mcore/loader.py:97
↓ 6 callers
Function
_broadcast_tensor
broadcast tensor from rank0 across mp_group
verl/verl/models/llama/megatron/checkpoint_utils/llama_loader_depracated.py:94
↓ 6 callers
Function
_fetch_tensor
fetch tensor
verl/verl/models/qwen2/megatron/checkpoint_utils/qwen2_loader.py:92
↓ 6 callers
Function
_fetch_tensor
fetch tensor
verl/verl/models/llama/megatron/checkpoint_utils/llama_loader.py:94
↓ 6 callers
Function
_repeat_interleave
(value: Union[torch.Tensor, np.ndarray], repeats: int)
verl/verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py:70
↓ 6 callers
Method
add
(self, data: DataProto)
verl/tests/ray_cpu/test_auto_padding.py:35
↓ 6 callers
Method
add
(self, idx: int, val: int)
verl/verl/utils/seqlen_balancing.py:31
↓ 6 callers
Function
combined_int_check
(val)
verl/verl/utils/reward_score/prime_code/testing_util.py:76
↓ 6 callers
Function
copy_local_path_from_hdfs
Deprecated. Please use copy_to_local instead.
verl/verl/utils/fs.py:73
↓ 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/verl/utils/model.py:161
↓ 6 callers
Function
gather_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/verl/utils/ulysses.py:86
↓ 6 callers
Function
hf_processor
Create a huggingface processor to process multimodal data. Args: name_or_path (str): The name of the processor. Returns: tra
verl/verl/utils/tokenizer.py:64
↓ 6 callers
Method
init_workers
Init resource pool and worker group
verl/verl/trainer/ppo/ray_trainer.py:702
↓ 6 callers
Function
is_non_local
(path)
verl/verl/utils/fs.py:33
↓ 6 callers
Function
logprobs_from_logits
See: https://github.com/pytorch/pytorch/issues/563#issuecomment-330103591
verl/verl/utils/torch_functional.py:53
↓ 6 callers
Function
repeat_kv
This is the equivalent of torch.repeat_interleave(x, dim=2, repeats=n_rep). The hidden states go from (batch, seqlen, num_key_value_heads, he
verl/verl/models/transformers/monkey_patch.py:36
↓ 6 callers
Method
submit_chat_completions
Submit a chat completion request to chat scheduler and wait until it is done. To submit multiple requests in parallel, please use `generate_se
verl/verl/workers/rollout/async_server.py:309
↓ 6 callers
Function
truncatefn
(s, length=300)
verl/verl/utils/reward_score/prime_code/testing_util.py:39
↓ 5 callers
Method
__init__
(self, config: Qwen2Config, megatron_config: ModelParallelConfig)
verl/verl/models/qwen2/megatron/modeling_qwen2_megatron.py:82
↓ 5 callers
Method
__init__
(self, config: LlamaConfig, megatron_config: ModelParallelConfig)
verl/verl/models/llama/megatron/modeling_llama_megatron.py:82
next →
1–100 of 1,563, ranked by callers