Inspect · Source & workspace
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val>Gemini 3.7 Flash · RL
LFM2-1.2B model adapt GRPO 2dev · Model Adaptation
01 / PROCESS MAP
Each row shows one agent’s tool events in its own recorded order. Colors show broad activities; bar widths do not represent duration.
Main agentGemini 3.7 Flash · 184 visible calls
02 / EVENT SEQUENCE
Requests are grouped by agent, activity and topic. Delegations open into child branches. Summaries describe visible requests; tool errors and missing responses are flagged. A recorded response does not establish command success or a performance improvement.
Scroll within this panel to view all events. Command sketches retain familiar programs and options. Values become <val> or <n>; paths, addresses and script bodies are hidden as <path>, <url> and <script>.
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val>Requested file and log inspection related to task requirements.
2 calls · #0002–#0003
Read <path>Requested workspace inspection related to source & workspace.
1 call · #0004–#0004
ls -l -a <path> <path> <path>Requested file and log inspection related to reward & policy updates.
1 call · #0005–#0005
Read <path>Requested file and log inspection related to source & workspace.
3 calls · #0006–#0008
Read <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0009–#0009
Read <path>Requested script or workload execution related to parallelism & communication.
1 call · #0010–#0010
python3 -c <script>Requested file and log inspection related to source & workspace.
1 call · #0011–#0011
Read <path>Requested script or workload execution related to source & workspace.
1 call · #0012–#0012
python3 -c <script>Requested file and log inspection related to source & workspace.
2 calls · #0013–#0014
Read <path>Requested script or workload execution related to source & workspace.
1 call · #0015–#0015
bash <script>Requested source searches and file and log inspection related to source & workspace.
6 calls · #0016–#0021
Search <pattern> <path>Read <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0022–#0022
bash <script>Requested source searches and file and log inspection related to source & workspace.
10 calls · #0023–#0032
Search <pattern> <path>Read <path>Requested source searches related to convolution & sequence boundaries.
1 call · #0033–#0033
Search <pattern> <path>Requested file and log inspection related to source & workspace.
1 call · #0034–#0034
Read <path>Requested source searches related to attention kernels.
2 calls · #0035–#0036
Search <pattern> <path>Requested file and log inspection and source searches related to source & workspace.
9 calls · #0037–#0045
Read <path>Search <pattern> <path>Requested file and log inspection and source searches related to convolution & sequence boundaries.
2 calls · #0046–#0047
Read <path>Search <pattern> <path>Requested file and log inspection related to source & workspace.
1 call · #0048–#0048
Read <path>Requested file and log inspection related to convolution & sequence boundaries.
2 calls · #0049–#0050
Read <path>Requested source searches and file and log inspection related to source & workspace.
6 calls · #0051–#0056
Search <pattern> <path>Read <path>Requested script or workload execution related to source & workspace.
1 call · #0057–#0057
python3 -c <script>Requested source searches, workspace inspection and file and log inspection related to source & workspace.
12 calls · #0058–#0069
Search <pattern> <path>Find <pattern>Read <path>Requested source searches related to checkpoints & weight state.
1 call · #0070–#0070
Search <pattern> <path>Requested script or workload execution related to source & workspace.
2 calls · #0071–#0072
python3 -c <script>Requested file and log inspection related to source & workspace.
1 call · #0073–#0073
Read <path>Requested code edits related to source & workspace.
1 call · #0074–#0074
Edit <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0075–#0075
bash <script>Requested file and log inspection and workspace inspection related to source & workspace.
2 calls · #0076–#0077
Read <path>ls -l -a <path> <path>Requested file and log inspection related to benchmark & validation setup.
3 calls · #0078–#0080
Read <path>Requested file and log inspection and source searches related to source & workspace.
6 calls · #0081–#0086
Read <path>Search <pattern> <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0087–#0087
bash <script>Requested workspace inspection, source searches and file and log inspection related to source & workspace.
4 calls · #0088–#0091
ls -l -a <path>Search <pattern> <path>Read <path>Requested tool activity related to benchmark & validation setup.
1 call · #0092–#0092
shell <script>Requested file and log inspection and source searches related to source & workspace.
4 calls · #0093–#0096
Read <path>Search <pattern> <path>Requested source searches related to optimizer & gradients.
1 call · #0097–#0097
Search <pattern> <path>Requested file and log inspection and source searches related to source & workspace.
6 calls · #0098–#0103
Read <path>Search <pattern> <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0104–#0104
python3 -c <script>Requested tool activity related to convolution & sequence boundaries.
1 call · #0105–#0105
shell <script>Requested file and log inspection related to source & workspace.
2 calls · #0106–#0107
Read <path>Requested code edits related to source & workspace.
2 calls · #0108–#0109
Edit <path>Requested file and log inspection related to source & workspace.
3 calls · #0110–#0112
Read <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0113–#0113
bash <script>Requested tool activity related to benchmark & validation setup.
1 call · #0114–#0114
shell <script>Requested tool activity related to reward & policy updates.
1 call · #0115–#0115
shell <script>Requested script or workload execution related to benchmark & validation setup.
2 calls · #0116–#0117
shell <script>python3 -c <script>Requested file and log inspection related to source & workspace.
2 calls · #0118–#0119
Read <path>Requested file and log inspection and source searches related to convolution & sequence boundaries.
6 calls · #0120–#0125
Read <path>Search <pattern> <path>Requested file and log inspection related to source & workspace.
1 call · #0126–#0126
Read <path>Requested code edits related to convolution & sequence boundaries.
1 call · #0127–#0127
Edit <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0128–#0128
bash <script>Requested tool activity related to benchmark & validation setup.
2 calls · #0129–#0130
shell <script>Requested file and log inspection related to source & workspace.
2 calls · #0131–#0132
Read <path>Requested source searches related to convolution & sequence boundaries.
1 call · #0133–#0133
Search <pattern> <path>Requested file and log inspection related to source & workspace.
1 call · #0134–#0134
Read <path>Requested file and log inspection related to convolution & sequence boundaries.
4 calls · #0135–#0138
Read <path>Requested script or workload execution related to convolution & sequence boundaries.
3 calls · #0139–#0141
python3 -c <script>shell <script>Requested source searches and file and log inspection related to source & workspace.
3 calls · #0142–#0144
Search <pattern> <path>Read <path>Requested tool activity related to convolution & sequence boundaries.
1 call · #0145–#0145
shell <script>Requested file and log inspection related to source & workspace.
1 call · #0146–#0146
Read <path>Requested tool activity related to convolution & sequence boundaries.
1 call · #0147–#0147
shell <script>Requested source searches related to source & workspace.
1 call · #0148–#0148
Search <pattern> <path>Requested file and log inspection related to convolution & sequence boundaries.
1 call · #0149–#0149
Read <path>Requested code edits related to convolution & sequence boundaries.
1 call · #0150–#0150
Edit <path>Requested file and log inspection related to convolution & sequence boundaries.
1 call · #0151–#0151
Read <path>Requested code edits related to convolution & sequence boundaries.
1 call · #0152–#0152
Edit <path>Requested tool activity related to convolution & sequence boundaries.
4 calls · #0153–#0156
shell <script>Requested file and log inspection related to convolution & sequence boundaries.
1 call · #0157–#0157
Read <path>Requested code edits related to convolution & sequence boundaries.
1 call · #0158–#0158
Edit <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0159–#0159
bash <script>Requested tool activity related to benchmark & validation setup.
1 call · #0160–#0160
shell <script>Requested source searches and file and log inspection related to source & workspace.
2 calls · #0161–#0162
Search <pattern> <path>Read <path>Requested source searches and file and log inspection related to checkpoints & weight state.
3 calls · #0163–#0165
Search <pattern> <path>Read <path>Requested file and log inspection and source searches related to source & workspace.
14 calls · #0166–#0179
Read <path>Search <pattern> <path>Requested code edits related to source & workspace.
1 call · #0180–#0180
Edit <path>Requested source searches related to source & workspace.
2 calls · #0181–#0182
Search <pattern> <path>Requested code edits related to source & workspace.
1 call · #0183–#0183
Edit <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0184–#0184
bash <script>03 / CANDIDATE ARTIFACT
Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
Base commit: 76b3bd40ca74d26f0c2bffaf42ed01f422fc70f6
@@ -491,6 +491,7 @@ class Lfm2ShortConv(nn.Module): x: torch.Tensor, past_key_values: Lfm2HybridConvCache | None = None, attention_mask: torch.Tensor | None = None,+ position_ids: torch.LongTensor | None = None, ): seqlen = x.shape[1] @@ -526,6 +527,18 @@ class Lfm2ShortConv(nn.Module): conv_out = self.conv(Bx)[..., :seqlen] + if position_ids is not None and Bx.shape[-1] > 1:+ p_ids = position_ids+ if p_ids.dim() == 3:+ p_ids = p_ids[0]+ W = self.conv.weight+ for k in range(1, self.L_cache):+ W_k = W[:, 0, self.L_cache - 1 - k].unsqueeze(-1)+ Bx_prev_k = F.pad(Bx[:, :, :-k], (k, 0))+ invalid_mask_k = (p_ids < k).unsqueeze(1)+ correction_k = W_k * Bx_prev_k * invalid_mask_k+ conv_out = conv_out - correction_k+ y = C * conv_out y = y.transpose(-1, -2).contiguous() y = self.out_proj(y)@@ -536,10 +549,11 @@ class Lfm2ShortConv(nn.Module): hidden_states: torch.Tensor, past_key_values: Lfm2HybridConvCache | None = None, attention_mask: torch.Tensor | None = None,+ position_ids: torch.LongTensor | None = None, ): if is_fast_path_available and "cuda" in hidden_states.device.type and not is_torchdynamo_compiling(): return self.cuda_kernels_forward(hidden_states, past_key_values, attention_mask)- return self.slow_forward(hidden_states, past_key_values, attention_mask)+ return self.slow_forward(hidden_states, past_key_values, attention_mask, position_ids) class Lfm2DecoderLayer(GradientCheckpointingLayer):@@ -579,6 +593,7 @@ class Lfm2DecoderLayer(GradientCheckpointingLayer): hidden_states=self.operator_norm(hidden_states), past_key_values=past_key_values, attention_mask=attention_mask,+ position_ids=position_ids, ) hidden_states = hidden_states + residual hidden_states = hidden_states + self.feed_forward(self.ffn_norm(hidden_states))@@ -326,6 +326,7 @@ class Lfm2ShortConv(nn.Module): x: torch.Tensor, past_key_values: Lfm2HybridConvCache | None = None, attention_mask: torch.Tensor | None = None,+ position_ids: torch.LongTensor | None = None, ): seqlen = x.shape[1] @@ -361,6 +362,18 @@ class Lfm2ShortConv(nn.Module): conv_out = self.conv(Bx)[..., :seqlen] + if position_ids is not None and Bx.shape[-1] > 1:+ p_ids = position_ids+ if p_ids.dim() == 3:+ p_ids = p_ids[0]+ W = self.conv.weight+ for k in range(1, self.L_cache):+ W_k = W[:, 0, self.L_cache - 1 - k].unsqueeze(-1)+ Bx_prev_k = F.pad(Bx[:, :, :-k], (k, 0))+ invalid_mask_k = (p_ids < k).unsqueeze(1)+ correction_k = W_k * Bx_prev_k * invalid_mask_k+ conv_out = conv_out - correction_k+ y = C * conv_out y = y.transpose(-1, -2).contiguous() y = self.out_proj(y)@@ -371,10 +384,11 @@ class Lfm2ShortConv(nn.Module): hidden_states: torch.Tensor, past_key_values: Lfm2HybridConvCache | None = None, attention_mask: torch.Tensor | None = None,+ position_ids: torch.LongTensor | None = None, ): if is_fast_path_available and "cuda" in hidden_states.device.type and not is_torchdynamo_compiling(): return self.cuda_kernels_forward(hidden_states, past_key_values, attention_mask)- return self.slow_forward(hidden_states, past_key_values, attention_mask)+ return self.slow_forward(hidden_states, past_key_values, attention_mask, position_ids) class Lfm2DecoderLayer(GradientCheckpointingLayer):@@ -414,6 +428,7 @@ class Lfm2DecoderLayer(GradientCheckpointingLayer): hidden_states=self.operator_norm(hidden_states), past_key_values=past_key_values, attention_mask=attention_mask,+ position_ids=position_ids, ) hidden_states = hidden_states + residual hidden_states = hidden_states + self.feed_forward(self.ffn_norm(hidden_states))Base commit: 5a0277de14789b245c781911b3119ed6af901b7b
@@ -533,4 +533,4 @@ class Lfm2ForCausalLM( self, skip_prefixes=(["lm_head."] if self.config.tie_word_embeddings else None), )- return loader.load_weights(weights)+ return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)@@ -762,7 +762,7 @@ class Lfm2MoeForCausalLM( self, skip_prefixes=(["lm_head."] if self.config.tie_word_embeddings else None), )- return loader.load_weights(weights)+ return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper) def get_expert_mapping(self) -> list[tuple[str, str, int, str]]: return self.model.get_expert_mapping()Base commit: f649187194c44d86415d1ddfa49359e824932c9a
@@ -11,7 +11,7 @@ from typing import Any import torch import torch.nn.functional as F-from vllm.distributed import get_pcp_group+from vllm.distributed import get_pcp_group, parallel_state from vllm.forward_context import get_forward_context from vllm.triton_utils import tl, triton from vllm.v1.attention.backends.utils import PAD_SLOT_ID # type: ignore@@ -97,14 +97,6 @@ def causal_conv1d_fn( indices 0 and 3 out: (batch, dim, seqlen) """- forward_context = get_forward_context()- num_decodes = 0- attn_metadata = forward_context.attn_metadata- if attn_metadata is not None and isinstance(attn_metadata, dict):- attn_metadata = next(iter(attn_metadata.values()), None)- if attn_metadata is not None:- num_decodes = attn_metadata.num_decodes- if activation not in [None, "silu", "swish"]: raise NotImplementedError("activation must be None, silu, or swish") if x.stride(-1) != 1:@@ -117,18 +109,22 @@ def causal_conv1d_fn( seqlens = seqlens.tolist() splits = torch.split(x, seqlens, dim=-1) width = weight.shape[1]- last_width_prefill_x = extract_last_width(x, query_start_loc[num_decodes:], conv_states.shape[-1])+ last_width_prefill_x = extract_last_width(x, query_start_loc, conv_states.shape[-1]) - if get_pcp_group().world_size > 1:+ has_pcp = getattr(parallel_state, "_PCP", None) is not None and parallel_state._PCP.world_size > 1+ if has_pcp: all_last_width_prefill_x = get_pcp_group().all_gather(last_width_prefill_x.unsqueeze(0).contiguous(), 0) pcp_rank = get_pcp_group().rank_in_group if pcp_rank > 0:- conv_states[cache_indices[num_decodes:]] = all_last_width_prefill_x[pcp_rank - 1, ...]+ conv_states[cache_indices] = all_last_width_prefill_x[pcp_rank - 1, ...] for i in range(len(seqlens)): x_s = splits[i] if cache_indices[i] == PAD_SLOT_ID: continue+ init_state = None+ if has_initial_state is not None and bool(has_initial_state[i]):+ init_state = conv_states[cache_indices[i]][..., : (width - 1)] out_ref_b.append( causal_conv1d_ref( x_s,@@ -137,12 +133,12 @@ def causal_conv1d_fn( activation=activation, return_final_states=True, final_states_out=conv_states[cache_indices[i]][..., : (width - 1)].unsqueeze(0),- initial_states=conv_states[cache_indices[i]][..., : (width - 1)],+ initial_states=init_state, ) ) - if get_pcp_group().world_size > 1:- conv_states[cache_indices[num_decodes:]] = all_last_width_prefill_x[-1, ...]+ if has_pcp:+ conv_states[cache_indices] = all_last_width_prefill_x[-1, ...] out_ref.append(torch.cat([t[0] for t in out_ref_b], dim=-1)) out_ref_tensor = torch.cat(out_ref, dim=0) return out_ref_tensor@@ -1,12 +1,15 @@ # mypy: ignore-errors-import math+# SPDX-License-Identifier: Apache-2.0+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project+from math import lcm import vllm.model_executor.models.config from vllm.logger import logger from vllm.model_executor.models import ModelRegistry from vllm.model_executor.models.config import MambaModelConfig from vllm.utils.math_utils import cdiv-from vllm.utils.torch_utils import STR_DTYPE_TO_TORCH_DTYPE, get_dtype_size+from vllm.utils.torch_utils import STR_DTYPE_TO_TORCH_DTYPE+from vllm.v1.kv_cache_interface import FullAttentionSpec, MambaSpec @classmethod@@ -21,9 +24,10 @@ def verify_and_update_config(cls, vllm_config) -> None: Args: vllm_config: vLLM Config """+ # Save the user input before it gets modified by MambaModelConfig+ mamba_block_size = vllm_config.cache_config.mamba_block_size # Enable FULL_AND_PIECEWISE by default MambaModelConfig.verify_and_update_config(vllm_config)- cache_config = vllm_config.cache_config model_config = vllm_config.model_config parallel_config = vllm_config.parallel_config@@ -33,63 +37,68 @@ def verify_and_update_config(cls, vllm_config) -> None: else: kv_cache_dtype = STR_DTYPE_TO_TORCH_DTYPE[cache_config.cache_dtype] - kernel_block_size = 128- # get attention block size- attn_num_kv_heads = model_config.get_num_kv_heads(parallel_config)- attn_head_size = model_config.get_head_size()- attn_single_token_k_page_size = attn_head_size * attn_num_kv_heads * get_dtype_size(kv_cache_dtype)+ # get attention page size (for 1 token)+ if model_config.use_mla:+ raise RuntimeError("MLA is not supported on Ascend currently.")+ kernel_block_alignment_size = 128+ attn_page_size_1_token = FullAttentionSpec(+ block_size=1,+ num_kv_heads=model_config.get_num_kv_heads(parallel_config),+ head_size=model_config.get_head_size(),+ dtype=kv_cache_dtype,+ ).page_size_bytes model_cls, _ = ModelRegistry.resolve_model_cls( model_config.architecture, model_config=model_config, ) - # get mamba block size- mamba_shapes = model_cls.get_mamba_state_shape_from_config(vllm_config)- mamba_dtypes = model_cls.get_mamba_state_dtype_from_config(vllm_config)- mamba_sizes = []- for shape, dtype in zip(mamba_shapes, mamba_dtypes):- mamba_sizes.append(math.prod(shape) * get_dtype_size(dtype))- ssm_block_page_size, conv_block_page_size = max(mamba_sizes), min(mamba_sizes)-- # NOTE(zxr): because of the limit of Ascend Hardware, we need to keep- # all cache tensors contiguous, so we align the page size of ssm_block- # and single attn_block- attn_block_size = kernel_block_size * cdiv(ssm_block_page_size, kernel_block_size * attn_single_token_k_page_size)- assert attn_single_token_k_page_size * attn_block_size == ssm_block_page_size, (- "Cannot align ssm_page_size and attn_page_size."- )+ # get mamba page size+ mamba_page_size = MambaSpec(+ shapes=model_cls.get_mamba_state_shape_from_config(vllm_config),+ dtypes=model_cls.get_mamba_state_dtype_from_config(vllm_config),+ block_size=-1,+ ).page_size_bytes - # override attention block size if either (a) the- # user has not set it or (b) the user has set it- # too small.+ # Model may be marked as is_hybrid+ # but mamba is skipped via config,+ # return directly+ if mamba_page_size == 0:+ return+ if cache_config.mamba_cache_mode == "all":+ base_chunk_size = mamba_block_size or model_config.get_mamba_chunk_size()+ attn_tokens_per_mamba_state = cdiv(mamba_page_size, attn_page_size_1_token)+ chunk_size = lcm(base_chunk_size, kernel_block_alignment_size)+ attn_block_size = chunk_size * cdiv(attn_tokens_per_mamba_state, chunk_size)+ cache_config.mamba_block_size = attn_block_size+ else:+ attn_block_size = kernel_block_alignment_size * cdiv(+ mamba_page_size, kernel_block_alignment_size * attn_page_size_1_token+ ) if cache_config.block_size is None or cache_config.block_size < attn_block_size: cache_config.block_size = attn_block_size logger.info( "Setting attention block size to %d tokens to ensure that attention page size is >= mamba page size.", attn_block_size, )-- # compute new attention page size- attn_page_size = cache_config.block_size * 2 * attn_head_size * attn_num_kv_heads * get_dtype_size(kv_cache_dtype)-- # pad mamba page size for conv_blocks- if (- cache_config.mamba_page_size_padded is None- or cache_config.mamba_page_size_padded != attn_page_size + conv_block_page_size- ):- cache_config.mamba_page_size_padded = attn_page_size + conv_block_page_size- mamba_padding_pct = 100 * conv_block_page_size / cache_config.mamba_page_size_padded+ if cache_config.mamba_cache_mode == "align":+ cache_config.mamba_block_size = cache_config.block_size+ attn_page_size = cache_config.block_size * attn_page_size_1_token+ assert attn_page_size >= mamba_page_size+ if attn_page_size == mamba_page_size:+ # don't need to pad mamba page size+ return+ # pad mamba page size to exactly match attention+ if cache_config.mamba_page_size_padded is None or cache_config.mamba_page_size_padded != attn_page_size:+ cache_config.mamba_page_size_padded = attn_page_size+ mamba_padding_pct = 100 * (attn_page_size - mamba_page_size) / mamba_page_size logger.info( "Padding mamba page size by %.2f%% to ensure " "that mamba page size and attention page size are " "exactly equal.", mamba_padding_pct, )- if cache_config.enable_prefix_caching and cache_config.mamba_cache_mode == "align":- cache_config.mamba_block_size = cache_config.block_size- else:- cache_config.mamba_block_size = model_config.max_model_len vllm.model_executor.models.config.HybridAttentionMambaModelConfig.verify_and_update_config = verify_and_update_config+