GLM-5.3 · Serving

S12 · Serving adapt

Valid

SGLang LFM2-1.2B model adapt serving 1dev · Model Adaptation

1.15×PERFORMANCE RATIO
195TOOL 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 agentGLM-5.3 · 195 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
77Inspect
41Edit
1Build
24Validate
33Execute
3Profile
16Other

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 timeline121 groups · 195 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 · Task requirements

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

    3 calls · #0001–#0003

    ls -l -a <path> <n> > <path>echo <flag>ls <path> <n> > <path>find <path> -maxdepth <n> -name <val> -o -maxdepth <n> -name <val> <n> <args>head -n <n>ls -l -a <path>
    3 more command sketches
    echo <val>cat <path> <n> > <path>cat <path>
  2. Validate · Benchmark & validation setup

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

    2 calls · #0004–#0005

    cd <path><command> <args>cat <val>
  3. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0006–#0007

    cd <path>cat <path>head -n <n>sed -n <val> <path>
  4. Inspect · Attention kernels

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

    1 call · #0008–#0008

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

    Requested file and log inspection related to source & workspace.

    1 call · #0009–#0009

    cd <path>sed -n <val> <path>
  6. Inspect · Benchmark & validation setup

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

    3 calls · #0010–#0012

    cd <path>sed -n <val> <path>echo <val>
  7. Inspect · Device memory

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

    1 call · #0013–#0013

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

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

    7 calls · #0014–#0020

    ls <path>echo <val>cat <path>cd <path>grep -i <val>echo <flag>
    9 more command sketches
    wc -l <path>grep -r -n <val> <path> <path> <n> > <path>head -n <n>Read <path>bash <script> <n> >& <path>tail -n <n>grep -n <val> <path>sed -n <val> <path>env <vars> bash <script> <n> >& <path>
  9. Inspect · Attention kernels

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

    4 calls · #0021–#0024

    cd <path>ls <path>head -n <n>echo <val>grep -r -n <val> <path>sed -n <val> <path>
    1 more command sketches
    Read <path>
  10. Inspect · Source & workspace

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

    3 calls · #0025–#0027

    python3 -c <script> <n> >& <path>tail -n <n>echo <val>cd <path>cat <path> <n> > <path>head -n <n>
    1 more command sketches
    ls <path>
  11. Inspect · Convolution & sequence boundaries

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

    2 calls · #0028–#0029

    Read <path>cd <path>grep -r -n <val> <path> <path> --include <path>grep -v <path>head -n <n>
  12. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0030–#0030

    cd <path>sed -n <val> <path>
  13. Validate · Benchmark & validation setup

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

    2 calls · #0031–#0032

    cd <path>env <vars> timeout <n> <val> <path> <n> >& <path>tail -n <n>echo <val>env <vars> nohup <val> <path> > <path> <n> >& <path>
  14. Inspect · Attention kernels

    Requested file and log inspection and workspace inspection related to attention kernels.

    3 calls · #0033–#0035

    cd <path>sed -n <val> <path>ls <path> <path> <n> > <path>Read <path>
  15. Validate · Benchmark & validation setup

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

    1 call · #0036–#0036

    sleep <n>cat <path> <n> > <path>tail -n <n>echo <flag>tail -n <n> <path> <n> > <path>
  16. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0037–#0037

    cd <path>sed -n <val> <path>
  17. Validate · Benchmark & validation setup

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

    3 calls · #0038–#0040

    tail -n <n> <path> <n> > <path>cut <flag>echo <val>cat <path>dateps <val>
    5 more command sketches
    grep -c <val>ls -l -a <path>wc -l <path>sleep <n>tail -c <n> <path>
  18. Inspect · Device memory

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

    4 calls · #0041–#0044

    cd <path>grep -n <val> <path>sed -n <val> <path>echo <val>Read <path>
  19. Inspect · Source & workspace

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

    2 calls · #0045–#0046

    cd <path>grep -n <val> <path>head -n <n>echo <val>sed -n <val> <path>
  20. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    2 calls · #0047–#0048

    cd <path>sed -n <val> <path>
  21. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    2 calls · #0049–#0050

    cd <path>cat <path>echo <val>head -c <n> <path>echo <flag>head -n <n> <path>
    4 more command sketches
    cut <flag>echowc -l <path>head -n <n>
  22. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0051–#0051

    cd <path>sed -n <val> <path>
  23. Inspect · Precision & numerical checks

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

    1 call · #0052–#0052

    cd <path>cat > <path> <script>python3 <script> <n> >& <path>grep -v <val>
  24. Inspect · Device memory

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

    1 call · #0053–#0053

    cd <path>grep -n <val> <path>headsed -n <val> <path>
  25. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    2 calls · #0054–#0055

    cd <path>sed -n <val> <path>echo <val>Read <path>
  26. Edit · Attention kernels

    Requested code edits related to attention kernels.

    4 calls · #0056–#0059

    Edit <path>
  27. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0060–#0060

    Read <path>
  28. Edit · Attention kernels

    Requested code edits related to attention kernels.

    4 calls · #0061–#0064

    Edit <path>Write <path>
  29. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0065–#0065

    Read <path>
  30. Edit · Attention kernels

    1 tool error

    Requested code edits related to attention kernels.

    5 calls · #0066–#0070

    Edit <path>
  31. Profile · Attention kernels

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

    1 call · #0071–#0071

    cd <path>cat > <path> <script>python3 <script> <n> >& <path>grep -v <val>
  32. Edit · Source & workspace

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

    2 calls · #0072–#0073

    cd <path>sed -i <val> <path>python3 <script> <n> >& <path>grep -v <val>
  33. Other · Source & workspace

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

    1 call · #0074–#0074

    cd <path>python3 - <script>python3 <script> <n> >& <path>grep -v <val>
  34. Profile · Attention kernels

    Requested script or workload execution and source searches related to attention kernels.

    1 call · #0075–#0075

    cd <path>python3 -c <script> <n> >& <path>grep -v <val>
  35. Edit · Attention kernels

    Requested code edits related to attention kernels.

    3 calls · #0076–#0078

    Edit <path>
  36. Other · Source & workspace

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

    1 call · #0079–#0079

    cd <path>python3 <script> <n> >& <path>grep -v <val>
  37. Other · Attention kernels

    Requested script or workload execution and source searches related to attention kernels.

    1 call · #0080–#0080

    cd <path>python3 - <script>grep -n <val> <path> <n> > <path>grep -n <val> <path>
  38. Inspect · Convolution & sequence boundaries

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

    1 call · #0081–#0081

    cd <path>python3 - <script>python3 <script> <n> >& <path>grep -v <val>
  39. Edit · Source & workspace

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

    2 calls · #0082–#0083

    cd <path>sed -i <val> <path>python3 <script> <n> >& <path>grep -v <val>
  40. Validate · Benchmark & validation setup

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

    5 calls · #0084–#0088

    cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>sleep <n>datetail -c <n> <path>
    7 more command sketches
    cut <flag>cat <path>head -n <n>grep -n <val> <path>tail -n <n>head -c <n> <path>python3 -c <script> <n> > <path>
  41. Inspect · Source & workspace

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

    1 call · #0089–#0089

    cd <path>grep -n <val> -A <n> <path>headecho <val>sed -n <val> <path>
  42. Validate · Benchmark & validation setup

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

    2 calls · #0090–#0091

    sleep <n>cat <path>tail -n <n>echo <val>ls <path>tail -n <n> <path> <n> > <path>
    1 more command sketches
    cut <flag>
  43. Execute · Prefix caching

    Requested script or workload execution related to prefix caching.

    1 call · #0092–#0092

    cd <path>nohup <path> -m <val> <flag> <args>echo <val>
  44. Inspect · Source & workspace

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

    1 call · #0093–#0093

    cd <path>grep -r -n <val> <path>sed -n <val>echo <val>sed -n <val> <path>
  45. Execute · Runtime processes

    1 tool error

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

    2 calls · #0094–#0095

    <command> <args>grep -q <val>curl -s -m <n> <url> <val>tail -n <n> <path>cut <flag>curl -s -m <n> <url> <val> <val>
  46. Execute · Source & workspace

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

    1 call · #0096–#0096

    curl -s -m <n> <url> -H <path> -d <val>head -c <n>echo
  47. Validate · Rollout generation

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

    1 call · #0097–#0097

    cd <path>cat > <path> <script>python3 <script> <n> >& <path>tail -n <n>
  48. Validate · Device memory

    1 tool error

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

    1 call · #0098–#0098

    pkill -f <val>sleep <n>npu-smi info <n> >& <path>tail -n <n>cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>
    1 more command sketches
    echo <val>
  49. Execute · Device memory

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

    1 call · #0099–#0099

    ps <val>grep -c <val>npu-smi info <n> >& <path>tail -n <n>
  50. Inspect · Device memory

    1 tool error

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

    2 calls · #0100–#0101

    kill <flag> <args>pkill <flag> <args>sleep <n>ps <val>grep -c <val>npu-smi info <n> >& <path>
    3 more command sketches
    tail -n <n>grep <val>head -n <n>
  51. Validate · Benchmark & validation setup

    Requested environment setup or inspection related to benchmark & validation setup.

    1 call · #0102–#0102

    cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val>
  52. Edit · Attention kernels

    Requested code edits related to attention kernels.

    3 calls · #0103–#0105

    Edit <path>
  53. Other · Attention kernels

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

    1 call · #0106–#0106

    cd <path>python3 - <script>head -n <n> <path>
  54. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0107–#0107

    Edit <path>
  55. Inspect · Benchmark & validation setup

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

    1 call · #0108–#0108

    cat <path>tail -n <n>echo <val>ps <val>grep -c <val>
  56. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0109–#0109

    Edit <path>
  57. Other · Attention kernels

    Requested script or workload execution and source searches related to attention kernels.

    1 call · #0110–#0110

    python3 - <script>grep -n <val> <path>echo <val>python3 -c <script>
  58. Inspect · Benchmark & validation setup

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

    1 call · #0111–#0111

    cat <path>tail -n <n>ps <val>grep -c <val>
  59. Validate · Benchmark & validation setup

    Requested execution waits, file and log inspection and runtime inspection related to benchmark & validation setup.

    2 calls · #0112–#0113

    sleep <n>cat <path>tail -n <n>echo <flag>tail -n <n> <path> <n> > <path>cut <flag>
    6 more command sketches
    dateps <val>grep <val>wc -ltail -n <n> <path>ls <path>
  60. Inspect · Benchmark & validation setup

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

    2 calls · #0114–#0115

    grep -n <val> <path>tail -n <n>sed -n <val> <path>
  61. Edit · Attention kernels

    Requested code edits related to attention kernels.

    2 calls · #0116–#0117

    Edit <path>
  62. Other · Source & workspace

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

    1 call · #0118–#0118

    cd <path>python3 <script> <n> >& <path>grep -v <val>
  63. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0119–#0119

    Edit <path>
  64. Other · Source & workspace

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

    1 call · #0120–#0120

    cd <path>python3 <script> <n> >& <path>grep -E <val>
  65. Execute · Prefix caching

    1 tool error

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

    1 call · #0121–#0121

    pkill <flag> <args>sleep <n>npu-smi info <n> >& <path>tail -n <n>cat > <path> <script>nohup <val> <path> > <path> <n> >& <path>
    1 more command sketches
    echo <val>
  66. Execute · Runtime processes

    1 tool error

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

    1 call · #0122–#0122

    ps <val>grep -c <val>ls -l -a <path> <n> > <path>tail -n <n> <path> <n> > <path>
  67. Inspect · Prefix caching

    Requested file and log inspection and runtime inspection related to prefix caching.

    1 call · #0123–#0123

    cat > <path> <script>echo <val>npu-smi info <n> >& <path>tail -n <n>
  68. Execute · Runtime processes

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

    1 call · #0124–#0124

    cd <path>nohup <val> <path> > <path> <n> >& <path>sleep <n>echo <val>ps <val>grep -c <val>
  69. Edit · Source & workspace

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

    1 call · #0125–#0125

    cd <path>sed -i <path> <path><command> <args>python3 <script> <n> >& <path>tail -n <n>
  70. Execute · Runtime processes

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

    1 call · #0126–#0126

    cd <path>python3 <script> <n> >& <path>head -n <n>echo <flag>
  71. Inspect · Runtime processes

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

    1 call · #0127–#0127

    grep -o <val> <path> <n> > <path>head -n <n>echo <val>grep -i -n <val> <path> <n> > <path>grep -i -v <val>grep -i -n <val> <path>
  72. Execute · Batching & scheduling

    1 tool error

    Requested environment setup or inspection, service requests and execution waits related to batching & scheduling.

    5 calls · #0128–#0132

    cd <path>env <vars>curl -s -X <val> <url> > <path>sleep <n><command> <args>tail -n <n>
    7 more command sketches
    nohup <val> -c <path> > <path> <n> >& <path>echo <val>tail -n <n> <path>cut <flag>grep -E <val> <path>head -n <n>python3 -c <script> <n> > <path>
  73. Inspect · Benchmark & validation setup

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

    1 call · #0133–#0133

    cd <path>cat > <path> <script>python3 <script> <n> >& <path>grep -E <val>
  74. Inspect · Precision & numerical checks

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

    1 call · #0134–#0134

    cd <path>cat > <path> <script>python3 <script> <n> >& <path>grep -E <val>
  75. Execute · Task requirements

    Requested service requests, execution waits and script or workload execution related to task requirements.

    1 call · #0135–#0135

    cd <path>curl -s -X <val> <url> > <path>sleep <n>nohup <val> -c <path> > <path> <n> >& <path>echo <val>
  76. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0136–#0136

    Read <path>
  77. Execute · Benchmark & validation setup

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

    1 call · #0137–#0137

    tail -n <n> <path>python3 -c <script> <n> > <path>echo <val>
  78. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0138–#0138

    Edit <path>
  79. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0139–#0139

    Read <path>
  80. Edit · Attention kernels

    Requested code edits related to attention kernels.

    2 calls · #0140–#0141

    Edit <path>
  81. Inspect · Source & workspace

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

    1 call · #0142–#0142

    cd <path>python3 <script> <n> >& <path>grep -E <val>echo <val>python3 -c <script> <n> > <path>tail -n <n> <path>
  82. Inspect · Batching & scheduling

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

    1 call · #0143–#0143

    cd <path>python3 <script> <n> >& <path>grep -v <val>tail -n <n>
  83. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0144–#0144

    Edit <path>
  84. Other · Batching & scheduling

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

    1 call · #0145–#0145

    cd <path>python3 <script> <n> >& <path>grep -E <val>
  85. Profile · Attention kernels

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

    1 call · #0146–#0146

    cd <path>cat > <path> <script>python3 <script> <n> >& <path>grep -E <path>
  86. Execute · Convolution & sequence boundaries

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

    1 call · #0147–#0147

    cd <path>cat > <path> <script>python3 <script> <n> >& <path>grep -E <val>
  87. Inspect · Source & workspace

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

    1 call · #0148–#0148

    cd <path>python3 <script> <n> >& <path>grep -v <val>tail -n <n>
  88. Edit · Source & workspace

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

    1 call · #0149–#0149

    cd <path>sed -i <val> <path>python3 <script> <n> >& <path>grep -E <val>
  89. Other · Source & workspace

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

    1 call · #0150–#0150

    cd <path>python3 <script> <n> >& <path>grep -v <val>grep <val>
  90. Other · Precision & numerical checks

    Requested script or workload execution and source searches related to precision & numerical checks.

    1 call · #0151–#0151

    cd <path>python3 - <script>python3 <script> <n> >& <path>grep -v <val>grep <val>
  91. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0152–#0152

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

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

    1 call · #0153–#0153

    cd <path>python3 - <script>python3 <script> <n> >& <path>grep -E <val>
  93. Execute · Benchmark & validation setup

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

    1 call · #0154–#0154

    python3 -c <script> <n> > <path><command> <args>tail -n <n> <path>
  94. Execute · Device memory

    1 tool error

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

    1 call · #0155–#0155

    pkill <flag> <args>sleep <n>npu-smi info <n> >& <path>tail -n <n>cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>
    1 more command sketches
    echo <val>
  95. Inspect · Device memory

    Requested execution waits, runtime inspection and file and log inspection related to device memory.

    2 calls · #0156–#0157

    sleep <n>npu-smi info <n> >& <path>tail -n <n>ps <val>grep -c <val>kill <flag> <args>
  96. Execute · Benchmark & validation setup

    Requested environment setup or inspection, execution waits and runtime inspection related to benchmark & validation setup.

    2 calls · #0158–#0159

    cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>sleep <n>ps <val>grep -c <val>ls <path>
    2 more command sketches
    headtail -n <n> <path>
  97. Validate · Benchmark & validation setup

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

    1 call · #0160–#0160

    sleep <n>ls <path>grep -E <val>tail -n <n> <path>python3 -c <script>
  98. Execute · Benchmark & validation setup

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

    1 call · #0161–#0161

    sleep <n>ls <path>grep -E <val>tail -n <n> <path>
  99. Other · Batching & scheduling

    Requested script or workload execution related to batching & scheduling.

    1 call · #0162–#0162

    python3 -c <script>
  100. Execute · Benchmark & validation setup

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

    2 calls · #0163–#0164

    sleep <n>ls <path>grep -E <val>tail -n <n> <path>ls <path> <n> > <path>
  101. Validate · Benchmark & validation setup

    Requested environment setup or inspection, execution waits and repository inspection related to benchmark & validation setup.

    1 call · #0165–#0165

    cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>sleep <n>git status <flag>echo <flag>git diff --stat
  102. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0166–#0166

    Read <path>
  103. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0167–#0167

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

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

    2 calls · #0168–#0169

    cd <path>python3 <script> <n> >& <path>grep -E <val>echo <val>cat <path>python3 -c <script> <n> > <path>
    4 more command sketches
    sleep <n><command> <args>tail -n <n> <path>cut <flag>
  105. Execute · Device memory

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

    1 call · #0170–#0170

    npu-smi info <n> >& <path>tail -n <n>cd <path>env <vars> nohup <val> <path> > <path> <n> >& <path>sleep <n>ps <val>
    1 more command sketches
    grep -c <val>
  106. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0171–#0171

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

    1 tool error

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

    2 calls · #0172–#0173

    sleep <n>ls <path>grep -E <val>
  108. Other · Batching & scheduling

    1 tool error

    Requested script or workload execution related to batching & scheduling.

    2 calls · #0174–#0175

    python3 -c <script>python3 - <script>
  109. Inspect · Benchmark & validation setup

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

    1 call · #0176–#0176

    ls -l -a <path>grep -E <val>echo <flag>ps <val>grep -c <val>tail -n <n> <path>
  110. Execute · Benchmark & validation setup

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

    6 calls · #0177–#0182

    sleep <n>ls <path> <n> > <path>echo <val><command> <args>grep -E <val> <val>ls -l -a <path> <n> > <path>
    13 more command sketches
    ls -l -a <path>grep -E <val>awk <val>tail -n <n> <path> <n> > <path>cut <flag>echo <flag>tail -n <n> <path>ps <val>grep <val>datehead -n <n>tail -n <n>python3 - <script>
  111. Inspect · Device memory

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

    1 call · #0183–#0183

    cd <path>env <vars> bash <script> <n> >& <path>tail -n <n>echo <flag>ps <val>grep -c <val>
    4 more command sketches
    npu-smi info <n> >& <path><command> <args>grep -c <n>echo <val>
  112. Edit · Device memory

    Requested code edits related to device memory.

    2 calls · #0184–#0185

    Write <path>
  113. Inspect · Device memory

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

    1 call · #0186–#0186

    env <vars>ls <val>echo <flag>cat <path> <n> > <path>echo <val>
  114. Edit · Device memory

    Requested code edits related to device memory.

    1 call · #0187–#0187

    Write <path>
  115. Inspect · Source & workspace

    1 tool error

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

    1 call · #0188–#0188

    ls <path> <val> <n> > <path>head -n <n><command> <args>ls <path> <n> > <path>
  116. Inspect · Dependencies & build setup

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

    1 call · #0189–#0189

    grep <flag> <args>head -n <n>python3 -m <module> --version <n> > <path>pip list <n> > <path>grep -i -E <val>
  117. Build · Attention kernels

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

    1 call · #0190–#0190

    python3 -m <module> <val> --quiet <flag> <args>tail -n <n>command -v <val> <val> <val> <n> > <path>echo <flag><command> <args>head -n <n>
  118. Other · Attention kernels

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

    1 call · #0191–#0191

    cd <path><command> <args>awk <val> <val>echo <val>python3 -m <module> <script> <script> <script>
  119. Edit · Attention kernels

    Requested code edits related to attention kernels.

    2 calls · #0192–#0193

    Edit <path>
  120. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0194–#0194

    Read <path>
  121. Other · Attention kernels

    Requested script or workload execution and source searches related to attention kernels.

    1 call · #0195–#0195

    python3 -c <script> <n> >& <path>grep -v <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 · 3 changed files

Base commit: 340db9201005fc64635bb25db1d2538f955761c3

diff --git a/python/sglang/srt/hardware_backend/npu/attention/ascend_short_conv_backend.py b/python/sglang/srt/hardware_backend/npu/attention/ascend_short_conv_backend.pynew file mode 100644index 0000000000000000000000000000000000000000..801e2a8ad6cd3085ac3fbe00de87f338f965c5c3--- /dev/null+++ b/python/sglang/srt/hardware_backend/npu/attention/ascend_short_conv_backend.py@@ -0,0 +1,103 @@+"""Ascend short-conv (LFM2 / LFM2-MoE / ZAYA1 CCA) state sidecar.++The generic :class:`ShortConvAttnBackend+<sglang.srt.layers.attention.linear.short_conv_backend.ShortConvAttnBackend>`+owns the per-request conv-state plumbing and is platform agnostic; the only+Ascend-specific part is the *layout* of the state it hands out. The NPU mamba+pool allocates conv state as ``(slots, kernel - 1, dim)`` -- dim last, which is+what the Ascend grouped-conv AscendC ops want (see ``_init_npu_conv_state``) --+while the short-conv models consume ``(slots, dim, kernel - 1)``. This backend+transposes the per-layer pool views into that canonical layout and leaves every+other behaviour (slot resolution, prefix mask, cu-seqlens) to the base class.+"""++from __future__ import annotations++from typing import Any, NamedTuple++import torch++from sglang.srt.hardware_backend.npu.attention.ascend_hybrid_linear_attn_backend import (+    AscendHybridLinearAttnBackend,+)+from sglang.srt.layers.attention.linear.short_conv_backend import (+    ShortConvAttnBackend,+    ShortConvMetadata,+)+from sglang.srt.model_executor.forward_batch_info import ForwardBatch+++class AscendLayerConvCache(NamedTuple):+    """Canonical-layout stand-in for a :class:`MambaPool.State` layer view."""++    conv: list+    temporal: Any+++class AscendShortConvAttnBackend(ShortConvAttnBackend):+    """``ShortConvAttnBackend`` with the NPU conv-state layout transposed."""++    # The Ascend short-conv kernels run the whole ragged window on device; the+    # base class' host mirrors cost a device->host sync per extend step that+    # nothing on Ascend reads.+    needs_extend_host_mirrors: bool = False++    def __init__(self, model_runner):+        super().__init__(model_runner)+        # Base class derived this from the NPU pool shape, where the trailing+        # axis is ``dim``; swap the last two so consumers read ``kernel - 1``.+        self.conv_states_shape = self._canonical_conv_states_shape(+            self.conv_states_shape+        )+        self._layer_conv_views: dict[int, AscendLayerConvCache] = {}++    @staticmethod+    def _canonical_conv_states_shape(pool_shape: torch.Size) -> torch.Size:+        # (..., kernel - 1, dim) -> (..., dim, kernel - 1)+        return torch.Size((*pool_shape[:-2], pool_shape[-1], pool_shape[-2]))++    def conv_state_metadata(+        self, layer_id: int, forward_batch: ForwardBatch+    ) -> ShortConvMetadata:+        meta = super().conv_state_metadata(layer_id, forward_batch)+        pool_index = self.req_to_token_pool.mamba2_layer_index(layer_id)+        cache = self._layer_conv_views.get(pool_index)+        if cache is None:+            layer_cache = self.req_to_token_pool.mamba_pool.mamba_cache.at_layer_idx(+                pool_index+            )+            cache = AscendLayerConvCache(+                # A view, so the kernels' in-place slot writes land in the pool.+                conv=[t.transpose(-2, -1) for t in layer_cache.conv],+                temporal=layer_cache.temporal,+            )+            self._layer_conv_views[pool_index] = cache+        return ShortConvMetadata(+            layer_cache=cache,+            cache_indices=meta.cache_indices,+            query_start_loc=meta.query_start_loc,+            has_initial_state=meta.has_initial_state,+            slot_ids_cpu=meta.slot_ids_cpu,+            has_prefix_cpu=meta.has_prefix_cpu,+        )+++class AscendShortConvHybridAttnBackend(AscendHybridLinearAttnBackend):+    """Ascend hybrid wrapper that routes ``conv_state_metadata`` to the sidecar.++    Short-conv layers are never reached through the full-vs-linear+    ``forward_decode`` / ``forward_extend`` dispatch; the model calls this+    hook directly, exactly as ``ShortConvHybridAttnBackend`` does on CUDA.+    """++    def __init__(+        self,+        full_attn_backend,+        short_conv_backend: AscendShortConvAttnBackend,+        full_attn_layers: list[int],+    ):+        super().__init__(full_attn_backend, short_conv_backend, full_attn_layers)+        self.short_conv_backend = short_conv_backend++    def conv_state_metadata(self, layer_id: int, forward_batch: ForwardBatch):+        return self.short_conv_backend.conv_state_metadata(layer_id, forward_batch)diff --git a/python/sglang/srt/layers/attention/attention_registry.py b/python/sglang/srt/layers/attention/attention_registry.pyindex 9af985d73765d55f812d40af43986ebdeb783619..b42cc8a5b052fb6a704449f01ab6a1bb1c172619 100644--- a/python/sglang/srt/layers/attention/attention_registry.py+++ b/python/sglang/srt/layers/attention/attention_registry.py@@ -436,27 +436,25 @@ def attn_backend_wrapper(runner: "ModelRunner", full_attn_backend: "AttentionBac             )             if isinstance(mamba2_config(runner.model_config), short_conv_cfgs):                 if is_npu():-                    # The model conv layers call-                    # get_attn_backend().conv_state_metadata() unconditionally,-                    # but the Ascend hybrid/mamba backend has no such method.-                    # Fail here (before model execution) with a clear message-                    # rather than an AttributeError deep in the first conv layer.-                    raise NotImplementedError(-                        "Short-conv hybrid models (ZAYA1 CCA, LFM2 / LFM2-MoE) "-                        "are not yet supported on NPU: the conv-state sidecar "-                        "(ShortConvAttnBackend.conv_state_metadata) has no Ascend "-                        "implementation. Add an Ascend conv-state backend before "-                        "serving these models on NPU."+                    # The NPU mamba pool stores conv state dim-last, so the+                    # sidecar has to hand the model canonical-layout views.+                    from sglang.srt.hardware_backend.npu.attention.ascend_short_conv_backend import (+                        AscendShortConvAttnBackend,+                        AscendShortConvHybridAttnBackend,+                    )++                    linear_attn_backend = AscendShortConvAttnBackend(runner)+                    hybrid_backend_cls = AscendShortConvHybridAttnBackend+                else:+                    from sglang.srt.layers.attention.hybrid_linear_attn_backend import (+                        ShortConvHybridAttnBackend,+                    )+                    from sglang.srt.layers.attention.linear.short_conv_backend import (+                        ShortConvAttnBackend,                     )-                from sglang.srt.layers.attention.hybrid_linear_attn_backend import (-                    ShortConvHybridAttnBackend,-                )-                from sglang.srt.layers.attention.linear.short_conv_backend import (-                    ShortConvAttnBackend,-                ) -                linear_attn_backend = ShortConvAttnBackend(runner)-                hybrid_backend_cls = ShortConvHybridAttnBackend+                    linear_attn_backend = ShortConvAttnBackend(runner)+                    hybrid_backend_cls = ShortConvHybridAttnBackend             else:                 linear_attn_backend = Mamba2AttnBackend(runner)         elif kimi_linear_config(runner.model_config) is not None:diff --git a/python/sglang/srt/layers/attention/mamba/causal_conv1d.py b/python/sglang/srt/layers/attention/mamba/causal_conv1d.pyindex 4601f1df533b24cfffdc262834ea5478a47e334e..8c02456fa74956f274d5fed99eec070e4508ed7e 100644--- a/python/sglang/srt/layers/attention/mamba/causal_conv1d.py+++ b/python/sglang/srt/layers/attention/mamba/causal_conv1d.py@@ -5,10 +5,16 @@ # Copyright (c) 2024, Tri Dao. # Adapted from https://github.com/Dao-AILab/causal-conv1d/blob/main/causal_conv1d/causal_conv1d_interface.py +import weakref from typing import Optional  import torch +# Memoized fp32 conv taps. Keyed on ``id(weight)`` -- tensors are unhashable --+# with a weakref back to the owner so a recycled address can never hit.+_TAPS_CACHE: "dict[int, tuple[weakref.ReferenceType, torch.Tensor]]" = {}+_TAPS_CACHE_MAX = 512+ from sglang.kernels.ops.mamba.causal_conv1d_triton import (     PAD_SLOT_ID, )@@ -18,6 +24,7 @@ from sglang.kernels.ops.mamba.causal_conv1d_triton import ( from sglang.kernels.ops.mamba.causal_conv1d_triton import (     causal_conv1d_update as _causal_conv1d_update_triton, )+from sglang.srt.utils import is_npu  try:     from sgl_kernel import causal_conv1d_fwd@@ -28,6 +35,8 @@ try: except (ImportError, AttributeError):     _HAS_SGL_KERNEL = False +_IS_NPU = is_npu()+  def _get_seq_lens_cpu(query_start_loc, x):     if query_start_loc is not None:@@ -35,6 +44,294 @@ def _get_seq_lens_cpu(query_start_loc, x):     return [x.shape[-1]]  +# ---------------------------------------------------------------------------+# Ascend NPU path.+#+# The NPU mamba pool stores conv state as ``(slots, kernel - 1, dim)`` (dim+# last, see ``_init_npu_conv_state``), and the Ascend short-conv backends hand+# that to the model transposed into the canonical ``(slots, dim, kernel - 1)``+# layout these wrappers speak. Everything below is plain torch: no host sync,+# no per-sequence Python loop, so a chunked prefill step stays launch-bound+# only. Accumulation is fp32 with the taps applied in ascending tap order, the+# same order the CUDA/Triton kernels use.+# ---------------------------------------------------------------------------+++def _weight_taps(weight: torch.Tensor) -> torch.Tensor:+    """``(dim, width)`` weight -> fp32 ``(width, dim)`` tap vectors.++    The taps are per-layer constants, so they are memoized on the weight tensor+    itself: recomputing them cost two small launches per conv layer per step,+    which is pure overhead on the decode path where the whole conv is a handful+    of elementwise kernels.+    """+    cached = _TAPS_CACHE.get(id(weight))+    if cached is not None and cached[0]() is weight:+        return cached[1]+    taps = weight.detach().t().to(torch.float32).contiguous()+    if len(_TAPS_CACHE) >= _TAPS_CACHE_MAX:+        _TAPS_CACHE.clear()+    _TAPS_CACHE[id(weight)] = (weakref.ref(weight), taps)+    return taps+++def causal_conv1d_update_npu(+    x: torch.Tensor,+    conv_state: torch.Tensor,+    weight: torch.Tensor,+    bias: Optional[torch.Tensor] = None,+    activation: Optional[str] = None,+    cache_seqlens: Optional[torch.Tensor] = None,+    conv_state_indices: Optional[torch.Tensor] = None,+    pad_slot_id: int = PAD_SLOT_ID,+) -> torch.Tensor:+    """Depthwise causal conv over a short multi-token (or single-token) block.++    ``x``: ``(batch, dim)`` or ``(batch, dim, seqlen)``.+    ``conv_state``: ``(slots, dim, state_len)`` with ``state_len >= width - 1``.+    """+    del cache_seqlens, pad_slot_id  # circular-buffer mode is unused here+    dtype = x.dtype+    squeeze = x.dim() == 2+    if squeeze:+        x = x.unsqueeze(-1)+    batch, _, seqlen = x.shape+    width = weight.shape[1]+    state_len = conv_state.shape[-1]++    indices = conv_state_indices+    if indices is None:+        indices = torch.arange(batch, device=x.device, dtype=torch.int64)+    # Padded rows carry a negative slot id; route them at slot 0 so the gathers+    # stay in bounds. Their scatter is dummy traffic on the reserved slot.+    safe = indices.to(torch.int64).clamp_(min=0)+    taps = _weight_taps(weight)++    # One window, one cast, one fused multiply-add per tap: the whole conv is+    # eight launches, which matters because Ascend elementwise kernels have a+    # ~30us floor and this runs for every conv layer on every decode step.+    window = torch.cat((conv_state[safe], x.to(conv_state.dtype)), dim=-1)+    window_f = window.to(torch.float32)+    offset = state_len - width + 1+    acc = torch.mul(+        window_f[..., offset : offset + seqlen], taps[0].view(1, -1, 1)+    )+    for k in range(1, width):+        acc = torch.addcmul(+            acc,+            window_f[..., offset + k : offset + k + seqlen],+            taps[k].view(1, -1, 1),+        )+    if bias is not None:+        acc = acc + bias.to(torch.float32).view(1, -1, 1)+    if activation in ("silu", "swish"):+        acc = torch.nn.functional.silu(acc)++    conv_state[safe] = window[..., -state_len:]+    out = acc.to(dtype)+    return out.squeeze(-1) if squeeze else out+++def causal_conv1d_fn_npu(+    x: torch.Tensor,+    weight: torch.Tensor,+    bias: Optional[torch.Tensor] = None,+    query_start_loc: Optional[torch.Tensor] = None,+    cache_indices: Optional[torch.Tensor] = None,+    has_initial_state: Optional[torch.Tensor] = None,+    conv_states: Optional[torch.Tensor] = None,+    activation: Optional[str] = None,+    pad_slot_id: int = PAD_SLOT_ID,+    **kwargs,+) -> torch.Tensor:+    """Varlen depthwise causal conv over a ragged ``(dim, total_tokens)`` block.++    ``query_start_loc``/``cache_indices``/``conv_states`` follow the CUDA+    wrapper contract; ``conv_states`` is ``(slots, dim, width - 1)`` and is+    updated in place with each sequence's trailing window.+    """+    del pad_slot_id+    if query_start_loc is None or cache_indices is None or conv_states is None:+        if x.dim() != 3:+            raise ValueError("varlen Ascend causal_conv1d_fn needs query_start_loc")+        return causal_conv1d_update_npu(+            x,+            conv_states,+            weight,+            bias=bias,+            activation=activation,+            conv_state_indices=cache_indices,+        )++    dtype = x.dtype+    dim, total = x.shape+    width = weight.shape[1]+    state_len = conv_states.shape[-1]+    device = x.device+    single_sequence = query_start_loc.shape[0] == 2++    if single_sequence:+        seq_lens = None+    else:+        # Only the multi-sequence path reads the cu-seqlens; deriving them costs+        # a handful of launches per conv layer, which is real time on Ascend.+        starts = query_start_loc[:-1].to(torch.int64)+        ends = query_start_loc[1:].to(torch.int64)+        seq_lens = ends - starts+    has_prefix = (+        has_initial_state.to(dtype)+        if has_initial_state is not None+        else torch.zeros(query_start_loc.shape[0] - 1, dtype=dtype, device=device)+    )++    safe = cache_indices.to(torch.int64).clamp_(min=0)+    taps = _weight_taps(weight)+    xf = x.to(torch.float32)++    # Sequences that resume a cached prefix seed the window from their slot;+    # the rest start from zeros (the pool state is stale for them).+    state = conv_states[safe].to(torch.float32) * has_prefix.view(-1, 1, 1)++    # Causal taps over a zero-padded copy of the flat token stream. The first+    # ``width - 1`` positions of every sequence read across the boundary and are+    # overwritten below.+    padded = torch.cat(+        (+            torch.zeros((dim, width - 1), dtype=torch.float32, device=device),+            xf,+        ),+        dim=1,+    )+    newest = width - 1+    acc = padded[:, newest : newest + total] * taps[newest].view(-1, 1)+    for lag in range(1, width):+        acc = torch.addcmul(+            acc,+            padded[:, newest - lag : newest - lag + total],+            taps[newest - lag].view(-1, 1),+        )+    if bias is not None:+        acc = acc + bias.to(torch.float32).view(-1, 1)++    if single_sequence:+        _apply_single_sequence(+            acc, xf, state, safe, conv_states, taps, width, state_len, total+        )+    else:+        # Boundary fix-ups: output ``start + m`` consumes the window's oldest+        # ``width - 1 - m`` taps from the per-slot state. Write the deeper+        # offsets first so an out-of-range write for a short sequence is+        # overwritten by the always-valid ``m == 0`` fix-up of whichever+        # sequence owns that position.+        for m in range(width - 2, -1, -1):+            pos = (starts + m).clamp_(max=total - 1)+            val = xf[:, pos] * taps[width - 1].view(-1, 1)+            for lag in range(1, width):+                if lag <= m:+                    src = xf[:, (pos - lag).clamp_(min=0)]+                else:+                    src = state[:, :, state_len + m - lag].t()+                val = torch.addcmul(val, src, taps[width - 1 - lag].view(-1, 1))+            acc[:, pos] = val++        # Roll each slot's window forward: column ``i`` of the new state is+        # ``z[len + i]`` of ``z = [state, seq]``, i.e. the sequence's own token+        # when long enough and otherwise the carried-over state column.+        if state_len:+            conv_states[safe] = _roll_window(+                xf, state, ends, seq_lens, state_len, total, conv_states.dtype+            )++    if activation in ("silu", "swish"):+        acc = torch.nn.functional.silu(acc)++    return acc.to(dtype)+++def _apply_single_sequence(+    acc: torch.Tensor,+    xf: torch.Tensor,+    state: torch.Tensor,+    safe: torch.Tensor,+    conv_states: torch.Tensor,+    taps: torch.Tensor,+    width: int,+    state_len: int,+    total: int,+) -> None:+    """Fix-ups + window roll for a one-sequence ragged block.++    A single sequence starts at offset 0 and ends at ``total`` -- both host+    constants -- so the gather/clamp/select machinery of the multi-sequence+    path collapses to plain slices. That is the shape every chunked-prefill+    step of a long prompt takes, and each Ascend elementwise launch costs+    ~30us, so the op count is what matters here.+    """+    bias_cols = min(width - 1, total)+    for m in range(bias_cols):+        val = xf[:, m] * taps[width - 1]+        for lag in range(1, width):+            if m - lag >= 0:+                src = xf[:, m - lag]+            else:+                src = state[:, :, state_len + m - lag].squeeze(0)+            val = torch.addcmul(val, src, taps[width - 1 - lag])+        acc[:, m] = val++    if not state_len:+        return+    cols = []+    for i in range(state_len):+        own = total - state_len + i+        cols.append(+            xf[:, own]+            if own >= 0+            else state[:, :, total + i].squeeze(0)+        )+    conv_states[safe] = torch.stack(cols, dim=-1).unsqueeze(0).to(+        conv_states.dtype+    )+++def _roll_window(+    xf: torch.Tensor,+    state: torch.Tensor,+    ends: torch.Tensor,+    seq_lens: torch.Tensor,+    state_len: int,+    total: int,+    dtype: torch.dtype,+) -> torch.Tensor:+    """Trailing ``(batch, dim, state_len)`` window of ``[state, sequence]``."""+    if state_len == 1:+        # A single-column window always takes the sequence's last token.+        return xf[:, (ends - 1).clamp_(min=0, max=total - 1)].t().unsqueeze(-1)+    last = state_len - 1+    carried = state[:, :, last]+    own_last = xf[:, (ends - 1).clamp_(min=0, max=total - 1)].t()+    if state_len == 2:+        # The common short-conv window. A one-token sequence carries its oldest+        # column over from ``state[len] == state[1]``; longer ones take their own+        # second-to-last token.+        own_prev = xf[:, (ends - 2).clamp_(min=0, max=total - 1)].t()+        col_prev = torch.where((seq_lens < 2).view(-1, 1), carried, own_prev)+        return torch.stack((col_prev, own_last), dim=-1).to(dtype)+    col_last = own_last+    new_cols = [col_prev, col_last]+    for i in range(state_len - 3, -1, -1):+        resume = seq_lens < (state_len - i)+        carried_i = state.gather(+            2,+            (seq_lens + i)+            .clamp_(max=state_len - 1)+            .view(-1, 1, 1)+            .expand(-1, state.shape[1], 1),+        ).squeeze(-1)+        own_i = xf[:, (ends - state_len + i).clamp_(min=0, max=total - 1)].t()+        new_cols.insert(0, torch.where(resume.view(-1, 1), carried_i, own_i))+    return torch.stack(new_cols, dim=-1).to(dtype)++ def causal_conv1d_fn(     x: torch.Tensor,     weight: torch.Tensor,@@ -76,6 +373,19 @@ def causal_conv1d_fn(      out: (batch, dim, seqlen)     """+    if _IS_NPU:+        return causal_conv1d_fn_npu(+            x,+            weight,+            bias=bias,+            query_start_loc=query_start_loc,+            cache_indices=cache_indices,+            has_initial_state=has_initial_state,+            conv_states=conv_states,+            activation=activation,+            pad_slot_id=pad_slot_id,+            **kwargs,+        )     # Use Triton when: (1) sgl_kernel not available, or (2) input is     # non-contiguous and seq_lens_cpu is already pre-computed by caller.     # The Triton kernel accepts arbitrary strides, avoiding a .contiguous()@@ -150,6 +460,17 @@ def causal_conv1d_update(             indices 0 and 3     out: (batch, dim) or (batch, dim, seqlen)     """+    if _IS_NPU:+        return causal_conv1d_update_npu(+            x,+            conv_state,+            weight,+            bias=bias,+            activation=activation,+            cache_seqlens=cache_seqlens,+            conv_state_indices=conv_state_indices,+            pad_slot_id=pad_slot_id,+        )     use_triton = not _HAS_SGL_KERNEL     if use_triton:         return _causal_conv1d_update_triton(