Kimi K3 · Serving

S04 · SLO

Measurement failed

Online SLO goodput 1dev · Implementation Optimization

—PERFORMANCE RATIO
192TOOL EVENTS
1TEXT 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 agentKimi K3 · 192 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
131Inspect
12Edit
6Validate
15Execute
1Profile
1Rollback
26Other

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 timeline133 groups · 192 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> <n> > <path>true
  2. Inspect · Task requirements

    Requested file and log inspection, environment setup or inspection and workspace inspection related to task requirements.

    3 calls · #0002–#0004

    Read <path>env <vars>ls -l -a <path> <path> <path> <path> <path> <path> <n> > <path>
  3. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0005–#0005

    Read <path>
  4. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0006–#0006

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

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

    2 calls · #0007–#0008

    Read <path>
  6. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    4 calls · #0009–#0012

    Read <path>
  7. Inspect · Device memory

    Requested environment setup or inspection, source searches and runtime inspection related to device memory.

    1 call · #0013–#0013

    envgrep -E <val>sortecho <flag>npu-smi info <n> > <path>head -n <n>
    1 more command sketches
    true
  8. Inspect · Source & workspace

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

    6 calls · #0014–#0019

    grep -n <val> <path>head -n <n>Read <path>
  9. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0020–#0020

    which <val>python3 -c <script> <n> >& <path>echo <flag>
  10. Inspect · Source & workspace

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

    2 calls · #0021–#0022

    cd <path>git status --shorthead -n <n>git log --oneline <flag> <args>head -n <n> <path>
  11. Other · Task requirements

    Requested script or workload execution related to task requirements.

    2 calls · #0023–#0024

    python3 - <script>
  12. Inspect · Source & workspace

    Requested file and log inspection and script or workload execution related to source & workspace.

    2 calls · #0025–#0026

    Read <path>cd <path>bash <script> <n> >& <path>tail -n <n>
  13. Validate · Benchmark & validation setup

    Requested script or workload execution and file and log inspection related to benchmark & validation setup.

    2 calls · #0027–#0028

    cd <path>bash <script> <n> >& <path>tail -n <n>echo <val>bash <script> > <path> <n> >& <path>tail -n <n> <path>
  14. Inspect · Attention kernels

    Requested workspace inspection, file and log inspection and source searches related to attention kernels.

    1 call · #0029–#0029

    ls <path>head -n <n>echo <flag>grep -i -E <val>ls <path> <n> > <path>
  15. Inspect · Source & workspace

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

    1 call · #0030–#0030

    ls -R <path>head -n <n>
  16. Inspect · Attention kernels

    Requested file and log inspection and source searches related to attention kernels.

    1 call · #0031–#0031

    wc -l <path> <path> <path> <n> > <path>echo <flag>grep -r -n <val> <path>head -n <n>
  17. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0032–#0032

    Read <path>
  18. Other · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0033–#0033

    Read task output <task>
  19. Inspect · Runtime processes

    Requested source searches and file and log inspection related to runtime processes.

    2 calls · #0034–#0035

    grep -r -n <val> <path>grep -i <val>headecho <flag>grep -n <val> <path>head -n <n>
    1 more command sketches
    sed -n <val> <path>
  20. Validate · Benchmark & validation setup

    Requested file and log inspection, source searches and workspace inspection related to benchmark & validation setup.

    1 call · #0036–#0036

    tail -n <n> <path> <n> > <path>grep -v -E <val>tail -n <n>ls <path> <n> > <path>
  21. Inspect · Attention kernels

    Requested source searches and file and log inspection related to attention kernels.

    2 calls · #0037–#0038

    grep -n <val> <path>head -n <n>Read <path>
  22. Validate · Benchmark & validation setup

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

    1 call · #0039–#0039

    grep -E <val> <path> <n> > <path>tail -n <n>
  23. Inspect · Source & workspace

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

    2 calls · #0040–#0041

    Read <path>grep -n <val> <path>head
  24. Other · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0042–#0042

    Read task output <task>
  25. Inspect · Batching & scheduling

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

    3 calls · #0043–#0045

    ls <path>wc -l <path> <path> <n> > <path>ls <path> <n> > <path>grep -n <val> <path>headecho <flag>
    3 more command sketches
    grep -r -n <val> <path>head -n <n>Read <path>
  26. Other · Source & workspace

    Requested execution waits related to source & workspace.

    1 call · #0046–#0046

    Wait for <task>
  27. Validate · Benchmark & validation setup

    Requested workspace file updates, file and log inspection and script or workload execution related to benchmark & validation setup.

    1 call · #0047–#0047

    cp <path> <path>cat <path>python3 -m <module>head -n <n>
  28. Execute · Benchmark & validation setup

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

    1 call · #0048–#0048

    cd <path>bash <script> > <path> <n> >& <path>echo <val>tee -a <path>
  29. Inspect · Source & workspace

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

    7 calls · #0049–#0055

    Read <path>sed -n <val> <path>tail -n <n> <path> <n> > <path>ls -l -a <path> <n> > <path>tailgrep -n <val> <path>
    4 more command sketches
    head -n <n>wc -l <path>tail -n <n> <path>ls <path>
  30. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0056–#0056

    Read <path>
  31. Inspect · Source & workspace

    Requested execution waits, file and log inspection and workspace inspection related to source & workspace.

    1 call · #0057–#0057

    sleep <n>tail -n <n> <path>ls <path>grep -E <val>
  32. Other · Latency & request handling

    Requested script or workload execution related to latency & request handling.

    2 calls · #0058–#0059

    python3 - <script>
  33. Inspect · Batching & scheduling

    Requested source searches and file and log inspection related to batching & scheduling.

    1 call · #0060–#0060

    grep -n <val> <path>head -n <n>
  34. Inspect · Source & workspace

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

    1 call · #0061–#0061

    ls -l -a <path>grep -E <val>echo <flag>tail -n <n> <path>
  35. Other · Latency & request handling

    Requested script or workload execution related to latency & request handling.

    1 call · #0062–#0062

    python3 - <script>
  36. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0063–#0063

    python3 - <script>
  37. Inspect · Batching & scheduling

    Requested source searches and file and log inspection related to batching & scheduling.

    2 calls · #0064–#0065

    grep -n <val> <path>grep -i -E <val>head -n <n>grep -E <val>awk <val>grep -v -E <path>
  38. Inspect · Source & workspace

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

    1 call · #0066–#0066

    ls <path>grep -E <val>tail -n <n> <path>
  39. Other · Latency & request handling

    Requested script or workload execution related to latency & request handling.

    1 call · #0067–#0067

    python3 - <script>
  40. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0068–#0068

    sed -n <val> <path>
  41. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0069–#0069

    Read <path>
  42. Inspect · Source & workspace

    Requested execution waits, workspace inspection and source searches related to source & workspace.

    1 call · #0070–#0070

    sleep <n>ls <path>grep <val>tail -n <n> <path> <n> > <path>
  43. Execute · Latency & request handling

    Requested script or workload execution and workspace file updates related to latency & request handling.

    1 call · #0071–#0071

    python3 - <script>cp <path> <path>
  44. Inspect · Runtime processes

    Requested source searches and file and log inspection related to runtime processes.

    1 call · #0072–#0072

    grep -r -n <val> <path>head -n <n>
  45. Execute · Batching & scheduling

    Requested workspace file updates and environment setup or inspection related to batching & scheduling.

    1 call · #0073–#0073

    mkdir -p <path>cd <path>env <vars> nohup <val> -m <val> <flag> <args>echo <val>
  46. Execute · Source & workspace

    Requested source searches and execution waits related to source & workspace.

    1 call · #0074–#0074

    <command> <args>grep -q <val>sleep <n>
  47. Execute · Device memory

    Requested service requests, script or workload execution and execution waits related to device memory.

    1 call · #0075–#0075

    cd <path>curl -s -X <val> <url> -H <path> -d <val>echopython3 - <script>curl -s -X <val> <url> <val>sleep <n>
    2 more command sketches
    ls -l -a <path>head
  48. Inspect · Source & workspace

    3 tool errors

    Requested workspace inspection, file and log inspection and script or workload execution related to source & workspace.

    9 calls · #0076–#0084

    find <path> -name <val>headfind <path> -type <val>head -n <n>python3 - <script>head -n <n> <path>
    1 more command sketches
    wc -l <path>
  49. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0085–#0085

    python3 - <script>
  50. Inspect · Batching & scheduling

    Requested source searches and file and log inspection related to batching & scheduling.

    1 call · #0086–#0086

    grep -r -n <val> <path>head
  51. Inspect · Source & workspace

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

    1 call · #0087–#0087

    grep -r -n <val> <path> -lgrep -r -n <val> <path>head
  52. Inspect · Batching & scheduling

    Requested source searches, file and log inspection and script or workload execution related to batching & scheduling.

    4 calls · #0088–#0091

    grep -n <val> <path>head -n <n>python3 - <script>which <val> <val> <n> > <path>python3 -c <script> <n> >& <path>echo <flag>
    6 more command sketches
    sed -n <val> <path>ps <val>grep -E <val>grep -v <val>awk <val>head
  53. Inspect · Device memory

    Requested environment setup or inspection, execution waits and file and log inspection related to device memory.

    1 call · #0092–#0092

    cd <path><command> <args>env <vars>sleep <n>tail -n <n>head -n <n>
    1 more command sketches
    wait <val>
  54. Inspect · Source & workspace

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

    2 calls · #0093–#0094

    grep -n <val> <path>headsed -n <val> <path>
  55. Other · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0095–#0095

    Read task output <task>
  56. Other · Batching & scheduling

    Requested script or workload execution related to batching & scheduling.

    1 call · #0096–#0096

    python3 - <script>
  57. Inspect · Batching & scheduling

    Requested source searches and file and log inspection related to batching & scheduling.

    1 call · #0097–#0097

    grep -E <val> <path>tail -n <n>echo <path>grep -c <val> <path>
  58. Profile · Batching & scheduling

    Requested execution waits and file and log inspection related to batching & scheduling.

    1 call · #0098–#0098

    cd <path><command> <args>sleep <n>tail -n <n>
  59. Inspect · Source & workspace

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

    1 call · #0099–#0099

    grep -n <val> <path>head -n <n>echo <flag>sed -n <val> <path>
  60. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0100–#0100

    python3 - <script>
  61. Inspect · Runtime processes

    Requested file and log inspection and source searches related to runtime processes.

    1 call · #0101–#0101

    tail -n <n> <path>echo <val>grep -c <val> <path>
  62. Execute · Task requirements

    Requested script or workload execution, execution waits and source searches related to task requirements.

    1 call · #0102–#0102

    cd <path>nohup <val> -m <val> <flag> <args>echo <val>sleep <n>grep -c <val> <path><command> <args>
    1 more command sketches
    tail -n <n>
  63. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0103–#0103

    python3 - <script>
  64. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    3 calls · #0104–#0106

    sed -n <val> <path>
  65. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0107–#0107

    Read <path>
  66. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0108–#0108

    Read <path>
  67. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0109–#0109

    Read <path>
  68. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0110–#0111

    Read <path>
  69. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0112–#0112

    Read <path>
  70. Inspect · Source & workspace

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

    1 call · #0113–#0113

    grep -n <val> <path>head -n <n>
  71. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0114–#0114

    Edit <path>
  72. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0115–#0115

    Read <path>
  73. Inspect · Source & workspace

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

    1 call · #0116–#0116

    sed -n <val> <path>grep -n <val> <path>head
  74. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0117–#0117

    Edit <path>
  75. Inspect · Runtime processes

    Requested source searches and file and log inspection related to runtime processes.

    1 call · #0118–#0118

    grep -n <val> <path> <path> <n> > <path>head -n <n>
  76. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0119–#0120

    sed -n <val> <path>Read <path>
  77. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    2 calls · #0121–#0122

    Read <path>
  78. Inspect · Device memory

    1 tool error

    Requested process termination, execution waits and runtime inspection related to device memory.

    1 call · #0123–#0123

    kill <n> <n> > <path>sleep <n>pkill -f <val> <n> > <path>npu-smi infogrep -E <val>head -n <n>
    2 more command sketches
    ps <val>grep -c <val>
  79. Other · Device memory

    Requested runtime inspection, source searches and file and log inspection related to device memory.

    1 call · #0124–#0124

    ps <val>grep -E <val>grep -v <val>awk <val>echo <flag>npu-smi info
    1 more command sketches
    grep <flag> <args>
  80. Inspect · Source & workspace

    Requested script or workload execution, file and log inspection and source searches related to source & workspace.

    1 call · #0125–#0125

    python3 -c <script>echo <val>cat <path> <n> > <path>grep -i <val>headls <path>
  81. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0126–#0126

    Write <path>
  82. Execute · Batching & scheduling

    Requested script or workload execution, source searches and execution waits related to batching & scheduling.

    1 call · #0127–#0127

    cd <path>nohup <val> -m <val> <flag> <args>echo <val><command> <args>grep -q <val>sleep <n>
  83. Inspect · Source & workspace

    Requested script or workload execution and file and log inspection related to source & workspace.

    1 call · #0128–#0128

    bash <script> <val> <n> >& <path>tail -n <n>
  84. Inspect · Runtime processes

    1 tool error

    Requested process termination, execution waits and repository inspection related to runtime processes.

    1 call · #0129–#0129

    pkill -f <val>sleep <n>cd <path>git stash <val> -m <val>git diff --stat <val>tail -n <n>
  85. Inspect · Source & workspace

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

    1 call · #0130–#0130

    cd <path>git stash <val>git status --shorthead
  86. Other · Batching & scheduling

    Requested runtime inspection, source searches and file and log inspection related to batching & scheduling.

    1 call · #0131–#0131

    ps <val>grep -E <val>grep -v <val>awk <val>
  87. Inspect · Source & workspace

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

    1 call · #0132–#0132

    cd <path>git stash <val> -m <val>git status --shorthead -n <n>echo <val>
  88. Execute · Batching & scheduling

    Requested script or workload execution, source searches and execution waits related to batching & scheduling.

    1 call · #0133–#0133

    cd <path>nohup <val> -m <val> <flag> <args><command> <args>grep -q <val>sleep <n>bash <script> <val> <n> >& <path>
    1 more command sketches
    tail -n <n>
  89. Other · Latency & request handling

    Requested script or workload execution and source searches related to latency & request handling.

    1 call · #0134–#0134

    cd <path>python3 -m <module> <flag> <args>grep -E <val>
  90. Inspect · Runtime processes

    1 tool error

    Requested process termination, execution waits and repository inspection related to runtime processes.

    1 call · #0135–#0135

    pkill -f <val>sleep <n>cd <path>git stash <val>git diff --stattail -n <n>
  91. Inspect · Source & workspace

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

    2 calls · #0136–#0137

    cd <path>git stash <val>git status --shorthead -n <n>
  92. Inspect · Runtime processes

    Requested file and log inspection, workspace file updates and script or workload execution related to runtime processes.

    1 call · #0138–#0138

    cat > <path> <script>chmod <val> <path>bash <script>
  93. Execute · Batching & scheduling

    Requested script or workload execution, source searches and execution waits related to batching & scheduling.

    1 call · #0139–#0139

    cd <path>nohup <val> -m <val> <flag> <args><command> <args>grep -q <val>sleep <n>
  94. Inspect · Latency & request handling

    Requested script or workload execution, file and log inspection and source searches related to latency & request handling.

    1 call · #0140–#0140

    bash <script> <val> <n> >& <path>tail -n <n>cd <path>python3 -m <module> <flag> <args>grep -E <val>
  95. Execute · Runtime processes

    Requested source searches and file and log inspection related to runtime processes.

    1 call · #0141–#0141

    grep <val> <path>grep <flag> <args>awk <val>sort -ntail -n <n>echo <flag>
  96. Inspect · Device memory

    Requested script or workload execution, environment setup or inspection and execution waits related to device memory.

    1 call · #0142–#0142

    python3 - <script>env <vars>sleep <n>grep <val> <path>tail -n <n>wait <val>
  97. Inspect · Source & workspace

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

    1 call · #0143–#0143

    grep -n <val> <path>head -n <n>
  98. Other · Latency & request handling

    Requested script or workload execution related to latency & request handling.

    1 call · #0144–#0144

    python3 - <script>
  99. Inspect · Device memory

    Requested script or workload execution, environment setup or inspection and execution waits related to device memory.

    1 call · #0145–#0145

    python3 - <script>env <vars>sleep <n><command> <args>head <flag> <args>tail -n <n>
    1 more command sketches
    kill <val> <n> > <path>
  100. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0146–#0146

    python3 - <script>
  101. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0147–#0147

    sed -n <val> <path>
  102. Inspect · Attention kernels

    Requested source searches, file and log inspection and script or workload execution related to attention kernels.

    1 call · #0148–#0148

    grep -r -n <val> <path> <n> > <path>headpython3 - <script>
  103. Inspect · Source & workspace

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

    3 calls · #0149–#0151

    sed -n <val> <path>grep -n <val> <path>headcd <path>git diff <path>head -n <n>
  104. Rollback · Source & workspace

    Requested source restoration and repository inspection related to source & workspace.

    1 call · #0152–#0152

    cd <path>git checkout <path>git diff --stat
  105. Inspect · Source & workspace

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

    2 calls · #0153–#0154

    ls <path>grep -n <val> <path>headsed -n <val> <path>
  106. Execute · Benchmark & validation setup

    Requested source searches, file and log inspection and environment setup or inspection related to benchmark & validation setup.

    1 call · #0155–#0155

    grep -n <val> <path>headenvgrep -i <val>python3 -c <script>
  107. Inspect · Source & workspace

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

    2 calls · #0156–#0157

    grep -n <val> <path>head -n <n>Read <path>
  108. Inspect · Runtime processes

    Requested source searches and file and log inspection related to runtime processes.

    1 call · #0158–#0158

    grep -E <val> <path>tail -n <n>
  109. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0159–#0159

    Read <path>
  110. Edit · Source & workspace

    Requested code edits related to source & workspace.

    3 calls · #0160–#0162

    Edit <path>
  111. Inspect · Source & workspace

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

    1 call · #0163–#0163

    grep -r -n <val> <path>headgrep -r -n <val> <path> --include <path>grep -v <val>
  112. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0164–#0164

    Edit <path>
  113. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0165–#0165

    Read <path>
  114. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0166–#0166

    Edit <path>
  115. Inspect · Speculative decoding

    Requested source searches, file and log inspection and script or workload execution related to speculative decoding.

    1 call · #0167–#0167

    grep -r -n <val> <path> <path> <n> > <path>headecho <flag>python3 -c <script>
  116. Execute · Batching & scheduling

    1 tool error

    Requested script or workload execution, source searches and execution waits related to batching & scheduling.

    1 call · #0168–#0168

    bash <script>cd <path>nohup <val> -m <val> <flag> <args><command> <args>grep -q <val>sleep <n>
    2 more command sketches
    grep -E <val> <path>tail -n <n>
  117. Inspect · Runtime processes

    1 tool error

    Requested runtime inspection, source searches and file and log inspection related to runtime processes.

    1 call · #0169–#0169

    ps <val>grep -E <val>grep -v <val>awk <val>tail -n <n> <path> <n> > <path>
  118. Execute · Runtime processes

    Requested file and log inspection and script or workload execution related to runtime processes.

    1 call · #0170–#0170

    cat > <path> <script>bash <script>
  119. Execute · Batching & scheduling

    Requested source searches, execution waits and file and log inspection related to batching & scheduling.

    1 call · #0171–#0171

    cd <path><command> <args>grep -q <val>sleep <n>grep -E <val> <path>tail -n <n>
  120. Inspect · Source & workspace

    Requested script or workload execution and file and log inspection related to source & workspace.

    1 call · #0172–#0172

    bash <script> <val> <n> >& <path>tail -n <n>
  121. Other · Latency & request handling

    2 tool errors

    Requested script or workload execution and source searches related to latency & request handling.

    2 calls · #0173–#0174

    cd <path>python3 -m <module> <flag> <args>grep -E <val>echo <val>grep -E <val> <path>
  122. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0175–#0175

    tail -n <n> <path>
  123. Inspect · Runtime processes

    Requested file and log inspection and source searches related to runtime processes.

    1 call · #0176–#0176

    tail -n <n> <path>grep -v -E <val>
  124. Inspect · Source & workspace

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

    1 call · #0177–#0177

    grep -n <val> <path>headgrep -r -n <val> <path>head -n <n>
  125. Edit · Source & workspace

    Requested code edits related to source & workspace.

    4 calls · #0178–#0181

    Edit <path>
  126. Execute · Batching & scheduling

    Requested script or workload execution, source searches and execution waits related to batching & scheduling.

    1 call · #0182–#0182

    bash <script>cd <path><command> <args>grep -q <val>sleep <n>
  127. Inspect · Runtime processes

    Requested script or workload execution, file and log inspection and source searches related to runtime processes.

    2 calls · #0183–#0184

    bash <script> <val> <n> >& <path>tail -n <n>grep <flag> <args>grep -i -E <val> <path>head -n <n>
  128. Other · Latency & request handling

    Requested script or workload execution and source searches related to latency & request handling.

    2 calls · #0185–#0186

    cd <path>python3 -m <module> <flag> <args>echo <val>grep -E <val> <path>python3 - <script>
  129. Inspect · Source & workspace

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

    2 calls · #0187–#0188

    grep -r -n <val> <path> --include <path>grep -v <path>sed -n <val> <path>
  130. Other · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0189–#0189

    date -ubash <script>
  131. Validate · Benchmark & validation setup

    Requested script or workload execution and file and log inspection related to benchmark & validation setup.

    1 call · #0190–#0190

    cd <path>bash <script> > <path> <n> >& <path>echo <val>tail -n <n> <path>
  132. Inspect · Source & workspace

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

    1 call · #0191–#0191

    cd <path>git diff --statgit status --shorthead
  133. Inspect · Device memory

    Requested script or workload execution, file and log inspection and runtime inspection related to device memory.

    1 call · #0192–#0192

    cd <path>bash <script> <n> >& <path>tail -n <n>ps <val>grep -E <val>grep -v <val>
    3 more command sketches
    wc -lnpu-smi infogrep <flag> <args>

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.

sglang · 2 changed files

Base commit: 340db9201005fc64635bb25db1d2538f955761c3

diff --git a/python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py b/python/sglang/srt/hardware_backend/npu/attention/ascend_backend.pyindex 89e9de06db1cb0350cb55b83dbaffc15c100fff9..7c7f60cbb86360d6f2ebe52df88abfdc8bbcd6c4 100644--- a/python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py+++ b/python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py@@ -459,9 +459,16 @@ class AscendAttnBackend(AttentionBackend):             )         if forward_batch.extend_seq_lens is not None:             self.forward_metadata.extend_seq_lens = forward_batch.extend_seq_lens-            self.forward_metadata.extend_seq_lens_cpu_int = (-                forward_batch.extend_seq_lens.cpu().int()-            )+            if forward_batch.extend_seq_lens_cpu is not None:+                # Use the host-side mirror instead of a stream-ordered D2H+                # readback, which would stall on any in-flight device work.+                self.forward_metadata.extend_seq_lens_cpu_int = torch.tensor(+                    forward_batch.extend_seq_lens_cpu, dtype=torch.int32+                )+            else:+                self.forward_metadata.extend_seq_lens_cpu_int = (+                    forward_batch.extend_seq_lens.cpu().int()+                )         if forward_batch.seq_lens is not None:             self.forward_metadata.seq_lens = forward_batch.seq_lens.int()         else:diff --git a/python/sglang/srt/hardware_backend/npu/graph_runner/npu_cudagraph_backend.py b/python/sglang/srt/hardware_backend/npu/graph_runner/npu_cudagraph_backend.pyindex 105034c03c0fb36d35254f822b63908f5bd0a2a0..fd6584813f4c1079c601b0d949a89210399a455d 100644--- a/python/sglang/srt/hardware_backend/npu/graph_runner/npu_cudagraph_backend.py+++ b/python/sglang/srt/hardware_backend/npu/graph_runner/npu_cudagraph_backend.py@@ -39,9 +39,26 @@ if TYPE_CHECKING:   class NPUCudaGraphBackend(BaseCudaGraphBackend):-    """One torch.npu.NPUGraph per shape; attention metadata captured+    """Two torch.npu.NPUGraph slots per shape; attention metadata captured     inside the graph. replay_with_input_update substitutes fresh-    seq_lens without re-recording."""+    seq_lens without re-recording.++    Dual-slot update pipelining: ``NPUGraph.update`` re-dispatches every+    recorded host-input operator (one FIA per layer) through the driver+    task-update API, which costs several ms per step on the critical path+    between two replays of the same graph. Two alternating graph slots are+    captured per shape so the seq_lens update for the *next* step can be+    issued on the idle slot while the current slot's replay is still on the+    device. The update of a slot is only ever issued when every previously+    launched replay (of any slot) is guaranteed complete: callers reach this+    method only after the runner's stream-ordered readback of the current+    step's seq_lens, which drains all prior replays on the compute stream.+    A slot is fast-replayed only when its armed seq_lens exactly equal the+    current batch's; any batch-composition change falls back to an inline+    update, preserving the legacy behavior and numerics.+    """++    _NUM_SLOTS = 2      def __init__(         self,@@ -51,6 +68,13 @@ class NPUCudaGraphBackend(BaseCudaGraphBackend):     ) -> None:         self._graphs: Dict[Any, Any] = {}         self._outputs: Dict[Any, Any] = {}+        # Per-shape slot state: [{"armed": tuple|None, "thread": Thread|None}].+        self._slot_state: Dict[Any, list] = {}+        # torch_npu routes every NPUGraph.update through one shared, class-level+        # update stream, and the driver rejects a task-update group started+        # while another update is in flight. Serialize all update issuing+        # (inline and background) across slots and shapes with this lock.+        self._update_lock = threading.Lock()         self._pool = None         self._device_module = cuda_graph_runner.device_module         self._device_id = self._device_module.current_device()@@ -93,8 +117,6 @@ class NPUCudaGraphBackend(BaseCudaGraphBackend):             if post_warmup_hook is not None:                 post_warmup_hook() -        graph = torch.npu.NPUGraph()-         if self._enable_torch_compile:             skip_guard_context = torch.compiler.set_stance(skip_guard_eval_unsafe=True)         else:@@ -112,19 +134,28 @@ class NPUCudaGraphBackend(BaseCudaGraphBackend):         else:             graph_ctx = torch.npu.graph -        with (-            skip_guard_context,-            graph_ctx(-                graph,-                pool=self._pool,-                stream=self._capture_stream,-                auto_dispatch_capture=True,-            ),-        ):-            out = forward_fn()+        graphs = []+        outputs = []+        for _ in range(self._NUM_SLOTS):+            graph = torch.npu.NPUGraph()+            with (+                skip_guard_context,+                graph_ctx(+                    graph,+                    pool=self._pool,+                    stream=self._capture_stream,+                    auto_dispatch_capture=True,+                ),+            ):+                out = forward_fn()+            graphs.append(graph)+            outputs.append(out) -        self._graphs[shape_key] = graph-        self._outputs[shape_key] = out+        self._graphs[shape_key] = graphs+        self._outputs[shape_key] = outputs+        self._slot_state[shape_key] = [+            {"armed": None, "thread": None} for _ in range(self._NUM_SLOTS)+        ]      def can_run(self, forward_batch: ForwardBatch, shape_key: ShapeKey) -> bool:         return shape_key in self._graphs@@ -139,8 +170,37 @@ class NPUCudaGraphBackend(BaseCudaGraphBackend):         static_forward_batch: ForwardBatch,         **kwargs,     ) -> Any:-        self._graphs[shape_key].replay()-        return self._outputs[shape_key]+        self._graphs[shape_key][0].replay()+        return self._outputs[shape_key][0]++    def _build_update_tensor(self, seq_lens, attr_type):+        if isinstance(attr_type, torch.Tensor):+            seq_lens = torch.from_numpy(np.array(seq_lens).astype(np.int32))+        return seq_lens++    def _issue_update_thread(self, shape_key, slot_idx, attr_name, seq_lens_value, armed):+        """Update ``slot_idx`` of ``shape_key`` on a background thread.++        Only launched right after a replay was issued, i.e. after the+        caller's stream-ordered seq_lens readback has drained every prior+        replay on the compute stream, so the slot being updated has no+        in-flight execution. ``armed`` is published only after the update+        call returns, so a matching armed value implies completion.+        """+        graph = self._graphs[shape_key][slot_idx]+        state = self._slot_state[shape_key][slot_idx]+        cpu_update_input = [{attr_name: seq_lens_value}]++        def _update():+            self._device_module.set_device(self._device_id)+            with self._update_lock:+                graph.update(cpu_update_input=cpu_update_input)+            state["armed"] = armed+            state["thread"] = None++        thread = threading.Thread(target=_update, daemon=True)+        state["thread"] = thread+        thread.start()      def replay_with_input_update(         self,@@ -150,33 +210,109 @@ class NPUCudaGraphBackend(BaseCudaGraphBackend):         attr_type: Any = None,         cpu_update_input: list = None,     ) -> Any:-        """Rebind seq_lens on the recorded NPU graph in a background-        thread, then replay. Used when the model is not deepseek-nsa.--        Two calling conventions:-        1. (legacy) seq_lens + attr_name + attr_type:-           Constructs cpu_update_input=[{attr_name: seq_lens}] internally.-        2. cpu_update_input: A list of {attr_name: seq_lens} dicts,-           one per speculative step.  Used by EAGLE draft runners.+        """Rebind seq_lens on a recorded NPU graph, then replay.++        Dual-slot fast path: when the slot armed (pre-updated) with exactly+        this step's seq_lens exists, replay it directly without paying the+        multi-ms NPUGraph.update on the step's critical path, then issue the+        predicted next-step update (+1 per live request, padded slots stay 0)+        on the other slot in the background.++        Any mismatch (batch composition changed, speculative path, missing+        arming) falls back to the legacy inline update + replay on a slot,+        which keeps behavior identical to the single-graph implementation.         """-        if cpu_update_input is None:-            if isinstance(attr_type, torch.Tensor):-                seq_lens = torch.from_numpy(np.array(seq_lens).astype(np.int32))-            cpu_update_input = [{attr_name: seq_lens}]+        graphs = self._graphs[shape_key] -        graph = self._graphs[shape_key]+        # Speculative / explicit update path: keep legacy inline semantics on+        # slot 0 and invalidate its arming since the new values are opaque.+        if cpu_update_input is not None:+            state = self._slot_state[shape_key][0]+            pending = state["thread"]+            if pending is not None:+                pending.join()+                state["thread"] = None+            graph = graphs[0] -        def _update():-            self._device_module.set_device(self._device_id)-            graph.update(cpu_update_input=cpu_update_input)+            def _update():+                self._device_module.set_device(self._device_id)+                with self._update_lock:+                    graph.update(cpu_update_input=cpu_update_input) -        thread = threading.Thread(target=_update)-        thread.start()-        graph.replay()-        thread.join()-        return self._outputs[shape_key]+            thread = threading.Thread(target=_update, daemon=True)+            thread.start()+            graph.replay()+            thread.join()+            state["armed"] = None+            return self._outputs[shape_key][0]++        seq_lens_list = list(seq_lens)+        armed_key = tuple(int(v) for v in seq_lens_list)+        states = self._slot_state[shape_key]++        # Fast path: a slot is already armed with exactly these seq_lens and+        # its arming update has completed (armed is set after update returns).+        hit = -1+        for idx in range(len(graphs)):+            if states[idx]["armed"] == armed_key and states[idx]["thread"] is None:+                hit = idx+                break++        if hit >= 0:+            graph = graphs[hit]+            graph.replay()+            output = self._outputs[shape_key][hit]+        else:+            # Slow path: inline update on a slot whose pending background+            # update (if any) has been joined, then replay.+            hit = 0 if states[0]["armed"] is None else 1+            state = states[hit]+            pending = state["thread"]+            if pending is not None:+                pending.join()+                state["thread"] = None+            graph = graphs[hit]+            with self._update_lock:+                graph.update(+                    cpu_update_input=[+                        {+                            attr_name: self._build_update_tensor(+                                seq_lens_list, attr_type+                            )+                        }+                    ]+                )+            graph.replay()+            state["armed"] = armed_key+            output = self._outputs[shape_key][hit]++        # Arm the other slot with the predicted next-step seq_lens. Decode+        # advances every live request by exactly one token per step; padded+        # slots stay 0. The prediction is only a hint — the next step's exact+        # comparison above guarantees correctness on any deviation.+        other = 1 - hit+        other_state = states[other]+        if other_state["thread"] is None:+            predicted = [v + 1 if v > 0 else 0 for v in seq_lens_list]+            self._issue_update_thread(+                shape_key,+                other,+                attr_name,+                self._build_update_tensor(predicted, attr_type),+                tuple(predicted),+            )++        return output      def cleanup(self) -> None:+        for states in self._slot_state.values():+            for state in states:+                pending = state.get("thread")+                if pending is not None:+                    pending.join()+                    state["thread"] = None+                state["armed"] = None+        self._slot_state.clear()         self._graphs.clear()         self._outputs.clear()         self._pool = None