before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
num_reqs = min(
model_runner.scheduler_config.max_num_seqs,
model_runner.scheduler_config.max_num_batched_tokens // prompt_len,
)
num_kv_cache_groups = len(model_runner.kv_cache_config.kv_cache_groups)
req_ids = [f"_warmup_{i}_" for i in range(num_reqs)]
# SamplingParams exercising... | No issues found. | num_reqs = min(
model_runner.scheduler_config.max_num_seqs,
model_runner.scheduler_config.max_num_batched_tokens // prompt_len,
)
num_kv_cache_groups = len(model_runner.kv_cache_config.kv_cache_groups)
req_ids = [f"_warmup_{i}_" for i in range(num_reqs)]
# SamplingParams exercising... | @@ -0,0 +1,105 @@
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
+
+import numpy as np
+import torch
+
+from vllm import PoolingParams, SamplingParams
+from vllm.v1.core.sched.output import (
+ CachedRequestData,
+ GrammarOutput,
+ NewRequestData,
+... | vllm/v1/worker/gpu/warmup.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Model Runner V2] Warmup kernels | 35,172 | vllm-project/vllm | 71,895 | Python | njhill | |
head_size: int,
cos_sin_cache: torch.Tensor,
is_neox_style: bool,
offsets: torch.Tensor | None = None,
) -> None:
return
# Global flag to ensure ops are registered only once
_OPS_REGISTERED = False
class rocm_aiter_ops:
"""ROCm AITER operations wrapper for AMD GPU acceleration in vLLM.
... | No issues found. | head_size: int,
cos_sin_cache: torch.Tensor,
is_neox_style: bool,
offsets: torch.Tensor | None = None,
) -> None:
return
# Global flag to ensure ops are registered only once
_OPS_REGISTERED = False
class rocm_aiter_ops:
"""ROCm AITER operations wrapper for AMD GPU acceleration in vLLM.
... | @@ -831,6 +831,59 @@ def _rocm_aiter_triton_add_rmsnorm_pad_fake(
return out, residual_out
+def _triton_rotary_embedding_impl(
+ positions: torch.Tensor,
+ query: torch.Tensor,
+ key: torch.Tensor,
+ head_size: int,
+ cos_sin_cache: torch.Tensor,
+ is_neox: bool,
+ offsets: torch.Tensor | ... | vllm/_aiter_ops.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [ROCm]: Enable customop and rope+kvcache fusion for AITER RoPE | 35,180 | vllm-project/vllm | 71,895 | Python | Rohan138 | |
token=text,
logprob=max(token_logprob.logprob, -9999.0),
bytes=list(text.encode("utf-8", errors="replace")),
top_logprobs=(
self._topk_logprobs(
logprob, top_logprobs=top_logprobs, tokeniz... | No issues found. | token=text,
logprob=max(token_logprob.logprob, -9999.0),
bytes=list(text.encode("utf-8", errors="replace")),
top_logprobs=(
self._topk_logprobs(
logprob, top_logprobs=top_logprobs, tokeniz... | @@ -85,6 +85,8 @@
ResponseCreatedEvent,
ResponseInProgressEvent,
ResponseInputOutputMessage,
+ ResponseReasoningPartAddedEvent,
+ ResponseReasoningPartDoneEvent,
ResponsesRequest,
ResponsesResponse,
ResponseUsage,
@@ -1339,6 +1341,19 @@ async def _process_simple_streaming_events(
... | vllm/entrypoints/openai/responses/serving.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Bugfix] Emit reasoning_part events in simple streaming path for Resp… | 35,184 | vllm-project/vllm | 71,895 | Python | daniel-salib | |
(uint64_t(out_val.hi) << 32) | uint64_t(out_val.lo);
reinterpret_cast<uint64_t*>(out)[outOffset >> 1] = packed64;
} else {
out[inOffset] = out_val;
}
}
}
}
}
// Use UE4M3 by default.
template <class Type, bool UE8M0_SF = false>
__global__ void __launch_boun... | No issues found. | (uint64_t(out_val.hi) << 32) | uint64_t(out_val.lo);
reinterpret_cast<uint64_t*>(out)[outOffset >> 1] = packed64;
} else {
out[inOffset] = out_val;
}
}
}
}
}
// Use UE4M3 by default.
template <class Type, bool UE8M0_SF = false>
__global__ void __launch_boun... | @@ -109,7 +109,8 @@ __global__ void __launch_bounds__(512, VLLM_BLOCKS_PER_SM(512))
template <class Type, bool UE8M0_SF = false>
__global__ void __launch_bounds__(512, VLLM_BLOCKS_PER_SM(512))
cvt_fp16_to_fp4_sf_major(int32_t numRows, int32_t numCols,
- int32_t sf_n_unpadded, Type con... | csrc/quantization/fp4/nvfp4_quant_kernels.cu | 0 | CUDA | 1 | none | 16 | 51 | 51 | true | [BugFix] Fix fp4 quant kernel on CUDA 12.8 | 35,210 | vllm-project/vllm | 71,895 | Python | LopezCastroRoberto | |
"""Convert seconds to HH:MM:SS.mmm format."""
h = int(sec_time // 3600)
assert h < 100, "time seems to last more than 100 hours"
m = int((sec_time % 3600) // 60)
s = sec_time % 60
return f"{h:02d}:{m:02d}:{s:06.3f}"
def itl_type(itl: float) -> str:
"""Categor... | No issues found. | """Convert seconds to HH:MM:SS.mmm format."""
h = int(sec_time // 3600)
assert h < 100, "time seems to last more than 100 hours"
m = int((sec_time % 3600) // 60)
s = sec_time % 60
return f"{h:02d}:{m:02d}:{s:06.3f}"
def itl_type(itl: float) -> str:
"""Categor... | @@ -0,0 +1,316 @@
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
+"""Generate plots for benchmark results."""
+
+from pathlib import Path
+from typing import Any
+
+from vllm.utils.import_utils import PlaceholderModule
+
+try:
+ import plotly.express as p... | vllm/benchmarks/plot.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Benchmarks] Plot benchmark timeline and requests statistics | 35,220 | vllm-project/vllm | 71,895 | Python | sducouedic | |
@pytest.mark.parametrize("is_rms_norm", IS_RMS_NORM)
@torch.inference_mode()
def test_layer_norm_fwd_with_groups(
num_tokens: int,
hidden_size: int,
group_size: int,
dtype: torch.dtype,
is_rms_norm: bool,
) -> None:
"""Test layer norm forward pass with group normalization."""
if hidden_size ... | No issues found. | @pytest.mark.parametrize("is_rms_norm", IS_RMS_NORM)
@torch.inference_mode()
def test_layer_norm_fwd_with_groups(
num_tokens: int,
hidden_size: int,
group_size: int,
dtype: torch.dtype,
is_rms_norm: bool,
) -> None:
"""Test layer norm forward pass with group normalization."""
if hidden_size ... | @@ -74,7 +74,7 @@ def layer_norm_ref(
return out.to(dtype)
-DTYPES = [torch.bfloat16, torch.float32]
+DTYPES = [torch.float16, torch.bfloat16, torch.float32]
# Test various M sizes to ensure rows_per_block logic works correctly
NUM_TOKENS = [
1,
@@ -380,6 +380,68 @@ def test_multidimensional_input(
... | tests/kernels/test_fla_layernorm_guard.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Bugfix] Fix dtype mismatch in RMSNormGated.forward_native() during torch.compile | 35,256 | vllm-project/vllm | 71,895 | Python | haosdent | |
can_force_load_format = False
break
prompt = "Hello, my name is"
token_ids = tokenizer(prompt).input_ids
ref_results: list = []
for i, (args, env) in enumerate(zip(all_args, all_envs)):
if can_force_load_format:
# we are comparing the results and
... | No issues found. | can_force_load_format = False
break
prompt = "Hello, my name is"
token_ids = tokenizer(prompt).input_ids
ref_results: list = []
for i, (args, env) in enumerate(zip(all_args, all_envs)):
if can_force_load_format:
# we are comparing the results and
... | @@ -1327,6 +1327,57 @@ def wrapper(f: Callable[_P, None]) -> Callable[_P, None]:
return wrapper
+def gpu_tier_mark(*, min_gpus: int = 1, max_gpus: int | None = None):
+ """
+ Mark a test to only run when the GPU count falls within [min_gpus, max_gpus].
+
+ Examples:
+ @gpu_tier_mark(min_gpus=2)... | tests/utils.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [ROCm][CI] Extending attention backend coverage for Eagle spec decode tests | 35,265 | vllm-project/vllm | 71,895 | Python | AndreasKaratzas | |
# Map batch KV start to each token
start_tensor = kv_starts_per_batch[batch_id] # [N]
# End-align local positions inside each batch:
# local_pos = L[b] - counts[b] + (1..counts[b]) for each batch b
L_expand = torch.repeat_interleave(L, counts) # [N]
m_expand = torch.repeat_interleave(counts,... | No issues found. | # Map batch KV start to each token
start_tensor = kv_starts_per_batch[batch_id] # [N]
# End-align local positions inside each batch:
# local_pos = L[b] - counts[b] + (1..counts[b]) for each batch b
L_expand = torch.repeat_interleave(L, counts) # [N]
m_expand = torch.repeat_interleave(counts,... | @@ -8,7 +8,10 @@
from vllm.config import VllmConfig
from vllm.logger import init_logger
from vllm.platforms import current_platform
-from vllm.utils.deep_gemm import get_paged_mqa_logits_metadata, has_deep_gemm
+from vllm.utils.deep_gemm import (
+ get_paged_mqa_logits_metadata,
+ is_deep_gemm_supported,
+)
f... | vllm/v1/attention/backends/mla/indexer.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Feat] Add CUDA torch fallbacks for fp8_mqa_logits/fp8_paged_mqa_logits_torch function | 35,271 | vllm-project/vllm | 71,895 | Python | chaunceyjiang | |
kwargs_on_init: bool,
):
"""Ensure Qwen2VLMultiModalProcessor handles min/max pixels properly."""
if (
Version(TRANSFORMERS_VERSION) < Version("5.2.0")
and "size" in mm_processor_kwargs
):
pytest.skip("`size` ignored by `Qwen2VLProcessor.__call__`")
ctx = build_model_context... | No issues found. | kwargs_on_init: bool,
):
"""Ensure Qwen2VLMultiModalProcessor handles min/max pixels properly."""
if (
Version(TRANSFORMERS_VERSION) < Version("5.2.0")
and "size" in mm_processor_kwargs
):
pytest.skip("`size` ignored by `Qwen2VLProcessor.__call__`")
ctx = build_model_context... | @@ -2,6 +2,8 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import pytest
+from packaging.version import Version
+from transformers import __version__ as TRANSFORMERS_VERSION
from vllm.multimodal import MULTIMODAL_REGISTRY
@@ -15,6 +17,16 @@
[
({}, 1426, (5704, 1176)),
... | tests/models/multimodal/processing/test_qwen2_vl.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Misc] Standardize handling of `mm_processor_kwargs.size` | 35,284 | vllm-project/vllm | 71,895 | Python | DarkLight1337 | |
prompt_len=prompt_len,
all_token_ids=new_req_data.prefill_token_ids,
num_computed_tokens=new_req_data.num_computed_tokens,
)
req_index = self.req_states.req_id_to_index[req_id]
if self.encoder_cache is not None:
self.en... | No issues found. | prompt_len=prompt_len,
all_token_ids=new_req_data.prefill_token_ids,
num_computed_tokens=new_req_data.num_computed_tokens,
)
req_index = self.req_states.req_id_to_index[req_id]
if self.encoder_cache is not None:
self.en... | @@ -57,10 +57,7 @@
from vllm.v1.worker.gpu.buffer_utils import async_copy_to_gpu
from vllm.v1.worker.gpu.cp_utils import prepare_dcp_local_seq_lens
from vllm.v1.worker.gpu.cudagraph_utils import CudaGraphManager
-from vllm.v1.worker.gpu.dp_utils import (
- get_cudagraph_and_dp_padding,
- make_num_tokens_across... | vllm/v1/worker/gpu/model_runner.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Model Runner V2] support dp & ep for spec decoding | 35,294 | vllm-project/vllm | 71,895 | Python | izhuhaoran | |
"Expected was_aot_compile_fn_loaded_from_disk to be True"
)
artifacts = compiled_mod.aot_compiled_fn._artifacts
guards_string = artifacts.compiled_fn.shape_env.format_guards()
assert guards_string == " - s77 <= 42\n - Eq(Mod(s77, 2), 0)... | No issues found. | "Expected was_aot_compile_fn_loaded_from_disk to be True"
)
artifacts = compiled_mod.aot_compiled_fn._artifacts
guards_string = artifacts.compiled_fn.shape_env.format_guards()
assert guards_string == " - s77 <= 42\n - Eq(Mod(s77, 2), 0)... | @@ -16,6 +16,7 @@
import vllm.model_executor.layers.activation
from vllm.compilation.caching import (
StandaloneCompiledArtifacts,
+ VllmSerializableFunction,
)
from vllm.compilation.decorators import support_torch_compile
from vllm.config import (
@@ -156,6 +157,26 @@ def test_save_and_load(monkeypatch: p... | tests/compile/test_aot_compile.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [compile] Fix caching error over pytree slice node. | 35,308 | vllm-project/vllm | 71,895 | Python | zhxchen17 | |
self,
cross_encoder_model_config,
cross_encoder_tokenizer,
tokenization_kwargs,
mock_model_with_score_template,
):
"""Test when model supports score template but custom template is provided."""
template = (
'TEMPLATE_USED {{ messages[0]["content"] ... | No issues found. | self,
cross_encoder_model_config,
cross_encoder_tokenizer,
tokenization_kwargs,
mock_model_with_score_template,
):
"""Test when model supports score template but custom template is provided."""
template = (
'TEMPLATE_USED {{ messages[0]["content"] ... | @@ -4,10 +4,15 @@
from unittest.mock import patch
import pytest
+import torch
from vllm.config import ModelConfig
from vllm.entrypoints.chat_utils import ChatTemplateResolutionError
-from vllm.entrypoints.pooling.score.utils import get_score_prompt
+from vllm.entrypoints.pooling.score.utils import (
+ comput... | tests/entrypoints/pooling/score/test_utils.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Perf] Optimize maxsim scores computation for pooling models, 13.9% E2E throughput improvement | 35,330 | vllm-project/vllm | 71,895 | Python | yewentao256 | |
def prepare_pos_seq_lens(
idx_mapping: torch.Tensor,
query_start_loc: torch.Tensor,
num_computed_tokens: torch.Tensor,
pos: torch.Tensor,
seq_lens: torch.Tensor,
) -> None:
num_reqs = idx_mapping.shape[0]
# NOTE(woosuk): We do +1 because the last thread block is used
# to pad unused se... | No issues found. |
def prepare_pos_seq_lens(
idx_mapping: torch.Tensor,
query_start_loc: torch.Tensor,
num_computed_tokens: torch.Tensor,
pos: torch.Tensor,
seq_lens: torch.Tensor,
) -> None:
num_reqs = idx_mapping.shape[0]
# NOTE(woosuk): We do +1 because the last thread block is used
# to pad unused se... | @@ -65,8 +65,6 @@ class InputBatch:
input_ids: torch.Tensor
# [num_tokens_after_padding]
positions: torch.Tensor
- # [3, num_tokens_after_padding]
- mrope_positions: torch.Tensor | None
# [num_tokens_after_padding, hidden_size]
inputs_embeds: torch.Tensor | None
@@ -143,7 +141,6 @@ def ... | vllm/v1/worker/gpu/input_batch.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Model Runner V2] Add model states [1/N] | 35,350 | vllm-project/vllm | 71,895 | Python | WoosukKwon | |
use_audio_in_video = hf_processor_mm_kwargs.get("use_audio_in_video", False)
thinker_config = self.info.get_hf_config()
def get_replacement_qwen2_use_audio_in_video(item_idx: int):
nonlocal audio_in_video_item_idx
audio_num_features = audio_output_lengths[
... | No issues found. |
use_audio_in_video = hf_processor_mm_kwargs.get("use_audio_in_video", False)
thinker_config = self.info.get_hf_config()
def get_replacement_qwen2_use_audio_in_video(item_idx: int):
nonlocal audio_in_video_item_idx
audio_num_features = audio_output_lengths[
... | @@ -1376,23 +1376,12 @@ def embed_input_ids(
is_multimodal: torch.Tensor | None = None,
handle_oov_mm_token: bool = False,
) -> torch.Tensor:
- from .utils import _merge_multimodal_embeddings
-
if multimodal_embeddings is None or is_multimodal is None:
return super().... | vllm/model_executor/models/qwen2_5_omni_thinker.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Bugfix] Fix Qwen2.5-Omni and Qwen3-Omni mixed-modality embed regression | 35,368 | vllm-project/vllm | 71,895 | Python | linyueqian | |
self.uses_mrope = self.model_config.uses_mrope
if self.uses_mrope:
self.mrope_state = MRopeState(
max_num_reqs=self.max_num_reqs,
max_num_tokens=self.max_num_tokens,
max_model_len=self.max_model_len,
device=self.device,
... | No issues found. |
self.uses_mrope = self.model_config.uses_mrope
if self.uses_mrope:
self.mrope_state = MRopeState(
max_num_reqs=self.max_num_reqs,
max_num_tokens=self.max_num_tokens,
max_model_len=self.max_model_len,
device=self.device,
... | @@ -1,13 +1,18 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
+from typing import Any
+
import torch
import torch.nn as nn
from vllm.config import VllmConfig
from vllm.v1.core.sched.output import NewRequestData
+from vllm.v1.kv_cache_interface impor... | vllm/v1/worker/gpu/model_states.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Model Runner V2] Prepare attn metadata in ModelState [2/N] | 35,383 | vllm-project/vllm | 71,895 | Python | WoosukKwon | |
# MLA-specific
kv_lora_rank: int | None = None
qk_nope_head_dim: int | None = None
qk_rope_head_dim: int | None = None
v_head_dim: int | None = None
# Backend-specific tuning
num_kv_splits: int | None = None # CUTLASS MLA
reorder_batch_threshold: int | None = None # FlashAttn MLA, Fl... | No issues found. |
# MLA-specific
kv_lora_rank: int | None = None
qk_nope_head_dim: int | None = None
qk_rope_head_dim: int | None = None
v_head_dim: int | None = None
# Backend-specific tuning
num_kv_splits: int | None = None # CUTLASS MLA
reorder_batch_threshold: int | None = None # FlashAttn MLA, Fl... | @@ -10,7 +10,6 @@
from pathlib import Path
from typing import Any
-import numpy as np
import torch
from batch_spec import get_batch_type, parse_batch_spec
from rich.console import Console
@@ -62,10 +61,7 @@ def get_text_config(self):
# Import AttentionLayerBase at module level to avoid circular dependencies
tr... | benchmarks/attention_benchmarks/common.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Refactor] Remove dead code for attention benchmark script | 35,418 | vllm-project/vllm | 71,895 | Python | yewentao256 | |
def cmd_init() -> list[CLISubcommand]:
return [ServeSubcommand()]
def run_headless(args: argparse.Namespace):
if args.api_server_count > 1:
raise ValueError("api_server_count can't be set in headless mode")
# Create the EngineConfig.
engine_args = vllm.AsyncEngineArgs.from_cli_args(args)
... | No issues found. |
def cmd_init() -> list[CLISubcommand]:
return [ServeSubcommand()]
def run_headless(args: argparse.Namespace):
if args.api_server_count > 1:
raise ValueError("api_server_count can't be set in headless mode")
# Create the EngineConfig.
engine_args = vllm.AsyncEngineArgs.from_cli_args(args)
... | @@ -220,6 +220,12 @@ def run_multi_api_server(args: argparse.Namespace):
num_api_servers: int = args.api_server_count
assert num_api_servers > 0
+ if num_api_servers > 1 and getattr(args, "use_gpu_for_pooling_score", False):
+ # TODO(wentao): remove this once well tested
+ raise ValueError(... | vllm/entrypoints/cli/serve.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Refactor] Fix maxsim cuda platform and add cli to control it | 35,427 | vllm-project/vllm | 71,895 | Python | yewentao256 | |
return max_total_tokens, max_output_tokens
class EmbeddingCompletionRequest(
PoolingBasicRequestMixin, CompletionRequestMixin, EmbedRequestMixin
):
def build_tok_params(self, model_config: ModelConfig) -> TokenizeParams:
encoder_config = model_config.encoder_config or {}
(
max... | No issues found. | return max_total_tokens, max_output_tokens
class EmbeddingCompletionRequest(
PoolingBasicRequestMixin, CompletionRequestMixin, EmbedRequestMixin
):
def build_tok_params(self, model_config: ModelConfig) -> TokenizeParams:
encoder_config = model_config.encoder_config or {}
(
max... | @@ -14,12 +14,9 @@
EmbedRequestMixin,
PoolingBasicRequestMixin,
)
-from vllm.logger import init_logger
from vllm.renderers import TokenizeParams
from vllm.utils import random_uuid
-logger = init_logger(__name__)
-
def _get_max_total_output_tokens(
model_config: ModelConfig,
@@ -60,18 +57,10 @@ de... | vllm/entrypoints/pooling/embed/protocol.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Deprecation] Deprecate code in 0.17 as scheduled | 35,441 | vllm-project/vllm | 71,895 | Python | yewentao256 | |
params = SamplingParams(
max_tokens=100,
repetition_detection=RepetitionDetectionParams(
max_pattern_size=5,
min_pattern_size=2,
min_count=3,
),
)
request = Request(
request_id="test",
pro... | No issues found. | params = SamplingParams(
max_tokens=100,
repetition_detection=RepetitionDetectionParams(
max_pattern_size=5,
min_pattern_size=2,
min_count=3,
),
)
request = Request(
request_id="test",
pro... | @@ -0,0 +1,290 @@
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
+import pytest
+
+from vllm.sampling_params import RepetitionDetectionParams, SamplingParams
+from vllm.v1.core.sched.utils import check_sequence_repetition, check_stop
+from vllm.v1.request im... | tests/v1/core/test_repetition_detection.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Core] Add optional flags to check for repetitive token patterns in engine output | 35,451 | vllm-project/vllm | 71,895 | Python | aykoppol | |
token_ids=[],
cumulative_logprob=None,
logprobs=None,
finish_reason="error",
)
request_output = RequestOutput(
request_id="test-id",
prompt="Test prompt",
prompt_token_ids=[1, 2, 3],
prompt_logprobs=None,
outputs=[completion_output],
... | No issues found. | token_ids=[],
cumulative_logprob=None,
logprobs=None,
finish_reason="error",
)
request_output = RequestOutput(
request_id="test-id",
prompt="Test prompt",
prompt_token_ids=[1, 2, 3],
prompt_logprobs=None,
outputs=[completion_output],
... | @@ -221,6 +221,19 @@ async def mock_generate(*args, **kwargs):
assert chunks[-1] == "data: [DONE]\n\n"
+def test_json_schema_response_format_missing_schema():
+ """When response_format type is 'json_schema' but the json_schema field
+ is not provided, request construction should raise a validation error
... | tests/entrypoints/openai/test_completion_error.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Bugfix] Replace assert with ValueError for response_format validation in completions endpoint | 35,456 | vllm-project/vllm | 71,895 | Python | umut-polat | |
partition_input_names = (
OrderedSet(
[
x.name
for x in read_writes.reads | read_writes.writes
if not is_none_layout(x.name)
]
)
- output_names
)
partition_input_names... | No issues found. | partition_input_names = (
OrderedSet(
[
x.name
for x in read_writes.reads | read_writes.writes
if not is_none_layout(x.name)
]
)
- output_names
)
partition_input_names... | @@ -482,3 +482,44 @@ def _patch_get_raw_stream_if_needed():
PythonWrapperCodegen.memory_plan_reuse = memory_plan_reuse_patched
GraphLowering._update_scheduler = _update_scheduler_patched
+
+# ===================================================
+# torch 2.11 Inductor constrain_to_fx_strides monkeypatch
+# ==... | vllm/env_override.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [torch.compile] Undo the fast_moe_cold_start hack in torch>=2.11 | 35,475 | vllm-project/vllm | 71,895 | Python | zou3519 | |
def pin_lora(self, lora_id: int) -> bool:
raise NotImplementedError
def list_loras(self) -> set[int]:
raise NotImplementedError
@property
def vocab_size(self) -> int:
"""Get vocabulary size from model configuration."""
return self.model_config.get_vocab_size()
def... | No issues found. |
def pin_lora(self, lora_id: int) -> bool:
raise NotImplementedError
def list_loras(self) -> set[int]:
raise NotImplementedError
@property
def vocab_size(self) -> int:
"""Get vocabulary size from model configuration."""
return self.model_config.get_vocab_size()
def... | @@ -87,8 +87,12 @@ def get_kv_cache_spec(self) -> dict[str, KVCacheSpec]:
"""Get specifications for KV cache implementation."""
raise NotImplementedError
- def compile_or_warm_up_model(self) -> None:
- """Prepare model for execution through compilation/warmup."""
+ def compile_or_warm_u... | vllm/v1/worker/worker_base.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Bugfix] Propagate compilation_time from workers to main process for TP>1 | 35,503 | vllm-project/vllm | 71,895 | Python | huydhn | |
# Ignore triton kernels in ops.
"vllm/v1/attention/ops",
# TODO: Remove these entries after fixing mypy errors.
"vllm/benchmarks",
"vllm/config",
"vllm/reasoning",
"vllm/tool_parser",
]
def group_files(changed_files: list[str]) -> dict[str, list[str]]:
"""
Group changed files into ... | No issues found. | # Ignore triton kernels in ops.
"vllm/v1/attention/ops",
# TODO: Remove these entries after fixing mypy errors.
"vllm/benchmarks",
"vllm/config",
"vllm/reasoning",
"vllm/tool_parser",
]
def group_files(changed_files: list[str]) -> dict[str, list[str]]:
"""
Group changed files into ... | @@ -41,7 +41,6 @@
# TODO: Remove these entries after fixing mypy errors.
"vllm/benchmarks",
"vllm/config",
- "vllm/device_allocator",
"vllm/reasoning",
"vllm/tool_parser",
] | tools/pre_commit/mypy.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [CI] Fix mypy for vllm/device allocator | 35,518 | vllm-project/vllm | 71,895 | Python | hickeyma | |
valid_num_frames = len(valid_frame_indices)
if recovered_map:
logger.info(
"Frame recovery: %d frames recovered using forward scan.",
len(recovered_map),
)
else:
frame_indices_set = set(frame_indices_lis... | No issues found. | valid_num_frames = len(valid_frame_indices)
if recovered_map:
logger.info(
"Frame recovery: %d frames recovered using forward scan.",
len(recovered_map),
)
else:
frame_indices_set = set(frame_indices_lis... | @@ -749,6 +749,33 @@ def load_bytes(
return out
+@VIDEO_LOADER_REGISTRY.register("nemotron_vl")
+class NemotronVLVideoBackend(OpenCVVideoBackend):
+ @classmethod
+ def load_bytes(
+ cls,
+ data: bytes,
+ num_frames: int = -1,
+ fps: int = -1,
+ max_duration: int = 3... | vllm/multimodal/video.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | Support Audio Extraction from MP4 Video for Nemotron Nano VL | 35,539 | vllm-project/vllm | 71,895 | Python | askliar | |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import torch
from vllm.multimodal.inputs import MultiModalFeatureSpec
class EncoderCache:
def __init__(self):
# req_id -> MM features
self.mm_features: dict[str, list[MultiModalFeatureSpec]]... | No issues found. | # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import torch
from vllm.multimodal.inputs import MultiModalFeatureSpec
class EncoderCache:
def __init__(self):
# req_id -> MM features
self.mm_features: dict[str, list[MultiModalFeatureSpec]]... | @@ -0,0 +1,40 @@
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
+import torch
+
+from vllm.multimodal.inputs import MultiModalFeatureSpec
+
+
+class EncoderCache:
+ def __init__(self):
+ # req_id -> MM features
+ self.mm_features: dict[str, ... | vllm/v1/worker/gpu/mm/encoder_cache.py | 0 | Python | 1 | none | 16 | 41 | 41 | true | [Model Runner V2] Move MM encoder to Model States [3/N] | 35,564 | vllm-project/vllm | 71,895 | Python | WoosukKwon | |
"type": "function",
"function": {
"name": tool.name,
"description": tool.description,
"parameters": tool.input_schema,
},
}
)
... | No issues found. | "type": "function",
"function": {
"name": tool.name,
"description": tool.description,
"parameters": tool.input_schema,
},
}
)
... | @@ -17,6 +17,9 @@
from vllm.engine.protocol import EngineClient
from vllm.entrypoints.anthropic.protocol import (
AnthropicContentBlock,
+ AnthropicContextManagement,
+ AnthropicCountTokensRequest,
+ AnthropicCountTokensResponse,
AnthropicDelta,
AnthropicError,
AnthropicMessagesRequest,
@... | vllm/entrypoints/anthropic/serving.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Feat] Supports Anthropic Messages count_tokens API | 35,588 | vllm-project/vllm | 71,895 | Python | chaunceyjiang | |
from vllm.v1.core.sched.output import NewRequestData
from vllm.v1.kv_cache_interface import KVCacheConfig
from vllm.v1.worker.gpu.input_batch import InputBatch
from vllm.v1.worker.gpu.mm.encoder_cache import EncoderCache
from vllm.v1.worker.gpu.states import RequestState
from vllm.v1.worker.utils import AttentionGroup
... | No issues found. | from vllm.v1.core.sched.output import NewRequestData
from vllm.v1.kv_cache_interface import KVCacheConfig
from vllm.v1.worker.gpu.input_batch import InputBatch
from vllm.v1.worker.gpu.mm.encoder_cache import EncoderCache
from vllm.v1.worker.gpu.states import RequestState
from vllm.v1.worker.utils import AttentionGroup
... | @@ -0,0 +1,67 @@
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
+from abc import ABC, abstractmethod
+from typing import Any
+
+import torch
+import torch.nn as nn
+
+from vllm.config import VllmConfig
+from vllm.v1.core.sched.output import NewRequestData
+f... | vllm/v1/worker/gpu/model_states/interface.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Model Runner V2] Add ModelStateInterface [4/N] | 35,621 | vllm-project/vllm | 71,895 | Python | WoosukKwon | |
start_idx = self._buffer.find(self.tool_call_start_token)
if start_idx == -1:
# Check for partial start token at end of buffer
for i in range(1, len(self.tool_call_start_token)):
if self._buffer.endswith(self.tool_call_start... | No issues found. | start_idx = self._buffer.find(self.tool_call_start_token)
if start_idx == -1:
# Check for partial start token at end of buffer
for i in range(1, len(self.tool_call_start_token)):
if self._buffer.endswith(self.tool_call_start... | @@ -355,20 +355,17 @@ def extract_tool_calls_streaming(
self._buffer = self._buffer[val_end + len(self.arg_val_end) :]
self._pending_key = None
- frag = self._append_arg_fragment(
- key=key,
- raw_val=raw_val,
-... | vllm/tool_parsers/glm4_moe_tool_parser.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [MISC] fixed tool_parser mypy errors | 35,640 | vllm-project/vllm | 71,895 | Python | taneem-ibrahim | |
cleanup_dist_env_and_memory()
@pytest.fixture(scope="session")
def hf_runner():
return HfRunner
class VllmRunner:
"""
The default value of some arguments have been modified from
{class}`~vllm.LLM` as follows:
- `trust_remote_code`: Set to `True` instead of `False` for convenience.
-... | No issues found. | cleanup_dist_env_and_memory()
@pytest.fixture(scope="session")
def hf_runner():
return HfRunner
class VllmRunner:
"""
The default value of some arguments have been modified from
{class}`~vllm.LLM` as follows:
- `trust_remote_code`: Set to `True` instead of `False` for convenience.
-... | @@ -1544,6 +1544,14 @@ def use_fresh_inductor_cache():
yield
+@pytest.fixture
+def fresh_vllm_cache(monkeypatch, use_fresh_inductor_cache):
+ """Temporary VLLM_CACHE_ROOT combined with a fresh inductor cache."""
+ with tempfile.TemporaryDirectory() as tmp_dir:
+ monkeypatch.setenv("VLLM_CACHE_... | tests/conftest.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [torch.compile] Improve cold and warm start compile tests | 35,709 | vllm-project/vllm | 71,895 | Python | zou3519 | |
output_sizes = (
self.output_sizes[loaded_shard_id[0] : loaded_shard_id[-1] + 1]
if loaded_shard_id is not None
else self.output_sizes
)
current_shard_offset = 0
use_bitsandbytes_4bit = getattr(param, "use_bitsandbytes_4bit"... | No issues found. | output_sizes = (
self.output_sizes[loaded_shard_id[0] : loaded_shard_id[-1] + 1]
if loaded_shard_id is not None
else self.output_sizes
)
current_shard_offset = 0
use_bitsandbytes_4bit = getattr(param, "use_bitsandbytes_4bit"... | @@ -744,10 +744,14 @@ def weight_loader(
)
current_shard_offset = 0
use_bitsandbytes_4bit = getattr(param, "use_bitsandbytes_4bit", False)
- if use_bitsandbytes_4bit and isinstance(loaded_shard_id, tuple):
+ if (
+ use_bitsandbytes_4bit
+ ... | vllm/model_executor/layers/linear.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | Enable bnb for multiple indices weight | 35,838 | vllm-project/vllm | 71,895 | Python | flutist | |
cpu_backend = CPUBackend(block_size=block_size, num_blocks=4)
arc_manager = ARCOffloadingManager(cpu_backend, enable_events=True)
# prepare store [1, 2]
prepare_store_output = arc_manager.prepare_store(to_hashes([1, 2]))
verify_store_output(
prepare_store_output,
ExpectedPrepareStor... | No issues found. | cpu_backend = CPUBackend(block_size=block_size, num_blocks=4)
arc_manager = ARCOffloadingManager(cpu_backend, enable_events=True)
# prepare store [1, 2]
prepare_store_output = arc_manager.prepare_store(to_hashes([1, 2]))
verify_store_output(
prepare_store_output,
ExpectedPrepareStor... | @@ -4,6 +4,7 @@
from dataclasses import dataclass
import numpy as np
+import pytest
from vllm.v1.core.kv_cache_utils import BlockHash
from vllm.v1.kv_offload.abstract import (
@@ -78,6 +79,54 @@ def to_hash_sets(int_sets: tuple[set[int], ...]) -> tuple[set[BlockHash], ...]:
assert tuple(stores) == to_hash_... | tests/v1/kv_offload/test_cpu_manager.py | 0 | Python | 1 | none | 16 | 51 | 51 | true | [Bugfix][CPUOffloadingManager] Prevent eviction of already-stored blocks in LRU/ARC `prepare_store()` | 35,846 | vllm-project/vllm | 71,895 | Python | ronensc | |
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import pytest
from tests.models.utils import GenerateModelInfo
from .ppl_utils import wikitext_ppl_test
MODELS = [
GenerateModelInfo("google/gemma-2b", hf_ppl=21.48524284362793),
GenerateModelInfo("goog... | No issues found. | # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import pytest
from tests.models.utils import GenerateModelInfo
from .ppl_utils import wikitext_ppl_test
MODELS = [
GenerateModelInfo("google/gemma-2b", hf_ppl=21.48524284362793),
GenerateModelInfo("goog... | @@ -7,9 +7,9 @@
from .ppl_utils import wikitext_ppl_test
MODELS = [
- GenerateModelInfo("google/gemma-2b"),
- GenerateModelInfo("google/gemma-2-2b"),
- GenerateModelInfo("google/gemma-3-4b-it"),
+ GenerateModelInfo("google/gemma-2b", hf_ppl=21.48524284362793),
+ GenerateModelInfo("google/gemma-2-2b",... | tests/models/language/generation_ppl_test/test_gemma.py | 0 | Python | 1 | none | 16 | 19 | 19 | true | [CI] And PPL test for Qwen3.5. | 35,853 | vllm-project/vllm | 71,895 | Python | noooop | |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license in https://github.com/pytorch/torchtune/blob/main/LICENSE
import logging
import torch
logger = logging.getLogger(__name__)
def is_torch_npu_available() -> bool:
"""Check the ... | Don't use global variable. Try add a function | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license in https://github.com/pytorch/torchtune/blob/main/LICENSE
import logging
import torch
logger = logging.getLogger(__name__)
def is_torch_npu_available() -> bool:
"""Check the ... | @@ -28,6 +28,8 @@ def is_torch_npu_available() -> bool:
is_cuda_available = torch.cuda.is_available()
is_npu_available = is_torch_npu_available()
+VISIBLE_DEVICE_PREFIX = "CUDA" if is_cuda_available else "ASCEND_RT" | verl/utils/device.py | 26 | Python | 0.143 | suggestion | 45 | 51 | 51 | false | [hardware] feat: support ray actor sharing situation on ASCEND NPU | 2,341 | volcengine/verl | 16,907 | Python | vermouth1992 | FightingZhen |
# All rights reserved.
#
# This source code is licensed under the BSD-style license in https://github.com/pytorch/torchtune/blob/main/LICENSE
import logging
import torch
logger = logging.getLogger(__name__)
def is_torch_npu_available() -> bool:
"""Check the availability of NPU"""
try:
import torch_... | Shall we modify this to directly return CUDA_VISIBLE_DEVICES to avoid performing string manipulation, which is error-prone. | # All rights reserved.
#
# This source code is licensed under the BSD-style license in https://github.com/pytorch/torchtune/blob/main/LICENSE
import logging
import torch
logger = logging.getLogger(__name__)
def is_torch_npu_available() -> bool:
"""Check the availability of NPU"""
try:
import torch_... | @@ -29,6 +29,14 @@ def is_torch_npu_available() -> bool:
is_npu_available = is_torch_npu_available()
+def get_visible_devices_prefix() -> str: | verl/utils/device.py | 26 | Python | 0.571 | suggestion | 123 | 51 | 51 | false | [hardware] feat: support ray actor sharing situation on ASCEND NPU | 2,341 | volcengine/verl | 16,907 | Python | vermouth1992 | FightingZhen |
# on the Retool dataset, Dapo training will not converge.
# If you still wish to perform SFT from scratch, follow the steps below:
# Step 1: Download the SFT dataset
#huggingface-cli download JoeYing/ReTool-SFT --repo-type dataset --local-dir ./ReTool-SFT
# Step 2: Preprocess the data for SFT
#python3 recipe/retool/... | why we limit the `response_length`? | # on the Retool dataset, Dapo training will not converge.
# If you still wish to perform SFT from scratch, follow the steps below:
# Step 1: Download the SFT dataset
#huggingface-cli download JoeYing/ReTool-SFT --repo-type dataset --local-dir ./ReTool-SFT
# Step 2: Preprocess the data for SFT
#python3 recipe/retool/... | @@ -31,14 +51,14 @@ python3 -m verl.trainer.main_ppo \
data.return_raw_chat=True \
data.train_batch_size=32 \
data.max_prompt_length=2048 \
- data.max_response_length=16384 \
+ data.max_response_length=5000 \ | examples/sglang_multiturn/run_qwen3_4b_dapo_multiturn.sh | 26 | Shell | 0.214 | question | 35 | 51 | 51 | false | [WIP]: Setting DAPO baseline in SGLang multi-turn RL | 3,175 | volcengine/verl | 16,907 | Python | zhaochenyang20 | zhaochenyang20 |
#huggingface-cli download JoeYing/ReTool-SFT --repo-type dataset --local-dir ./ReTool-SFT
# Step 2: Preprocess the data for SFT
#python3 recipe/retool/retool_sft_preprocess.py
# Step 3: Run SFT training
#bash recipe/retool/run_qwen2-32b_sft.sh
# having trouble setup? see https://github.com/zhaochenyang20/Awesome-ML-... | keep the `update_weights_bucket_megabytes` | #huggingface-cli download JoeYing/ReTool-SFT --repo-type dataset --local-dir ./ReTool-SFT
# Step 2: Preprocess the data for SFT
#python3 recipe/retool/retool_sft_preprocess.py
# Step 3: Run SFT training
#bash recipe/retool/run_qwen2-32b_sft.sh
# having trouble setup? see https://github.com/zhaochenyang20/Awesome-ML-... | @@ -47,16 +67,15 @@ python3 -m verl.trainer.main_ppo \
actor_rollout_ref.actor.clip_ratio_high=0.28 \
actor_rollout_ref.actor.clip_ratio_c=10.0 \
actor_rollout_ref.actor.optim.lr=1e-6 \
+ actor_rollout_ref.actor.use_dynamic_bsz=False \
actor_rollout_ref.actor.ppo_mini_batch_size=32 \
actor_r... | examples/sglang_multiturn/run_qwen3_4b_dapo_multiturn.sh | 26 | Shell | 0.214 | suggestion | 42 | 51 | 51 | false | [WIP]: Setting DAPO baseline in SGLang multi-turn RL | 3,175 | volcengine/verl | 16,907 | Python | zhaochenyang20 | zhaochenyang20 |
dp = world_size // self.ulysses_sequence_parallel_size
if self.ulysses_sequence_parallel_size > 1:
self.ulysses_device_mesh = init_device_mesh(
device_name, mesh_shape=(dp, self.ulysses_sequence_parallel_size), mesh_dim_names=["dp", "sp"]
)
# create train... | I think it would be better to retrieve `use_orig_params` from user input during initialization, like this:
```suggestion
self.use_orig_params = self.config.actor.fsdp_config.get("use_orig_params", False)
``` | def __init__(self, config: DictConfig, role: str, **kwargs):
Worker.__init__(self)
self.config = config
import torch.distributed
if not torch.distributed.is_initialized():
rank = int(os.environ.get("RANK", 0))
world_size = int(os.environ.get("WORLD_SIZE", 1)... | @@ -163,6 +163,7 @@ def __init__(self, config: DictConfig, role: str, **kwargs):
self._is_actor = self.role in ["actor", "actor_rollout", "actor_rollout_ref"]
self._is_rollout = self.role in ["rollout", "actor_rollout", "actor_rollout_ref"]
self._is_ref = self.role in ["ref", "actor_rollout_r... | verl/workers/fsdp_workers.py | 26 | Python | 0.857 | suggestion | 220 | 51 | 51 | false | [trainer] feat: VL support freeze vision model | 3,178 | volcengine/verl | 16,907 | Python | Mighten | maijia-cwh |
device_name = get_device_name()
def create_device_mesh(world_size, fsdp_size):
if fsdp_size < 0 or fsdp_size >= world_size:
device_mesh = init_device_mesh(device_name, mesh_shape=(world_size,), mesh_dim_names=["fsdp"])
else:
device_mesh = init_device_mesh(
device_name, mesh_shape=(... | Please move this function to fsdp_utils.py | device_name = get_device_name()
def create_device_mesh(world_size, fsdp_size):
if fsdp_size < 0 or fsdp_size >= world_size:
device_mesh = init_device_mesh(device_name, mesh_shape=(world_size,), mesh_dim_names=["fsdp"])
else:
device_mesh = init_device_mesh(
device_name, mesh_shape=(... | @@ -119,6 +119,19 @@ def get_sharding_strategy(device_mesh):
return sharding_strategy
+def get_vl_model_vision_tower(vl_model_instance): | verl/workers/fsdp_workers.py | 26 | Python | 0.143 | refactor | 42 | 51 | 51 | false | [trainer] feat: VL support freeze vision model | 3,178 | volcengine/verl | 16,907 | Python | wuxibin89 | maijia-cwh |
# Tested successfully on the hiyouga/verl:ngc-th2.6.0-cu126-vllm0.8.4-flashinfer0.2.2-cxx11abi0 image.
# It outperforms the Qwen2 7B base model by two percentage points on the test set of GSM8K.
set -x
project_name='GRPO'
exp_name='GRPO-Qwen3-8B-npu'
gen_tp=2
WORKING_DIR=${WORKING_DIR:-"./"}
RUNTIME_ENV=${RUNTIME_ENV:... | These comments can be removed before merged | set -x
project_name='GRPO-Qwen3'
exp_name='GRPO-Qwen3-8B-npu'
gen_tp=2
RAY_DATA_HOME=${RAY_DATA_HOME:-"${HOME}/verl"}
MODEL_PATH=${MODEL_PATH:-"${RAY_DATA_HOME}/models/Qwen3-8B"}
CKPTS_DIR=${CKPTS_DIR:-"${RAY_DATA_HOME}/ckpts/${project_name}/${exp_name}"}
TRAIN_FILE=${TRAIN_FILE:-"${RAY_DATA_HOME}/data/dapo-math-17k.p... | @@ -0,0 +1,67 @@
+# Tested successfully on the hiyouga/verl:ngc-th2.6.0-cu126-vllm0.8.4-flashinfer0.2.2-cxx11abi0 image. | examples/grpo_trainer/run_qwen3-8b_npu.sh | 1 | Shell | 0.143 | suggestion | 43 | 26 | 26 | false | [model] feat: add qwen3 grpo 8b/32b script on ASCEND NPU | 3,310 | volcengine/verl | 16,907 | Python | FightingZhen | tardis-key |
# Tested successfully on the hiyouga/verl:ngc-th2.6.0-cu126-vllm0.8.4-flashinfer0.2.2-cxx11abi0 image.
# It outperforms the Qwen2 7B base model by two percentage points on the test set of GSM8K.
set -x
project_name='GRPO'
exp_name='GRPO-Qwen3-8B-npu'
gen_tp=2
WORKING_DIR=${WORKING_DIR:-"./"}
RUNTIME_ENV=${RUNTIME_ENV:... | can 8b and 32b shell script use same format? one use ray job submit while another use common python command looks strange :( | set -x
project_name='GRPO-Qwen3'
exp_name='GRPO-Qwen3-8B-npu'
gen_tp=2
RAY_DATA_HOME=${RAY_DATA_HOME:-"${HOME}/verl"}
MODEL_PATH=${MODEL_PATH:-"${RAY_DATA_HOME}/models/Qwen3-8B"}
CKPTS_DIR=${CKPTS_DIR:-"${RAY_DATA_HOME}/ckpts/${project_name}/${exp_name}"}
TRAIN_FILE=${TRAIN_FILE:-"${RAY_DATA_HOME}/data/dapo-math-17k.p... | @@ -0,0 +1,67 @@
+# Tested successfully on the hiyouga/verl:ngc-th2.6.0-cu126-vllm0.8.4-flashinfer0.2.2-cxx11abi0 image.
+# It outperforms the Qwen2 7B base model by two percentage points on the test set of GSM8K.
+set -x
+
+project_name='GRPO'
+exp_name='GRPO-Qwen3-8B-npu'
+gen_tp=2
+WORKING_DIR=${WORKING_DIR:-"./"}
+... | examples/grpo_trainer/run_qwen3-8b_npu.sh | 17 | Shell | 0.429 | style | 124 | 42 | 42 | false | [model] feat: add qwen3 grpo 8b/32b script on ASCEND NPU | 3,310 | volcengine/verl | 16,907 | Python | FightingZhen | tardis-key |
--hf_model_path "${MODEL_PATH}" \
--new_config_path "${DUMMY_MODEL_CONFIG_PATH}" \
--output_path "${DUMMY_MODEL_PATH}"
MODEL_PATH=$DUMMY_MODEL_PATH
fi
if [[ "$USE_DIST_CKPT" == "True" ]]; then
if [[ "$USE_DUMMY_MODEL" == "True" ]]; then
DIST_CKPT_PATH=${HOME}/dist_ckpt/qwen3_3... | Weights need to be generated every time the script runs. Unless the time is strictly controlled, it is not recommended to integrate it into CI. | if [[ -d $DUMMY_MODEL_PATH && $DUMMY_MODEL_PATH != "/" ]]; then
rm -rf $DUMMY_MODEL_PATH
fi
# init model
python scripts/init_random_model.py \
--hf_model_path "${MODEL_PATH}" \
--new_config_path "${DUMMY_MODEL_CONFIG_PATH}" \
--output_path "${DUMMY_MODEL_PATH}"
# re... | @@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
+MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
+USE_DIST_CKPT=${USE_DIST_CKPT:-False}
+DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
+
+if [[ "$USE_DUMMY_MODEL" == "True"... | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 26 | Shell | 0.357 | suggestion | 143 | 51 | 51 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | tardis-key | wlf-darkmatter |
#!/usr/bin/env bash
set -xeuo pipefail
MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
USE_DIST_CKPT=${USE_DIST_CKPT:-False}
DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
if [[ "$USE_DUMMY_MODEL" == "True" ]]; then
DUMMY_MODEL_P... | This model should be pre-downloaded into CI machine, otherwise it will go error | #!/usr/bin/env bash
set -xeuo pipefail
export VLLM_ASCEND_ENABLE_NZ=0
MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct-2507}
MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
USE_DIST_CKPT=${USE_DIST_CKPT:-False}
DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
# use dummy model
if [[ ... | @@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
+MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}} | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 7 | Shell | 0.429 | suggestion | 79 | 32 | 32 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | FightingZhen | wlf-darkmatter |
#!/usr/bin/env bash
set -xeuo pipefail
MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
USE_DIST_CKPT=${USE_DIST_CKPT:-False}
DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
if [[ "$USE_DUMMY_MODEL" == "True" ]]; then
DUMMY_MODEL_P... | suggest appending proper blank lines for easy reading, same as follows | #!/usr/bin/env bash
set -xeuo pipefail
export VLLM_ASCEND_ENABLE_NZ=0
MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct-2507}
MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
USE_DIST_CKPT=${USE_DIST_CKPT:-False}
DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
# use dummy model
if [[ ... | @@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
+MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
+USE_DIST_CKPT=${USE_DIST_CKPT:-False}
+DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
+
+if [[ "$USE_DUMMY_MODEL" == "True"... | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 14 | Shell | 0.214 | suggestion | 70 | 39 | 39 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | FightingZhen | wlf-darkmatter |
exit 1
fi
if [[ -d $DUMMY_MODEL_PATH && $DUMMY_MODEL_PATH != "/" ]]; then
rm -rf $DUMMY_MODEL_PATH
fi
python scripts/init_random_model.py \
--hf_model_path "${MODEL_PATH}" \
--new_config_path "${DUMMY_MODEL_CONFIG_PATH}" \
--output_path "${DUMMY_MODEL_PATH}"
... | This new path should be deleted after CI finish, otherwise docker container might OOM | DUMMY_MODEL_PATH=${DUMMY_MODEL_PATH:-${HOME}/models_dummy/${MODEL_ID}}
if [ -z "${DUMMY_MODEL_CONFIG_PATH}" ]; then
echo "[ERROR] DUMMY_MODEL_CONFIG_PATH not set"
exit 1
fi
# make sure the path is empty
if [[ -d $DUMMY_MODEL_PATH && $DUMMY_MODEL_PATH != "/" ]]; then
rm -rf $... | @@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
+MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
+USE_DIST_CKPT=${USE_DIST_CKPT:-False}
+DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
+
+if [[ "$USE_DUMMY_MODEL" == "True"... | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 26 | Shell | 0.286 | suggestion | 85 | 51 | 51 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | FightingZhen | wlf-darkmatter |
if [[ -d $DUMMY_MODEL_PATH && $DUMMY_MODEL_PATH != "/" ]]; then
rm -rf $DUMMY_MODEL_PATH
fi
python scripts/init_random_model.py \
--hf_model_path "${MODEL_PATH}" \
--new_config_path "${DUMMY_MODEL_CONFIG_PATH}" \
--output_path "${DUMMY_MODEL_PATH}"
MODEL_PATH=$DUMMY_MODE... | rename it to `Qwen3-30B-A3B-DAPO-MindSpeed` | echo "[ERROR] DUMMY_MODEL_CONFIG_PATH not set"
exit 1
fi
# make sure the path is empty
if [[ -d $DUMMY_MODEL_PATH && $DUMMY_MODEL_PATH != "/" ]]; then
rm -rf $DUMMY_MODEL_PATH
fi
# init model
python scripts/init_random_model.py \
--hf_model_path "${MODEL_PATH}" ... | @@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
+MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
+USE_DIST_CKPT=${USE_DIST_CKPT:-False}
+DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
+
+if [[ "$USE_DUMMY_MODEL" == "True"... | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 26 | Shell | 0.286 | suggestion | 43 | 51 | 51 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | FightingZhen | wlf-darkmatter |
actor_rollout_ref.actor.use_dynamic_bsz=True \
actor_rollout_ref.model.path="${MODEL_PATH}" \
actor_rollout_ref.actor.optim.lr=1e-6 \
actor_rollout_ref.actor.ppo_mini_batch_size=16 \
actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=16 \
actor_rollout_ref.rollout.log_prob_use_dynamic_bsz=True... | rename it to `qwen3_30b_a3b_cut_gsm8k_mindspeed` | actor_rollout_ref.rollout.free_cache_engine=True \
actor_rollout_ref.actor.ppo_max_token_len_per_gpu=${actor_ppo_max_token_len} \
actor_rollout_ref.ref.log_prob_max_token_len_per_gpu=${infer_ppo_max_token_len} \
actor_rollout_ref.rollout.log_prob_max_token_len_per_gpu=${infer_ppo_max_token_len} \
ac... | @@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
+MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
+USE_DIST_CKPT=${USE_DIST_CKPT:-False}
+DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
+
+if [[ "$USE_DUMMY_MODEL" == "True"... | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 26 | Shell | 0.286 | suggestion | 48 | 37 | 51 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | FightingZhen | wlf-darkmatter |
#!/usr/bin/env bash
set -xeuo pipefail
MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct}
MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
USE_DIST_CKPT=${USE_DIST_CKPT:-False}
DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
if [[ "$USE_DUMMY_MODEL" == "True" ]]; then
DUMMY_MODEL_P... | model name should be `Qwen3-30B-A3B-Instruct-2507`, see https://huggingface.co/Qwen/Qwen3-30B-A3B-Instruct-2507 | #!/usr/bin/env bash
set -xeuo pipefail
export VLLM_ASCEND_ENABLE_NZ=0
MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct-2507}
MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
USE_DIST_CKPT=${USE_DIST_CKPT:-False}
DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed}
# use dummy model
if [[ ... | @@ -0,0 +1,121 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct} | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 4 | Shell | 0.571 | suggestion | 111 | 29 | 29 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | FightingZhen | wlf-darkmatter |
actor_rollout_ref.ref.strategy=megatron \
actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=16 \
actor_rollout_ref.ref.megatron.pipeline_model_parallel_size=2 \
actor_rollout_ref.ref.megatron.tensor_model_parallel_size=2 \
actor_rollout_ref.ref.megatron.expert_model_parallel_size=2 \
actor... | For user who run this shell, after finish running it, should `DIST_CKPT_PATH` and `DUMMY_MODEL_PATH` be removed actually? If not, suggest moving `rm` operation up to e2e_ascend script. If removing is required, just ignore this comment :) | actor_rollout_ref.ref.strategy=megatron \
actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=16 \
actor_rollout_ref.ref.megatron.pipeline_model_parallel_size=2 \
actor_rollout_ref.ref.megatron.tensor_model_parallel_size=2 \
actor_rollout_ref.ref.megatron.expert_model_parallel_size=2 \
actor... | @@ -0,0 +1,139 @@
+#!/usr/bin/env bash
+set -xeuo pipefail
+
+export VLLM_ASCEND_ENABLE_NZ=0
+
+MODEL_ID=${MODEL_ID:-Qwen/Qwen3-30B-A3B-Instruct-2507}
+MODEL_PATH=${MODEL_PATH:-${HOME}/models/${MODEL_ID}}
+USE_DIST_CKPT=${USE_DIST_CKPT:-False}
+DIST_CKPT_PATH=${DIST_CKPT_PATH:-${HOME}/dist_ckpt/qwen3_30b_dapo_mindspeed... | tests/special_npu/run_qwen3_30b_dapo_mindspeed.sh | 26 | Shell | 0.643 | suggestion | 237 | 31 | 31 | false | [ci, megatron] test: Add Qwen3 Megatron+Mindspeed Ascend NPU CI | 3,465 | volcengine/verl | 16,907 | Python | FightingZhen | wlf-darkmatter |
from megatron.core.models.common.model_chunk_schedule_plan import TransformerModelChunkSchedulePlan
from megatron.core.models.gpt.gpt_model import GPTModel
from megatron.core.utils import make_viewless_tensor
from torch import Tensor
from verl.models.mcore.util import preprocess_packed_seqs
from verl.utils.kernel.lin... | Similar to #3849, I think it would be better to have an additional `**kwargs` to support deepstack for Qwen3VL MoE models / any possible additional parameters for the future, and pass them to the decoder. |
import torch
from megatron.core.models.common.model_chunk_schedule_plan import TransformerModelChunkSchedulePlan
from megatron.core.models.gpt.gpt_model import GPTModel
from megatron.core.utils import make_viewless_tensor
from torch import Tensor
from verl.models.mcore.util import preprocess_packed_seqs
from verl.uti... | @@ -0,0 +1,252 @@
+# Copyright 2025 Bytedance Ltd. and/or its affiliates
+# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
+# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in comp... | verl/models/mcore/model_forward_1f1b_overlap.py | 26 | Python | 0.643 | suggestion | 204 | 51 | 51 | false | [Megatron] feat: 1f1b overlap/moe_a2a_overlap | 3,522 | volcengine/verl | 16,907 | Python | HollowMan6 | ISEEKYAN |
# Copyright 2025 Bytedance Ltd. and/or its affiliates
# Copyright 2025 Meituan Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | Please move this import into local scope. | # Copyright 2025 Bytedance Ltd. and/or its affiliates
# Copyright 2025 Meituan Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | @@ -13,12 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import asyncio
import logging
import os
import torch
import torch.distributed
from omegaconf import DictConfig, OmegaConf
+from sglang.srt.weight_sync.utils import update_weights as sgl... | recipe/one_step_off_policy/fsdp_workers.py | 23 | Python | 0.143 | refactor | 41 | 48 | 48 | false | [sglang, recipe] feat: add SGLang as rollout engine for one-step-off-policy | 3,531 | volcengine/verl | 16,907 | Python | wuxibin89 | KAMiPan |
log_gpu_memory_usage("After building sharding manager", logger=logger)
self.rollout = rollout
self.rollout_sharding_manager = rollout_sharding_manager
@register(dispatch_mode=make_nd_compute_dataproto_dispatch_fn(mesh_name="rollout"), blocking=False)
def async_generate_sequences(self,... | All ShardingManagers have been deprecated in https://github.com/volcengine/verl/pull/3285 and will be removed in release v0.7 | )
self.rollout_device_mesh = rollout_device_mesh
is_collect = rollout_device_mesh["infer_tp"].get_local_rank() == 0
self._register_dispatch_collect_info(
"rollout", dp_rank=rollout_device_mesh["dp"].get_local_rank(), is_collect=is_collect
)
rollout_name = se... | @@ -227,14 +253,23 @@ def init_model(self):
config=rollout_config, model_config=model_config, device_mesh=rollout_device_mesh
)
log_gpu_memory_usage(f"After building {rollout_name} rollout", logger=logger)
- from .vllm_sharding_manager import VLLMShardingManager
- rollout_... | recipe/one_step_off_policy/fsdp_workers.py | 26 | Python | 0.429 | suggestion | 125 | 51 | 51 | false | [sglang, recipe] feat: add SGLang as rollout engine for one-step-off-policy | 3,531 | volcengine/verl | 16,907 | Python | wuxibin89 | KAMiPan |
aggressive_empty_cache(force_sync=True)
log_gpu_memory_usage("Before load_fsdp_model_to_gpu", logger=logger)
if self._is_offload_param:
load_fsdp_model_to_gpu(self.actor_module_fsdp)
log_gpu_memory_usage("After load_fsdp_model_to_gpu", logger=logger)
peft_config = N... | I think we should use `getattr(self.rollout, 'sleep_level', None) == 2` instead of `VLLM_SLEEP_LEVEL == 2 and not self.layered_summon` to reduce code duplication. | if self._is_offload_param:
load_fsdp_model_to_gpu(self.actor_module_fsdp)
log_gpu_memory_usage("After load_fsdp_model_to_gpu", logger=logger)
peft_config = None
peft_model = getattr(self.actor_module_fsdp, "_fsdp_wrapped_module", self.actor_module_fsdp)
if hasattr(pe... | @@ -653,6 +650,17 @@ async def rollout_mode(self):
params, getattr(self.actor_module_fsdp, "_fsdp_wrapped_module", self.actor_module_fsdp)
)
+ if peft_config is not None and VLLM_SLEEP_LEVEL == 2 and not self.layered_summon: | verl/workers/fsdp_workers.py | 26 | Python | 0.571 | suggestion | 162 | 51 | 51 | false | [trainer,rollout] fix: ensure LoRA weights are loaded when vllm_sleep_level=2 and without using layerd_summon | 3,541 | volcengine/verl | 16,907 | Python | techkang | piood |
aggressive_empty_cache(force_sync=True)
log_gpu_memory_usage("Before load_fsdp_model_to_gpu", logger=logger)
if self._is_offload_param:
load_fsdp_model_to_gpu(self.actor_module_fsdp)
log_gpu_memory_usage("After load_fsdp_model_to_gpu", logger=logger)
peft_config = N... | Besides, can you add some comment here to explain why we load base model weights? I think it's something like "When LoRA is enabled alongside a rollout sleep level of 2, the base model's weights are destroyed every sleep time. Therefore, we must load both the base weights and the LoRA weights separately and update each... | if self._is_offload_param:
load_fsdp_model_to_gpu(self.actor_module_fsdp)
log_gpu_memory_usage("After load_fsdp_model_to_gpu", logger=logger)
peft_config = None
peft_model = getattr(self.actor_module_fsdp, "_fsdp_wrapped_module", self.actor_module_fsdp)
if hasattr(pe... | @@ -653,6 +650,17 @@ async def rollout_mode(self):
params, getattr(self.actor_module_fsdp, "_fsdp_wrapped_module", self.actor_module_fsdp)
)
+ if peft_config is not None and VLLM_SLEEP_LEVEL == 2 and not self.layered_summon: | verl/workers/fsdp_workers.py | 26 | Python | 0.429 | suggestion | 358 | 51 | 51 | false | [trainer,rollout] fix: ensure LoRA weights are loaded when vllm_sleep_level=2 and without using layerd_summon | 3,541 | volcengine/verl | 16,907 | Python | techkang | piood |
log_gpu_memory_usage("Before offload_fsdp_model_to_cpu", logger=logger)
if self._is_offload_param:
offload_fsdp_model_to_cpu(self.actor_module_fsdp)
log_gpu_memory_usage("After offload_fsdp_model_to_cpu", logger=logger)
set_expandable_segments(False)
if peft_config ... | I think we should remove `perf_config` in this line to emphasize this is only used to update base model's weights. |
log_gpu_memory_usage("Before offload_fsdp_model_to_cpu", logger=logger)
if self._is_offload_param:
offload_fsdp_model_to_cpu(self.actor_module_fsdp)
log_gpu_memory_usage("After offload_fsdp_model_to_cpu", logger=logger)
set_expandable_segments(False)
if peft_config... | @@ -672,6 +680,15 @@ async def rollout_mode(self):
if self.config.rollout.free_cache_engine:
await self.rollout.resume(tags=["weights"])
log_gpu_memory_usage("After resume weights", logger=logger)
+
+ if peft_config is not None and VLLM_SLEEP_LEVEL == 2 and not self.layered_summon:... | verl/workers/fsdp_workers.py | 26 | Python | 0.571 | suggestion | 114 | 51 | 51 | false | [trainer,rollout] fix: ensure LoRA weights are loaded when vllm_sleep_level=2 and without using layerd_summon | 3,541 | volcengine/verl | 16,907 | Python | techkang | piood |
"""Start profiling for all worker groups if profiling is enabled."""
if do_profile:
self.actor_rollout_wg.start_profile(role="e2e", profile_step=self.global_steps)
if self.use_reference_policy:
self.ref_policy_wg.start_profile(profile_step=self.global_steps)
... | `calculate_workload` should be used to caculate workload, but this function change global_seqlen_lst(for token counts), make the metric(with prefix `global_seqlen`) corruption. @conver334
<img width="926" height="594" alt="CleanShot 2025-11-14 at 12 16 02@2x" src="https://github.com/user-attachments/assets/5edaab0d-a... | if do_profile:
self.actor_rollout_wg.start_profile(role="e2e", profile_step=self.global_steps)
if self.use_reference_policy:
self.ref_policy_wg.start_profile(profile_step=self.global_steps)
if self.use_critic:
self.critic_wg.start_profile(profi... | @@ -900,15 +900,35 @@ def _stop_profiling(self, do_profile: bool) -> None:
if self.use_rm:
self.rm_wg.stop_profile()
- def _balance_batch(self, batch: DataProto, metrics, logging_prefix="global_seqlen"):
+ def _balance_batch(self, batch: DataProto, metrics, logging_prefix="global_s... | verl/trainer/ppo/ray_trainer.py | 26 | Python | 0.643 | suggestion | 352 | 51 | 51 | false | [perf, data] feat: DP workload balance | 3,605 | volcengine/verl | 16,907 | Python | wlhgtc | conver334 |
# Copyright 2025 CollabLLM team and/or its affiliates
# Copyright 2025 Bytedance Ltd. and/or its affiliates
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | Will this register take effect since it's in recipe? | # Retry mechanism for calling the metric function
for attempt in range(num_retries):
try:
# Call the metric function (await if it's async)
if asyncio.iscoroutinefunction(compute_score_fn):
rewards[metric] = await compute_score_fn(data_sourc... | @@ -93,3 +102,126 @@ async def conversation_level_reward_func(
# Return dict with metric names as keys
return {metric: torch.tensor(reward, dtype=torch.float32) for metric, reward in rewards.items()}
+
+
+@register("collabllm") | recipe/collabllm/reward_function.py | 26 | Python | 0.214 | question | 52 | 96 | 51 | false | [recipe] fix: move all collabllm files into recipe directory | 3,706 | volcengine/verl | 16,907 | Python | wuxibin89 | chenhaiq |
"Multimedia type 'video' is not currently supported. Only 'image' is supported."
)
if tool_reward is not None:
agent_data.tool_rewards.append(tool_reward)
# Update prompt with tool responses
if self.processor is not None:
raw_... | @HJSang self.tool_parser is NOT a string, thus the condition of the if statement here is always false. | # Currently not supported, raise informative error
logger.warning("Multimedia type 'video' is not currently supported. Only 'image' is supported.")
raise NotImplementedError(
"Multimedia type 'video' is not currently supported. Only 'image' is supporte... | @@ -341,11 +344,25 @@ async def _handle_processing_tools_state(self, agent_data: AgentData) -> AgentSt
model_inputs = self.processor(text=[raw_tool_response], images=current_images, return_tensors="pt")
response_ids = model_inputs.pop("input_ids").squeeze(0).tolist()
else:
- ... | verl/experimental/agent_loop/tool_agent_loop.py | 26 | Python | 0.357 | suggestion | 102 | 51 | 51 | false | [recipe, rollout] feat: enable gpt-oss training for tool agent add gpt-oss for retool recipe | 3,837 | volcengine/verl | 16,907 | Python | mirrorboat | HJSang |
# (False, 'model.layers.0.mlp.experts.w13_weight') use mlp.experts.weight_loader
# (False, 'model.layers.0.mlp.experts.w2_weight') use mlp.experts.weight_loader
# Early return if no MOE models are supported
if not SUPPORTED_MOE_MODELS:
return
original_model_type = type(mo... | This new logic is different from old one, should consider both `model` or `inner_model` isinstance of `tuple(SUPPORTED_MOE_MODELS)` | # (False, 'model.layers.0.mlp.experts.w13_weight') use mlp.experts.weight_loader
# (False, 'model.layers.0.mlp.experts.w2_weight') use mlp.experts.weight_loader
# Early return if no MOE models are supported
if not SUPPORTED_MOE_MODELS:
return
original_model_type = type(mo... | @@ -96,6 +100,12 @@ def patch_vllm_moe_model_weight_loader(model):
if inner_model is None:
raise ValueError("The provided model does not have a valid 'model' or 'language_model' attribute.")
+ if not isinstance(inner_model, tuple(SUPPORTED_MOE_MODELS)): | verl/utils/vllm/patch.py | 26 | Python | 0.571 | suggestion | 131 | 47 | 49 | false | [recipe] fix: Qwen3-vl moe model patch | 3,878 | volcengine/verl | 16,907 | Python | FightingZhen | leisuzz |
cos = cos.repeat(1, 2)
sin = sin.repeat(1, 2)
q_embed = apply_rotary_emb(
q.float(), cos.unsqueeze(0).unsqueeze(2).float(), sin.unsqueeze(0).unsqueeze(2).float()
).type_as(q)
k_embed = apply_rotary_emb(
k.float(), cos.unsqueeze(0).unsqueeze(2).float(), sin.unsqueeze(0).unsqueez... | Is `.contiguous()` necessary for this? It maybe cause extra time cost. | cos = cos.repeat(1, 2)
sin = sin.repeat(1, 2)
q_embed = apply_rotary_emb(
q.float(), cos.unsqueeze(0).unsqueeze(2).float(), sin.unsqueeze(0).unsqueeze(2).float()
).type_as(q)
k_embed = apply_rotary_emb(
k.float(), cos.unsqueeze(0).unsqueeze(2).float(), sin.unsqueeze(0).unsqueez... | @@ -61,11 +62,11 @@ def silu_forward(self, hidden_state):
return self.down_proj(torch_npu.npu_swiglu(gate_up, dim=-1))
-def apply_rotary_pos_emb_qwen3_npu(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
+def apply_rotary_pos_emb_npu(q, k, cos, sin, position_ids=None, unsqueeze_dim=1):
cos = cos.... | verl/models/transformers/npu_patch.py | 26 | Python | 0.429 | suggestion | 70 | 51 | 51 | false | [fsdp] feat: add NPU fusion kernels for Qwen2 and Qwen2.5 dense model. | 3,923 | volcengine/verl | 16,907 | Python | FightingZhen | ZLiao097 |
micro_batches = mini_batch.split(self.config.ppo_micro_batch_size_per_gpu)
self.actor_optimizer.zero_grad()
global_snis_denom = None
try:
if (
"rollout_is_weights" in mini_batch.batch.keys()
... | Can we move `global_snis_denom` calculation to `verl/trainer/ppo/mismatch_helper.py`? Better to keep `update_policy` function concise. | mini_batches = data.split(self.config.ppo_mini_batch_size)
on_policy = len(mini_batches) == 1 and self.config.ppo_epochs == 1
metrics = {}
for _ in range(self.config.ppo_epochs):
for batch_idx, mini_batch in enumerate(mini_batches):
if self.config.use_dynami... | @@ -403,6 +405,45 @@ def update_policy(self, data: DataProto):
self.actor_optimizer.zero_grad()
+ global_snis_denom = None
+ try:
+ if (
+ "rollout_is_weights" in mini_batch.batch.keys()
+ and "rollout_is... | verl/workers/actor/dp_actor.py | 26 | Python | 0.571 | refactor | 134 | 51 | 51 | false | [trainer] feat: Self-Normalized Importance Sampling | 3,980 | volcengine/verl | 16,907 | Python | wuxibin89 | EduardDurech |
rollout_is_weights = rollout_is_weights * response_mask
# Compute IS weight metrics (BEFORE truncation to get accurate fraction_high/low)
metrics: dict[str, float] = compute_is_metrics(
rollout_is_weights=rollout_is_weights,
log_ratio_for_metrics=log_ratio_for_metrics,
response_mask... | why do we need distributed masked mean? | rollout_is_weights = rollout_is_weights * response_mask
# Compute IS weight metrics (BEFORE truncation to get accurate fraction_high/low)
metrics: dict[str, float] = compute_is_metrics(
rollout_is_weights=rollout_is_weights,
log_ratio_for_metrics=log_ratio_for_metrics,
response_mask... | @@ -405,15 +405,23 @@ def compute_rollout_correction_weights(
# Apply batch normalization if requested
if rollout_is_batch_normalize:
# Compute mean based on aggregation level
+ mask_float = response_mask.to(dtype=rollout_is_weights.dtype)
if rollout_is == "token":
# Toke... | verl/trainer/ppo/rollout_corr_helper.py | 26 | Python | 0.071 | question | 39 | 51 | 51 | false | [trainer] feat: Self-Normalized Importance Sampling | 3,980 | volcengine/verl | 16,907 | Python | szrlee | EduardDurech |
rollout_is_weights = rollout_is_weights.clamp(max=rollout_is_threshold)
# Detach weights to prevent gradient flow (mathematically required by IS theory)
# IS weights change the measure, not the objective. See §3.2.2 in docs/algo/rollout_corr_math.md
rollout_is_weights = rollout_is_weights.detach()
... | do we need to multiply the batch size or total token size to cancel out the loss aggregation in the later stage? | rollout_is_weights = rollout_is_weights.clamp(max=rollout_is_threshold)
# Detach weights to prevent gradient flow (mathematically required by IS theory)
# IS weights change the measure, not the objective. See §3.2.2 in docs/algo/rollout_corr_math.md
rollout_is_weights = rollout_is_weights.detach()
... | @@ -405,15 +405,23 @@ def compute_rollout_correction_weights(
# Apply batch normalization if requested
if rollout_is_batch_normalize:
# Compute mean based on aggregation level
+ mask_float = response_mask.to(dtype=rollout_is_weights.dtype)
if rollout_is == "token":
# Toke... | verl/trainer/ppo/rollout_corr_helper.py | 26 | Python | 0.357 | performance | 112 | 51 | 51 | false | [trainer] feat: Self-Normalized Importance Sampling | 3,980 | volcengine/verl | 16,907 | Python | szrlee | EduardDurech |
import torch
from cachetools import LRUCache
from omegaconf import DictConfig, OmegaConf
from pydantic import BaseModel, ConfigDict
from tensordict import TensorDict
from transformers import AutoProcessor, AutoTokenizer
from verl.experimental.reward import RewardManagerWorker
from verl.protocol import DataProto
from v... | please move to `verl/experimental/agent_loop/utils.py` | from cachetools import LRUCache
from omegaconf import DictConfig, OmegaConf
from pydantic import BaseModel, ConfigDict
from tensordict import TensorDict
from transformers import AutoProcessor, AutoTokenizer
from verl.experimental.agent_loop.utils import resolve_config_path
from verl.experimental.reward import RewardMa... | @@ -47,6 +48,60 @@
logger.setLevel(os.getenv("VERL_LOGGING_LEVEL", "WARN"))
+def resolve_config_path(config_path: str) -> str: | verl/experimental/agent_loop/agent_loop.py | 26 | Python | 0.429 | suggestion | 54 | 51 | 51 | false | [rollout] fix: resolve agent loop config path in multi-node Ray training | 4,029 | volcengine/verl | 16,907 | Python | wuxibin89 | CzsGit |
role = "Ref" if actor_optimizer is None else "Actor"
self.use_remove_padding = self.config.get("use_remove_padding", False)
if torch.distributed.get_rank() == 0:
print(f"{role} use_remove_padding={self.use_remove_padding}")
self.use_fused_kernels = self.config.get("use_fused... | Does `ShardedGradScaler` works for both fsdp and fsdp2? | role = "Ref" if actor_optimizer is None else "Actor"
self.use_remove_padding = self.config.get("use_remove_padding", False)
if torch.distributed.get_rank() == 0:
print(f"{role} use_remove_padding={self.use_remove_padding}")
self.use_fused_kernels = self.config.get("use_fused... | @@ -82,6 +83,13 @@ def __init__(self, config: ActorConfig, actor_module: nn.Module, actor_optimizer
else entropy_from_logits
)
self.device_name = get_device_name()
+ assert self.config.dtype in ["float16", "float32", "bfloat16"]
+ if self.config.dtype == "float16":
+ ... | verl/workers/actor/dp_actor.py | 26 | Python | 0.357 | question | 55 | 51 | 51 | false | [worker, trainer, recipe] feat: add FP16 training and inference support | 4,036 | volcengine/verl | 16,907 | Python | wuxibin89 | Xuekai-Zhu |
**multi_modal_inputs,
use_cache=False,
**extra_args,
) # prevent model thinks we are generating
if self.use_fused_kernels:
log_probs = output.log_probs[:, -response_length - 1 : -1]
entr... | Just curious
1. why we need `unscale_` here?
2. why we don't scale actor loss by `self.scalar(loss).backward()`? | use_cache=False,
**extra_args,
) # prevent model thinks we are generating
if self.use_fused_kernels:
log_probs = output.log_probs[:, -response_length - 1 : -1]
entropy = output.entropy[:, -response_length -... | @@ -274,7 +283,8 @@ def _forward_micro_batch(
def _optimizer_step(self):
assert self.config.grad_clip is not None
-
+ if self.scaler is not None:
+ self.scaler.unscale_(self.actor_optimizer) | verl/workers/actor/dp_actor.py | 26 | Python | 0.5 | question | 114 | 51 | 51 | false | [worker, trainer, recipe] feat: add FP16 training and inference support | 4,036 | volcengine/verl | 16,907 | Python | wuxibin89 | Xuekai-Zhu |
AutoModelForCausalLM,
AutoModelForImageTextToText,
AutoModelForVision2Seq,
)
from verl.utils.model import get_generation_config, print_model_size, update_model_config
from verl.utils.torch_dtypes import PrecisionType
assert role in ["actor", "ref"]
... | There's 2 question here:
1. `fsdp_config.get("model_dtype", None)` always return fp32 here, so we never enter this branch.
2. `torch_dtype` only affects `AutoModel.from_pretrained`, while FSDP mixed precision still use bf16 as param_dtype
https://github.com/volcengine/verl/blob/main/verl/workers/fsdp_workers.py#L134... | AutoModelForCausalLM,
AutoModelForImageTextToText,
AutoModelForVision2Seq,
)
from verl.utils.model import get_generation_config, print_model_size, update_model_config
from verl.utils.torch_dtypes import PrecisionType
assert role in ["actor", "ref"]
... | @@ -310,7 +310,13 @@ def _build_model_optimizer(
torch_dtype = fsdp_config.get("model_dtype", None)
if torch_dtype is None: | verl/workers/fsdp_workers.py | 26 | Python | 0.786 | suggestion | 327 | 51 | 51 | false | [worker, trainer, recipe] feat: add FP16 training and inference support | 4,036 | volcengine/verl | 16,907 | Python | wuxibin89 | Xuekai-Zhu |
self.layer_name_mapping = {
"qkv_layer_name": "self_attention.linear_qkv.",
"gate_proj_layer_name": "linear_fc1.",
}
self.weight_converter = None
def _init_device_mesh(self):
mpu.initialize_model_parallel(
tensor_model_parallel_size=self.engine_c... | Do we need latest mbridge for `fp16`? |
self.layer_name_mapping = {
"qkv_layer_name": "self_attention.linear_qkv.",
"gate_proj_layer_name": "linear_fc1.",
}
self.weight_converter = None
def _init_device_mesh(self):
mpu.initialize_model_parallel(
tensor_model_parallel_size=self.engine_c... | @@ -98,6 +99,9 @@ def _build_tf_config(self):
from verl.utils.torch_dtypes import PrecisionType
self.param_dtype = torch.bfloat16
+ if self.engine_config.fp16:
+ self.param_dtype = torch.float16
+ assert self.engine_config.use_mbridge, "fp16 mode requires use_mbridge to ... | verl/workers/engine/megatron/transformer_impl.py | 26 | Python | 0.214 | question | 37 | 51 | 51 | false | [megatron] feat: fp16 training (dense and MoE supported) | 4,086 | volcengine/verl | 16,907 | Python | wuxibin89 | ISEEKYAN |
{"model": {"path": self.model_config.local_path, "use_shm": self.model_config.use_shm}}
)
load_megatron_gptmodel_weights(
tmp_config,
self.model_config.hf_config,
module,
params_dtype=sel... | I plan to extend this PR for fp16 RL training before merging it. For bf16 precision alignment issue please just cherry-pick this line in another small PR @wuxibin89 | )
load_megatron_gptmodel_weights(
tmp_config,
self.model_config.hf_config,
module,
params_dtype=self.dtype,
is_value_model=is_value_model,
)
if torch.distributed.... | @@ -181,8 +187,14 @@ def _build_megatron_module(self):
def _build_optimizer(self):
from verl.utils.megatron.optimizer import get_megatron_optimizer, init_megatron_optim_config
- optim_config_megatron = init_megatron_optim_config(self.optimizer_config)
+ optim_config_megatron = init_megatro... | verl/workers/engine/megatron/transformer_impl.py | 26 | Python | 0.357 | suggestion | 165 | 51 | 51 | false | [megatron] feat: fp16 training (dense and MoE supported) | 4,086 | volcengine/verl | 16,907 | Python | ISEEKYAN | ISEEKYAN |
# batch sequence generation is bounded by the slowest sample
slowest = np.argmax(t_generate_sequences + t_tool_calls)
attention_mask = output.batch["attention_mask"][slowest]
prompt_length = output.batch["prompts"].shape[1]
timing["agent_loop/slowest/generate_sequences"] = t_gene... | Please move this function to a separate util file, and keep agent_loop.py concise. | timing["agent_loop/tool_calls/max"] = t_tool_calls.max()
timing["agent_loop/tool_calls/mean"] = t_tool_calls.mean()
# batch sequence generation is bounded by the slowest sample
slowest = np.argmax(t_generate_sequences + t_tool_calls)
attention_mask = output.batch["attention_mask... | @@ -805,3 +813,88 @@ async def run_all():
await asyncio.gather(*tasks)
asyncio.run(run_all())
+
+ def _update_prometheus_config(self): | verl/experimental/agent_loop/agent_loop.py | 26 | Python | 0.286 | refactor | 82 | 51 | 28 | false | [sglang,vllm] feat: use prometheus and grafana to show rollout message | 4,088 | volcengine/verl | 16,907 | Python | wuxibin89 | ArronHZG |
else self.config.trainer.n_gpus_per_node * self.config.trainer.nnodes
)
num_replicas = world_size // rollout_world_size
rollout_config = self.config.actor_rollout_ref.rollout
model_config = self.config.actor_rollout_ref.model
self.rollout_replicas = [
sel... | Please add config in `verl/trainer/config/rollout/rollout.yaml` instead of environment variable. | else self.config.trainer.n_gpus_per_node * self.config.trainer.nnodes
)
num_replicas = world_size // rollout_world_size
rollout_config = self.config.actor_rollout_ref.rollout
model_config = self.config.actor_rollout_ref.model
self.rollout_replicas = [
sel... | @@ -720,6 +721,14 @@ def _initialize_llm_servers(self):
self.server_handles = [server._server_handle for server in self.rollout_replicas]
self.server_addresses = [server._server_address for server in self.rollout_replicas]
+ print(f"AgentLoopManager: {self.server_addresses}")
+
+ # Upd... | verl/experimental/agent_loop/agent_loop.py | 26 | Python | 0.429 | suggestion | 96 | 51 | 51 | false | [sglang,vllm] feat: use prometheus and grafana to show rollout message | 4,088 | volcengine/verl | 16,907 | Python | wuxibin89 | ArronHZG |
self._start_profiling(
not prev_step_profile and curr_step_profile
if self.config.global_profiler.profile_continuous_steps
else curr_step_profile
)
new_batch: DataProto = DataProto.from_singl... | gen_batch_output should be gen_baseline_batch? | self._start_profiling(
not prev_step_profile and curr_step_profile
if self.config.global_profiler.profile_continuous_steps
else curr_step_profile
)
new_batch: DataProto = DataProto.from_singl... | @@ -164,15 +153,15 @@ def fit(self):
with marked_timer("step", timing_raw):
# generate a batch
with marked_timer("gen", timing_raw, "red"):
- gen_batch_output = self.actor_rollout_wg.generate_sequences(gen_batch_output)
+ ... | recipe/dapo/dapo_ray_trainer.py | 26 | Python | 0.143 | performance | 46 | 51 | 51 | false | [BREAKING][rollout] feat: change rollout to server mode by default | 4,106 | volcengine/verl | 16,907 | Python | vermouth1992 | wuxibin89 |
set -x
export VLLM_ASCEND_ENABLE_NZ=0
export HCCL_EXEC_TIMEOUT=60000
export HCCL_CONNECT_TIMEOUT=7200
project_name='GRPO'
exp_name='GRPO-Qwen3-8b-gsm8k-fsdp2-one-step-off-8-8-npu'
# Paths
RAY_DATA_HOME=${RAY_DATA_HOME:-"${HOME}/verl"}
MODEL_PATH=${MODEL_PATH:-"${RAY_DATA_HOME}/models/Qwen/Qwen3-8B"}
CKPTS_DIR=${CKPT... | Add a comment to declare that the script has been verified to run on A3. | # The script has been validated on the Ascend Atlas 800T A3.
set -x
export VLLM_ASCEND_ENABLE_NZ=0
export HCCL_EXEC_TIMEOUT=60000
export HCCL_CONNECT_TIMEOUT=7200
project_name='GRPO'
exp_name='GRPO-Qwen3-8b-gsm8k-fsdp2-one-step-off-8-8-npu'
# Paths
RAY_DATA_HOME=${RAY_DATA_HOME:-"${HOME}/verl"}
MODEL_PATH=${MODEL_PA... | @@ -0,0 +1,93 @@
+set -x
+
+export VLLM_ASCEND_ENABLE_NZ=0 | recipe/one_step_off_policy/grpo_qwen3_8b_gsm8k_fsdp2_8_8_npu.sh | 4 | Shell | 0.214 | suggestion | 72 | 29 | 29 | false | [recipe] feat: add qwen3 8b grpo one_step_off_policy script on ASCEND NPU | 4,163 | volcengine/verl | 16,907 | Python | ji-huazhong | baymax591 |
up_res = GmmFunction.apply(permuted_tokens, w1, group_list, split_size)
gate_res = GmmFunction.apply(permuted_tokens, w2, group_list, split_size)
act_res = torch_npu.npu_swiglu(torch.cat([gate_res, up_res], dim=-1))
down_res = GmmFunction.apply(act_res, w3, group_list, split_size)
probs = ro... | How about renaming this class name to `GmmFunctionVL`? |
up_res = GmmFunction.apply(permuted_tokens, w1, group_list, split_size)
gate_res = GmmFunction.apply(permuted_tokens, w2, group_list, split_size)
act_res = torch_npu.npu_swiglu(torch.cat([gate_res, up_res], dim=-1))
down_res = GmmFunction.apply(act_res, w3, group_list, split_size)
probs = ro... | @@ -166,6 +182,117 @@ def moe_block_forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
return final_hidden_states, router_logits
+class GmmFunction_vl(torch.autograd.Function):
| verl/models/transformers/npu_patch.py | 26 | Python | 0.357 | question | 54 | 51 | 51 | false | [recipe] fix: Qwen3-vl npu patch | 4,186 | volcengine/verl | 16,907 | Python | FightingZhen | leisuzz |
fwd_output = torch_npu.npu_grouped_matmul(
[x], [weight], bias=None, group_list=group_list, split_item=2, group_type=0, group_list_type=1
)[0]
return fwd_output
@staticmethod
def backward(ctx, grad_output):
input_tensor, weight = ctx.saved_tensors
gro... | Same here, it is not adviced to add `_` into a class name, how about `NPUQwen3VLMoeTextExperts` ? | fwd_output = torch_npu.npu_grouped_matmul(
[x], [weight], bias=None, group_list=group_list, split_item=2, group_type=0, group_list_type=1
)[0]
return fwd_output
@staticmethod
def backward(ctx, grad_output):
input_tensor, weight = ctx.saved_tensors
gro... | @@ -166,6 +182,117 @@ def moe_block_forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
return final_hidden_states, router_logits
+class GmmFunction_vl(torch.autograd.Function):
+ @staticmethod
+ def forward(ctx, x, weight, group_list):
+ ctx.save_for_backward(x, weight)
+ ct... | verl/models/transformers/npu_patch.py | 26 | Python | 0.357 | question | 97 | 51 | 51 | false | [recipe] fix: Qwen3-vl npu patch | 4,186 | volcengine/verl | 16,907 | Python | FightingZhen | leisuzz |
def patch_vllm_moe_model_weight_loader(model):
# this is a work around to load the weight of vllm fused moe model
# it is from a bug from vllm 0.8.2
# all the weights are supposed to have a weight_loader, but the moe weights
# do not have a weight_loader, so we need to patch it
# (True, 'model.emb... | Suggest following review comment :) |
def patch_vllm_moe_model_weight_loader(model):
# this is a work around to load the weight of vllm fused moe model
# it is from a bug from vllm 0.8.2
# all the weights are supposed to have a weight_loader, but the moe weights
# do not have a weight_loader, so we need to patch it
# (True, 'model.emb... | @@ -90,6 +90,9 @@ def patch_vllm_moe_model_weight_loader(model):
return
original_model_type = type(model)
+ if "ACLGraphWrapper" in str(original_model_type): | verl/utils/vllm/patch.py | 26 | Python | 0.071 | suggestion | 35 | 51 | 51 | false | [vllm] fix: Fix issues that occur during the ACLGraph initialization process in the NPU. | 4,209 | volcengine/verl | 16,907 | Python | FightingZhen | chengminhua |
from verl.workers.config import HFModelConfig, McoreCriticConfig, RolloutConfig
from verl.workers.critic.megatron_critic import MegatronPPOCritic
from verl.workers.reward_model.megatron.reward_model import MegatronRewardModel
from verl.workers.rollout import get_rollout_class
_COMPILE = None
def init_torch_compile(c... | Is repatch after importing megatron truly work? | simple_timer,
)
from verl.utils.profiler.performance import reduce_timing, topk_reduce_ratio_min_max
from verl.utils.ray_utils import get_event_loop
from verl.utils.torch_functional import use_original_torch_compile
from verl.workers.actor.megatron_actor import MegatronPPOActor
from verl.workers.config import HFMod... | @@ -77,6 +72,30 @@
from verl.workers.reward_model.megatron.reward_model import MegatronRewardModel
from verl.workers.rollout import get_rollout_class
+_COMPILE = None
+
+
+def init_torch_compile(compile):
+ global _COMPILE
+ _COMPILE = compile
+
+
+@contextmanager
+def replace_torch_compile():
+ original_c... | verl/workers/megatron_workers.py | 26 | Python | 0.071 | question | 47 | 51 | 51 | false | [vllm] fix: Fix issues that occur during the ACLGraph initialization process in the NPU. | 4,209 | volcengine/verl | 16,907 | Python | FightingZhen | chengminhua |
simple_timer,
)
from verl.utils.profiler.performance import reduce_timing, topk_reduce_ratio_min_max
from verl.utils.ray_utils import get_event_loop
from verl.workers.actor.megatron_actor import MegatronPPOActor
from verl.workers.config import HFModelConfig, McoreCriticConfig, RolloutConfig
from verl.workers.critic... | Please add key comments to clarify the problem this solves. | DistProfiler,
DistProfilerExtension,
GPUMemoryLogger,
ProfilerConfig,
log_gpu_memory_usage,
simple_timer,
)
from verl.utils.profiler.performance import reduce_timing, topk_reduce_ratio_min_max
from verl.utils.ray_utils import get_event_loop
from verl.utils.torch_functional import use_original_to... | @@ -77,6 +72,30 @@
from verl.workers.reward_model.megatron.reward_model import MegatronRewardModel
from verl.workers.rollout import get_rollout_class
+_COMPILE = None
+
+
+def init_torch_compile(compile):
+ global _COMPILE
+ _COMPILE = compile
+
+
+@contextmanager
+def replace_torch_compile():
+ original_c... | verl/workers/megatron_workers.py | 26 | Python | 0.214 | suggestion | 59 | 51 | 51 | false | [vllm] fix: Fix issues that occur during the ACLGraph initialization process in the NPU. | 4,209 | volcengine/verl | 16,907 | Python | ji-huazhong | chengminhua |
import ray
import torch
from verl import DataProto
from verl.single_controller.base import Worker
from verl.single_controller.base.decorator import Dispatch, register
from verl.single_controller.ray.base import (
RayClassWithInitArgs,
RayResourcePool,
RayWorkerGroup,
)
@ray.remote
class Actor(Worker):
... | What's self.world_size here? Could you add an assertion self.world_size == 4? | import ray
import torch
from verl import DataProto
from verl.single_controller.base import Worker
from verl.single_controller.base.decorator import Dispatch, register
from verl.single_controller.ray.base import (
RayClassWithInitArgs,
RayResourcePool,
RayWorkerGroup,
)
@ray.remote
class Actor(Worker):
... | @@ -0,0 +1,79 @@
+# Copyright 2024 Bytedance Ltd. and/or its affiliates
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless r... | tests/single_controller/test_split_resource_pool.py | 26 | Python | 0.286 | question | 77 | 51 | 51 | false | [single_controller] feat: support resource pool split method | 4,251 | volcengine/verl | 16,907 | Python | vermouth1992 | yyDing1 |
"""
use_gpu = resource_pool.use_gpu
strategy = "PACK"
if bin_pack:
strategy = "STRICT_PACK"
pgs = resource_pool.get_placement_groups(strategy=strategy, device_name=self.device_name)
world_size = self.replica_world_size
self._world_size = world_size
... | Isn't it kind of weird that for a regular RayWorkerGroup without using a splited RayResourcePool, the concept of `subgroup` is also force? | def _get_master_addr_port(self, pg):
"""Get master addr and port for this worker group"""
self._master_addr, self._master_port = ray.get(
get_master_addr_port.options(
scheduling_strategy=PlacementGroupSchedulingStrategy(
placement_group=pg, placement_... | @@ -382,21 +400,16 @@ def _init_with_resource_pool(self, resource_pool, ray_cls_with_init, bin_pack, d
if bin_pack:
strategy = "STRICT_PACK"
pgs = resource_pool.get_placement_groups(strategy=strategy, device_name=self.device_name)
- world_size = self.replica_world_size
+ wor... | verl/single_controller/ray/base.py | 26 | Python | 0.5 | question | 138 | 51 | 51 | false | [single_controller] feat: support resource pool split method | 4,251 | volcengine/verl | 16,907 | Python | zw0610 | yyDing1 |
# cia.add_kwarg("_world_size", world_size)
num_gpus = 1 / resource_pool.max_colocate_count
rank = -1
local_world_size = resource_pool.store[0]
assert world_size * (self.replica_rank + 1) <= resource_pool.world_size, (
f"world_size={world_size} is not enough for"
... | The previous link with `for curr_rank in range(world_size * self.replica_rank, world_size * (self.replica_rank + 1)):` is introduced https://github.com/volcengine/verl/pull/4226/files#diff-3f7fc1c6677319523cf937db17b89d1e238427005652a5fc7ea308020c097649R399 but is quickly changed to a new definition. As this looks not ... |
def _init_with_resource_pool(self, resource_pool, ray_cls_with_init, bin_pack, detached, worker_env=None):
"""Initialize the worker group by creating new workers from a resource pool.
Args:
resource_pool: Resource pool for worker allocation
ray_cls_with_init: Class with ini... | @@ -382,21 +400,16 @@ def _init_with_resource_pool(self, resource_pool, ray_cls_with_init, bin_pack, d
if bin_pack:
strategy = "STRICT_PACK"
pgs = resource_pool.get_placement_groups(strategy=strategy, device_name=self.device_name)
- world_size = self.replica_world_size
+ wor... | verl/single_controller/ray/base.py | 26 | Python | 0.643 | question | 415 | 51 | 51 | false | [single_controller] feat: support resource pool split method | 4,251 | volcengine/verl | 16,907 | Python | zw0610 | yyDing1 |
transformer_config_dict = asdict(self.transformer_config)
for k in backup:
setattr(self.transformer_config, k, backup[k])
to_convert_types = {torch.dtype: str, AttnBackend: str}
ignore_types = [Callable]
pop_keys = []
... | Not sure where this `global_step` come from? | if hdfs_path is not None:
log_with_rank(
f"Uploading checkpoint to {hdfs_path}", rank=self.rank, logger=logger, log_only_rank_0=True
)
from verl.utils import hdfs_io
hdfs_io.m... | @@ -630,6 +566,11 @@ def finalize_save_fn():
f"Dist checkpointing save completed for {dist_checkpoint_path}", rank=self.rank, logger=logger
)
if self.rank == 0:
+ local_latest_checkpointed_iteration = os.path.join(
+ os.path.dirname(os.path.di... | verl/utils/checkpoint/megatron_checkpoint_manager.py | 26 | Python | 0.214 | question | 44 | 51 | 45 | false | [megatron] fix: megatron async save ckpt fix | 4,253 | volcengine/verl | 16,907 | Python | FightingZhen | Leem-Li |
self.actor_rollout_wg.save_checkpoint(
actor_local_path, actor_remote_path, self.global_steps, max_ckpt_to_keep=max_actor_ckpt_to_keep
)
if self.use_critic:
critic_local_path = os.path.join(local_global_step_folder, str(Role.Critic))
critic_remote_path = (
... | why we have to skip saving latest checkpoint iteration step here? please show me the reason |
self.actor_rollout_wg.save_checkpoint(
actor_local_path, actor_remote_path, self.global_steps, max_ckpt_to_keep=max_actor_ckpt_to_keep
)
if self.use_critic:
critic_local_path = os.path.join(local_global_step_folder, str(Role.Critic))
critic_remote_path = (
... | @@ -843,6 +844,15 @@ def _save_checkpoint(self):
torch.save(dataloader_state_dict, dataloader_local_path)
# latest checkpointed iteration tracker (for atomic usage)
+ if ( | verl/trainer/ppo/ray_trainer.py | 26 | Python | 0.214 | question | 91 | 51 | 51 | false | [megatron] fix: megatron async save ckpt fix | 4,253 | volcengine/verl | 16,907 | Python | FightingZhen | Leem-Li |
optimizer_scheduler=self.critic_optimizer_scheduler,
use_distributed_optimizer=self.config.megatron.use_distributed_optimizer,
use_checkpoint_opt_param_scheduler=self.config.optim.use_checkpoint_opt_param_scheduler,
bridge=self.bridge,
use_dist_checkpointing=s... | Align with actor, here role should be `critic_update` | is_value_model=True, # critic is value model
share_embeddings_and_output_weights=False,
wrap_with_ddp=True,
use_distributed_optimizer=self.config.megatron.use_distributed_optimizer,
)
critic_module, updated_tf_config = make_megatron_module(
wr... | @@ -1182,7 +1096,7 @@ def compute_values(self, data: DataProto):
return output
@register(dispatch_mode=make_nd_compute_dataproto_dispatch_fn(mesh_name="critic"))
- @DistProfiler.annotate(color="pink")
+ @DistProfiler.annotate(color="pink", role="update_critic") | verl/workers/megatron_workers.py | 26 | Python | 0.429 | suggestion | 53 | 51 | 51 | false | [megatron] feat: support discrete profiling for mindspeed | 4,271 | volcengine/verl | 16,907 | Python | FightingZhen | tardis-key |
processing_class=self.processor if self.processor is not None else self.tokenizer,
checkpoint_config=self.config.checkpoint,
)
@register(dispatch_mode=make_nd_compute_dataproto_dispatch_fn(mesh_name="critic"))
@DistProfiler.annotate(color="cyan", role="compute_values")
def c... | same here, change the role name to `critic_update` | model=self.critic_module,
optimizer=self.critic_optimizer,
lr_scheduler=self.critic_lr_scheduler,
processing_class=self.processor if self.processor is not None else self.tokenizer,
checkpoint_config=self.config.checkpoint,
)
@register(dispatch_mod... | @@ -1504,7 +1503,7 @@ def compute_values(self, data: DataProto):
return output
@register(dispatch_mode=make_nd_compute_dataproto_dispatch_fn(mesh_name="critic"))
- @DistProfiler.annotate(color="pink")
+ @DistProfiler.annotate(color="pink", role="update_critic") | verl/workers/fsdp_workers.py | 26 | Python | 0.429 | suggestion | 50 | 51 | 51 | false | [megatron] feat: support discrete profiling for mindspeed | 4,271 | volcengine/verl | 16,907 | Python | FightingZhen | tardis-key |
"""Initialize the worker group by creating new workers from a resource pool or sub resource pool.
Args:
resource_pool: Resource pool for worker allocation
ray_cls_with_init: Class with initialization arguments for workers
bin_pack: Whether to use strict bin packing fo... | Make #L536-#L585 a common util function. | def _create_worker(self, rank, pg_idx, pg, local_rank, resource_pool, ray_cls_with_init, worker_env, detached):
world_size = resource_pool.world_size
use_gpu = resource_pool.use_gpu
local_world_size = resource_pool.store[0]
num_gpus = 1 / resource_pool.max_colocate_count
# w... | @@ -443,6 +507,83 @@ def _init_with_resource_pool(self, resource_pool, ray_cls_with_init, bin_pack, d
self._workers.append(worker)
self._worker_names.append(name)
+ def _init_with_subresource_pool(self, resource_pool, ray_cls_with_init, bin_pack, detached, worker_env=None):
+ ... | verl/single_controller/ray/base.py | 26 | Python | 0.071 | suggestion | 40 | 51 | 51 | false | [single_controller] feat: support resource_pool split | 4,273 | volcengine/verl | 16,907 | Python | wuxibin89 | yyDing1 |
split_resource_pool,
)
@ray.remote
class Actor(Worker):
def __init__(self, worker_id) -> None:
super().__init__()
self.worker_id = worker_id
self.temp_tensor = torch.rand(4096, 4096).to("cuda")
if not torch.distributed.is_initialized():
rank = int(os.environ.get("R... | Add a test for split_size=[2,6] | split_resource_pool,
)
@ray.remote
class Actor(Worker):
def __init__(self, worker_id) -> None:
super().__init__()
self.worker_id = worker_id
self.temp_tensor = torch.rand(4096, 4096).to("cuda")
if not torch.distributed.is_initialized():
rank = int(os.environ.get("R... | @@ -0,0 +1,149 @@
+# Copyright 2024 Bytedance Ltd. and/or its affiliates
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless ... | tests/single_controller/test_split_resource_pool.py | 26 | Python | 0.071 | suggestion | 31 | 51 | 51 | false | [single_controller] feat: support resource_pool split | 4,273 | volcengine/verl | 16,907 | Python | wuxibin89 | yyDing1 |
pgs = resource_pool.get_placement_groups(strategy=strategy, device_name=self.device_name)
world_size = resource_pool.world_size
self._world_size = world_size
rank = -1
local_world_size = resource_pool.store[0]
self._get_master_addr_port(pgs[0])
for curr_rank in r... | register_single_bundle => _create_worker | self._world_size = world_size
rank = -1
local_world_size = resource_pool.store[0]
self._get_master_addr_port(pgs[0])
for curr_rank in range(resource_pool.start_bundle_index, resource_pool.start_bundle_index + world_size):
pg_idx = curr_rank // local_world_size
... | @@ -388,60 +463,114 @@ def _init_with_resource_pool(self, resource_pool, ray_cls_with_init, bin_pack, d
for local_rank in range(local_world_size):
rank += 1
+ self.register_single_bundle(
+ rank=rank,
+ pg_idx=pg_idx,
+ ... | verl/single_controller/ray/base.py | 26 | Python | 0.071 | suggestion | 40 | 51 | 51 | false | [single_controller] feat: support resource_pool split | 4,273 | volcengine/verl | 16,907 | Python | wuxibin89 | yyDing1 |
# this WorkerGroup.
self.sub_cls_name = ""
self.device_name = kwargs.get("device_name", "cuda")
self.profile_steps = kwargs.get("profile_steps", None)
self.worker_nsight_options = kwargs.get("worker_nsight_options", None)
self.customized_worker_env = kwargs.get("worker_en... | Why putting `SubRayResourcePool` as the default behavior instead of keeping `RayResourcePool` as the default? | # this WorkerGroup.
self.sub_cls_name = ""
self.device_name = kwargs.get("device_name", "cuda")
self.profile_steps = kwargs.get("profile_steps", None)
self.worker_nsight_options = kwargs.get("worker_nsight_options", None)
self.customized_worker_env = kwargs.get("worker_en... | @@ -313,14 +379,24 @@ def __init__(
if self._is_init_with_detached_workers:
self._init_with_detached_workers(worker_names=worker_names, worker_handles=worker_handles)
- else:
+ elif not isinstance(resource_pool, SubRayResourcePool):
+ assert isinstance(resource_pool, Ray... | verl/single_controller/ray/base.py | 26 | Python | 0.571 | question | 109 | 51 | 51 | false | [single_controller] feat: support resource_pool split | 4,273 | volcengine/verl | 16,907 | Python | zw0610 | yyDing1 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | add assertion to make sure that tensor_dict is a TensorDict | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | @@ -20,19 +20,67 @@
from tensordict.tensorclass import NonTensorData, NonTensorStack
-def assign_non_tensor_dict(tensor_dict: TensorDict, non_tensor_dict: dict):
- for key, val in non_tensor_dict.items():
- assign_non_tensor_data(tensor_dict=tensor_dict, key=key, val=val)
- return tensor_dict
-
-
def... | verl/utils/tensordict_utils.py | 26 | Python | 0.214 | suggestion | 59 | 51 | 51 | false | [misc] fix: fix list conversion in get_tensordict | 4,304 | volcengine/verl | 16,907 | Python | vermouth1992 | PeterSH6 |
# Copyright 2025 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | add assertion to make sure that tensor_dict is a TensorDict | # Copyright 2025 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | @@ -20,19 +20,67 @@
from tensordict.tensorclass import NonTensorData, NonTensorStack
-def assign_non_tensor_dict(tensor_dict: TensorDict, non_tensor_dict: dict):
- for key, val in non_tensor_dict.items():
- assign_non_tensor_data(tensor_dict=tensor_dict, key=key, val=val)
- return tensor_dict
-
-
def... | verl/utils/tensordict_utils.py | 23 | Python | 0.214 | suggestion | 59 | 48 | 48 | false | [misc] fix: fix list conversion in get_tensordict | 4,304 | volcengine/verl | 16,907 | Python | vermouth1992 | PeterSH6 |
batch_size = None
for key, val in tensor_dict.items():
if isinstance(val, torch.Tensor) and val.is_nested:
assert val.is_contiguous(), "Nested tensors must be contiguous. Try setting layout=torch.jagged"
# Skip validation for NonTensorStack as it's already properly formatted
... | tensor_dict[key] = NonTensorStack.from_list([NonTensorData(item) for item in val]) | """
tensor_dict = tensor_dict.copy()
if non_tensor_dict is None:
non_tensor_dict = {}
batch_size = None
for key, val in tensor_dict.items():
if isinstance(val, torch.Tensor) and val.is_nested:
assert val.is_contiguous(), "Nested tensors must be contiguous. Try setting l... | @@ -127,6 +190,9 @@ def get_tensordict(tensor_dict: dict[str, torch.Tensor | list], non_tensor_dict:
"Passing a list makes the data NonTensorStack, "
"which doesn't support torch.Tensor. Please convert to numpy first"
)
+ # Convert to NonTensorStack ... | verl/utils/tensordict_utils.py | 26 | Python | 0.214 | suggestion | 82 | 51 | 51 | false | [misc] fix: fix list conversion in get_tensordict | 4,304 | volcengine/verl | 16,907 | Python | vermouth1992 | PeterSH6 |
assert val.is_contiguous(), "Nested tensors must be contiguous. Try setting layout=torch.jagged"
# Skip validation for NonTensorStack as it's already properly formatted
if isinstance(val, NonTensorStack):
if batch_size is None:
batch_size = len(val)
e... | Create a util function for NonTensorStack.from_list([NonTensorData(item) for item in val]) | batch_size = None
for key, val in tensor_dict.items():
if isinstance(val, torch.Tensor) and val.is_nested:
assert val.is_contiguous(), "Nested tensors must be contiguous. Try setting layout=torch.jagged"
# Skip validation for NonTensorStack as it's already properly formatted
... | @@ -127,6 +190,9 @@ def get_tensordict(tensor_dict: dict[str, torch.Tensor | list], non_tensor_dict:
"Passing a list makes the data NonTensorStack, "
"which doesn't support torch.Tensor. Please convert to numpy first"
)
+ # Convert to NonTensorStack ... | verl/utils/tensordict_utils.py | 26 | Python | 0.214 | suggestion | 90 | 51 | 51 | false | [misc] fix: fix list conversion in get_tensordict | 4,304 | volcengine/verl | 16,907 | Python | vermouth1992 | PeterSH6 |
elif model.config.model_type in ["qwen3_vl", "qwen3_vl_moe"]:
# Step 1: patch model to support image-text mixed data
from transformers.models.qwen3_vl.modeling_qwen3_vl import (
Qwen3VLForConditionalGeneration,
Qwen3VLModel,
Qwen3VLTextModel,
)
fro... | Could you add a version check here so that future versions that fix the issue will not patch | elif model.config.model_type in ["qwen3_vl", "qwen3_vl_moe"]:
# Step 1: patch model to support image-text mixed data
from transformers.models.qwen3_vl.modeling_qwen3_vl import (
Qwen3VLForConditionalGeneration,
Qwen3VLModel,
Qwen3VLTextModel,
)
fro... | @@ -356,14 +356,18 @@ def state_dict(self, *args, **kwargs):
Qwen3VLMoeTextModel,
)
- from verl.models.transformers.qwen3_vl import forward_with_normal_backend, qwen3_vl_base_forward
+ from verl.models.transformers.qwen3_vl import forward_with_normal_backend, qwen3_vl_base_forward,... | verl/models/transformers/monkey_patch.py | 26 | Python | 0.286 | suggestion | 92 | 51 | 51 | false | [fsdp] fix: qwen3vlmoe with Monkey patch to fix a bug in transformers 4.57.x | 4,402 | volcengine/verl | 16,907 | Python | vermouth1992 | pengyanai |
self.servers.append(server)
# launch http server in each node
master_address, master_port = await self.servers[0].get_master_address.remote()
await asyncio.gather(
*[
server.launch_server.remote(master_address=master_address, master_port=master_port)
... | We may need add an abstract ServerBase for both vllm, sglang, tensorrt, ...
```python
ServerBase(ABC):
@abstractmethod
async def generate(
self,
prompt_ids: list[int],
sampling_params: dict[str, Any],
request_id: str,
image_data: Optional[list[Any]] = None,
... |
# launch http server in each node
master_address, master_port = await self.servers[0].get_master_address.remote()
await asyncio.gather(
*[
server.launch_server.remote(master_address=master_address, master_port=master_port)
for server in self.servers
... | @@ -589,6 +673,43 @@ async def sleep(self):
await self.servers[0].wait_for_requests_to_drain.remote()
await asyncio.gather(*[server.sleep.remote() for server in self.servers])
+ async def abort_all_requests(self) -> dict[str, Any]: | verl/workers/rollout/vllm_rollout/vllm_async_server.py | 26 | Python | 0.786 | refactor | 557 | 51 | 51 | false | [vllm] feat: support abort generating requests in vllm server | 4,453 | volcengine/verl | 16,907 | Python | wuxibin89 | PeterSH6 |
param_offload: bool = False
optimizer_offload: bool = False
grad_offload: bool = False
forward_only: bool = False
strategy: str = None
dtype: str = "bfloat16" # ["bfloat16", "float16"]
@dataclass
class McoreEngineConfig(EngineConfig):
"""Configuration for Megatron parallelism.
The in... | These configs are duplicated with ActorConfig?
https://github.com/volcengine/verl/blob/main/verl/workers/config/actor.py#L129-L132 | _mutable_fields = BaseConfig._mutable_fields | {
"use_dynamic_bsz",
"max_token_len_per_gpu",
"micro_batch_size_per_gpu",
"infer_max_token_len_per_gpu",
"infer_micro_batch_size_per_gpu",
"use_fused_kernels",
"use_remove_padding",
}
# whether to offload... | @@ -27,12 +27,52 @@
@dataclass
class EngineConfig(BaseConfig):
+ _mutable_fields = BaseConfig._mutable_fields | {
+ "use_dynamic_bsz",
+ "max_token_len_per_gpu",
+ "micro_batch_size_per_gpu",
+ "infer_max_token_len_per_gpu",
+ "infer_micro_batch_size_per_gpu",
+ "use_fus... | verl/workers/config/engine.py | 26 | Python | 0.357 | refactor | 131 | 51 | 51 | false | [model] feat: enhances TrainingWorker | 4,461 | volcengine/verl | 16,907 | Python | wuxibin89 | vermouth1992 |
The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to None.
"""
if profile_level == "level_none":
level = torch_npu.profiler.ProfilerLevel.Level_none
elif profile_level == "level0":
level... | The current verl version comes with torch_npu 2.7.1, which includes the mstx_domain_exclude parameter by default, so no judgment is needed. | The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to None.
"""
if profile_level == "level_none":
level = torch_npu.profiler.ProfilerLevel.Level_none
elif profile_level == "level0":
level... | @@ -128,12 +129,20 @@ def get_npu_profiler(
if role:
profile_save_path = os.path.join(profile_save_path, role)
+ init_method = torch_npu.profiler._ExperimentalConfig.__init__
+
+ # The ability to filter communication via mstx_domain_exclude depends on Profiler versions 630 and later. Compatibi... | verl/utils/profiler/mstx_profile.py | 26 | Python | 0.357 | suggestion | 139 | 51 | 51 | false | [perf] fix: modify the NPU profiler default configuration | 4,475 | volcengine/verl | 16,907 | Python | mengchengTang | tardis-key |
"""
if profile_level == "level_none":
level = torch_npu.profiler.ProfilerLevel.Level_none
elif profile_level == "level0":
level = torch_npu.profiler.ProfilerLevel.Level0
elif profile_level == "level1":
level = torch_npu.profiler.ProfilerLevel.Level1
elif profile_level == "lev... | When setting level0, the configuration item aic_metrics=torch_npu.profiler.AiCMetrics.PipeUtilization can be omitted. In RL scenarios, aic_metrics is rarely used. | """
if profile_level == "level_none":
level = torch_npu.profiler.ProfilerLevel.Level_none
elif profile_level == "level0":
level = torch_npu.profiler.ProfilerLevel.Level0
elif profile_level == "level1":
level = torch_npu.profiler.ProfilerLevel.Level1
elif profile_level == "lev... | @@ -128,12 +129,20 @@ def get_npu_profiler(
if role:
profile_save_path = os.path.join(profile_save_path, role)
+ init_method = torch_npu.profiler._ExperimentalConfig.__init__
+
+ # The ability to filter communication via mstx_domain_exclude depends on Profiler versions 630 and later. Compatibi... | verl/utils/profiler/mstx_profile.py | 26 | Python | 0.429 | suggestion | 162 | 51 | 51 | false | [perf] fix: modify the NPU profiler default configuration | 4,475 | volcengine/verl | 16,907 | Python | mengchengTang | tardis-key |
The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to None.
"""
if profile_level == "level_none":
level = torch_npu.profiler.ProfilerLevel.Level_none
elif profile_level == "level0":
level... | version 630 might be a strange description for public Ascend developer, maybe change the description to `torch_npu published after 2025/xx/xx`? | The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to None.
"""
if profile_level == "level_none":
level = torch_npu.profiler.ProfilerLevel.Level_none
elif profile_level == "level0":
level... | @@ -128,12 +129,20 @@ def get_npu_profiler(
if role:
profile_save_path = os.path.join(profile_save_path, role)
+ init_method = torch_npu.profiler._ExperimentalConfig.__init__
+
+ # The ability to filter communication via mstx_domain_exclude depends on Profiler versions 630 and later. Compatibi... | verl/utils/profiler/mstx_profile.py | 26 | Python | 0.571 | question | 143 | 51 | 51 | false | [perf] fix: modify the NPU profiler default configuration | 4,475 | volcengine/verl | 16,907 | Python | FightingZhen | tardis-key |
The path to save the collected data.
analysis (bool):
Whether to enables automatic data parsing.
role (str, optional):
The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to No... | Suggest using double quotes
```suggestion
if version.parse(torch_npu.__version__) < version.parse("2.1"):
``` | analysis (bool):
Whether to enables automatic data parsing.
role (str, optional):
The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to None.
"""
if profile_level == "level_none":... | @@ -128,12 +130,16 @@ def get_npu_profiler(
if role:
profile_save_path = os.path.join(profile_save_path, role)
+ # The ability to filter communication via mstx_domain_exclude requires torch_npu 2.1 or higher. Compatibility issues may arise with older versions.
+ if version.parse(torch_npu.__versio... | verl/utils/profiler/mstx_profile.py | 26 | Python | 0.714 | suggestion | 113 | 51 | 51 | false | [perf] fix: modify the NPU profiler default configuration | 4,475 | volcengine/verl | 16,907 | Python | FightingZhen | tardis-key |
analysis (bool):
Whether to enables automatic data parsing.
role (str, optional):
The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to None.
"""
if profile_level == "level_none":... | package name should be `torch_npu`, not `Torch_npu`
```suggestion
raise RuntimeError("torch_npu==2.1 or higher is required to use mstx_domain_exclude")
``` | Whether to enables automatic data parsing.
role (str, optional):
The role of the current data collection. Defaults to None.
profile_step(str, optional):
The current training step. Defaults to None.
"""
if profile_level == "level_none":
level = torch_np... | @@ -128,12 +130,16 @@ def get_npu_profiler(
if role:
profile_save_path = os.path.join(profile_save_path, role)
+ # The ability to filter communication via mstx_domain_exclude requires torch_npu 2.1 or higher. Compatibility issues may arise with older versions.
+ if version.parse(torch_npu.__versio... | verl/utils/profiler/mstx_profile.py | 26 | Python | 0.929 | suggestion | 164 | 51 | 51 | false | [perf] fix: modify the NPU profiler default configuration | 4,475 | volcengine/verl | 16,907 | Python | FightingZhen | tardis-key |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.