Claude Opus 5 · Serving

S03 · TTFT

Valid

Online TTFT 1dev · Implementation Optimization

1.02×PERFORMANCE RATIO
215TOOL 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 agentClaude Opus 5 · 215 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
106Inspect
14Edit
10Validate
55Execute
15Profile
15Other

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 timeline148 groups · 215 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 and file and log inspection related to source & workspace.

    2 calls · #0001–#0002

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

    Requested file and log inspection and workspace inspection related to task requirements.

    3 calls · #0003–#0005

    Read <path>cd <path>ls -l -a <val> <val> <val> <val> <val> <path> <path>
  3. Validate · Benchmark & validation setup

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

    1 call · #0006–#0006

    cd <path><command> <args>cat <val>
  4. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0007–#0007

    cd <path>echo <val>cat <path>echo
  5. Inspect · Device memory

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

    1 call · #0008–#0008

    git log --oneline <flag>echo <flag><command> <args>head <flag>python3 -c <script> <n> >& <path>tail -n <n>
  6. Inspect · Source & workspace

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

    7 calls · #0009–#0015

    cd <path>wc -l <path>grep -n <val> <path>head -n <n>Read <path>
  7. Inspect · Dependencies & build setup

    Requested script or workload execution, file and log inspection and dependency and build commands related to dependencies & build setup.

    1 call · #0016–#0016

    python3 -c <script> <n> >& <path>tail -n <n>pip show <val> <n> > <path>head -n <n>echo <flag>python3 -c <script>
    2 more command sketches
    ls <path> <n> > <path>grep -i -E <val>
  8. Other · Source & workspace

    Requested environment setup or inspection and source searches related to source & workspace.

    1 call · #0017–#0017

    envgrep -i -E <val>sort
  9. Inspect · Source & workspace

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

    5 calls · #0018–#0022

    cat <path>Read <path>cd <path>grep -n <val> <path>head -n <n>
  10. Execute · Task requirements

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

    1 call · #0023–#0023

    mkdir -p <path>env <vars> bash <script> > <path> <n> >& <path>echo <val>
  11. Inspect · Source & workspace

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

    2 calls · #0024–#0025

    ls <path>echo <flag>find <path> -iname <val> -o -iname <val>sortls -l -a <path> <n> > <path>tail -n <n> <path> <n> > <path>
  12. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0026–#0026

    wc -l <path>sed -n <val> <path>
  13. Inspect · Source & workspace

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

    1 call · #0027–#0027

    ls -l -a <path>echo <flag>tail -c <n> <path> <n> > <path>
  14. Inspect · Device memory

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

    1 call · #0028–#0028

    wc -l <path>grep -n <val> <path>head -n <n>
  15. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0029–#0029

    Read <path>
  16. Inspect · Runtime processes

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

    2 calls · #0030–#0031

    ls -l -a <path>echo <val>grep -a -n -E <val> <path> <n> > <path>tail -n <n>grep -a -v <val> <path>
  17. Inspect · Attention kernels

    Requested source searches related to attention kernels.

    1 call · #0032–#0032

    grep -n <val> <path>
  18. Inspect · Runtime processes

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

    1 call · #0033–#0033

    ls -l -a <path>echo <val>grep -a -v <val> <path>grep -a -v <val>tail -n <n>
  19. Execute · Device memory

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

    1 call · #0034–#0034

    datewc -c <path>ps <val>grep -c <val>npu-smi info <n> > <path>sed -n <val>
  20. Inspect · Batching & scheduling

    Requested source searches related to batching & scheduling.

    1 call · #0035–#0035

    grep -n <val> -A <n> <path>
  21. Inspect · Source & workspace

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

    1 call · #0036–#0036

    grep -r -n <val> <path>headecho <flag><command> <args>echo <val>grep -n <val> -A <n> <val>
  22. Inspect · Batching & scheduling

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

    1 call · #0037–#0037

    ls -l -a <path>tail -n <n>echo <val><command> <args>head <flag>grep -n <val> -A <n> <path> <n> > <path>
    1 more command sketches
    head -n <n>
  23. Execute · Runtime processes

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

    2 calls · #0038–#0039

    dategrep -a -v <val> <path>tail -n <n>echo <val>ls <path>grep -a -o <val> <path>
  24. Inspect · Runtime processes

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

    2 calls · #0040–#0041

    datels <path>echo <val>grep -a -v <val> <path>tail -n <n>grep -a -c <path> <path> <n> > <path>
  25. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0042–#0042

    Read <path>
  26. Inspect · Source & workspace

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

    1 call · #0043–#0043

    datels -l -a <path>echo <val>grep -a -c <path> <path>
  27. Validate · Benchmark & validation setup

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

    2 calls · #0044–#0045

    cat <path>echodatels <path>mkdir -p <path>cp <path> <path>
    2 more command sketches
    echo <val>grep -c <val>
  28. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0046–#0046

    Read <path>
  29. Inspect · Source & workspace

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

    3 calls · #0047–#0049

    datels <path>echo <val>grep -a -c <path> <path>tail -c <n> <path> <n> > <path>tail -c <n> <path>
    2 more command sketches
    grep -E <val>command -v <val>
  30. Other · Latency & request handling

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

    1 call · #0050–#0050

    cd <path>python3 -c <script>echo <val>
  31. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0051–#0051

    cd <path>python3 -c <script>
  32. Inspect · Source & workspace

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

    1 call · #0052–#0052

    grep -r -n <val> --include <path> <path> <path> <n> > <path>head -n <n>
  33. Inspect · Device memory

    Requested file and log inspection related to device memory.

    1 call · #0053–#0053

    cat <path>echo <val>
  34. Execute · Benchmark & validation setup

    Requested workspace inspection, source searches and script or workload execution related to benchmark & validation setup.

    1 call · #0054–#0054

    datels <path>grep -E <val>echo <val>python3 -c <script>
  35. Other · Latency & request handling

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

    2 calls · #0055–#0056

    cd <path>python3 -c <script>
  36. Execute · Latency & request handling

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

    1 call · #0057–#0057

    datecd <path>python3 -c <script>ls <path>grep -E <val>
  37. Execute · Benchmark & validation setup

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

    2 calls · #0058–#0059

    datels <path>grep -E <val>tail -n <n> <path>echo <val>cd <path>
    1 more command sketches
    python3 -c <script>
  38. Inspect · Source & workspace

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

    1 call · #0060–#0060

    grep -r -n <val> --include <path> <path>headecho <val>grep -r -n <val> -A <n> <path> <n> > <path>head -n <n>grep -r -l -n <val> <path>
  39. Inspect · Batching & scheduling

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

    1 call · #0061–#0061

    sed -n <val> <path>echo <val>grep -r -n <val> <path>head
  40. Execute · Benchmark & validation setup

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

    3 calls · #0062–#0064

    datels <path>grep -E <val>tail -n <n> <path>grep -r -n <val> -A <n> <path>head -n <n>
    4 more command sketches
    python3 -c <script>cd <path>cp <val> <path>echo <val>
  41. Execute · Batching & scheduling

    Requested workspace file updates and file and log inspection related to batching & scheduling.

    1 call · #0065–#0065

    mkdir -p <path>cat > <path> <script>chmod <val> <path>echo <val>
  42. Execute · Runtime processes

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

    1 call · #0066–#0066

    nohup <path> > <path> <n> >& <path>echo <val>sleep <n>tail -n <n> <path>
  43. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0067–#0067

    sed -n <val> <path>
  44. Execute · Runtime processes

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

    3 calls · #0068–#0070

    dategrep -a -c <path> <path>grep -a -o <val> <path>tail -n <n>tail -c <n> <path>echo
    4 more command sketches
    curl -s -m <n> <url> > <path>echo <val><command> <args>sleep <n>
  45. Execute · Source & workspace

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

    1 call · #0071–#0071

    cd <path>curl -s -m <n> -X <val> <url> > <path><script> <args>tail -n <n>date
  46. Inspect · Source & workspace

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

    1 call · #0072–#0072

    datels <path> <n> > <path>tail -n <n> <path> <n> > <path>
  47. Execute · Benchmark & validation setup

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

    1 call · #0073–#0073

    ls <path> <n> >& <path>headecho <val>cd <path>python3 -c <script> <n> >& <path>tail -n <n>
  48. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0074–#0074

    cat <path>
  49. Execute · Benchmark & validation setup

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

    1 call · #0075–#0075

    cd <path>env <vars> python3 -c <script> <n> >& <path>grep -v <val>
  50. Other · Source & workspace

    Requested script or workload execution and source searches related to source & workspace.

    1 call · #0076–#0076

    cd <path>python3 - <script>grep -n <path> <path>
  51. Execute · Source & workspace

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

    2 calls · #0077–#0078

    curl -s -m <n> -X <val> <url> > <path>bash <script> <val> <val> <n> >& <path>tail -n <n>date<command> <args>
  52. Inspect · Batching & scheduling

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

    1 call · #0079–#0079

    ps <flag> <args>grep -E <val>awk <val>head -n <n>
  53. Profile · Batching & scheduling

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

    1 call · #0080–#0080

    cd <path><command> <args>sleep <n>bash <script> <val> <val> <n> >& <path>tail -n <n>tail -n <n> <path>
    1 more command sketches
    ls -l -a <path> <n> > <path>
  54. Profile · Source & workspace

    1 tool error

    Requested script or workload execution related to source & workspace.

    2 calls · #0081–#0082

    cd <path>python3 - <script>
  55. Other · Latency & request handling

    Requested environment setup or inspection related to latency & request handling.

    1 call · #0083–#0083

    cd <path>env <vars> python3 - <script>
  56. Inspect · Batching & scheduling

    Requested source searches related to batching & scheduling.

    1 call · #0084–#0084

    grep -n <val> -A <n> <path>
  57. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0085–#0085

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

    1 tool error

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

    1 call · #0086–#0086

    grep -n <val> -A <n> <path>echo <val>sed -n <val> <path>
  59. Inspect · Source & workspace

    Requested environment setup or inspection and file and log inspection related to source & workspace.

    1 call · #0087–#0087

    env <vars> python -name <val>echo <val>sed -n <val> <val>
  60. Other · Rollout generation

    Requested environment setup or inspection related to rollout generation.

    1 call · #0088–#0088

    cd <path>env <vars> python3 - <script>
  61. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0089–#0089

    sed -n <val> <path>
  62. Profile · Rollout generation

    Requested execution waits, environment setup or inspection and file and log inspection related to rollout generation.

    1 call · #0090–#0090

    cd <path><command> <args>sleep <n>env <vars> python3 - <script>tail -n <n> <path>
  63. Profile · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0091–#0091

    cd <path>python3 - <script>
  64. Profile · Rollout generation

    Requested execution waits, environment setup or inspection and file and log inspection related to rollout generation.

    1 call · #0092–#0092

    cd <path><command> <args>sleep <n>env <vars> python3 - <script>tail -n <n> <path>
  65. Profile · Device memory

    Requested script or workload execution related to device memory.

    1 call · #0093–#0093

    cd <path>python3 - <script>
  66. Inspect · Source & workspace

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

    3 calls · #0094–#0096

    echo <val>grep -r -n <val> --include <path> <path>headechosed -n <val> <path>
  67. Execute · Runtime processes

    Requested repository inspection, file and log inspection and runtime inspection related to runtime processes.

    1 call · #0097–#0097

    date -udateecho <flag>git status <flag>headps -o <val> -p <n> <n> > <path>
    1 more command sketches
    tail -n <n>
  68. Inspect · Source & workspace

    1 tool error

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

    3 calls · #0098–#0100

    cd <path>grep -r -n <val> --include <path> <path>echo <val>wc -lhead -n <n>sed -n <val> <path>
    2 more command sketches
    <command> <args>sed -n <val> <val>
  69. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0101–#0101

    cd <path>sed -n <val> <path>
  70. Profile · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0102–#0102

    cd <path>ls -l -a <val> <val> <n> > <path>
  71. Other · Attention kernels

    1 tool error

    Requested script or workload execution related to attention kernels.

    1 call · #0103–#0103

    cd <path>python3 - <script>
  72. Profile · Attention kernels

    1 tool error

    Requested script or workload execution related to attention kernels.

    1 call · #0104–#0104

    cd <path>python3 - <script>
  73. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0105–#0105

    cd <path>python3 - <script>
  74. Profile · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0106–#0106

    cd <path>python3 - <script>
  75. Inspect · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0107–#0107

    cd <path>python3 - <script>
  76. Inspect · Device memory

    Requested file and log inspection related to device memory.

    1 call · #0108–#0108

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

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

    2 calls · #0109–#0110

    cd <path>sed -n <val> <path>echo <val>grep -r -n <val> --include <path> <path>
  78. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0111–#0111

    cd <path>sed -n <val> <path>
  79. Edit · Source & workspace

    Requested code edits related to source & workspace.

    2 calls · #0112–#0113

    Edit <path>
  80. Edit · Batching & scheduling

    Requested code edits related to batching & scheduling.

    2 calls · #0114–#0115

    Edit <path>
  81. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0116–#0116

    cd <path>sed -n <val> <path>
  82. Inspect · Source & workspace

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

    1 call · #0117–#0117

    cd <path>grep -r -n <val> -A <n> --include <path> <path>head -n <n>
  83. Execute · Runtime processes

    1 tool error

    Requested workspace inspection, file and log inspection and process termination related to runtime processes.

    5 calls · #0118–#0122

    ls -l -a <path> <path> <n> > <path>echo <path>cat <path>cd <path>kill <n> <n> > <path>sleep <n>
    13 more command sketches
    pkill -f <val> <n> > <path><command> <args>grep -c <n>nohup <path> > <path> <n> >& <path>echo <val>tail -n <n> <path>ls -l -a <path>echo <flag>grep <n>head -n <n>pgrep -f <val>grep -i -E <val> <path>tail -n <n>
  84. Execute · Benchmark & validation setup

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

    1 call · #0123–#0123

    cd <path><script> <args>tail -n <n>
  85. Inspect · Batching & scheduling

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

    1 call · #0124–#0124

    cd <path>grep -i -E <val> <val>tail -n <n>echo <path>grep -E <val> <val>
  86. Inspect · Device memory

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

    1 call · #0125–#0125

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

    1 tool error

    Requested file and log inspection related to source & workspace.

    1 call · #0126–#0126

    cd <path><command> <args>tail -n <n>date <val>
  88. Other · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0127–#0127

    cd <path>python3 - <script>
  89. Inspect · Batching & scheduling

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

    1 call · #0128–#0128

    cd <path>grep -r -n <val> --include <path> <path> <path> <path> <path> <path> <n> <args>grep -v <val>head -n <n>
  90. Profile · Rollout generation

    Requested script or workload execution, execution waits and file and log inspection related to rollout generation.

    1 call · #0129–#0129

    cd <path><command> <args>echo <val>date <val>python3 - <script>sleep <n>
    2 more command sketches
    waitcat <path>
  91. Profile · Batching & scheduling

    Requested script or workload execution related to batching & scheduling.

    1 call · #0130–#0130

    cd <path>python3 - <script>
  92. Inspect · Attention kernels

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

    2 calls · #0131–#0132

    cd <path>echo <val>sed -n <val> <path> <n> > <path>find <val> -name <path>sed -n <val> <path>find <val> -name <path> <n> > <path>
    3 more command sketches
    python3 -c <script> <n> >& <path>grep -v <val>tail -n <n>
  93. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0133–#0133

    cd <path>python3 - <n> > <path> <script>
  94. Inspect · Attention kernels

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

    1 call · #0134–#0134

    cd <path>find <path> -name <path> <n> > <path>head -n <n>echo <val>grep -r -n <val> --include <path> <path> <n> > <path>echo <path>
    1 more command sketches
    sed -n <val> <path>
  95. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0135–#0135

    Write <path>
  96. Inspect · Attention kernels

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

    1 call · #0136–#0136

    cd <path>echo <val>sed -n <val> <path>grep -n <val>
  97. Edit · Device memory

    Requested code edits related to device memory.

    2 calls · #0137–#0138

    Edit <path>
  98. Inspect · Attention kernels

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

    2 calls · #0139–#0140

    cd <path>grep -n <val> <path>awk <flag> <args>sed -n <val> <path>
  99. Edit · Attention kernels

    Requested code edits related to attention kernels.

    2 calls · #0141–#0142

    Edit <path>
  100. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0143–#0143

    cd <path>python3 - <n> > <path> <script>
  101. Other · Source & workspace

    Requested environment setup or inspection and file and log inspection related to source & workspace.

    1 call · #0144–#0144

    env <vars>awk <val> <val>
  102. Execute · Attention kernels

    Requested script or workload execution and repository inspection related to attention kernels.

    1 call · #0145–#0145

    python3 -m <module> <script> <script> <script> <script> <script>echo <val>git status <flag>
  103. Execute · Runtime processes

    1 tool error

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

    2 calls · #0146–#0147

    cd <path>pkill -f <val> <n> > <path>sleep <n>pgrep -f <val>head<command> <args>
    6 more command sketches
    echo <val>date <val>pgrep <flag> <args>head -n <n>echo <flag>ls -l -a <flag> <args>
  104. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0148–#0148

    Edit <path>
  105. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0149–#0149

    cd <path>sed -n <val> <path>
  106. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0150–#0150

    Edit <path>
  107. Execute · Runtime processes

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

    3 calls · #0151–#0153

    cd <path>python3 -c <script> <n> >& <path>grep -v -i <val>tail -n <n>kill <n> <n> > <path>sleep <n>
    8 more command sketches
    pgrep -f <val>head -n <n>echo <val>pgrep <flag> <args>echo <flag><command> <args>date <val>grep <flag> <args>
  108. Validate · Benchmark & validation setup

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

    1 call · #0154–#0154

    cd <path>python3 -m <module> <val>head -n <n>
  109. Inspect · Benchmark & validation setup

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

    2 calls · #0155–#0156

    cd <path>grep -n <val> <path>head -n <n>sed -n <val> <path>
  110. Validate · Task requirements

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

    1 call · #0157–#0157

    cd <path>grep -n <val> -A <n> <path>echo <val>python3 -c <script>
  111. Validate · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0158–#0158

    cd <path>python3 - <script>
  112. Inspect · Source & workspace

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

    3 calls · #0159–#0161

    cd <path><script> <args>tail -n <n>date <val>grep -n <val> -A <n> <path>head -n <n>
    5 more command sketches
    echo <val>grep -n <val> <path>headsed -n <val> <path>grep -r -n <val> -A <n> --include <path> <path>
  113. Other · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0162–#0162

    cd <path>python3 - <script>
  114. Execute · Task requirements

    Requested script or workload execution related to task requirements.

    1 call · #0163–#0163

    cd <path>python3 -c <script>date <val>
  115. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0164–#0164

    cd <path>sed -n <val> <path>
  116. Execute · Runtime processes

    1 tool error

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

    3 calls · #0165–#0167

    pkill -f <val> <n> > <path>sleep <n>pgrep <flag> <args>grep -v <val>head -n <n>echo <flag>
    8 more command sketches
    <command> <args>grep -c <n>ls <path> <n> > <path>headdate <val>kill <n> <n> > <path>pgrep -c -f <val> <n> > <path>echo <n>
  117. Inspect · Device memory

    Requested execution waits, runtime inspection and source searches related to device memory.

    2 calls · #0168–#0169

    sleep <n>pgrep <flag> <args>grep -v <val>head -n <n>echo <path><command> <args>
    6 more command sketches
    grep -E <val>headecho <val>npu-smi info <n> > <path>sed -n <val>ps <flag> <args>
  118. Inspect · Dependencies & build setup

    Requested file and log inspection related to dependencies & build setup.

    1 call · #0170–#0170

    cd <path>cat <path>echo <path>
  119. Execute · Benchmark & validation setup

    1 tool error

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

    10 calls · #0171–#0180

    cd <path>env <vars>bash <script> <n> >& <path>tail -n <n>echo <val>date <val>
    16 more command sketches
    export <vars>mkdir -p <val>nohup <val> <path> > <path> <n> >& <path>tail -n <n> <path> <n> > <path>ls <path> <n> > <path>sleep <n>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>echo <path>ls -l -a <path> <n> > <path>headgrep <val>tail -n <n> <val>python3 -c <script> <n> >& <path>
  120. Profile · Task requirements

    Requested script or workload execution, workspace inspection and file and log inspection related to task requirements.

    1 call · #0181–#0181

    cd <path>python3 -c <script>echo <val>find <path> <path> -name <val> <flag> <args>head
  121. Inspect · Task requirements

    Requested workspace inspection, file and log inspection and script or workload execution related to task requirements.

    1 call · #0182–#0182

    cd <path>ls -l -a <flag> <args>head -n <n>echo <val>python3 -c <script>
  122. Inspect · Source & workspace

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

    2 calls · #0183–#0184

    cd <path>grep -n <val> <path>head -n <n>echo <path>cat <path>sed -n <val> <path>
    2 more command sketches
    envgrep -i -E <val>
  123. Inspect · Benchmark & validation setup

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

    1 call · #0185–#0185

    cd <path>grep -n <val> <path>echo <val>ls -l -a <flag> <args>head
  124. Execute · Task requirements

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

    1 call · #0186–#0186

    cd <path>env <vars>cp <path> <path> <n> > <path>echo <val>ls <path>bash <script> > <path> <n> >& <path>
    3 more command sketches
    export <vars>nohup <val> <path> > <path> <n> >& <path>date <val>
  125. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0187–#0187

    date <val>tail -c <n> <path> <n> > <path>
  126. Inspect · Benchmark & validation setup

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

    1 call · #0188–#0188

    date <val>echo <flag>ls -l -a <path> <n> > <path>ps <flag> <args>grep -E <val>grep -v <val>
    2 more command sketches
    head -n <n>tail -c <n> <path> <n> > <path>
  127. Inspect · Source & workspace

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

    1 call · #0189–#0189

    sleep <n>date <val>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>
    3 more command sketches
    echo <flag>ls -l -a <flag> <args>tail -n <n>
  128. Profile · Task requirements

    Requested script or workload execution related to task requirements.

    1 call · #0190–#0190

    cd <path>python3 -c <script>
  129. Execute · Task requirements

    Requested environment setup or inspection, workspace file updates and script or workload execution related to task requirements.

    1 call · #0191–#0191

    cd <path>env <vars>cp <path> <path>echo <val>bash <script> > <path> <n> >& <path>export <vars>
    3 more command sketches
    nohup <val> <path> > <path> <n> >& <path><command> <args>date <val>
  130. Inspect · Source & workspace

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

    2 calls · #0192–#0193

    cd <path>echo <val>sed -n <val> <path>echogrep -n <val> <path>head -n <n>
    1 more command sketches
    grep -n <val> -A <n> <path>
  131. Execute · Benchmark & validation setup

    1 tool error

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

    2 calls · #0194–#0195

    date <val>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>echo <flag>
    4 more command sketches
    ls -l -a <flag> <args><command> <args>sleep <n>grep <val>
  132. Execute · Latency & request handling

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

    1 call · #0196–#0196

    cd <path>python3 -c <script>cp <val> <path>echo <val>
  133. Validate · Task requirements

    Requested environment setup or inspection, workspace file updates and script or workload execution related to task requirements.

    1 call · #0197–#0197

    cd <path>env <vars>cp <path> <path>echo <val>bash <script> > <path> <n> >& <path>export <vars>
    3 more command sketches
    nohup <val> <path> > <path> <n> >& <path><command> <args>date <val>
  134. Validate · Benchmark & validation setup

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

    1 call · #0198–#0198

    cd <path>ls -l -a <flag> <args>echo <val>python3 -c <script>
  135. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0199–#0199

    cd <path>git status <flag>echo <val>git diff --statechodate <val>
  136. Execute · Benchmark & validation setup

    Requested execution waits, runtime inspection and source searches related to benchmark & validation setup.

    1 call · #0200–#0200

    <command> <args>sleep <n>date <val>ps <flag> <args>grep <val>grep -v <val>
    1 more command sketches
    head -n <n>
  137. Validate · Latency & request handling

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

    1 call · #0201–#0201

    cd <path>cp <val> <path>python3 -c <script>date <val>
  138. Inspect · Runtime processes

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

    1 call · #0202–#0202

    cd <path>env <vars>bash <script> <n> >& <path>tail -n <n>echo <val>ps <flag> <args>
    6 more command sketches
    grep -E -i <val>grep -v <val>head -n <n>git <val> <val><command> <args>grep -E <val>
  139. Inspect · Device memory

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

    1 call · #0203–#0203

    echo <path>ls -l -a <path> <n> > <path>echo <val>npu-smi info <n> > <path>grep -i -E <val>head -n <n>
  140. Inspect · Source & workspace

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

    2 calls · #0204–#0205

    rm -rf <path> <path>echo <path>ls -l -a <path>head -n <n>echo <val>git status <flag>
    3 more command sketches
    cd <path>git diffcat -n <path>
  141. Inspect · Device memory

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

    1 call · #0206–#0206

    env <vars>ls -l -a <val> <n> > <path>echo <flag>cat <path> <n> > <path>echo <val>
  142. Edit · Device memory

    Requested code edits related to device memory.

    3 calls · #0207–#0209

    Write <path>
  143. Inspect · Attention kernels

    Requested repository inspection, runtime inspection and source searches related to attention kernels.

    1 call · #0210–#0210

    date <val>cd <path>echo <val>git status <flag>ps <flag> <args>grep -E -i <val>
    8 more command sketches
    grep -v <val>npu-smi info <n> > <path>grep -i -E <val>head -n <n>git <val> <val>ls <path>python3 -m <module> <script> <script> <script> <script> <script>find <val> -name <val> <flag> <args>
  144. Other · Task requirements

    1 tool error

    Requested environment setup or inspection, workspace file updates and script or workload execution related to task requirements.

    1 call · #0211–#0211

    cd <path>env <vars>mkdir -p <path>export <vars>nohup <val> <path> > <path> <n> >& <path><command> <args>
    4 more command sketches
    echo <val>date <val>git <val> -v <path> <n> > <path>ls <path> <n> > <path>
  145. Inspect · Source & workspace

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

    1 call · #0212–#0212

    cd <path>echo <val>ls -l -a <path> <n> > <path>head -n <n>grep -n -E <val> <path> <n> > <path>git status <flag> <args>
    1 more command sketches
    grep -i <val>
  146. Execute · Benchmark & validation setup

    Requested execution waits, runtime inspection and source searches related to benchmark & validation setup.

    1 call · #0213–#0213

    <command> <args>sleep <n>date <val>ps <flag> <args>grep <val>grep -v <val>
    1 more command sketches
    head -n <n>
  147. Validate · Latency & request handling

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

    1 call · #0214–#0214

    cd <path>python3 -c <script>date <val>
  148. Inspect · Device memory

    Requested environment setup or inspection, workspace file updates and script or workload execution related to device memory.

    1 call · #0215–#0215

    cd <path>env <vars>rm -rf <path>bash <script> <n> >& <path>tail -n <n>echo <val>
    13 more command sketches
    ps <flag> <args>grep -E -i <val>grep -v <val><command> <args>grep -E <val>npu-smi info <n> > <path>grep -i -E <val>head -n <n>git <val> <val>echo <path>ls <path>git status <flag>date <val>

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 · 5 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..b068d140076a4c021e8f80cd4d8e98d528ceba43 100644--- a/python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py+++ b/python/sglang/srt/hardware_backend/npu/attention/ascend_backend.py@@ -19,6 +19,7 @@ from sglang.srt.hardware_backend.npu.attention.mla_preprocess import (     is_fia_nz,     is_mla_preprocess_enabled, )+from sglang.srt.hardware_backend.npu.fast_factory import npu_empty from sglang.srt.layers.attention.base_attn_backend import AttentionBackend from sglang.srt.layers.attention.dsa.utils import is_dsa_enable_prefill_cp from sglang.srt.layers.radix_attention import AttentionType@@ -1521,7 +1522,10 @@ class AscendAttnBackend(AttentionBackend):                 ):                     if not self.use_alibi:                         query = q.reshape(-1, layer.tp_q_head_num * layer.qk_head_dim)-                        attn_output = torch.empty(+                        # `query.device` is already an NPU device, so the+                        # CUDA-alias rewrite in the wrapped factory has nothing+                        # to do; skip it on this per-layer allocation.+                        attn_output = npu_empty(                             (query.shape[0], layer.tp_q_head_num * layer.v_head_dim),                             dtype=query.dtype,                             device=query.device,diff --git a/python/sglang/srt/hardware_backend/npu/fast_factory.py b/python/sglang/srt/hardware_backend/npu/fast_factory.pynew file mode 100644index 0000000000000000000000000000000000000000..e9a798bbf8e5446346c5c21c9f73262f580d343b--- /dev/null+++ b/python/sglang/srt/hardware_backend/npu/fast_factory.py@@ -0,0 +1,52 @@+"""Unwrapped tensor factories for NPU hot paths.++`torch_npu.contrib.transfer_to_npu` wraps every tensor factory and `Tensor.to`+so that CUDA device arguments are rewritten to NPU ones. That rewrite is what+lets the shared (CUDA-worded) model code run unchanged on Ascend, so the wrapper+has to stay installed globally.++The rewrite is pure overhead once the caller already holds a real NPU+`torch.device` (or passes no device at all): it roughly doubles the cost of a+factory call -- measured 5.9 us -> 10.7 us for `torch.empty` on this host. In a+0.6B eager prefill the host issues hundreds of such calls per forward, so the+wrapper shows up as a few milliseconds of pure dispatch on the scheduler thread+that also has to issue the next prefill.++This module exposes the *pre-wrap* callables for use at hot sites only, where+the device argument is known to be an NPU device object or absent. Everywhere+else keeps using the wrapped builtins and their CUDA-alias behaviour.+"""++from __future__ import annotations++import torch++__all__ = ["npu_empty", "npu_zeros", "npu_arange", "npu_tensor", "to_dtype"]+++def _unwrapped(fn):+    """Return the pre-wrap callable, or `fn` when it is not wrapped.++    `transfer_to_npu` decorates with `functools.wraps`, so the original is+    reachable via `__wrapped__`. If a future torch_npu drops the wrapper (or+    the attribute), this degrades to the public callable and stays correct.+    """+    return getattr(fn, "__wrapped__", fn)+++npu_empty = _unwrapped(torch.empty)+npu_zeros = _unwrapped(torch.zeros)+npu_arange = _unwrapped(torch.arange)+npu_tensor = _unwrapped(torch.tensor)+_tensor_to = _unwrapped(torch.Tensor.to)+++def to_dtype(tensor: torch.Tensor, dtype: torch.dtype) -> torch.Tensor:+    """`tensor.to(dtype)` without the CUDA-alias rewrite, skipped when the+    tensor already has `dtype`.++    A dtype-only `.to` never names a device, so the rewrite has nothing to do.+    """+    if tensor.dtype is dtype:+        return tensor+    return _tensor_to(tensor, dtype)diff --git a/python/sglang/srt/hardware_backend/npu/memory_pool_npu.py b/python/sglang/srt/hardware_backend/npu/memory_pool_npu.pyindex a685406f2bffff4efddd8bc093558322e8b45b74..58885f4d4afb9b29c87f22722a14b53ea4a6c92f 100644--- a/python/sglang/srt/hardware_backend/npu/memory_pool_npu.py+++ b/python/sglang/srt/hardware_backend/npu/memory_pool_npu.py@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING, Optional import torch  from sglang.srt.constants import GPU_MEMORY_TYPE_KV_CACHE+from sglang.srt.hardware_backend.npu.fast_factory import to_dtype from sglang.srt.mem_cache.memory_pool import (     MHATokenToKVPool,     MLATokenToKVPool,@@ -213,7 +214,9 @@ class NPUMHATokenToKVPool(MHATokenToKVPool):                 cache_v.view(-1, 1, self.head_num, self.v_head_dim),             )         else:-            loc = loc.to(torch.int32)+            # Called once per layer with the same `loc`; a dtype-only cast needs+            # neither the CUDA-alias rewrite nor a copy when already int32.+            loc = to_dtype(loc, torch.int32)             torch_npu._npu_reshape_and_cache(                 key=cache_k,                 value=cache_v,diff --git a/python/sglang/srt/managers/load_snapshot.py b/python/sglang/srt/managers/load_snapshot.pyindex 6b147c98c238d333e96d2b1682fdec4cd7e7bda8..2077d95ba8a6b4b5a115256c6bf5e8faafcc3807 100644--- a/python/sglang/srt/managers/load_snapshot.py+++ b/python/sglang/srt/managers/load_snapshot.py@@ -311,6 +311,10 @@ class ShmLoadSnapshotWriter:             raise ValueError(f"invalid dp_rank={dp_rank} for dp_size={dp_size}")         self.publish_interval = max(1, publish_interval)         self.publish_counter = 0+        # Set once the current idle state has been published; cleared as soon as+        # the engine does work again. Lets the scheduler publish the idle+        # snapshot on the busy -> idle edge instead of on every idle pass.+        self.idle_published = False          self.path = path         self.dp_size = dp_size@@ -382,6 +386,8 @@ class ZmqLoadSnapshotWriter:             raise ValueError(f"invalid dp_rank={dp_rank} for dp_size={dp_size}")         self.publish_interval = max(1, publish_interval)         self.publish_counter = 0+        # See ShmLoadSnapshotWriter.idle_published.+        self.idle_published = False         self.dp_size = dp_size         self.dp_rank = dp_rank diff --git a/python/sglang/srt/managers/scheduler.py b/python/sglang/srt/managers/scheduler.pyindex a9615a14c512345b2d63323ff3ebd2fe3d9a0dca..b5c1224f8e75a9c3dee4a205b099183e78722d79 100644--- a/python/sglang/srt/managers/scheduler.py+++ b/python/sglang/srt/managers/scheduler.py@@ -773,14 +773,28 @@ class Scheduler(         else:             self.idle_sleeper = None -    def publish_load_snapshot(self, force: bool = False):+    def publish_load_snapshot(self, force: bool = False, idle: bool = False):+        """Publish the current load to /get_loads readers and DP balancing.++        `force` bypasses the publish-interval gate. `idle` marks the publish as+        describing the fully-idle state: it is emitted once on the busy -> idle+        edge and then suppressed while the engine stays idle, since republishing+        an unchanged idle snapshot only costs a file lock and a slot rewrite on+        the thread that also dispatches the next prefill.+        """         writer = self.load_snapshot_writer         if writer is None:             return-        if not force:-            writer.publish_counter += 1-            if writer.publish_counter < writer.publish_interval:+        if idle:+            if writer.idle_published:                 return+            writer.idle_published = True+        else:+            writer.idle_published = False+            if not force:+                writer.publish_counter += 1+                if writer.publish_counter < writer.publish_interval:+                    return         writer.publish_counter = 0         try:             writer.write(self.load_inquirer.get_loads())@@ -3958,8 +3972,10 @@ class Scheduler(         # reset token ratio         self.new_token_ratio_tracker.reset() -        # Publish the idle state so /get_loads and DP balancing do not see stale load.-        self.publish_load_snapshot(force=True)+        # Publish the idle state so /get_loads and DP balancing do not see stale+        # load. Once per busy -> idle edge is enough: nothing changes the load+        # while we stay idle, and the next batch clears the edge flag.+        self.publish_load_snapshot(idle=True)          # sleep until next event         self.maybe_sleep_on_idle()