Inspect · Source & workspace
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val> <n> > <path>echo <path>Claude Fable 5.1 · Serving
SGLang LFM2-1.2B model adapt serving 1dev · Model Adaptation
01 / PROCESS MAP
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 Fable 5.1 · 254 visible calls
02 / EVENT SEQUENCE
Requests are grouped by agent, activity and topic. Delegations open into child branches. Summaries describe visible requests; tool errors and missing responses are flagged. A recorded response does not establish command success or a performance improvement.
Scroll within this panel to view all events. Command sketches retain familiar programs and options. Values become <val> or <n>; paths, addresses and script bodies are hidden as <path>, <url> and <script>.
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val> <n> > <path>echo <path>Requested file and log inspection and workspace inspection related to task requirements.
3 calls · #0002–#0004
cat <path>cd <val><command> <args>find <val> -maxdepth <n>head -n <n>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0005–#0006
cd <path>wc -l <path><command> <args>cat <val>Requested file and log inspection related to benchmark & validation setup.
1 call · #0007–#0007
cd <val>echo <path>cat <path>Requested file and log inspection related to task requirements.
1 call · #0008–#0008
cd <path>wc -c <path> <path> <val> <val> <n> > <path>echo <val>cat <path>Requested file and log inspection related to source & workspace.
2 calls · #0009–#0010
cd <path>wc -l <path>echo <val>cat <path>Requested file and log inspection related to task requirements.
1 call · #0011–#0011
cd <path>echo <val>head -c <n> <val>echohead -n <n> <val>echo <path>head -n <n> <path>Requested source searches, file and log inspection and workspace inspection related to convolution & sequence boundaries.
1 call · #0012–#0012
echo <val>grep -r -i -l <val> <path> <val> <n> > <path>head -n <n>ls <path>echo <path>grep -r -l -i -E <val> <path> --include <path>Requested environment setup or inspection, source searches and workspace inspection related to source & workspace.
1 call · #0013–#0013
envgrep -i -E <val>sortecho <val>find <path> <path> <path> <path> <path> <path> <path> -maxdepth <n> -iname <val> <args>head -n <n>Requested runtime inspection, file and log inspection and script or workload execution related to device memory.
1 call · #0014–#0014
npu-smi info <n> >& <path>head -n <n>echo <val>python -c <script> <n> >& <path>tail -n <n>Requested file and log inspection related to task requirements.
1 call · #0015–#0015
cd <path>echo <val>cat <val>Requested file and log inspection related to benchmark & validation setup.
1 call · #0016–#0016
cat <path>Requested file and log inspection, environment setup or inspection and workspace inspection related to source & workspace.
9 calls · #0017–#0025
sed -n <val> <path>echo <val>cat <path>env <vars>ls -l -a <val>cat <path> <n> > <path>envgrep -E <val>sortls -l -a <path> <n> >& <path>head -n <n>cd <path>wc -l <path> <path>echo <path>Requested file and log inspection and workspace inspection related to attention kernels.
2 calls · #0026–#0027
cd <path>wc -l <path> <path> <path>echo <val>cat <path>ls -l -ahead -n <n>echo <path>wc -l <path> <path> <path> <n> > <path>tail -n <n>Requested source searches and file and log inspection related to source & workspace.
1 call · #0028–#0028
grep -n <val> <path>sed -n <val>Requested script or workload execution related to benchmark & validation setup.
1 call · #0029–#0029
python3 - <script>Requested script or workload execution related to benchmark & validation setup.
1 call · #0030–#0030
python3 - <script>Requested workspace inspection, file and log inspection and source searches related to attention kernels.
3 calls · #0031–#0033
cd <path> <n> > <path>find <path> -name <path>sortecho <path>wc -l <path> <n> > <path>echo <val>tail -n <n>cd <path>grep -n <val> <path>cat <path>Requested workspace inspection, source searches and file and log inspection related to device memory.
1 call · #0034–#0034
cd <path>lsgrep -r -n <val> <path>head -n <n>Requested repository inspection and file and log inspection related to source & workspace.
1 call · #0035–#0035
cd <path>git log --oneline <flag>git status <flag>head -n <n>echo <val>git ls-files <path>git rev-parse <flag> <args>Requested workspace inspection, file and log inspection and source searches related to convolution & sequence boundaries.
2 calls · #0036–#0037
cd <path>lsecho <val>find <val> -maxdepth <n> -name <path>head -n <n>grep -r -i -l <val> --include <path> --include <val> --include <val> --include <val> <args>grep -v <val>ls <val> <n> > <path>grep -r -i -l <val> <val> <path> <n> > <path>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0038–#0038
cd <path>timeout <n> <val> -c <path> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection related to source & workspace.
1 call · #0039–#0039
cd <path>wc -l <path> <path>cat <path>echo <val>Requested file and log inspection and source searches related to attention kernels.
4 calls · #0040–#0043
cd <path> <n> > <path>wc -l <path>echo <val>grep -n <val> <path>head -n <n>sed -n <val> <path>cat <path>Requested script or workload execution, source searches and file and log inspection related to convolution & sequence boundaries.
1 call · #0044–#0044
cd <path>timeout <n> <val> -c <val> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection related to runtime processes.
1 call · #0045–#0045
sed -n <val> <path>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0046–#0047
sed -n <val> <path>Requested file and log inspection related to attention kernels.
1 call · #0048–#0048
cat <path>Requested workspace inspection, source searches and file and log inspection related to source & workspace.
2 calls · #0049–#0050
cd <path>find <path> -type <val>grep -v <val>head -n <n>echo <val>ls -l -a <path> <n> > <path>headcat <val>grep -n <val> <path>python -c <script> <n> > <path>tail -n <n><command> <args>tail <flag>find <val> -type <val>grep -r -n <val> <path> --include <path>Requested file and log inspection related to device memory.
1 call · #0051–#0051
sed -n <val> <path>Requested workspace inspection, source searches and file and log inspection related to attention kernels.
1 call · #0052–#0052
cd <path>ls <path>echo <val>find <path> -type <val>grep -v -E <path>head -n <n>sed -n <val> <path>Requested environment setup or inspection, workspace inspection and file and log inspection related to convolution & sequence boundaries.
2 calls · #0053–#0054
env <vars>ls <path> <n> > <path>echo <val>cat <path> <n> > <path>sed -n <val> <path>Requested file and log inspection related to attention kernels.
1 call · #0055–#0055
sed -n <val> <path>Requested script or workload execution, source searches and file and log inspection related to convolution & sequence boundaries.
1 call · #0056–#0056
cd <path>timeout <n> <val> -c <val> <n> >& <path>grep -v <val>tail -n <n>Requested source searches and file and log inspection related to attention kernels.
1 call · #0057–#0057
cd <path>grep -n <val> <path>head -n <n>echo <val>sed -n <val> <path>Requested source searches and file and log inspection related to kv-cache management.
1 call · #0058–#0058
cd <path>grep -r -n <val> --include <path> <path>head -n <n>echo <val>grep -r -n <val> <path>grep -n <val> -A <n> <path>Requested file and log inspection related to source & workspace.
1 call · #0059–#0059
sed -n <val> <path>Requested file and log inspection related to attention kernels.
1 call · #0060–#0060
sed -n <val> <path>echo <val>Requested source searches and file and log inspection related to device memory.
1 call · #0061–#0061
cd <path>grep -n <val> <path>head -n <n>echo <val>Requested file and log inspection related to attention kernels.
1 call · #0062–#0062
cd <path>sed -n <val> <path>echo <val>Requested environment setup or inspection, source searches and script or workload execution related to convolution & sequence boundaries.
1 call · #0063–#0063
env <vars>grep -n <val> <val>echo <val>python3 - <script>Requested file and log inspection related to source & workspace.
2 calls · #0064–#0065
cat <val>sed -n <val> <path>Requested file and log inspection related to attention kernels.
1 call · #0066–#0066
cat <path>Requested file and log inspection and source searches related to kv-cache management.
1 call · #0067–#0067
cd <path>sed -n <val> <path>echo <val>grep -n <val> <path>head -n <n>Requested source searches and file and log inspection related to prefix caching.
1 call · #0068–#0068
cd <path>grep -r -n <val> <path> <path> <path> <n> > <path>grep -v <path>head -n <n>Requested file and log inspection related to convolution & sequence boundaries.
1 call · #0069–#0069
cd <path>wc -l <path> <path>sed -n <val> <path>Requested file and log inspection related to attention kernels.
1 call · #0070–#0070
sed -n <val> <path>Requested file and log inspection related to device memory.
1 call · #0071–#0071
cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to prefix caching.
1 call · #0072–#0072
cd <path>grep -n <val> <path>head -n <n>echo <val>grep -n <flag> <args>Requested script or workload execution related to convolution & sequence boundaries.
1 call · #0073–#0073
python3 - <script>Requested file and log inspection and source searches related to attention kernels.
2 calls · #0074–#0075
cd <path>wc -l <path>cat <path>sed -n <val> <path>echo <val>grep -r -n <val> <path>head -n <n>Requested workspace file updates, file and log inspection and execution waits related to prefix caching.
1 call · #0076–#0076
mkdir -p <path> <path> <path>cat > <path> <script>chmod <val> <path>cd <path><command> <args>echo <val>sleep <n>tail -n <n> <path>Requested source searches and file and log inspection related to attention kernels.
1 call · #0077–#0077
cd <path>grep -r -n <val> -A <n> <path>head -n <n>Requested execution waits, source searches and file and log inspection related to runtime processes.
1 call · #0078–#0078
sleep <n>echo <path>grep -n <val> <path>head -n <n>echo <val>tail -n <n> <path>pgrep <flag> <args><command> <args>Requested file and log inspection and source searches related to attention kernels.
3 calls · #0079–#0081
cd <path>sed -n <val> <path>grep -n <val> <path>head -n <n>echo <val>Requested environment setup or inspection, source searches and file and log inspection related to convolution & sequence boundaries.
1 call · #0082–#0082
env <vars>echo <val>grep -n <val> <val>head -n <n>grep -n <val> <path>sed -n <val>Requested source searches and file and log inspection related to attention kernels.
1 call · #0083–#0083
grep -n <val> <path>head -n <n>echo <val>Requested source searches and file and log inspection related to device memory.
1 call · #0084–#0084
cd <path>grep -n <val> -A <n> <path>head -n <n>Requested source searches, file and log inspection and script or workload execution related to convolution & sequence boundaries.
3 calls · #0085–#0087
cd <path>grep -n <val> <path>sed -n <val>sed -n <val> <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection related to attention kernels.
1 call · #0088–#0088
sed -n <val> <path>Requested source searches and file and log inspection related to runtime processes.
1 call · #0089–#0089
cd <path>grep -n <val> <path>head -n <n>echo <val>Requested runtime inspection, source searches and file and log inspection related to device memory.
1 call · #0090–#0090
pgrep <flag> <args>grep -v <val>head -n <n>echo <val><command> <args>npu-smi info <n> > <path>sed -n <path>Requested file and log inspection related to device memory.
1 call · #0091–#0091
sed -n <val> <path>Requested file and log inspection, script or workload execution and source searches related to convolution & sequence boundaries.
1 call · #0092–#0092
cd <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection related to prefix caching.
1 call · #0093–#0093
cd <path>echo <val>sed -n <val> <path>echo <path>Requested source searches and file and log inspection related to device memory.
1 call · #0094–#0094
cd <path>grep -n <val> -A <n> <path> <path> <n> > <path>head -n <n>echo <path>grep -n <val> -A <n> <path>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0095–#0095
echo <val>grep -r -n <val> <path>head -n <n>echo <path>sed -n <val> <path>Requested file and log inspection, script or workload execution and source searches related to convolution & sequence boundaries.
1 call · #0096–#0096
cd <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection related to source & workspace.
1 call · #0097–#0097
cat <path>Requested source searches and file and log inspection related to attention kernels.
1 call · #0098–#0098
cd <path>echo <path>grep -n <val> <path>sed -n <val>Requested source searches and file and log inspection related to source & workspace.
1 call · #0099–#0099
cd <path>grep -n <val> <path>head -n <n>Requested file and log inspection, script or workload execution and source searches related to convolution & sequence boundaries.
1 call · #0100–#0100
cd <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection, source searches and workspace inspection related to attention kernels.
3 calls · #0101–#0103
sed -n <val> <path>cd <path>echo <val>grep -n <val> -A <n> <path>head -n <n>grep -n <val> <path>ls <path>cat <path> <n> > <path>Requested source searches and file and log inspection related to convolution & sequence boundaries.
2 calls · #0104–#0105
cd <path>echo <val>grep -n <val> <path>head -n <n>Requested file and log inspection related to attention kernels.
1 call · #0106–#0106
sed -n <val> <path>Requested file and log inspection related to runtime processes.
2 calls · #0107–#0108
cd <path>sed -n <val> <path>Requested file and log inspection related to attention kernels.
1 call · #0109–#0109
cd <path>sed -n <val> <path>Requested file and log inspection related to source & workspace.
1 call · #0110–#0110
cd <path>sed -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0111–#0111
date -u <val>python3 -c <script>Requested source searches and file and log inspection related to source & workspace.
1 call · #0112–#0112
cd <path>grep -n <val> -A <n> <path>head -n <n>echo <val>grep -n <val> <path>Requested workspace inspection, file and log inspection and source searches related to benchmark & validation setup.
1 call · #0113–#0113
cd <path>ls <path>head -n <n>echo <val>grep -r -n <val> <path>cat <path> <n> > <path>Requested source searches and file and log inspection related to device memory.
1 call · #0114–#0114
cd <path>grep -n <val> <path>head -n <n>echo <val>sed -n <val> <path>Requested file and log inspection and script or workload execution related to speculative decoding.
1 call · #0115–#0115
cat > <path> <script>python3 -c <script>echo <val>Requested script or workload execution related to attention kernels.
1 call · #0116–#0116
cd <path>python3 - <script>python3 -c <script>echo <val>Requested script or workload execution related to source & workspace.
1 call · #0117–#0117
python3 - <script><command> <args>echo <val>Requested workspace file updates, execution waits and source searches related to runtime processes.
1 call · #0118–#0118
rm -f <path><command> <args>echo <val>sleep <n>grep -n -E <val> <path>head -n <n>tail -n <n>tail -n <n> <path>Requested source searches and file and log inspection related to attention kernels.
1 call · #0119–#0119
echo <val>grep -n <val> <path>sed -n <val> <path>Requested repository inspection related to source & workspace.
1 call · #0120–#0120
git status <flag>echo <val>git diff --statgit diff <path> <path>Requested execution waits, source searches and file and log inspection related to runtime processes.
1 call · #0121–#0121
<command> <args>sleep <n>echo <val>grep -n -E <val> <path>head -n <n>tail -n <n>tail -n <n> <path>Requested file and log inspection related to rollout generation.
1 call · #0122–#0122
cat > <path> <script>echo <val>Requested environment setup or inspection, file and log inspection and workspace inspection related to convolution & sequence boundaries.
1 call · #0123–#0123
env <vars>cat > <path> <script>printf <val> <flag> <args>ls <val>echo <flag>cat <path>Requested script or workload execution, source searches and file and log inspection related to runtime processes.
1 call · #0124–#0124
cd <path>timeout <n> <val> <path> <n> <n> >& <path>grep -v <val>tail -n <n>Requested workspace inspection and file and log inspection related to source & workspace.
1 call · #0125–#0125
ls <path> <n> > <path>sed -n <val> <path> <n> > <path>echo <path><command> <args>echo <val>Requested runtime inspection and file and log inspection related to device memory.
1 call · #0126–#0126
npu-smi info <n> > <path>sed -n <val>Requested file and log inspection, script or workload execution and source searches related to convolution & sequence boundaries.
1 call · #0127–#0127
cd <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested source searches and file and log inspection related to device memory.
1 call · #0128–#0128
cd <path>echo <val>grep -r -n <val> --include <path> <path>head -n <n>echo <path>grep -n <val> <path>Requested file and log inspection, script or workload execution and source searches related to rollout generation.
1 call · #0129–#0129
cd <path>cat > <path> <script>timeout <n> <val> <path> <n> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection, script or workload execution and source searches related to rollout generation.
1 call · #0130–#0130
cd <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested script or workload execution related to source & workspace.
1 call · #0131–#0131
python3 -c <script>Requested file and log inspection and workspace file updates related to benchmark & validation setup.
1 call · #0132–#0132
cat > <path> <script>chmod <val> <path>echo <val>Requested process termination, execution waits and runtime inspection related to device memory.
1 call · #0133–#0133
<command> <args>tr -d <val>kill <flag> <args>truesleep <n>pkill <flag> <args>echo <val>pgrep <flag> <args>head -n <n>npu-smi info <n> > <path>sed -n <val>rm -f <path>Requested tool activity related to source & workspace.
1 call · #0134–#0134
<command> <args>echo <val>Requested file and log inspection related to attention kernels.
1 call · #0135–#0135
sed -n <val> <path>Requested runtime inspection, source searches and file and log inspection related to runtime processes.
1 call · #0136–#0136
ps <flag> <args>grep -E <val>grep -v <val>head -n <n>echo <val>Requested workspace inspection and file and log inspection related to source & workspace.
1 call · #0137–#0137
ls -l -a <path> <n> > <path>echo <flag>tail -n <n> <path> <n> > <path>echo <val>ls -l -a <val> <n> > <path>headRequested script or workload execution, runtime inspection and file and log inspection related to device memory.
1 call · #0138–#0138
python3 -c <script>echo <val>npu-smi info <n> > <path>sed -n <val>Requested environment setup or inspection, workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0139–#0139
cd <path>export <vars>mkdir -p <val>bash <script> > <path> <n> >& <path>echo <val>tail -n <n> <path>Requested file and log inspection related to attention kernels.
2 calls · #0140–#0141
sed -n <val> <path>cd <path>echo <val>Requested file and log inspection and workspace inspection related to benchmark & validation setup.
1 call · #0142–#0142
tail -c <n> <path> <n> > <path>echo <val>ls -l -a <val> <n> > <path>head -n <n>tail -n <n> <path> <n> > <path>Requested file and log inspection and source searches related to source & workspace.
1 call · #0143–#0143
sed -n <val> <path>echo <val>grep -r -l -n <val> <path>head -n <n>Requested script or workload execution and file and log inspection related to attention kernels.
1 call · #0144–#0144
cd <path>python3 - <script>awk <val> <path>headRequested script or workload execution related to source & workspace.
1 call · #0145–#0145
python3 -c <script>Requested execution waits, file and log inspection and script or workload execution related to benchmark & validation setup.
1 call · #0146–#0146
<command> <args>sleep <n>echo <val>cat <path> <n> > <path>python3 -c <script> <n> >& <path>head -n <n>tail -n <n> <path> <n> > <path>grep -n -E <val> <path> <n> > <path>Requested file and log inspection, source searches and workspace inspection related to source & workspace.
2 calls · #0147–#0148
sed -n <val> <path>grep -r -l -n <val> <path> <n> > <path>head -n <n>echo <val>ls -R <path> <n> > <path>Requested file and log inspection related to attention kernels.
1 call · #0149–#0149
awk <val> <path>headecho <val>Requested execution waits, file and log inspection and script or workload execution related to benchmark & validation setup.
1 call · #0150–#0150
<command> <args>sleep <n>echo <val>cat <path> <n> > <path>python3 -c <script>tail -n <n> <path> <n> > <path>grep <flag> <args>echo <n>Requested file and log inspection and workspace inspection related to attention kernels.
1 call · #0151–#0151
sed -n <val> <path>echo <path>ls <path>Requested script or workload execution related to source & workspace.
1 call · #0152–#0152
python3 -c <script>Requested environment setup or inspection, workspace file updates and script or workload execution related to benchmark & validation setup.
2 calls · #0153–#0154
cd <path>export <vars>mkdir -p <val>bash <script> > <path> <n> >& <path>echo <val>tail -n <n> <path>cat <path> <n> > <path>echols -l -a <path> <n> > <path>Requested workspace file updates, file and log inspection and script or workload execution related to speculative decoding.
1 call · #0155–#0155
mkdir -p <path>cat > <path> <script>python3 -c <script>echo <val>Requested execution waits, workspace inspection and file and log inspection related to batching & scheduling.
1 call · #0156–#0156
sleep <n>echo <val>ls -l -a <val>head -n <n>tail -n <n> <path> <n> > <path>grep <flag> <args>echo <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0157–#0157
python3 - <script>python3 -c <script>echo <val>grep -n <val> <path>awk <val> <path>headRequested execution waits, script or workload execution and workspace inspection related to benchmark & validation setup.
1 call · #0158–#0158
sleep <n>python3 -c <script>echo <val>ls -l -a <path> <n> > <path>ls <val>grep -E <val>sorttail -n <n> <path> <n> > <path>Requested file and log inspection related to attention kernels.
1 call · #0159–#0159
awk <val> <path>Requested execution waits, script or workload execution and workspace inspection related to batching & scheduling.
1 call · #0160–#0160
sleep <n>python3 -c <script>echo <val>ls -l -a <path> <n> > <path>ls <val>grep -E <val>sorttail -n <n> <path> <n> > <path>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0161–#0161
grep <flag> <args>tail -n <n>echo <val>grep -E <val> <path> <n> > <path>Requested script or workload execution and file and log inspection related to attention kernels.
1 call · #0162–#0162
python3 - <script>python3 -c <script>echo <val>awk <val> <path>Requested file and log inspection related to convolution & sequence boundaries.
1 call · #0163–#0163
cat > <path> <script>echo <val>Requested execution waits, script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0164–#0164
<command> <args>sleep <n>python3 -c <script>echo <val>tail -n <n> <path> <n> > <path>Requested script or workload execution, source searches and file and log inspection related to source & workspace.
1 call · #0165–#0165
cd <path>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0166–#0166
timeout <n> <val> -m <val> <path> -q <n> >& <path>grep -v <val>tail -n <n>Requested workspace inspection, runtime inspection and source searches related to device memory.
1 call · #0167–#0167
echo <val>ls -l -a <path> <n> > <path>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>python3 -c <script>npu-smi info <n> > <path>sed -n <val>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0168–#0168
timeout <n> <val> -m <val> <path> -q -p <val> <n> >& <path>grep -v <val>grep -v -E <val>head -n <n>Requested script or workload execution related to benchmark & validation setup.
1 call · #0169–#0169
python3 -c <script>Requested repository inspection, source searches and file and log inspection related to source & workspace.
1 call · #0170–#0170
git status <flag>echo <val>git diff --statgrep <val>awk <val><command> <args>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0171–#0171
timeout <n> <val> -m <val> <path> -q -p <val> <flag> <args>grep -v <val>tail -n <n>Requested source searches and file and log inspection related to source & workspace.
1 call · #0172–#0172
grep <flag> <args>sed -E <path>sort -uhead -n <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
2 calls · #0173–#0174
python3 - <script>python3 -c <script>echo <val>timeout <n> <val> -m <val> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>Requested repository inspection related to attention kernels.
1 call · #0175–#0175
git diff <path>Requested script or workload execution related to source & workspace.
1 call · #0176–#0176
python3 -c <script>Requested file and log inspection, script or workload execution and source searches related to attention kernels.
1 call · #0177–#0177
cd <path>cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection and source searches related to source & workspace.
2 calls · #0178–#0179
sed -n <val> <path>echo <val>sed -n <path> <path>grep -n <val> -A <n>head -n <n>grep -n <val> -A <n> <path>Requested script or workload execution and file and log inspection related to attention kernels.
1 call · #0180–#0180
python3 - <script>python3 -c <script>echo <val>awk <val> <path>trueRequested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0181–#0181
timeout <n> <val> -m <val> <path> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>Requested workspace file updates, workspace inspection and runtime inspection related to benchmark & validation setup.
2 calls · #0182–#0183
mkdir -p <path>cp <path> <path>ls -l -a <path>echo <val>ls <path> <n> > <path>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>git <val> <val> <flag>ls -d <path> <n> > <path>timeout <n> <val> -m <val> <path> -q -p <val> <n> >& <path>tail -n <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0184–#0184
timeout <n> <val> -c <path> <n> >& <path>grep -v <val>tail -n <n>Requested workspace file updates, repository inspection and workspace inspection related to attention kernels.
1 call · #0185–#0185
mkdir -p <path>cd <path>git diff > <path>cp <path> <path>ls -l -a <path>wc -l <path>python3 -c <script>Requested script or workload execution, source searches and file and log inspection related to benchmark & validation setup.
1 call · #0186–#0186
timeout <n> <val> -m <val> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0187–#0187
timeout <n> <val> -m <val> <path> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>Requested script or workload execution, source searches and file and log inspection related to speculative decoding.
1 call · #0188–#0188
python3 - <script>python3 -c <script>echo <val>timeout <n> <val> -m <val> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>Requested environment setup or inspection, workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0189–#0189
cd <path>export <vars>mkdir -p <val>bash <script> > <path> <n> >& <path>echo <val>tail -n <n> <path>Requested file and log inspection, script or workload execution and source searches related to benchmark & validation setup.
1 call · #0190–#0190
cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested script or workload execution related to source & workspace.
2 calls · #0191–#0192
python3 -c <script>Requested file and log inspection, script or workload execution and source searches related to speculative decoding.
1 call · #0193–#0193
cat > <path> <script>timeout <n> <val> <path> <n> >& <path>grep -v <val>tail -n <n>Requested execution waits, script or workload execution and source searches related to benchmark & validation setup.
1 call · #0194–#0194
<command> <args>sleep <n>echo <val>python3 -c <script>grep <flag> <args>echo <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
2 calls · #0195–#0196
timeout <n> <val> -m <val> <path> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>env <vars>cat > <path> <script>printf <val> <flag> <args>cat <path>Requested file and log inspection, workspace file updates and source searches related to rollout generation.
1 call · #0197–#0197
sed <path> <path> > <path>chmod <val> <path>grep -n <val> <path>cat > <path> <script>rm -f <path><command> <args>echo <val>sleep <n>Requested file and log inspection related to attention kernels.
1 call · #0198–#0198
sed -n <val> <path>Requested script or workload execution and workspace inspection related to benchmark & validation setup.
1 call · #0199–#0199
python3 -c <script>echo <val>ls <path> <n> > <path>Requested service requests, source searches and execution waits related to batching & scheduling.
1 call · #0200–#0200
<command> <args>curl -s -m <n> <url> > <path> <n> >& <path>grep -q -E <val> <path> <n> > <path>sleep <n>echo <val>grep <flag> <args>head -n <n>grep -c <val> <path>cd <path>timeout <n> <val> <path> <n> <path> <n> >& <path>grep -v <val>tail -n <n>python3 -c <script>Requested file and log inspection related to attention kernels.
1 call · #0201–#0201
sed -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0202–#0202
python3 -c <script>Requested source searches and file and log inspection related to runtime processes.
1 call · #0203–#0203
echo <val>grep -n -E <val> <path>head -n <n>tail -n <n> <path>Requested runtime inspection, source searches and file and log inspection related to device memory.
1 call · #0204–#0204
ps <flag> <args>grep -E <val>grep -v <val>head -n <n>echo <val>python3 -c <script>npu-smi info <n> > <path>sed -n <val>ls <path> <n> > <path>Requested script or workload execution related to source & workspace.
1 call · #0205–#0205
python3 -c <script>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0206–#0206
echo <val>grep <flag> <args>tail -n <n>grep -c <val> <path>Requested script or workload execution, source searches and file and log inspection related to batching & scheduling.
1 call · #0207–#0207
cd <path>timeout <n> <val> <path> <n> <path> <n> >& <path>grep -v <val>tail -n <n>echo <val>python3 -c <script>Requested script or workload execution related to source & workspace.
1 call · #0208–#0208
python3 -c <script>Requested environment setup or inspection, runtime inspection and execution waits related to device memory.
1 call · #0209–#0209
env <vars><command> <args>tr -d <val>echo <val>ps -p <val> > <path> <n> >& <path>sleep <n>python3 -c <script>npu-smi info <n> > <path>sed -n <val>export <vars>mkdir -p <val>cd <path>Requested environment setup or inspection and file and log inspection related to convolution & sequence boundaries.
1 call · #0210–#0210
env <vars>cat > <path> <script>printf <val> <flag> <args>wc -l <path>tail -n <n> <path>Requested script or workload execution related to source & workspace.
1 call · #0211–#0211
python3 -c <script>Requested repository inspection, source searches and workspace inspection related to source & workspace.
1 call · #0212–#0212
echo <val>git status <flag> <args>grep -v -E <val>echo <flag>find <path> <val> -name <val> -type <val> <n> > <path>head -n <n>echo <path>git <val> -v <path> <n> > <path>Requested repository inspection and file and log inspection related to attention kernels.
1 call · #0213–#0213
git diff --statecho <val><command> <args>git status <flag> <args>head -n <n>Requested script or workload execution related to source & workspace.
1 call · #0214–#0214
python3 -c <script>Requested source searches, execution waits and script or workload execution related to benchmark & validation setup.
2 calls · #0215–#0216
<command> <args>grep -q <val> <path> <n> > <path>sleep <n>echo <val>python3 -c <script>python3 -c <script> <n> >& <path>head -n <n>Requested script or workload execution related to source & workspace.
1 call · #0217–#0217
python3 -c <script>Requested runtime inspection, source searches and file and log inspection related to device memory.
1 call · #0218–#0218
echo <val>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>npu-smi info <n> > <path>sed -n <val>tail -n <n> <path> <n> > <path>Requested execution waits and script or workload execution related to benchmark & validation setup.
1 call · #0219–#0219
<command> <args>sleep <n>python3 -c <script>Requested file and log inspection related to source & workspace.
1 call · #0220–#0220
echo <val>sed -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0221–#0221
python3 -c <script>Requested execution waits and script or workload execution related to benchmark & validation setup.
1 call · #0222–#0222
<command> <args>sleep <n>echo <val>python3 -c <script>Requested workspace inspection and file and log inspection related to source & workspace.
1 call · #0223–#0223
ls -l -a <val>awk <val>tail -n <n>Requested script or workload execution related to source & workspace.
1 call · #0224–#0224
python3 -c <script>Requested workspace file updates, runtime inspection and source searches related to device memory.
1 call · #0225–#0225
cp <path> <path>echo <val>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>python3 -c <script>npu-smi info <n> > <path>sed -n <val>ls <path> <n> > <path>git <val> <val> <flag>grep -c <val>ls -d <path> <n> > <path>Requested repository inspection, source searches and workspace inspection related to attention kernels.
1 call · #0226–#0226
echo <val>git status <flag> <args>grep -v -E <val>find <path> <val> -name <val> -o -name <val> <n> > <path>head -n <n>echo <path>timeout <n> <val> -m <val> <path> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>Requested script or workload execution related to benchmark & validation setup.
1 call · #0227–#0227
echo <val>python3 -c <script>Requested script or workload execution related to batching & scheduling.
1 call · #0228–#0228
python3 -c <script>Requested environment setup or inspection, workspace inspection and file and log inspection related to device memory.
1 call · #0229–#0229
env <vars>ls <val>echo <flag>cat <path>python3 -c <script>Requested script or workload execution related to benchmark & validation setup.
1 call · #0230–#0230
python3 -c <script>Requested script or workload execution, source searches and file and log inspection related to benchmark & validation setup.
1 call · #0231–#0231
timeout <n> <val> -m <val> <path> <path> <path> -q -p <val> <n> <args>grep -v <val>tail -n <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0232–#0232
cd <path>timeout <n> <val> -c <val> <n> >& <path>grep -v <val>tail -n <n>Requested file and log inspection and source searches related to source & workspace.
1 call · #0233–#0233
tail -c <n> <path> <n> > <path>grep -v <val>tail -n <n>Requested script or workload execution related to source & workspace.
1 call · #0234–#0234
python3 -c <script>Requested environment setup or inspection, workspace inspection and source searches related to benchmark & validation setup.
1 call · #0235–#0235
env <vars>ls -l -a <val> <n> > <path>echo <val>echo <path>grep -v -E <val> <val> <n> > <path>tail -n <n>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>Requested repository inspection, source searches and file and log inspection related to device memory.
1 call · #0236–#0236
echo <val>git status <flag> <args>grep -v -E <val>wc -lfind <path> <val> -name <val> -o -name <val> <n> > <path>echo <path>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>python3 -c <script>ls <path> <n> > <path>npu-smi info <n> > <path>sed -n <val>Requested runtime inspection, execution waits and environment setup or inspection related to source & workspace.
1 call · #0237–#0237
<command> <args>ps -p <n> > <path> <n> >& <path>sleep <n>env <vars>echo <val>grep -v -E <val> <val> <n> > <path>tail -n <n>Requested script or workload execution related to source & workspace.
2 calls · #0238–#0239
python3 -c <script>Requested repository inspection, file and log inspection and script or workload execution related to attention kernels.
3 calls · #0240–#0242
cd <path>git diff > <path>echo <val>git stash <val> <flag> <args>git status <flag> <args>wc -ltimeout <n> <val> -m <val> <path> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>git stash <val> > <path> <n> >& <path><command> <args>grep -v -E <val>timeout <n> <val> -m <val> <path> -q -p <val> <n> >& <path>git diff --statgrep -c <val> <path>grep -c <val> <path> <path>python3 -c <script>ps <flag> <args>grep -E <val>head -n <n>ls <path> <n> > <path>npu-smi info <n> > <path>sed -n <val>Requested script or workload execution, repository inspection and file and log inspection related to source & workspace.
1 call · #0243–#0243
python3 -c <script>git stash <val>head -n <n>echo <val>Requested repository inspection, file and log inspection and script or workload execution related to benchmark & validation setup.
1 call · #0244–#0244
cd <path>echo <val>git stash <val>wc -lpython3 -c <script>Requested environment setup or inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0245–#0245
cd <path>export <vars>echo <val>env <vars> timeout <n> <val> <path> > <path> <n> >& <path>python3 -c <script> <n> >& <path>head -n <n>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
1 call · #0246–#0246
timeout <n> <val> -m <val> <path> -q -p <val> <n> >& <path>grep -v <val>tail -n <n>Requested repository inspection, source searches and workspace inspection related to benchmark & validation setup.
1 call · #0247–#0247
cd <path>echo <val>git <val> <val> <flag>grep <val>ls -d <path> <n> > <path>ls <path> <n> > <path>Requested runtime inspection, source searches and file and log inspection related to device memory.
1 call · #0248–#0248
echo <val>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>python3 -c <script>ls <path> <n> > <path>npu-smi info <n> > <path>sed -n <val>sed -n <path>Requested repository inspection, source searches and workspace inspection related to source & workspace.
1 call · #0249–#0249
cd <path>echo <val>git status <flag> <args>grep -v -E <val>find <path> <val> -name <val> -o -name <val> <n> > <path>wc -lpython3 -c <script>Requested script or workload execution related to batching & scheduling.
1 call · #0250–#0250
python3 -c <script>Requested environment setup or inspection, file and log inspection and workspace inspection related to attention kernels.
1 call · #0251–#0251
env <vars>cd <path><command> <args>echo <val>wc -l < <path>ls <val>tr <val> <val>Requested repository inspection, source searches and runtime inspection related to device memory.
1 call · #0252–#0252
cd <path>echo <val>git status <flag> <args>grep -v -E <val>ps <flag> <args>grep -E <val>grep -v <val>head -n <n>ls <path> <n> > <path>git stash <val>wc -lsed <path>npu-smi info <n> > <path>sed -n <val>Requested script or workload execution related to attention kernels.
1 call · #0253–#0253
python3 - <script>Requested script or workload execution related to source & workspace.
1 call · #0254–#0254
python3 -c <script>03 / CANDIDATE ARTIFACT
Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
Base commit: 340db9201005fc64635bb25db1d2538f955761c3
@@ -0,0 +1,252 @@+# Copyright 2023-2026 SGLang Team+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+# ==============================================================================+"""Ascend conv-state sidecar for the short-conv hybrids (LFM2 / LFM2-MoE).++The CUDA sidecar (:class:`ShortConvAttnBackend+<sglang.srt.layers.attention.linear.short_conv_backend.ShortConvAttnBackend>`)+hands the model a state handle and lets the *model* run its own depthwise+``causal_conv1d`` against it. That split does not survive the move to Ascend for+two reasons:++* **Layout.** ``MambaPool`` stores the conv state as ``[layers, slots, dim,+ K-1]`` on CUDA, but ``_init_npu_conv_state`` allocates ``[layers, slots, K-1,+ dim]`` (dim last) because that is what the AscendC conv operators index.+* **Kernel entry.** The Ascend operator is a single fused varlen op,+ ``torch.ops.npu.causal_conv1d``, taking token-major ``x`` and a ``(K, dim)``+ weight -- not the channel-major ``(dim, T)`` / ``(dim, K)`` pair the CUDA+ kernels take.++Rather than teach every model definition about both layouts, this backend keeps+the layout knowledge here and hands the model a ready-to-call ``run_conv`` on+:class:`AscendShortConvMetadata`. A model that finds ``run_conv`` on its handle+delegates; on CUDA the field is absent and the existing kernel calls stay+byte-identical.++Only ``causal_conv1d`` is used, for prefill *and* decode. The dedicated+``causal_conv1d_update`` operator writes its conv state correctly but returns+wrong outputs for this shape (observed max deviation ~4.1 against a torch+reference at ``dim=2048, K=3``), so it is deliberately not called. Driving the+varlen op with ``query_start_loc = arange(B+1)`` computes decode exactly and, at+batch 32, measured faster than either the update operator or a torch fallback.+"""++from __future__ import annotations++from typing import TYPE_CHECKING, Any, Callable, List, NamedTuple, Optional++import torch++from sglang.srt.configs.hybrid_arch import mamba2_config+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.model_executor.forward_batch_info import ForwardBatch++if TYPE_CHECKING:+ from sglang.srt.model_executor.model_runner import ModelRunner+++class AscendShortConvMetadata(NamedTuple):+ """Per-(layer, step) conv handle for the Ascend path.++ Mirrors :class:`ShortConvMetadata` and adds ``run_conv``: the layer's conv+ already bound to this step's state, slot indices and cu-seqlens. The model+ passes only its own ``(x, weight, bias)``, so the pool layout and the+ operator's calling convention stay inside this backend.+ """++ layer_cache: Any+ cache_indices: torch.Tensor+ query_start_loc: Optional[torch.Tensor] = None+ has_initial_state: Optional[torch.Tensor] = None+ slot_ids_cpu: Optional[List[int]] = None+ has_prefix_cpu: Optional[List[bool]] = None+ # (x, weight, bias) -> conv output, same token-major shape as ``x``.+ run_conv: Optional[Callable[..., torch.Tensor]] = None+++class AscendShortConvAttnBackend(ShortConvAttnBackend):+ """Short-conv state plumbing plus the Ascend conv kernel call.++ The per-step plumbing (slot indices, the ``has_initial_state`` prefix mask,+ cu-seqlens, one resolve per step rather than per conv layer) is inherited+ unchanged from :class:`ShortConvAttnBackend`.+ """++ # The operator narrows indices to int64 internally, so int32 (the pool's own+ # dtype) avoids a widening cast per conv layer.+ cache_indices_dtype: torch.dtype = torch.int32+ # Fully device-side: the host mirrors would only add a device->host sync.+ needs_extend_host_mirrors: bool = False++ # Operator selectors: no fused activation (LFM2 gates outside the conv), and+ # run_mode 0 is the varlen "fn" path.+ _ACTIVATION_NONE: int = 0+ _RUN_MODE_FN: int = 0++ def __init__(self, model_runner: ModelRunner):+ super().__init__(model_runner)+ # NPU conv state is [n_layers, n_slots, state_len, conv_dim]: dim last,+ # unlike the CUDA [n_layers, n_slots, conv_dim, K-1]. Everything below+ # (and the operator itself) depends on that, so verify it against the+ # config rather than trusting it: a pool that ever hands back the CUDA+ # orientation would otherwise be silently convolved along the wrong axis.+ self.conv_state_len = int(self.conv_states_shape[-2])+ self.conv_dim = int(self.conv_states_shape[-1])+ cache_params = mamba2_config(model_runner.model_config).mamba2_cache_params+ expected_dim, expected_state_len = cache_params.shape.conv[0]+ # state_len is >= K-1 rather than == : the NPU pool reserves extra window+ # columns when speculative decoding is configured. dim must match exactly,+ # since that is the axis the operator convolves over.+ assert (+ self.conv_state_len >= expected_state_len+ and self.conv_dim == expected_dim+ ), (+ "the Ascend short-conv backend expects the dim-last NPU conv-state "+ f"layout [..., state_len>={expected_state_len}, dim={expected_dim}], "+ f"got [..., {self.conv_state_len}, {self.conv_dim}]"+ )++ # The model holds its conv weight as (dim, K); the operator wants+ # (K, dim). Transposing per conv layer per step would add a launch per+ # layer on the decode path, so cache the transposed view per layer and+ # revalidate against the source storage.+ self._weight_cache: dict[int, tuple[int, int, torch.Tensor]] = {}++ # Decode drives the varlen operator with one token per request, so its+ # cu-seqlens are arange(B+1) and every row resumes cached state. Both are+ # batch-shaped constants: build them once at the pool bound and slice.+ max_bs = int(self.req_to_token_pool.size) + 1+ self._decode_query_start_loc = torch.arange(+ max_bs + 1, dtype=torch.int32, device=self.device+ )+ self._decode_has_initial_state = torch.ones(+ max_bs, dtype=torch.bool, device=self.device+ )++ def _kd_weight(self, layer_id: int, weight: torch.Tensor) -> torch.Tensor:+ """``weight`` (dim, K) as the contiguous (K, dim) the operator wants."""+ cached = self._weight_cache.get(layer_id)+ version = weight._version+ if (+ cached is not None+ and cached[0] == weight.data_ptr()+ and cached[1] == version+ ):+ return cached[2]+ transposed = weight.t().contiguous()+ self._weight_cache[layer_id] = (weight.data_ptr(), version, transposed)+ return transposed++ def _decode_metadata(self, batch_size: int):+ bound = self._decode_has_initial_state.shape[0]+ assert batch_size <= bound, (+ f"short-conv decode batch {batch_size} exceeds the request-pool "+ f"bound {bound}"+ )+ return (+ self._decode_query_start_loc[: batch_size + 1],+ self._decode_has_initial_state[:batch_size],+ )++ def _run_conv(+ self,+ layer_cache: Any,+ layer_id: int,+ forward_batch: ForwardBatch,+ x: torch.Tensor,+ weight: torch.Tensor,+ bias: Optional[torch.Tensor] = None,+ ) -> torch.Tensor:+ """Run ``layer_id``'s depthwise short conv for this step.++ ``x`` is token-major ``(num_tokens, dim)`` for extend and+ ``(batch, dim)`` for decode -- one row per sequence either way, so the+ same varlen operator serves both. Returns a new tensor shaped like+ ``x``; the conv state is updated in place.+ """+ mode = forward_batch.forward_mode+ if mode.is_target_verify() or mode.is_draft_extend_v2():+ # Speculative decoding needs per-draft-token conv windows and a+ # rollback at commit, neither of which this backend implements. Fail+ # loudly instead of silently corrupting per-request state.+ raise NotImplementedError(+ "Speculative decoding is not supported for short-conv hybrid "+ "models on NPU: the conv-state sidecar has no per-draft-token "+ "window or verify rollback. Serve without speculative decoding."+ )++ cache_indices = self._cache_indices+ assert cache_indices is not None, (+ "short-conv metadata is missing slot indices; "+ "init_forward_metadata must run before the conv layers"+ )+ if mode.is_decode():+ query_start_loc, has_initial_state = self._decode_metadata(x.shape[0])+ else:+ query_start_loc = self.forward_metadata.query_start_loc+ has_initial_state = self._has_initial_state++ # The operator requires contiguous inputs and rejects a strided x.+ if not x.is_contiguous():+ x = x.contiguous()++ return torch.ops.npu.causal_conv1d(+ x,+ self._kd_weight(layer_id, weight),+ layer_cache.conv[0],+ bias,+ query_start_loc,+ cache_indices,+ has_initial_state,+ None, # num_accepted_tokens: speculative decoding only+ self._ACTIVATION_NONE,+ self.pad_slot_id,+ self._RUN_MODE_FN,+ )++ def conv_state_metadata(+ self, layer_id: int, forward_batch: ForwardBatch+ ) -> AscendShortConvMetadata:+ """Return ``layer_id``'s conv handle, including its bound kernel."""+ layer_cache = self.req_to_token_pool.mamba2_layer_cache(layer_id)+ metadata = self.forward_metadata++ def run_conv(+ x: torch.Tensor,+ weight: torch.Tensor,+ bias: Optional[torch.Tensor] = None,+ ) -> torch.Tensor:+ return self._run_conv(layer_cache, layer_id, forward_batch, x, weight, bias)++ return AscendShortConvMetadata(+ layer_cache=layer_cache,+ cache_indices=self._cache_indices,+ query_start_loc=metadata.query_start_loc if metadata else None,+ has_initial_state=self._has_initial_state,+ slot_ids_cpu=self._slot_ids_cpu,+ has_prefix_cpu=self._has_prefix_cpu,+ run_conv=run_conv,+ )+++class AscendShortConvHybridAttnBackend(ShortConvHybridAttnBackend):+ """Ascend full-attention backend plus the short-conv state sidecar.++ Identical routing to :class:`ShortConvHybridAttnBackend`: attention layers+ reach the full-attention child, conv layers reach the sidecar through+ ``conv_state_metadata``, and the sidecar is never routed through the+ full-vs-linear ``forward_decode`` / ``forward_extend`` dispatch.+ """@@ -436,27 +436,43 @@ 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."+ # LFM2's short conv is a plain depthwise conv over one+ # state stream, which the Ascend sidecar implements.+ # ZAYA1's CCA is not: it is a two-stage grouped conv with a+ # second `prev_hs` state stream, so it has no Ascend path+ # yet. Fail here (before model execution) rather than with+ # an AttributeError deep in the first conv layer.+ if isinstance(mamba2_config(runner.model_config), ZayaConfig):+ raise NotImplementedError(+ "ZAYA1 (CCA) is not yet supported on NPU: its "+ "two-stage grouped conv plus `prev_hs` state stream "+ "has no Ascend conv-state implementation. LFM2 / "+ "LFM2-MoE short-conv hybrids are supported."+ )+ from sglang.srt.hardware_backend.npu.attention.ascend_short_conv_backend import (+ AscendShortConvAttnBackend,+ AscendShortConvHybridAttnBackend,+ )++ assert (+ runner.server_args.attention_backend == "ascend"+ ), "ascend backend is the only supported backend on NPU for short-conv hybrid models, use --attention-backend ascend to specify the backend."+ logger.info(+ "Using the Ascend conv-state sidecar for short-conv "+ "hybrid models."+ )+ 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:@@ -279,6 +279,16 @@ class Lfm2ShortConv(nn.Module): B_gate, C_gate, x = proj.chunk(3, dim=-1) Bx = B_gate * x + # A backend whose conv state uses a different layout, or whose kernel+ # takes a different calling convention, hands the bound kernel back on+ # the handle (the Ascend sidecar does). Delegate when present, so the+ # layout stays with the backend that owns the pool.+ run_conv = getattr(meta, "run_conv", None)+ if run_conv is not None:+ conv_out = run_conv(Bx, self.conv_weight, self.conv_bias)+ output, _ = self.out_proj(C_gate * conv_out)+ return output+ if forward_batch.forward_mode.is_decode(): # Decode: single token per request, use optimized update kernel conv_out = causal_conv1d_update(@@ -338,6 +338,15 @@ class Lfm2MoeShortConv(nn.Module): B_gate, C_gate, x = proj.chunk(3, dim=-1) Bx = B_gate * x + # See Lfm2ShortConv.forward: a backend that owns a different conv-state+ # layout or kernel entry point (the Ascend sidecar) hands the bound+ # kernel back on the handle.+ run_conv = getattr(meta, "run_conv", None)+ if run_conv is not None:+ conv_out = run_conv(Bx, self.conv_weight, self.conv_bias)+ output, _ = self.out_proj(C_gate * conv_out)+ return output+ if forward_batch.forward_mode.is_decode(): conv_out = causal_conv1d_update( Bx,