Inspect · Task requirements
2 tool errorsRequested file and log inspection related to task requirements.
2 calls · #0123–#0124
Read <path>Kimi K3 · Serving
Offline throughput 1dev · Implementation Optimization
01 / PROCESS MAP
Compare agents on one time axis; overlapping spans line up vertically. Select an agent or bar to inspect its events.
Time starts at the first recorded activity. Select a bar or agent to open its events. Bars span the first and last recorded observation, including gaps; colored ticks mark tool calls. A hollow diamond marks a delegation whose child timing is unavailable.
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>. Each branch belongs to its named agent. Expand a delegation to inspect its child; branches can run concurrently. Call numbers preserve source order, not a serial schedule. Times are relative to the first recorded activity.
Requested file and log inspection related to task requirements.
2 calls · #0123–#0124
Read <path>Requested workspace inspection and file and log inspection related to source & workspace.
1 call · #0125–#0125
echo <val>ls -l -a <path> <n> > <path>head -n <n>Requested file and log inspection and workspace inspection related to task requirements.
3 calls · #0126–#0128
Read <path>cd <path>ls -l -a <val> <val> <val> <val> <val> <path> <path>cat <path>Requested file and log inspection related to source & workspace.
1 call · #0129–#0129
cd <path>cat <path>Requested file and log inspection related to task requirements.
1 call · #0130–#0130
cd <path>cat <path> <path>head -c <n> <path>echoRequested environment setup or inspection, source searches and script or workload execution related to source & workspace.
1 call · #0131–#0131
envgrep -E <val>sortecho <flag>python3 --versionwhich <val>Requested source searches, file and log inspection and workspace inspection related to source & workspace.
11 calls · #0132–#0142
cd <path>grep -n <val> <path>head -n <n>sed -n <val> <path>cat <path> <n> > <path>ls <path> <n> > <path>Requested script or workload execution, dependency and build commands and source searches related to dependencies & build setup.
1 call · #0143–#0143
python3 -c <script> <n> >& <path>pip list <n> > <path>grep -i -E <val>Requested script or workload execution, file and log inspection and source searches related to source & workspace.
5 calls · #0144–#0148
cd <path>bash <script> <n> >& <path>head -n <n>grep -n <val> <path>sed -n <val>sed -n <val> <path>sed -n <path> <path>env <vars> bash <script> <n> >& <path>python3 -m <module> <n> > <path>Requested workspace inspection, runtime inspection and file and log inspection related to device memory.
1 call · #0149–#0149
ls <path> <n> > <path>npu-smi info <n> > <path>head -n <n>python3 -c <script> <n> >& <path>tail -n <n>Requested script or workload execution related to benchmark & validation setup.
1 call · #0150–#0150
cd <path>bash <script> > <path> <n> >& <path>echo <val>Requested repository inspection, file and log inspection and workspace inspection related to attention kernels.
1 call · #0151–#0151
cd <path>git log --oneline <flag> <args>git status <flag>headls <path> <path>head -n <n>Requested source searches, file and log inspection and workspace inspection related to source & workspace.
2 calls · #0152–#0153
cd <path>grep -r -n <val> <path>headgrep -r -l -n <val> <path>ls <path> <n> > <path>find <path> -type <val>head -n <n>wc -l <path> <n> > <path>tail -n <n>Requested file and log inspection related to attention kernels.
1 call · #0154–#0154
cd <path>wc -l <path> <path> <path> <path> <n> > <path>Requested file and log inspection related to source & workspace.
2 calls · #0155–#0156
Read <path>Requested workspace inspection, source searches and file and log inspection related to runtime processes.
1 call · #0157–#0157
cd <path>ls <path>grep -r -n <val> <path>head -n <n>Requested file and log inspection and source searches related to source & workspace.
2 calls · #0158–#0159
Read <path>cd <path>wc -l <path>grep -n <val> <path>head -n <n>Requested source searches, file and log inspection and workspace inspection related to batching & scheduling.
1 call · #0160–#0160
cd <path>grep -r -n <val> <path>sed -n <path> <path> <n> > <path>head -n <n>ls <path>Requested file and log inspection related to source & workspace.
1 call · #0161–#0161
Read <path>Requested source searches and file and log inspection related to runtime processes.
3 calls · #0162–#0164
cd <path>grep -n <val> <path>sed -n <val>sed -n <val> <path>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0165–#0165
cd <path>grep -n <val> <path>headsed -n <path> <path>head -n <n>Requested file and log inspection related to runtime processes.
1 call · #0166–#0166
cd <path>sed -n <val> <path>Requested file and log inspection related to source & workspace.
1 call · #0167–#0167
cd <path>sed -n <val> <path>Requested file and log inspection, workspace inspection and script or workload execution related to benchmark & validation setup.
2 calls · #0168–#0169
cat <path>echo <flag>ls -l -a <path> <n> > <path>cat <path> <n> > <path>python3 -m <module>head -n <n>mkdir -p <path>cp <path> <path> <path>cd <path>bash <script> > <path> <n> >& <path>echo <val>Requested file and log inspection, source searches and workspace inspection related to source & workspace.
4 calls · #0170–#0173
cd <path>sed -n <val> <path>grep -n <val> <path>head -n <n>ls -l -atail -n <n> <val> <n> > <path>Requested task coordination related to source & workspace.
1 call · #0174–#0174
Delegate <task>Delegated by Main agent at call #0174. Observed activity +12:55–+32:25.
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
Find <pattern>Requested workspace inspection related to attention kernels.
1 call · #0002–#0002
Find <pattern>Requested source searches related to source & workspace.
1 call · #0003–#0003
Search <pattern> <path>Requested file and log inspection related to attention kernels.
1 call · #0004–#0004
Read <path>Requested file and log inspection related to source & workspace.
1 call · #0005–#0005
Read <path>Requested source searches and file and log inspection related to attention kernels.
5 calls · #0006–#0010
Search <pattern> <path>Read <path>Requested file and log inspection related to runtime processes.
2 calls · #0011–#0012
Read <path>Requested file and log inspection and source searches related to source & workspace.
2 calls · #0013–#0014
Read <path>Search <pattern> <path>Requested source searches related to attention kernels.
1 call · #0015–#0015
Search <pattern> <path>Requested source searches related to source & workspace.
1 call · #0016–#0016
Search <pattern> <path>Requested source searches related to attention kernels.
1 call · #0017–#0017
Search <pattern> <path>Requested file and log inspection related to source & workspace.
1 call · #0018–#0018
Read <path>Requested source searches and file and log inspection related to attention kernels.
3 calls · #0019–#0021
Search <pattern> <path>Read <path>Requested file and log inspection and workspace inspection related to source & workspace.
3 calls · #0022–#0024
Read <path>ls <path>Requested source searches related to attention kernels.
1 call · #0025–#0025
Search <pattern> <path>Requested source searches and file and log inspection related to source & workspace.
2 calls · #0026–#0027
Search <pattern> <path>Read <path>Requested file and log inspection related to attention kernels.
1 call · #0028–#0028
Read <path>Requested file and log inspection and source searches related to source & workspace.
7 calls · #0029–#0035
Read <path>Search <pattern> <path>Requested source searches and file and log inspection related to runtime processes.
3 calls · #0036–#0038
Search <pattern> <path>Read <path>Requested file and log inspection related to source & workspace.
1 call · #0039–#0039
Read <path>Requested source searches and file and log inspection related to attention kernels.
4 calls · #0040–#0043
Search <pattern> <path>Read <path>Requested file and log inspection related to source & workspace.
1 call · #0044–#0044
Read <path>Requested source searches and file and log inspection related to dependencies & build setup.
2 calls · #0045–#0046
Search <pattern> <path>Read <path>Requested file and log inspection related to source & workspace.
2 calls · #0047–#0048
Read <path>Requested source searches related to runtime processes.
1 call · #0049–#0049
Search <pattern> <path>Requested file and log inspection related to source & workspace.
2 calls · #0050–#0051
Read <path>Requested source searches and file and log inspection related to batching & scheduling.
6 calls · #0052–#0057
Search <pattern> <path>Read <path>Requested source searches and workspace inspection related to source & workspace.
2 calls · #0058–#0059
Search <pattern> <path>Find <pattern>Requested source searches related to batching & scheduling.
1 call · #0060–#0060
Search <pattern> <path>Requested workspace inspection related to source & workspace.
1 call · #0061–#0061
Find <pattern>Requested source searches related to runtime processes.
1 call · #0062–#0062
Search <pattern> <path>Requested source searches and file and log inspection related to batching & scheduling.
3 calls · #0063–#0065
Search <pattern> <path>Read <path>Requested source searches related to source & workspace.
1 call · #0066–#0066
Search <pattern> <path>Requested file and log inspection related to batching & scheduling.
2 calls · #0067–#0068
Read <path>Requested source searches related to latency & request handling.
1 call · #0069–#0069
Search <pattern> <path>Requested workspace inspection and file and log inspection related to source & workspace.
2 calls · #0070–#0071
ls -l -a <path>file <path>Read <path>Requested source searches and file and log inspection related to benchmark & validation setup.
2 calls · #0072–#0073
Search <pattern> <path>Read <path>Requested source searches related to runtime processes.
1 call · #0074–#0074
Search <pattern> <path>Requested file and log inspection related to source & workspace.
2 calls · #0075–#0076
Read <path>Requested source searches related to batching & scheduling.
1 call · #0077–#0077
Search <pattern> <path>Requested source searches related to source & workspace.
2 calls · #0078–#0079
Search <pattern> <path>Requested file and log inspection related to attention kernels.
1 call · #0080–#0080
Read <path>Requested source searches, file and log inspection and workspace inspection related to source & workspace.
10 calls · #0081–#0090
Search <pattern> <path>Read <path>ls <path>head -n <n>Requested source searches related to device memory.
1 call · #0091–#0091
Search <pattern> <path>Requested file and log inspection related to source & workspace.
2 calls · #0092–#0093
Read <path>Requested source searches related to attention kernels.
1 call · #0094–#0094
Search <pattern> <path>Requested source searches related to batching & scheduling.
1 call · #0095–#0095
Search <pattern> <path>Requested source searches related to source & workspace.
1 call · #0096–#0096
Search <pattern> <path>Requested file and log inspection related to attention kernels.
1 call · #0097–#0097
Read <path>Requested file and log inspection related to source & workspace.
1 call · #0098–#0098
Read <path>Requested file and log inspection related to attention kernels.
1 call · #0099–#0099
Read <path>Requested file and log inspection related to source & workspace.
1 call · #0100–#0100
Read <path>Requested source searches related to attention kernels.
1 call · #0101–#0101
Search <pattern> <path>Requested source searches related to device memory.
1 call · #0102–#0102
Search <pattern> <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0103–#0103
Read <path>Requested source searches related to source & workspace.
1 call · #0104–#0104
Search <pattern> <path>Requested file and log inspection related to device memory.
1 call · #0105–#0105
Read <path>Requested source searches and file and log inspection related to batching & scheduling.
3 calls · #0106–#0108
Search <pattern> <path>Read <path>Requested source searches related to source & workspace.
3 calls · #0109–#0111
Search <pattern> <path>Requested file and log inspection and source searches related to runtime processes.
2 calls · #0112–#0113
Read <path>Search <pattern> <path>Requested source searches and file and log inspection related to source & workspace.
5 calls · #0114–#0118
Search <pattern> <path>Read <path>Requested script or workload execution related to source & workspace.
1 call · #0119–#0119
python3 -c <script>Requested source searches and file and log inspection related to source & workspace.
3 calls · #0120–#0122
Search <pattern> <path>Read <path>Requested file and log inspection, script or workload execution and workspace file updates related to benchmark & validation setup.
2 calls · #0175–#0176
cat <path>echo <val>python3 -m <module> <path> <n> > <path>head -n <n>cd <path>python3 -c <script>cp <val> <path>tail -n <n> <val>Requested source searches and file and log inspection related to source & workspace.
2 calls · #0177–#0178
cd <path>grep -E <val> <val>head -n <n>sed -n <val> <path>Requested source searches and file and log inspection related to attention kernels.
1 call · #0179–#0179
cd <path>grep -n <val> <path>sed -n <path> <path>head -n <n>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0180–#0180
cd <path>grep -n <val> <path> <path> <n> > <path>headRequested file and log inspection related to source & workspace.
1 call · #0181–#0181
cd <path>sed -n <val> <path>Requested code edits related to source & workspace.
2 calls · #0182–#0183
Edit <path>Requested file and log inspection related to source & workspace.
1 call · #0184–#0184
Read <path>Requested script or workload execution related to source & workspace.
1 call · #0185–#0185
cd <path>python3 -c <script>Requested script or workload execution related to benchmark & validation setup.
1 call · #0186–#0186
cd <path>bash <script> > <path> <n> >& <path>echo <val>Requested file and log inspection related to source & workspace.
1 call · #0187–#0187
cd <path>sed -n <val> <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0188–#0188
cat <path> <n> > <path>echocat <path>Requested file and log inspection and workspace inspection related to source & workspace.
2 calls · #0189–#0190
cd <path>sed -n <val> <path>ls -thead -n <n>tail -n <n> <val> <n> > <path>cut <flag>Requested file and log inspection related to attention kernels.
1 call · #0191–#0191
cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to source & workspace.
2 calls · #0192–#0193
cd <path>grep -n <val> <path>head -n <n>tail -n <n> <val>cut <flag>Requested execution waits related to source & workspace.
1 call · #0194–#0194
Wait for <task>Requested script or workload execution and source searches related to benchmark & validation setup.
1 call · #0195–#0195
cd <path>python3 -c <script>grep -E <val> <val>cut <flag>Requested dependency and build commands, source searches and workspace inspection related to batching & scheduling.
1 call · #0196–#0196
which <val> <val> <n> > <path>pip list <n> > <path>grep -i -E <val>ls <path>Requested script or workload execution related to task requirements.
1 call · #0197–#0197
cd <path>python3 -c <script>Requested code edits related to source & workspace.
2 calls · #0198–#0199
Write <path>Edit <path>Requested environment setup or inspection, execution waits and source searches related to source & workspace.
2 calls · #0200–#0201
cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>sleep <n>grep -E <val> <path>tail -n <n>tail -n <n> <path>cut <flag>ps <val>grep -E <val>grep -v <val>awk <val>headRequested file and log inspection related to source & workspace.
1 call · #0202–#0202
Read task output <task>Requested source searches and file and log inspection related to source & workspace.
1 call · #0203–#0203
grep <flag> <args>head -n <n>Requested code edits related to source & workspace.
1 call · #0204–#0204
Write <path>Requested environment setup or inspection related to source & workspace.
1 call · #0205–#0205
cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>Requested execution waits, source searches and file and log inspection related to source & workspace.
1 call · #0206–#0206
sleep <n>grep -E <val> <path>tail -n <n> <path>cut <flag>Requested environment setup or inspection related to source & workspace.
1 call · #0207–#0207
cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>Requested execution waits, source searches and runtime inspection related to batching & scheduling.
2 calls · #0208–#0209
<command> <args>sleep <n>grep <val> <path>ps <flag>grep -i -E <val>grep -v <val>headhead -n <n>Requested file and log inspection, workspace inspection and runtime inspection related to source & workspace.
1 call · #0210–#0210
cat <path> <n> > <path>ls -l -a <path> <n> >& <path>ps -p <n> -o <val> <n> > <path><command> <args>head -n <n>Requested environment setup or inspection, execution waits and source searches related to batching & scheduling.
1 call · #0211–#0211
cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path><command> <args>sleep <n>grep <val> <path>head <flag>echo <val>tail -n <n>Requested source searches and file and log inspection related to source & workspace.
1 call · #0212–#0212
cd <path>grep -n <val> <path>sed -n <path> <path>head -n <n>Requested process termination, file and log inspection and environment setup or inspection related to batching & scheduling.
1 call · #0213–#0213
kill <val> <n> > <path>cd <path>cat > <path> <script>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>Requested file and log inspection related to batching & scheduling.
1 call · #0214–#0214
cd <path>sed -n <val> <path>Requested execution waits, source searches and file and log inspection related to source & workspace.
1 call · #0215–#0215
sleep <n>grep -E <val> <path>headls <path> <n> > <path>Requested script or workload execution, workspace file updates and environment setup or inspection related to batching & scheduling.
1 call · #0216–#0216
cd <path>python3 - <script>rm -rf <path>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>Requested file and log inspection related to batching & scheduling.
1 call · #0217–#0217
cd <path>sed -n <val> <path>Requested execution waits, source searches and workspace inspection related to source & workspace.
6 calls · #0218–#0223
sleep <n>grep -E <val> <path>ls -l -a <path> <n> > <path>headhead -n <n>find <path> -name <val>du <flag> <args>find <path> -type <val>grep <val> <path><command> <args>head <flag>echo <val>head -n <n> <val>cut <flag>python3 - <val> <script>Requested source searches and file and log inspection related to runtime processes.
1 call · #0224–#0224
cd <path>grep -r -n <val> <path> <path>head -n <n>Requested script or workload execution, source searches and file and log inspection related to source & workspace.
6 calls · #0225–#0230
cd <path>python3 - <script><command> <args>grep -E <val>sed <path>find <path> -name <val> -o -name <val>headhead <flag>python3 - <val> <script>grep -n <val> <path>head -n <n>Requested file and log inspection and source searches related to attention kernels.
1 call · #0231–#0231
cd <path>sed -n <path> <path>head -n <n>grep -r -n <val> <path>Requested file and log inspection and source searches related to source & workspace.
6 calls · #0232–#0237
cd <path>sed -n <val> <path>grep -n <val> <path>head -n <n>headgrep -r -n <val> <path>sed -n <path> <path>Requested code edits related to source & workspace.
1 call · #0238–#0238
Edit <path>Requested file and log inspection related to source & workspace.
1 call · #0239–#0239
Read <path>Requested code edits related to source & workspace.
2 calls · #0240–#0241
Edit <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0242–#0242
cd <path>grep -r -n <val> <path>head -n <n>grep -v <val>Requested code edits related to source & workspace.
1 call · #0243–#0243
Edit <path>Requested file and log inspection related to source & workspace.
1 call · #0244–#0244
Read <path>Requested code edits related to source & workspace.
1 call · #0245–#0245
Edit <path>Requested file and log inspection related to attention kernels.
1 call · #0246–#0246
cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0247–#0247
cd <path>grep -n <val> <path> <path>head -n <n>Requested file and log inspection related to attention kernels.
1 call · #0248–#0248
Read <path>Requested code edits related to attention kernels.
1 call · #0249–#0249
Edit <path>Requested file and log inspection related to attention kernels.
1 call · #0250–#0250
Read <path>Requested code edits related to attention kernels.
2 calls · #0251–#0252
Edit <path>Requested file and log inspection and source searches related to attention kernels.
2 calls · #0253–#0254
Read <path>Search <pattern> <path>Requested code edits related to attention kernels.
1 call · #0255–#0255
Edit <path>Requested code edits related to source & workspace.
1 call · #0256–#0256
Edit <path>Requested script or workload execution, environment setup or inspection and source searches related to attention kernels.
1 call · #0257–#0257
cd <path>python3 -c <script>env <vars> python3 <script> <n> > <path>grep -E <val>Requested script or workload execution, workspace file updates and environment setup or inspection related to source & workspace.
3 calls · #0258–#0260
python3 - <script>rm -rf <path>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>Requested source searches and file and log inspection related to batching & scheduling.
2 calls · #0261–#0262
cd <path>grep -n <val> <path> <path> <path> <n> > <path>headsed -n <val> <path>grep -n <val> <path> <path> <n> > <path>Requested execution waits, source searches and workspace inspection related to source & workspace.
2 calls · #0263–#0264
<command> <args>sleep <n>grep <val> <path>find <path> -name <val>head -n <n>tail -n <n> <path>cut <flag>ls <path> <n> > <path>Requested source searches and file and log inspection related to batching & scheduling.
2 calls · #0265–#0266
cd <path>grep -r -n <val> <path> <path> <n> > <path>head -n <n>sed -n <val> <path>Requested source searches, execution waits and workspace inspection related to source & workspace.
2 calls · #0267–#0268
<command> <args>grep -q <path>sleep <n>find <path> -name <val>headgrep <val> <path>head <flag>python3 - <val> <script>Requested file and log inspection related to device memory.
1 call · #0269–#0269
cd <path>sed -n <val> <path>Requested script or workload execution, environment setup or inspection and source searches related to source & workspace.
3 calls · #0270–#0272
cd <path>python3 - <script>env <vars> python3 <script> <n> > <path>grep <val>Wait for <task>Requested repository inspection and source restoration related to source & workspace.
1 call · #0273–#0273
cd <path>git diff --statgit checkout <path>Requested file and log inspection related to attention kernels.
2 calls · #0274–#0275
cd <path>sed -n <val> <path>Requested code edits related to source & workspace.
1 call · #0276–#0276
Write <path>Requested environment setup or inspection, source searches and file and log inspection related to source & workspace.
3 calls · #0277–#0279
cd <path>env <vars> timeout <n> <val> <path> <n> >& <path>grep -v -E <val>tail -n <n>env <vars> timeout <n> <val> <path> > <path> <n> >& <path>echo <val>cat <path>python3 - <script>tail -n <n> <path>03 / CANDIDATE ARTIFACT
Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
Base commit: 340db9201005fc64635bb25db1d2538f955761c3
@@ -425,6 +425,16 @@ class AscendAttnBackend(AttentionBackend): forward_mode=forward_batch.forward_mode, spec_info=forward_batch.spec_info, out_cache_loc=forward_batch.out_cache_loc,+ req_pool_indices_cpu=(+ None+ if in_capture+ else getattr(forward_batch, "req_pool_indices_cpu", None)+ ),+ raw_seq_lens_cpu=(+ None+ if in_capture+ else getattr(forward_batch, "raw_seq_lens_cpu", None)+ ), ) def init_forward_metadata(self, forward_batch: ForwardBatch):@@ -550,6 +560,10 @@ class AscendAttnBackend(AttentionBackend): self.graph_mode = False def init_cuda_graph_state(self, max_bs: int, max_num_tokens: int):+ # Per-bs block-table rebuild snapshots for the decode-replay fast+ # path in _apply_cuda_graph_metadata: bs -> (req_pool_indices_cpu,+ # max_seq_pages) of the last full block-table build.+ self._graph_bt_snapshot = {} total_context_len = self.max_context_len + self.page_size - 1 if self.speculative_num_draft_tokens is not None: total_context_len += self.speculative_num_draft_tokens@@ -676,6 +690,8 @@ class AscendAttnBackend(AttentionBackend): forward_mode: ForwardMode, spec_info: Optional[SpecInput], out_cache_loc: Optional[torch.Tensor] = None,+ req_pool_indices_cpu: Optional[torch.Tensor] = None,+ raw_seq_lens_cpu: Optional[torch.Tensor] = None, ): """Shared capture+replay body for the cuda-graph init path. @@ -697,6 +713,39 @@ class AscendAttnBackend(AttentionBackend): max_len += self.speculative_step_id + 1 max_seq_pages = (max_len + self.page_size - 1) // self.page_size + # Fast path (dense decode replay): the block-table rows only change+ # when the batch composition changes or a request's newest token+ # crosses a page boundary; both are decidable on the host. Skipping+ # the rebuild saves several device ops (and their host dispatch)+ # on nearly every decode step.+ rebuild_block_tables = True+ if (+ forward_mode.is_decode_or_idle()+ and spec_info is None+ and not self.is_hybrid_swa+ and not self.use_sliding_window_kv_pool+ and req_pool_indices_cpu is not None+ and raw_seq_lens_cpu is not None+ ):+ snapshot = self._graph_bt_snapshot.get(bs)+ if snapshot is not None:+ prev_rpi, prev_pages = snapshot+ page_crossed = bool(+ ((raw_seq_lens_cpu - 1) % self.page_size == 0).any().item()+ )+ if (+ not page_crossed+ and prev_pages == max_seq_pages+ and prev_rpi.shape == req_pool_indices_cpu.shape+ and torch.equal(prev_rpi, req_pool_indices_cpu)+ ):+ rebuild_block_tables = False+ if rebuild_block_tables:+ self._graph_bt_snapshot[bs] = (+ req_pool_indices_cpu.clone(),+ max_seq_pages,+ )+ if self.is_hybrid_swa: metadata.block_tables_swa[:bs, :max_seq_pages].copy_( self.full_to_swa_index_mapping[@@ -718,13 +767,16 @@ class AscendAttnBackend(AttentionBackend): ) metadata.swa_mask[:bs, 0, :].copy_(mask) metadata.swa_mask[bs:, :, :].fill_(True)- metadata.block_tables[:bs, :max_seq_pages].copy_(- self.req_to_token[req_pool_indices[:bs], 0 : max_len : self.page_size]- // self.page_size- )+ if rebuild_block_tables:+ metadata.block_tables[:bs, :max_seq_pages].copy_(+ self.req_to_token[+ req_pool_indices[:bs], 0 : max_len : self.page_size+ ]+ // self.page_size+ ) - metadata.block_tables[:bs, max_seq_pages:].fill_(0)- metadata.block_tables[bs:, :].fill_(0)+ metadata.block_tables[:bs, max_seq_pages:].fill_(0)+ metadata.block_tables[bs:, :].fill_(0) if forward_mode.is_target_verify(): seq_lens = seq_lens + self.speculative_num_draft_tokens@@ -240,10 +240,18 @@ class NPUGraphRunner(DecodeCudaGraphRunner): or is_deepseek_v4(self.model_runner.model_config.hf_config) ): if forward_batch.forward_mode.is_target_verify():- seq_lens_cpu = forward_batch.seq_lens.cpu() + self.captured_req_width+ seq_lens_cpu = forward_batch.seq_lens_cpu+ if seq_lens_cpu is None:+ seq_lens_cpu = forward_batch.seq_lens.cpu()+ seq_lens_cpu = seq_lens_cpu + self.captured_req_width seq_lens = seq_lens_cpu.tolist() + [0] * (self.bs - self.raw_bs) else:- seq_lens = forward_batch.seq_lens.cpu().tolist() + [0] * (+ # Prefer the scheduler-maintained CPU mirror over a fresh+ # device-to-host copy (which would stall the replay stream).+ seq_lens_cpu = forward_batch.seq_lens_cpu+ if seq_lens_cpu is None:+ seq_lens_cpu = forward_batch.seq_lens.cpu()+ seq_lens = seq_lens_cpu.tolist() + [0] * ( self.bs - self.raw_bs ) output = self.backend.replay_with_input_update(@@ -486,6 +486,11 @@ class ForwardBatch(ForwardBatchDeepSeekMHAMixin): # Optional seq_lens on cpu (CPU mirror of seq_lens) seq_lens_cpu: Optional[torch.Tensor] = None + # Optional req_pool_indices on cpu (CPU mirror of req_pool_indices).+ # Lets graph-replay metadata paths detect batch-composition changes+ # without a device-to-host copy.+ req_pool_indices_cpu: Optional[torch.Tensor] = None+ # For logprob top_logprobs_nums: Optional[List[int]] = None token_ids_logprobs: Optional[List[List[int]]] = None@@ -769,6 +774,7 @@ class ForwardBatch(ForwardBatchDeepSeekMHAMixin): seq_lens_sum=batch.seq_lens_sum, # Inputs aliased by reference from ScheduleBatch seq_lens_cpu=seq_lens_cpu,+ req_pool_indices_cpu=getattr(batch, "req_pool_indices_cpu", None), orig_seq_lens=batch.orig_seq_lens, out_cache_loc_dsv4=batch.out_cache_loc_dsv4, mamba_track_indices=batch.mamba_track_indices,@@ -27,8 +27,38 @@ from sglang.srt.runtime_context import get_flags from sglang.srt.utils import ( get_cuda_graph_batch_size_alignment, get_cuda_graph_max_batch_size,+ is_npu, ) +# On Ascend NPU, a decode batch larger than the biggest captured graph+# falls back to eager execution, where per-op host dispatch dominates the+# step time of small models. Extending the capture ladder past the+# configured decode max_bs (bounded by this ceiling) keeps larger decode+# batches on graph replay. The ceiling is deliberately modest: capture+# time and graph-pool memory grow with every additional bucket.+NPU_DECODE_GRAPH_EXTENSION_MAX_BS = 256+NPU_DECODE_GRAPH_EXTENSION_STEP = 8+++def _extend_npu_decode_capture_bs(+ capture_bs: List[int], num_max_requests: int+) -> List[int]:+ """Append sparse buckets above the configured max_bs so that decode+ batches beyond it still run on NPU graph replay instead of eager."""+ if not capture_bs:+ return capture_bs+ ceiling = min(num_max_requests, NPU_DECODE_GRAPH_EXTENSION_MAX_BS)+ largest = max(capture_bs)+ if largest >= ceiling:+ return capture_bs+ extension = list(+ range(largest + NPU_DECODE_GRAPH_EXTENSION_STEP, ceiling + 1,+ NPU_DECODE_GRAPH_EXTENSION_STEP)+ )+ if extension and extension[-1] != ceiling:+ extension.append(ceiling)+ return capture_bs + extension+ if TYPE_CHECKING: from sglang.srt.model_executor.input_buffers import ForwardInputBuffers from sglang.srt.model_executor.model_runner import ModelRunner@@ -85,6 +115,13 @@ def get_batch_sizes_to_capture( # is very small. We add more values here to make sure we capture the maximum bs. capture_bs += [num_max_requests] + # On NPU, decode batches above the configured graph max_bs would+ # otherwise run eager at a large host-dispatch penalty; capture a+ # bounded ladder of larger buckets so they can replay graphs. Exact+ # (unpadded) capture keeps the configured list untouched.+ if is_npu() and not server_args.disable_cuda_graph_padding:+ capture_bs = _extend_npu_decode_capture_bs(capture_bs, num_max_requests)+ # Model input token count = bs * alignment_width; must be a multiple of attn_tp_size. capture_bs = [bs for bs in capture_bs if bs * alignment_width % mul_base == 0] capture_bs = [bs for bs in capture_bs if bs <= num_max_requests]@@ -170,6 +170,11 @@ def build_replay_fb_view( None if forward_batch.seq_lens_cpu is None else buffers.seq_lens_cpu[:bs] ), num_padding=bs - raw_bs,+ # Unpadded (raw-bs) host mirrors from the live batch. Backends use+ # these to cheaply detect batch-composition / page-boundary changes+ # across replays without device syncs.+ req_pool_indices_cpu=getattr(forward_batch, "req_pool_indices_cpu", None),+ raw_seq_lens_cpu=forward_batch.seq_lens_cpu, encoder_lens=buffers.encoder_lens[:bs] if is_encoder_decoder else None, out_cache_loc=getattr(forward_batch, "out_cache_loc", None), out_cache_loc_dsv4=getattr(forward_batch, "out_cache_loc_dsv4", None),