Gemini 3.7 Flash · RL

R04 · RL adapt

Correctness rejected

LFM2-1.2B model adapt GRPO 2dev · Model Adaptation

—PERFORMANCE RATIO
184TOOL EVENTS
3TEXT PATCHES
0BINARY NAMES

01 / PROCESS MAP

Tool activity

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

InspectEditValidateExecuteBuildProfileRollbackOther
144Inspect
9Edit
11Validate
20Other

02 / EVENT SEQUENCE

Event timeline

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.

Show event timelineHide event timeline79 groups · 184 calls

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>.

Main agent

  1. Inspect · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0001–#0001

    echo <val>ls -l -a <val>
  2. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    2 calls · #0002–#0003

    Read <path>
  3. Inspect · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0004–#0004

    ls -l -a <path> <path> <path>
  4. Inspect · Reward & policy updates

    Requested file and log inspection related to reward & policy updates.

    1 call · #0005–#0005

    Read <path>
  5. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    3 calls · #0006–#0008

    Read <path>
  6. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0009–#0009

    Read <path>
  7. Other · Parallelism & communication

    Requested script or workload execution related to parallelism & communication.

    1 call · #0010–#0010

    python3 -c <script>
  8. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0011–#0011

    Read <path>
  9. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0012–#0012

    python3 -c <script>
  10. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0013–#0014

    Read <path>
  11. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0015–#0015

    bash <script>
  12. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    6 calls · #0016–#0021

    Search <pattern> <path>Read <path>
  13. Validate · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0022–#0022

    bash <script>
  14. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    10 calls · #0023–#0032

    Search <pattern> <path>Read <path>
  15. Inspect · Convolution & sequence boundaries

    Requested source searches related to convolution & sequence boundaries.

    1 call · #0033–#0033

    Search <pattern> <path>
  16. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0034–#0034

    Read <path>
  17. Inspect · Attention kernels

    Requested source searches related to attention kernels.

    2 calls · #0035–#0036

    Search <pattern> <path>
  18. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    9 calls · #0037–#0045

    Read <path>Search <pattern> <path>
  19. Inspect · Convolution & sequence boundaries

    Requested file and log inspection and source searches related to convolution & sequence boundaries.

    2 calls · #0046–#0047

    Read <path>Search <pattern> <path>
  20. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0048–#0048

    Read <path>
  21. Inspect · Convolution & sequence boundaries

    Requested file and log inspection related to convolution & sequence boundaries.

    2 calls · #0049–#0050

    Read <path>
  22. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    6 calls · #0051–#0056

    Search <pattern> <path>Read <path>
  23. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0057–#0057

    python3 -c <script>
  24. Inspect · Source & workspace

    1 tool error

    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>
  25. Inspect · Checkpoints & weight state

    Requested source searches related to checkpoints & weight state.

    1 call · #0070–#0070

    Search <pattern> <path>
  26. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    2 calls · #0071–#0072

    python3 -c <script>
  27. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0073–#0073

    Read <path>
  28. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0074–#0074

    Edit <path>
  29. Validate · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0075–#0075

    bash <script>
  30. Inspect · Source & workspace

    Requested file and log inspection and workspace inspection related to source & workspace.

    2 calls · #0076–#0077

    Read <path>ls -l -a <path> <path>
  31. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    3 calls · #0078–#0080

    Read <path>
  32. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    6 calls · #0081–#0086

    Read <path>Search <pattern> <path>
  33. Other · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0087–#0087

    bash <script>
  34. Inspect · Source & workspace

    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>
  35. Validate · Benchmark & validation setup

    Requested tool activity related to benchmark & validation setup.

    1 call · #0092–#0092

    shell <script>
  36. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    4 calls · #0093–#0096

    Read <path>Search <pattern> <path>
  37. Inspect · Optimizer & gradients

    Requested source searches related to optimizer & gradients.

    1 call · #0097–#0097

    Search <pattern> <path>
  38. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    6 calls · #0098–#0103

    Read <path>Search <pattern> <path>
  39. Validate · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0104–#0104

    python3 -c <script>
  40. Inspect · Convolution & sequence boundaries

    Requested tool activity related to convolution & sequence boundaries.

    1 call · #0105–#0105

    shell <script>
  41. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0106–#0107

    Read <path>
  42. Edit · Source & workspace

    Requested code edits related to source & workspace.

    2 calls · #0108–#0109

    Edit <path>
  43. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    3 calls · #0110–#0112

    Read <path>
  44. Other · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0113–#0113

    bash <script>
  45. Validate · Benchmark & validation setup

    Requested tool activity related to benchmark & validation setup.

    1 call · #0114–#0114

    shell <script>
  46. Validate · Reward & policy updates

    Requested tool activity related to reward & policy updates.

    1 call · #0115–#0115

    shell <script>
  47. Validate · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    2 calls · #0116–#0117

    shell <script>python3 -c <script>
  48. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0118–#0119

    Read <path>
  49. Inspect · Convolution & sequence boundaries

    Requested file and log inspection and source searches related to convolution & sequence boundaries.

    6 calls · #0120–#0125

    Read <path>Search <pattern> <path>
  50. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0126–#0126

    Read <path>
  51. Edit · Convolution & sequence boundaries

    Requested code edits related to convolution & sequence boundaries.

    1 call · #0127–#0127

    Edit <path>
  52. Other · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0128–#0128

    bash <script>
  53. Validate · Benchmark & validation setup

    Requested tool activity related to benchmark & validation setup.

    2 calls · #0129–#0130

    shell <script>
  54. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0131–#0132

    Read <path>
  55. Inspect · Convolution & sequence boundaries

    Requested source searches related to convolution & sequence boundaries.

    1 call · #0133–#0133

    Search <pattern> <path>
  56. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0134–#0134

    Read <path>
  57. Inspect · Convolution & sequence boundaries

    Requested file and log inspection related to convolution & sequence boundaries.

    4 calls · #0135–#0138

    Read <path>
  58. Other · Convolution & sequence boundaries

    Requested script or workload execution related to convolution & sequence boundaries.

    3 calls · #0139–#0141

    python3 -c <script>shell <script>
  59. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    3 calls · #0142–#0144

    Search <pattern> <path>Read <path>
  60. Other · Convolution & sequence boundaries

    Requested tool activity related to convolution & sequence boundaries.

    1 call · #0145–#0145

    shell <script>
  61. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0146–#0146

    Read <path>
  62. Other · Convolution & sequence boundaries

    Requested tool activity related to convolution & sequence boundaries.

    1 call · #0147–#0147

    shell <script>
  63. Inspect · Source & workspace

    Requested source searches related to source & workspace.

    1 call · #0148–#0148

    Search <pattern> <path>
  64. Inspect · Convolution & sequence boundaries

    Requested file and log inspection related to convolution & sequence boundaries.

    1 call · #0149–#0149

    Read <path>
  65. Edit · Convolution & sequence boundaries

    Requested code edits related to convolution & sequence boundaries.

    1 call · #0150–#0150

    Edit <path>
  66. Inspect · Convolution & sequence boundaries

    Requested file and log inspection related to convolution & sequence boundaries.

    1 call · #0151–#0151

    Read <path>
  67. Edit · Convolution & sequence boundaries

    Requested code edits related to convolution & sequence boundaries.

    1 call · #0152–#0152

    Edit <path>
  68. Other · Convolution & sequence boundaries

    Requested tool activity related to convolution & sequence boundaries.

    4 calls · #0153–#0156

    shell <script>
  69. Inspect · Convolution & sequence boundaries

    Requested file and log inspection related to convolution & sequence boundaries.

    1 call · #0157–#0157

    Read <path>
  70. Edit · Convolution & sequence boundaries

    Requested code edits related to convolution & sequence boundaries.

    1 call · #0158–#0158

    Edit <path>
  71. Other · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0159–#0159

    bash <script>
  72. Validate · Benchmark & validation setup

    Requested tool activity related to benchmark & validation setup.

    1 call · #0160–#0160

    shell <script>
  73. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    2 calls · #0161–#0162

    Search <pattern> <path>Read <path>
  74. Inspect · Checkpoints & weight state

    Requested source searches and file and log inspection related to checkpoints & weight state.

    3 calls · #0163–#0165

    Search <pattern> <path>Read <path>
  75. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    14 calls · #0166–#0179

    Read <path>Search <pattern> <path>
  76. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0180–#0180

    Edit <path>
  77. Inspect · Source & workspace

    Requested source searches related to source & workspace.

    2 calls · #0181–#0182

    Search <pattern> <path>
  78. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0183–#0183

    Edit <path>
  79. Other · Benchmark & validation setup

    1 missing return

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0184–#0184

    bash <script>

03 / CANDIDATE ARTIFACT

Text patches & binary names

Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.

transformers · 2 changed files

Base commit: 76b3bd40ca74d26f0c2bffaf42ed01f422fc70f6

diff --git a/src/transformers/models/lfm2/modeling_lfm2.py b/src/transformers/models/lfm2/modeling_lfm2.pyindex f9ae8deeb86523771939b52fee6531c60fac5bfa..0a8d192be56d4283273e65dbea60bcc0ceb64bbb 100644--- a/src/transformers/models/lfm2/modeling_lfm2.py+++ b/src/transformers/models/lfm2/modeling_lfm2.py@@ -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))diff --git a/src/transformers/models/lfm2/modular_lfm2.py b/src/transformers/models/lfm2/modular_lfm2.pyindex eab687df803a274d1a9e0d137e1b802abf9d4dbb..12f36f5182e2c984ab99baa9c832834355f9c892 100644--- a/src/transformers/models/lfm2/modular_lfm2.py+++ b/src/transformers/models/lfm2/modular_lfm2.py@@ -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))
vllm · 2 changed files

Base commit: 5a0277de14789b245c781911b3119ed6af901b7b

diff --git a/vllm/model_executor/models/lfm2.py b/vllm/model_executor/models/lfm2.pyindex 453173fc817d06bf6273280437a668a0b0a9959c..3e396db04b7e15dd17dc38cfe2700a555ad217b0 100644--- a/vllm/model_executor/models/lfm2.py+++ b/vllm/model_executor/models/lfm2.py@@ -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)diff --git a/vllm/model_executor/models/lfm2_moe.py b/vllm/model_executor/models/lfm2_moe.pyindex b7ca710eadcb12d21cfea4c78e363e41c0c4939b..607c473a7efaa7ce9f7550bf36af207c3bc7bbfb 100644--- a/vllm/model_executor/models/lfm2_moe.py+++ b/vllm/model_executor/models/lfm2_moe.py@@ -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()
vllm_ascend · 2 changed files

Base commit: f649187194c44d86415d1ddfa49359e824932c9a

diff --git a/vllm_ascend/ops/triton/mamba/causal_conv1d.py b/vllm_ascend/ops/triton/mamba/causal_conv1d.pyindex 4c9a0c001e4c06a4ff906e4b3094c46170fca77d..136e282738f0efb964553c59f14a6d76bac279bf 100644--- a/vllm_ascend/ops/triton/mamba/causal_conv1d.py+++ b/vllm_ascend/ops/triton/mamba/causal_conv1d.py@@ -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_tensordiff --git a/vllm_ascend/patch/platform/patch_mamba_config.py b/vllm_ascend/patch/platform/patch_mamba_config.pyindex 775e54743769e9f48de6fa316f05a48816b79f7d..acf630c256382ce798698ad3ca170947b53cc8da 100644--- a/vllm_ascend/patch/platform/patch_mamba_config.py+++ b/vllm_ascend/patch/platform/patch_mamba_config.py@@ -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+