Inspect · Task requirements
Requested file and log inspection related to task requirements.
1 call · #0001–#0001
echo <val>cat <path>echo <flag>DeepSeek-V4-Pro · 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 agentDeepSeek-V4-Pro · 216 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 file and log inspection related to task requirements.
1 call · #0001–#0001
echo <val>cat <path>echo <flag>Requested workspace inspection related to source & workspace.
1 call · #0002–#0002
ls -l -a <val>find <path> -maxdepth <n> -type <val> -exec <val> <flag><command> <args>Requested file and log inspection related to task requirements.
2 calls · #0003–#0004
cat <path>echo <flag><command> <args>head -c <n> <val>echohead -c <n>Requested environment setup or inspection, source searches and file and log inspection related to source & workspace.
13 calls · #0005–#0017
envsortgrep -E <val>head -n <n>echo <flag>ls -l -a <path>git -C <path> <val> --short <flag> <args>sed -n <val> <path>cat <path>cd <path>bash <script> <n> >& <path>bash <script> > <path> <n> > <path>echo <val>grep -n <val> -n <path>grep -n <val> <path>cat <val> <n> > <path>find <path> -maxdepth <n> -type <val>echopython - <script>grep -R <val> -n <path> <flag> <args>sed -n <val>git log --oneline <flag>grep -R <val> -n <path> <path>find <path> -maxdepth <n> -type <val> -name <path>xargs <flag> <args>Requested source searches, file and log inspection and script or workload execution related to source & workspace.
1 call · #0018–#0018
cd <path>grep -R <val> -n -i <path>head -n <n>python - <script>Requested file and log inspection, environment setup or inspection and script or workload execution related to source & workspace.
5 calls · #0019–#0023
cd <path>wc -l <path>sed -n <val> <path>export <vars>bash <script> > <path> <n> > <path>echo <val>head -c <n> <path>echocat <path>Requested environment setup or inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0024–#0024
export <vars>cd <path>bash <script> > <path> <n> > <path>echo <val>head -c <n> <path>echoRequested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0025–#0025
grep -n <val> <path>head -n <n>Requested file and log inspection related to source & workspace.
1 call · #0026–#0026
sed -n <val> <path>Requested environment setup or inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0027–#0027
export <vars>cd <path>bash <script> > <path> <n> > <path>echo <val>head -c <n> <path>echoRequested workspace inspection and file and log inspection related to benchmark & validation setup.
2 calls · #0028–#0029
ls -l -a <val>wc -c <path>sed -n <val> <path>tail -n <n> <path>Requested source searches and file and log inspection related to reward & policy updates.
1 call · #0030–#0030
grep -n <val> <path>tail -n <n>Requested file and log inspection, workspace inspection and source searches related to attention kernels.
2 calls · #0031–#0032
cd <path>sed -n <val> <path>echo <flag>find <path> -maxdepth <n> -type <val>sortgrep -E <val>Requested source searches and file and log inspection related to source & workspace.
1 call · #0033–#0033
cd <path>grep -R <val> -n <path>head -n <n>Requested file and log inspection and workspace inspection related to attention kernels.
4 calls · #0034–#0037
cd <path>sed -n <val> <path>echo <flag>find <path> -maxdepth <n> -type <val>sortechoRequested source searches and file and log inspection related to convolution & sequence boundaries.
2 calls · #0038–#0039
cd <path>grep -R <val> -n <path> <path>head -n <n>sed -n <val> <path>Requested file and log inspection related to attention kernels.
1 call · #0040–#0040
cd <path>sed -n <val> <path>Requested workspace inspection, file and log inspection and source searches related to convolution & sequence boundaries.
2 calls · #0041–#0042
cd <path>ls <path>sed -n <val> <path> <n> > <path>truegrep -R <val> -n <path>head -n <n>sed -n <val> <path>Requested file and log inspection and source searches related to attention kernels.
4 calls · #0043–#0046
cd <path>sed -n <val> <path>grep -n <val> <path>head -n <n>Requested source searches and file and log inspection related to convolution & sequence boundaries.
1 call · #0047–#0047
cd <path>grep -n <val> <path>sed -n <val>sed -n <val> <path>Requested file and log inspection and source searches related to attention kernels.
1 call · #0048–#0048
cd <path>cat <path>sed -n <val> <path>grep -n <val>grep -n <val> <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0049–#0049
cd <path>grep -R <val> -n <path> <path>head -n <n>Requested file and log inspection related to attention kernels.
1 call · #0050–#0050
cd <path>sed -n <val> <path>Requested repository inspection related to source & workspace.
1 call · #0051–#0051
cd <path>git diff --statgit status --shortRequested script or workload execution related to attention kernels.
1 call · #0052–#0052
cd <path>python - <script>Requested file and log inspection and source searches related to attention kernels.
2 calls · #0053–#0054
cd <path>sed -n <val> <path>tail -n <n> <path>grep -n <val> <path>Requested script or workload execution related to attention kernels.
1 call · #0055–#0055
cd <path>python - <script>Requested script or workload execution, source searches and file and log inspection related to attention kernels.
2 calls · #0056–#0057
cd <path>python - <script>grep -n <val> <path>head -n <n>python -m <module> -q <script> <script> <script> <script>echo <val>git diff --statRequested environment setup or inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
2 calls · #0058–#0059
export <vars>cd <path>timeout <n> <val> <path> > <path> <n> > <path>echo <val>head -c <n> <path>echols -l -a <val>grep -n <val> <path>tail -n <n>echo <flag>cat <path>head -c <n>Requested file and log inspection related to task requirements.
1 call · #0060–#0060
cat <path>head -c <n>Requested file and log inspection related to source & workspace.
1 call · #0061–#0061
sed -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0062–#0062
python - <script>Requested script or workload execution related to attention kernels.
1 call · #0063–#0063
python - <script>Requested script or workload execution related to convolution & sequence boundaries.
4 calls · #0064–#0067
cd <path>python - <script>Requested file and log inspection and source searches related to convolution & sequence boundaries.
2 calls · #0068–#0069
cd <path>diff -u <path> <path>head -n <n>echo <val>grep -n <val> -n <path>grep -n <val> <path>tail -n <n>Requested file and log inspection related to benchmark & validation setup.
1 call · #0070–#0070
sed -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0071–#0071
cd <path>python - <script>Requested environment setup or inspection related to convolution & sequence boundaries.
1 call · #0072–#0072
cd <path>env <vars> python - <script>Requested file and log inspection and source searches related to source & workspace.
2 calls · #0073–#0074
cd <path>sed -n <val> <path>grep -n <val> <flag> <args>Requested script or workload execution, file and log inspection and environment setup or inspection related to convolution & sequence boundaries.
1 call · #0075–#0075
cd <path>python - <script>sed -n <val> <path>env <vars> python - <script>Requested source searches, file and log inspection and script or workload execution related to source & workspace.
5 calls · #0076–#0080
grep -n <val> <path>head -n <n>sed -n <val> <path>cd <path>python - <script>python3 - <script>ls -l -a <path> <n> > <path>headreadlink -f <path>ls <flag> <args>grep -R <val> -n <path> <path> <n> > <path>ls <path>grep -i <val>Requested script or workload execution, repository inspection and environment setup or inspection related to convolution & sequence boundaries.
3 calls · #0081–#0083
cd <path>python - <script>git -C <path> <val> --statenv <vars> python - <script>Requested file and log inspection and source searches related to convolution & sequence boundaries.
2 calls · #0084–#0085
cd <path>sed -n <val> <path>grep -n <val> <flag> <args>Requested script or workload execution related to convolution & sequence boundaries.
4 calls · #0086–#0089
cd <path>python - <script>Requested file and log inspection related to source & workspace.
2 calls · #0090–#0091
sed -n <val> <path>Requested workspace file updates, environment setup or inspection and script or workload execution related to convolution & sequence boundaries.
1 call · #0092–#0092
cd <path>rm -rf <path>export <vars>bash <script> > <path> <n> > <path>echo <val>cat <path>head -n <n> <path>find <path> -maxdepth <n> -type <val>head -n <n>Requested environment setup or inspection, file and log inspection and script or workload execution related to source & workspace.
3 calls · #0093–#0095
cd <path>env <vars> python -c <script> <n> > <path><command> <args>headecho <val>cat <path>echo <flag>python -c <script> <n> > <path>head -n <n>env <vars> python -B -c <script> <path> > <path> <n> > <path>env <vars> python -B -c <script> > <path> <n> > <path>head -n <n> <path>Requested file and log inspection related to source & workspace.
1 call · #0096–#0096
cd <path>cat <path>Requested script or workload execution related to source & workspace.
1 call · #0097–#0097
python - <script>Requested script or workload execution and file and log inspection related to source & workspace.
1 call · #0098–#0098
python - > <path> <n> > <path> <script>echo <val><command> <args>cat <path>echoRequested script or workload execution and file and log inspection related to source & workspace.
1 call · #0099–#0099
python - > <path> <n> > <path> <script>echo <val><command> <args>cat <path>Requested script or workload execution related to source & workspace.
1 call · #0100–#0100
cd <path>python - <script>Requested script or workload execution related to source & workspace.
1 call · #0101–#0101
cd <path>python - <script>python -m <module> <script>Requested workspace file updates, environment setup or inspection and script or workload execution related to convolution & sequence boundaries.
1 call · #0102–#0102
cd <path>rm -rf <path>export <vars>bash <script> > <path> <n> > <path>echo <val>cat <path>head -n <n> <path>grep -n <val> <flag> <args>grep -n <val> <path>Requested environment setup or inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0103–#0103
export <vars>cd <path>timeout <n> <val> <path> > <path> <n> > <path>echo <val>cat <path>echohead -n <n> <path>Requested file and log inspection and source searches related to benchmark & validation setup.
1 call · #0104–#0104
tail -n <n> <path>echo <flag>grep -n <val> <path>tail -n <n>Requested script or workload execution related to convolution & sequence boundaries.
1 call · #0105–#0105
cd <path>python - <script>Requested workspace file updates and source searches related to convolution & sequence boundaries.
1 call · #0106–#0106
cd <path>cp <path> <path>grep -n <val> <path>Requested runtime inspection, source searches and environment setup or inspection related to benchmark & validation setup.
1 call · #0107–#0107
ps <flag>grep -E <val>grep -v <val>true<command> <args>grep <n>export <vars>cd <path>timeout <n> <val> <path> > <path> <n> > <path>echo <val>cat <path>echohead -n <n>Requested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0108–#0108
grep -n <val> <path>tail -n <n>tail -n <n> <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0109–#0109
cd <path>grep -n <val> <path>head -n <n>sed -n <val> <path>Requested source searches and file and log inspection related to device memory.
5 calls · #0110–#0114
cd <path>grep -R <val> -n <path>head -n <n>sed -n <val> <path>grep -n <val> <path>grep -n <val> <flag> <args>Requested source searches and file and log inspection related to source & workspace.
1 call · #0115–#0115
cd <path>grep -n <val> <path>head -n <n>sed -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0116–#0116
python - <script>Requested file and log inspection and script or workload execution related to prefix caching.
1 call · #0117–#0117
cd <path>cat > <path> <script>python - <script>Requested script or workload execution related to attention kernels.
2 calls · #0118–#0119
cd <path>python - <script>Requested file and log inspection related to source & workspace.
1 call · #0120–#0120
cd <path>sed -n <val> <path>Requested script or workload execution related to attention kernels.
2 calls · #0121–#0122
cd <path>python - <script>python -m <module> -q <script> <script> <script>Requested file and log inspection related to source & workspace.
2 calls · #0123–#0124
cd <path>sed -n <val> <path>Requested script or workload execution related to attention kernels.
1 call · #0125–#0125
cd <path>python - <script>python -m <module> -q <script> <script> <script>Requested environment setup or inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0126–#0126
export <vars>cd <path>timeout <n> <val> <path> > <path> <n> > <path>echo <val>cat <path>echohead -n <n> <path>Requested environment setup or inspection, script or workload execution and execution waits related to prefix caching.
1 call · #0127–#0127
cd <path>export <vars>python -m <module> <flag> <args>echo <val> > <path>echo <val> <val>sleep <n>tail -n <n> <path>Requested execution waits and file and log inspection related to source & workspace.
1 call · #0128–#0128
sleep <n>tail -n <n> <path>echo <val> <val> <path> <val> <val> -p <val> <path> -o <val> <n> <args>echo <val>Requested source searches, execution waits and file and log inspection related to source & workspace.
1 call · #0129–#0129
<command> <args>grep -q <val>sleep <n>tail -n <n> <path>cut <flag>ps -p <val> <path> -o <val>Requested script or workload execution related to task requirements.
1 call · #0130–#0130
python - <script>Requested script or workload execution related to rollout generation.
2 calls · #0131–#0132
python - <script>Requested script or workload execution and environment setup or inspection related to task requirements.
3 calls · #0133–#0135
python - <script>cd <path>env <vars> python - <script>Requested process termination, execution waits and runtime inspection related to source & workspace.
2 calls · #0136–#0137
kill <val> <path> <n> > <path>truesleep <n>ps -p <val> <path> -o <val> <n> > <path>echo <val>tail -n <n> <path>cut <flag>kill <flag> <args>Requested environment setup or inspection and script or workload execution related to prefix caching.
1 call · #0138–#0138
cd <path>export <vars>python -m <module> <flag> <args>echo <val> > <path>echo <val> <val>Requested source searches and runtime inspection related to source & workspace.
1 call · #0139–#0139
<command> <args>grep -q <val>ps -p <val> <path> -o <val> <n> > <path>echo <val>Requested runtime inspection, source searches and service requests related to runtime processes.
1 call · #0140–#0140
ps <flag>grep <val>grep -v <val>curl -s -m <n> <url>head -c <n>echotail -n <n> <path>cut <flag>Requested script or workload execution related to rollout generation.
1 call · #0141–#0141
python - <script>Requested script or workload execution related to attention kernels.
1 call · #0142–#0142
cd <path>python - <script>Requested script or workload execution related to attention kernels.
1 call · #0143–#0143
python - <script>Requested script or workload execution related to attention kernels.
1 call · #0144–#0144
python - <script>Requested source searches, workspace inspection and file and log inspection related to attention kernels.
6 calls · #0145–#0150
cd <path>grep -n <val> <flag> <args>find <path> -maxdepth <n> -iname <val> -o -iname <val>grep -R <val> -n <path>headsed -n <val> <path>head -n <n>Requested script or workload execution related to rollout generation.
1 call · #0151–#0151
python - <script>Requested process termination, execution waits and runtime inspection related to source & workspace.
1 call · #0152–#0152
kill <val> <path> <n> > <path>truesleep <n>kill <flag> <args>ps -p <val> <path> -o <val> <n> > <path>echo <val>Requested environment setup or inspection and script or workload execution related to prefix caching.
1 call · #0153–#0153
cd <path>export <vars>python -m <module> <flag> <args>echo <val> > <path>echo <val>Requested source searches and file and log inspection related to source & workspace.
1 call · #0154–#0154
<command> <args>grep -q <val>tail -n <n> <path>cut <flag>Requested runtime inspection, source searches and file and log inspection related to runtime processes.
1 call · #0155–#0155
ps -p <val> <path> -o <val> <n> > <path>echo <val>grep -n <val> <path>tail -n <n>tail -n <n> <path>cut <flag>curl -s -m <n> <url>head -c <n>Requested runtime inspection, service requests and file and log inspection related to source & workspace.
1 call · #0156–#0156
ps -p <val> <path> -o <val> <n> > <path>echo <val>curl -s -m <n> <url> <n> > <path>head -c <n>echogrep -n <val> <path>tail -n <n>Requested script or workload execution related to rollout generation.
1 call · #0157–#0157
python - <script>Requested script or workload execution related to source & workspace.
1 call · #0158–#0158
python - <script>Requested source searches and file and log inspection related to runtime processes.
2 calls · #0159–#0160
cd <path>grep -R <val> -n <path>head -n <n>grep -n <val> <flag> <args>grep -n <val> <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0161–#0161
cd <path>grep -n <val> <flag> <args>head -n <n>Requested script or workload execution related to rollout generation.
1 call · #0162–#0162
python - <script>Requested script or workload execution related to task requirements.
1 call · #0163–#0163
python - <script>Requested script or workload execution related to rollout generation.
1 call · #0164–#0164
python - <script>Requested script or workload execution related to task requirements.
1 call · #0165–#0165
python - <script>Requested script or workload execution related to rollout generation.
1 call · #0166–#0166
python - <script>Requested script or workload execution related to task requirements.
1 call · #0167–#0167
python - <script>Requested script or workload execution related to source & workspace.
3 calls · #0168–#0170
python - <script>Requested script or workload execution related to task requirements.
1 call · #0171–#0171
python - <script>Requested script or workload execution related to rollout generation.
1 call · #0172–#0172
python - <script>Requested script or workload execution related to task requirements.
1 call · #0173–#0173
python - <script>Requested script or workload execution related to batching & scheduling.
1 call · #0174–#0174
python - <script>Requested script or workload execution related to rollout generation.
1 call · #0175–#0175
python - <script>Requested environment setup or inspection related to convolution & sequence boundaries.
1 call · #0176–#0176
cd <path>env <vars> python - <script>Requested source searches, file and log inspection and workspace inspection related to convolution & sequence boundaries.
6 calls · #0177–#0182
cd <path>grep -n <val> <path>tail -n <n>sed -n <val> <path>find <path> -iname <val> -o -iname <val>head -n <n>grep -R <val> -n <path>grep -n <val> <flag> <args>Requested script or workload execution and file and log inspection related to prefix caching.
1 call · #0183–#0183
cd <path>python - <script>python -m <module> -q <script>sed -n <val> <path>Requested process termination, execution waits and runtime inspection related to source & workspace.
1 call · #0184–#0184
kill <val> <path> <n> > <path>truesleep <n>kill <flag> <args>ps -p <val> <path> -o <val> <n> > <path>echo <val>Requested environment setup or inspection and script or workload execution related to prefix caching.
1 call · #0185–#0185
cd <path>export <vars>python -m <module> <flag> <args>echo <val> > <path>echo <val>Requested source searches, file and log inspection and runtime inspection related to source & workspace.
2 calls · #0186–#0187
<command> <args>grep -q <val>tail -n <n> <path>ps -p <val> <path> -o <val> <n> > <path>echo <val>curl -s -m <n> <url> <n> > <path>head -c <n>echocut <flag>Requested runtime inspection related to source & workspace.
1 call · #0188–#0188
ps -p <val> <path> -o <val> <n> > <path>echo <val>Requested service requests and script or workload execution related to source & workspace.
1 call · #0189–#0189
curl -s -m <n> <url>python -c <script> <n> >& <path>Requested script or workload execution related to rollout generation.
1 call · #0190–#0190
python - <script>Requested process termination, execution waits and runtime inspection related to source & workspace.
1 call · #0191–#0191
kill <val> <path> <n> > <path>truesleep <n>kill <flag> <args>ps -p <val> <path> -o <val> <n> > <path>echo <val>Requested environment setup or inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0192–#0192
export <vars>cd <path>timeout <n> <val> <path> > <path> <n> > <path>echo <val>head -c <n> <path>echoRequested runtime inspection, source searches and file and log inspection related to benchmark & validation setup.
1 call · #0193–#0193
ps <flag>grep -E <val>grep -v <val>head -n <n>ls -l -a <val>tailtail -n <n> <path> <n> > <path>cut <flag>cat <path> <n> > <path>head -c <n>Requested tool activity related to source & workspace.
1 call · #0194–#0194
date -udateecho <val> -d <val> <val>echo <val> <val>Requested script or workload execution and source searches related to prefix caching.
1 call · #0195–#0195
cd <path>python - <script>python -m <module> -q <script>grep -n <val> <path>Requested workspace file updates, environment setup or inspection and script or workload execution related to convolution & sequence boundaries.
1 call · #0196–#0196
cd <path>rm -rf <path>export <vars>bash <script> > <path> <n> > <path>echo <val>cat <path>head -n <n>git status --shortRequested workspace inspection, repository inspection and file and log inspection related to source & workspace.
2 calls · #0197–#0198
cd <path>ls -l -a <val> <n> > <path>git status --shortfind <path> -maxdepth <n> -name <val> -o -name <val>headrm -f <val>Requested environment setup or inspection, script or workload execution and execution waits related to benchmark & validation setup.
4 calls · #0199–#0202
export <vars>cd <path>nohup <val> <path> > <path> <n> > <path>echo <val> > <path>echo <val> <val> <path>sleep <n>ps -p <val> <path> -o <val> <n> > <path>echo <val>cat <path> <n> > <path>head -n <n>tail -n <n> <path> <n> > <path>cut <flag>cat <path>tail -n <n> <path>echoRequested tool activity related to source & workspace.
1 call · #0203–#0203
date -udate <val><command> <args>echo <val> <val>Requested environment setup or inspection and script or workload execution related to benchmark & validation setup.
1 call · #0204–#0204
export <vars>cd <path>nohup <val> <path> > <path> <n> > <path>echo <val> > <path>echo <val> <val> <path>date -uRequested execution waits, runtime inspection and file and log inspection related to source & workspace.
1 call · #0205–#0205
sleep <n>ps -p <val> <path> -o <val> <n> > <path>echo <val>cat <path> <n> > <path>head -c <n>echotail -n <n> <path> <n> > <path>cut <flag>ls -l -a <val>tail -n <n>Requested repository inspection and file and log inspection related to attention kernels.
1 call · #0206–#0206
cd <path>git diff <flag> <args>sed -n <val>Requested execution waits, runtime inspection and file and log inspection related to source & workspace.
3 calls · #0207–#0209
sleep <n>ps -p <val> <path> -o <val> <n> > <path>echo <val>cat <path> <n> > <path>head -c <n>echotail -n <n> <path> <n> > <path>cut <flag>date -uls -l -a <val>tail -n <n>cat <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0210–#0210
python - <script>Requested tool activity related to source & workspace.
1 call · #0211–#0211
date -uecho <val> <val> -d <val> <val> <val> <val> <val> <val>Requested environment setup or inspection, script or workload execution and file and log inspection related to runtime processes.
1 call · #0212–#0212
export <vars>cd <path>bash <script> > <path> <n> > <path>echo <val>cat <path>head -n <n>ps <flag>grep -E <val>grep -v <val>trueRequested repository inspection and script or workload execution related to attention kernels.
1 call · #0213–#0213
cd <path>git status --shortecho <flag>git diff --statpython -m <module> -q <script> <script> <script> <script> <script> <script> <script>echo <val>Requested workspace inspection, file and log inspection and workspace file updates related to source & workspace.
1 call · #0214–#0214
cd <path>du <flag> <args>find <val> -maxdepth <n> -type <val>headrm -rf <val>git status --shortRequested environment setup or inspection and script or workload execution related to benchmark & validation setup.
1 call · #0215–#0215
export <vars>cd <path>timeout <n> <val> <path> > <path> <n> > <path>echo <val>python - <script>Requested runtime inspection, source searches and repository inspection related to runtime processes.
1 call · #0216–#0216
ps <flag>grep -E <val>grep -v <val>echo <val>cd <path>git status --shortdate -u03 / CANDIDATE ARTIFACT
Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
Base commit: 340db9201005fc64635bb25db1d2538f955761c3
@@ -12,6 +12,9 @@ from sglang.srt.layers.attention.hybrid_linear_attn_backend import ( HybridLinearAttnBackend, MambaAttnBackendBase, )+from sglang.srt.layers.attention.linear.short_conv_backend import (+ ShortConvAttnBackend,+) from sglang.srt.layers.attention.mamba.mamba2_metadata import ( ForwardMetadata, )@@ -213,6 +216,33 @@ class AscendMambaAttnBackendBase(MambaAttnBackendBase): return 0 # Mamba attn does not use seq lens to index kv cache +class AscendShortConvAttnBackend(ShortConvAttnBackend, AscendMambaAttnBackendBase):+ """Ascend sidecar for short-conv hybrids (ZAYA1 CCA, LFM2 / LFM2-MoE).++ The state plumbing is identical to the CUDA ``ShortConvAttnBackend``;+ mixing in :class:`AscendMambaAttnBackendBase` routes the cuda-graph capture+ and replay metadata through the Ascend implementations while retaining the+ per-step short-conv fields and ``conv_state_metadata`` handle from+ ``ShortConvAttnBackend``.+ """+++class AscendShortConvHybridAttnBackend(HybridLinearAttnBackend):+ """Ascend wrapper exposing ``conv_state_metadata`` to the model conv layers."""++ def __init__(+ self,+ full_attn_backend: AttentionBackend,+ 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):+ return self.short_conv_backend.conv_state_metadata(layer_id, forward_batch)++ class AscendMamba2AttnBackend(AscendMambaAttnBackendBase): pass @@ -436,27 +436,23 @@ 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."+ from sglang.srt.hardware_backend.npu.attention.ascend_hybrid_linear_attn_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:@@ -0,0 +1,126 @@+# 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.+# ==============================================================================+"""Portable short-conv kernels for the Ascend conv-state layout.++The Ascend MambaPool stores per-layer conv state as+``[num_slots, kernel_size - 1, hidden_dim]`` (see+``sglang.srt.hardware_backend.npu.memory_pool_npu``) because the Ascend conv1d+operators want the channel axis last. The stock ``sgl_kernel_npu``+``causal_conv1d_*`` wrappers and the CUDA short-conv path expect the transposed+``[num_slots, hidden_dim, kernel_size - 1]`` layout, so LFM2/ZAYA short-conv+layers dispatch prefill and decode to these small, layout-aware helpers instead.+"""++from __future__ import annotations++from typing import List, Optional++import torch+import torch.nn.functional as F+++def short_conv_prefill_npu(+ Bx: torch.Tensor,+ weight: torch.Tensor,+ bias: Optional[torch.Tensor],+ conv_state: torch.Tensor,+ query_start_loc: torch.Tensor,+ cache_indices: torch.Tensor,+ has_initial_state: torch.Tensor,+ seq_lens_cpu: List[int],+) -> torch.Tensor:+ """Causal depthwise short conv over a varlen prefill batch.++ ``Bx`` is ``[total_tokens, hidden_dim]`` and ``conv_state`` uses the Ascend+ layout ``[num_slots, kernel_size - 1, hidden_dim]``. Output has the same+ shape as ``Bx``; the selected conv slots are updated in place.+ """+ if Bx.numel() == 0:+ return Bx++ batch_size = len(seq_lens_cpu)+ max_len = max(seq_lens_cpu)+ width = int(weight.shape[-1])+ hidden_dim = Bx.shape[-1]++ # [total_tokens, hidden] -> [batch, max_len, hidden]+ x_pad = Bx.new_zeros((batch_size, max_len, hidden_dim))+ flat_indices: List[int] = []+ offset = 0+ for batch_idx, seq_len in enumerate(seq_lens_cpu):+ flat_indices.extend(+ range(batch_idx * max_len, batch_idx * max_len + seq_len)+ )+ offset += seq_len+ x_pad.view(-1, hidden_dim)[flat_indices] = Bx[:offset]+ # Conv1d wants channels before the sequence axis.+ x_pad = x_pad.transpose(1, 2) # [batch, hidden, max_len]++ previous = conv_state[cache_indices] # [batch, K-1, hidden]+ previous = previous.transpose(1, 2).contiguous() # [batch, hidden, K-1]+ if has_initial_state is not None:+ previous = previous * has_initial_state.to(previous.dtype)[:, None, None]++ # Prepending either the cached prefix or zeros makes one depthwise conv+ # serve both fresh sequences and radix/prefix-cache continuations.+ x_in = torch.cat([previous, x_pad], dim=-1)+ conv_out = F.conv1d(+ x_in,+ weight.unsqueeze(1),+ bias,+ padding=0,+ groups=hidden_dim,+ )++ # Store the last K-1 inputs of every sequence back in the Ascend layout.+ new_state_std = x_in.new_empty((batch_size, hidden_dim, width - 1))+ for batch_idx, seq_len in enumerate(seq_lens_cpu):+ new_state_std[batch_idx] = x_in[+ batch_idx, :, seq_len : seq_len + width - 1+ ]+ conv_state[cache_indices] = new_state_std.transpose(1, 2).contiguous()++ # Unpad back to the original varlen order.+ out_flat = conv_out.transpose(1, 2).contiguous().view(-1, hidden_dim)+ return out_flat[flat_indices].contiguous()+++def short_conv_decode_npu(+ Bx: torch.Tensor,+ weight: torch.Tensor,+ bias: Optional[torch.Tensor],+ conv_state: torch.Tensor,+ cache_indices: torch.Tensor,+) -> torch.Tensor:+ """One-token decode step for the Ascend short-conv layout."""+ if Bx.numel() == 0:+ return Bx++ width = int(weight.shape[-1])+ hidden_dim = Bx.shape[-1]++ previous = conv_state[cache_indices] # [batch, K-1, hidden]+ previous = previous.transpose(1, 2).contiguous() # [batch, hidden, K-1]+ x_in = torch.cat([previous, Bx.unsqueeze(-1)], dim=-1)++ conv_out = F.conv1d(+ x_in,+ weight.unsqueeze(1),+ bias,+ padding=0,+ groups=hidden_dim,+ ).squeeze(-1)++ conv_state[cache_indices] = x_in[..., 1:].transpose(1, 2).contiguous()+ return conv_out@@ -20,10 +20,18 @@ from torch import nn from sglang.srt.configs.lfm2 import Lfm2Config from sglang.srt.distributed import get_pp_group-from sglang.srt.layers.attention.mamba.causal_conv1d import (- causal_conv1d_fn,- causal_conv1d_update,-)+from sglang.srt.utils import is_npu++if is_npu():+ from sglang.srt.layers.attention.mamba.short_conv_npu import (+ short_conv_decode_npu,+ short_conv_prefill_npu,+ )+else:+ from sglang.srt.layers.attention.mamba.causal_conv1d import (+ causal_conv1d_fn,+ causal_conv1d_update,+ ) from sglang.srt.layers.layernorm import RMSNorm from sglang.srt.layers.linear import ( ColumnParallelLinear,@@ -279,7 +287,33 @@ class Lfm2ShortConv(nn.Module): B_gate, C_gate, x = proj.chunk(3, dim=-1) Bx = B_gate * x - if forward_batch.forward_mode.is_decode():+ if is_npu():+ if forward_batch.forward_mode.is_decode():+ conv_out = short_conv_decode_npu(+ Bx,+ self.conv_weight,+ self.conv_bias,+ conv_state,+ meta.cache_indices,+ )+ else:+ seq_lens_cpu = forward_batch.extend_seq_lens_cpu+ if seq_lens_cpu is None:+ query_start_loc = meta.query_start_loc+ seq_lens_cpu = (+ query_start_loc[1:] - query_start_loc[:-1]+ ).detach().cpu().tolist()+ conv_out = short_conv_prefill_npu(+ Bx,+ self.conv_weight,+ self.conv_bias,+ conv_state,+ meta.query_start_loc,+ meta.cache_indices,+ meta.has_initial_state,+ seq_lens_cpu,+ )+ elif forward_batch.forward_mode.is_decode(): # Decode: single token per request, use optimized update kernel conv_out = causal_conv1d_update( Bx,@@ -20,10 +20,18 @@ from torch import nn from sglang.srt.configs.lfm2_moe import Lfm2MoeConfig from sglang.srt.distributed import get_pp_group from sglang.srt.layers.activation import SiluAndMul-from sglang.srt.layers.attention.mamba.causal_conv1d import (- causal_conv1d_fn,- causal_conv1d_update,-)+from sglang.srt.utils import is_npu++if is_npu():+ from sglang.srt.layers.attention.mamba.short_conv_npu import (+ short_conv_decode_npu,+ short_conv_prefill_npu,+ )+else:+ from sglang.srt.layers.attention.mamba.causal_conv1d import (+ causal_conv1d_fn,+ causal_conv1d_update,+ ) from sglang.srt.layers.layernorm import RMSNorm from sglang.srt.layers.linear import ( MergedColumnParallelLinear,@@ -338,7 +346,33 @@ class Lfm2MoeShortConv(nn.Module): B_gate, C_gate, x = proj.chunk(3, dim=-1) Bx = B_gate * x - if forward_batch.forward_mode.is_decode():+ if is_npu():+ if forward_batch.forward_mode.is_decode():+ conv_out = short_conv_decode_npu(+ Bx,+ self.conv_weight,+ self.conv_bias,+ conv_state,+ meta.cache_indices,+ )+ else:+ seq_lens_cpu = forward_batch.extend_seq_lens_cpu+ if seq_lens_cpu is None:+ query_start_loc = meta.query_start_loc+ seq_lens_cpu = (+ query_start_loc[1:] - query_start_loc[:-1]+ ).detach().cpu().tolist()+ conv_out = short_conv_prefill_npu(+ Bx,+ self.conv_weight,+ self.conv_bias,+ conv_state,+ meta.query_start_loc,+ meta.cache_indices,+ meta.has_initial_state,+ seq_lens_cpu,+ )+ elif forward_batch.forward_mode.is_decode(): conv_out = causal_conv1d_update( Bx, conv_state,@@ -1,15 +1,42 @@+import atexit import os import pathlib+import sys from functools import lru_cache, wraps import torch import torch_npu +def _quiet_torch_shutdown_stdout():+ """Keep torch_npu's C++ shutdown diagnostics out of captured stdout.++ Some runtime builds emit ``path string is NULL`` on stdout while native+ libraries are torn down after ``Py_Finalize``. Redirecting the fd here (in+ an ``atexit`` callback, which still runs before those C++ destructors) keeps+ clean pipe/stdout protocols such as the candidate-build import probe.+ """+ try:+ sys_stdout = sys.stdout+ if sys_stdout is not None:+ sys_stdout.flush()+ except (AttributeError, OSError, ValueError):+ pass+ try:+ devnull_fd = os.open(os.devnull, os.O_WRONLY)+ try:+ os.dup2(devnull_fd, 1)+ finally:+ os.close(devnull_fd)+ except OSError:+ pass++ def _load_sgl_kernel_npu(): npu_path = pathlib.Path(__file__).parents[0] so_path = os.path.join(npu_path, "lib", "libsgl_kernel_npu.so") torch.ops.load_library(so_path) +atexit.register(_quiet_torch_shutdown_stdout) _load_sgl_kernel_npu()@@ -729,7 +729,10 @@ def prepare_data( indices = (base_idx.unsqueeze(1) + base_t)[mask] x_flat.index_copy_(1, indices, x[..., :cu_seq_len])- x_pad = x_flat.view(dim, batch_size, max_T).transpose(0, 1).contiguous()+ # native causal_conv1d_fn expects x as (batch, dim, seqlen); the flat+ # gather above is (dim, batch * max_T), so permute the padded copy+ # accordingly instead of handing F.conv1d a (batch, max_T, dim) tensor.+ x_pad = x_flat.view(dim, batch_size, max_T).permute(1, 0, 2).contiguous() return x_pad, initial_states, seqlens, indices @@ -797,7 +800,11 @@ def causal_conv1d_fn_npu( activation=activation, return_final_states=True, )- conv_states.index_copy_(0, cache_indices, final_states_out)+ # aclnnInplaceIndexCopy rejects duplicate slot indices (and is brittle+ # about slice shapes on NPU); advanced-index assignment implements the+ # same scatter with last-write-wins semantics and accepts the real+ # continuous-batching case where one conv slot can appear more than once.+ conv_states[cache_indices] = final_states_out if x.ndim == 3: return out # [batch_size, dim, seq_len]