Inspect · Source & workspace
Requested workspace inspection and file and log inspection related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val> <n> > <path>ls -l -a <path>head -n <n>Kimi K3 · Serving
Mixed interactivity 1dev · Implementation Optimization
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 agentKimi K3 · 193 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 and file and log inspection related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val> <n> > <path>ls -l -a <path>head -n <n>Requested file and log inspection and workspace inspection related to task requirements.
3 calls · #0002–#0004
Read <path>cd <path>ls -l -a <val> <val> <val> <val> <val> <path> <path>Requested file and log inspection related to runtime processes.
1 call · #0005–#0005
Read <path>Requested file and log inspection related to source & workspace.
1 call · #0006–#0006
Read <path>Requested file and log inspection related to benchmark & validation setup.
3 calls · #0007–#0009
Read <path>Requested file and log inspection related to source & workspace.
3 calls · #0010–#0012
Read <path>Requested file and log inspection related to task requirements.
2 calls · #0013–#0014
Read <path>cd <path>head -c <n> <path>echoecho <flag>cat <path>Requested source searches and file and log inspection related to source & workspace.
5 calls · #0015–#0019
cd <path>grep -n <val> <path>head -n <n>Read <path>Requested source searches related to benchmark & validation setup.
1 call · #0020–#0020
Search <pattern> <path>Requested source searches related to task requirements.
1 call · #0021–#0021
Search <pattern> <path>Requested file and log inspection related to source & workspace.
3 calls · #0022–#0024
Read <path>Requested file and log inspection related to task requirements.
1 call · #0025–#0025
Read <path>Requested environment setup or inspection and source searches related to source & workspace.
1 call · #0026–#0026
envgrep -E <val>sortRequested file and log inspection and script or workload execution related to source & workspace.
2 calls · #0027–#0028
Read <path>cat <path> <n> > <path>python3 -m <module>head -n <n>Requested script or workload execution related to source & workspace.
1 call · #0029–#0029
python3 -c <script> <n> >& <path>Requested workspace inspection, source searches and file and log inspection related to source & workspace.
1 call · #0030–#0030
ls <path>grep -i -E <val>cat <path> <n> > <path>head -n <n>find <path> -maxdepth <n> -name <val> <n> > <path>Requested source searches and file and log inspection related to latency & request handling.
1 call · #0031–#0031
cd <path>grep -n <val> <path>head -n <n>Requested file and log inspection and source searches related to benchmark & validation setup.
2 calls · #0032–#0033
cd <path>sed -n <val> <path>grep -n <val> <path>head -n <n>sed -n <path> <path>sed -n <val>Requested task coordination, script or workload execution and file and log inspection related to source & workspace.
3 calls · #0034–#0036
Update task list <tasks>bash <script> <n> >& <path>tail -n <n>mkdir -p <path>cd <path>sed -n <val> <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0037–#0037
bash <script> > <path> <n> >& <path>echo <val>Requested workspace inspection, source searches and file and log inspection related to batching & scheduling.
3 calls · #0038–#0040
cd <path>ls <path>grep -n <val> <path>head -n <n>sed -n <val> <path>Requested file and log inspection related to source & workspace.
2 calls · #0041–#0042
cd <path>sed -n <val> <path>Requested file and log inspection and workspace inspection related to benchmark & validation setup.
1 call · #0043–#0043
tail -n <n> <path> <n> > <path>ls <path> <n> > <path>Requested source searches related to batching & scheduling.
1 call · #0044–#0044
Search <pattern> <path>Requested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0045–#0045
cd <path>grep -n <val> <path>grep -i <val>headRequested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0046–#0046
cd <path>grep -n <val> <path> <path> <n> > <path>headRequested file and log inspection related to benchmark & validation setup.
1 call · #0047–#0047
cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0048–#0048
cd <path>grep -n <val> <path>head -n <n>grep -r -n <val> <path>Requested file and log inspection related to runtime processes.
1 call · #0049–#0049
cd <path>sed -n <val> <path>Requested file and log inspection, script or workload execution and workspace file updates related to benchmark & validation setup.
2 calls · #0050–#0051
cat <path>echo <flag>python3 -c <script>cp <path> <path>echo <val>Requested script or workload execution related to benchmark & validation setup.
1 call · #0052–#0052
bash <script> > <path> <n> >& <path>echo <val>Requested task coordination and file and log inspection related to source & workspace.
2 calls · #0053–#0054
Update task list <tasks>cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to batching & scheduling.
2 calls · #0055–#0056
cd <path>grep -n <val> <path>head -n <n>sed -n <val> <path>Requested source searches and file and log inspection related to attention kernels.
1 call · #0057–#0057
grep -i -E <val> <path>head -n <n>Requested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0058–#0058
grep -E <val> <path>head -n <n>tail -n <n>Requested environment setup or inspection, file and log inspection and source searches related to source & workspace.
1 call · #0059–#0059
env <vars>tail -n <n> <val> <n> > <path>cut <flag>grep -c <val> <val> <n> > <path>Requested source searches, file and log inspection and workspace inspection related to attention kernels.
3 calls · #0060–#0062
cd <path>grep -r -n <val> <path> <n> > <path>headls <path>grep -i <val>head -n <n>grep -i -E <val>grep -r -n <val> <path>grep -i -n <val>grep -r -l -n <val> <path>Requested workspace inspection, file and log inspection and environment setup or inspection related to source & workspace.
2 calls · #0063–#0064
cd <path>ls <path> <n> > <path>sed -n <val> <path> <n> > <path>env <vars>ls <path>grep -c <val> <val>grep <val> <val>tail -n <n>cut <flag>Requested script or workload execution related to latency & request handling.
1 call · #0065–#0065
python3 -c <script>Requested script or workload execution and file and log inspection related to source & workspace.
1 call · #0066–#0066
python3 -c <script>head -n <n>Requested environment setup or inspection, source searches and file and log inspection related to batching & scheduling.
1 call · #0067–#0067
env <vars>grep -n <val> <path>awk <path> <val>grep -E <val>head -n <n>cut <flag>Requested environment setup or inspection, file and log inspection and source searches related to source & workspace.
1 call · #0068–#0068
env <vars>awk <path> <val>grep -v -E <val>cut <flag>head -n <n>Requested environment setup or inspection, source searches and file and log inspection related to batching & scheduling.
1 call · #0069–#0069
env <vars>grep -E <val> <val>awk <val>tail -n <n>echo <val>ls <path> <n> > <path>Requested script or workload execution and workspace file updates related to benchmark & validation setup.
1 call · #0070–#0070
python3 -c <script>cp <path> <path>Requested environment setup or inspection, file and log inspection and source searches related to batching & scheduling.
2 calls · #0071–#0072
env <vars>awk <path> <val>grep -v -E <val>cut <flag>head -n <n>Requested script or workload execution related to source & workspace.
1 call · #0073–#0073
date -upython3 - <script>Requested source searches and file and log inspection related to source & workspace.
1 call · #0074–#0074
cd <path>grep -r -n <val> <path>head -n <n>Requested source searches, file and log inspection and workspace inspection related to batching & scheduling.
2 calls · #0075–#0076
cd <path>grep -r -n <val> <path>head -n <n>grep -r -n <val> <path> <n> > <path>headls <path> <n> > <path>sed -n <val> <path>Requested environment setup or inspection related to prefix caching.
1 call · #0077–#0077
cd <path>env <vars> nohup <path> -m <val> <flag> <args>echo <val>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0078–#0078
cd <path>grep -r -n <val> <path> <path> <path> <n> > <path>headRequested workspace inspection, source searches and file and log inspection related to source & workspace.
1 call · #0079–#0079
cd <path>ls <path> <n> > <path>grep -r -n <val> <path> <n> > <path>headRequested file and log inspection related to batching & scheduling.
1 call · #0080–#0080
cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to device memory.
1 call · #0081–#0081
cd <path>grep -r -n <val> <path> <path> <n> > <path>grep -r -n <val> <path> <n> > <path>headRequested source searches, file and log inspection and script or workload execution related to source & workspace.
5 calls · #0082–#0086
cd <path>grep -r -n <val> <path>headgrep -r -n <val> <path> <n> > <path>head -n <n>sed -n <val> <path>python3 - <script>grep -r -l -n <val> <path>python3 -c <script> <n> >& <path>tail -n <n>Update task list <tasks>Requested file and log inspection related to runtime processes.
1 call · #0087–#0087
tail -n <n> <path>cut <flag>Requested code edits related to source & workspace.
1 call · #0088–#0088
Write <path>Requested script or workload execution and source searches related to source & workspace.
2 calls · #0089–#0090
cd <path>python3 <script> <val> <n> >& <path>grep -v <val>Requested script or workload execution, source searches and file and log inspection related to batching & scheduling.
1 call · #0091–#0091
cd <path>python3 <script> <val> <n> >& <path>grep -v <val>grep -E <val> <path>tail -n <n>cut <flag>Requested environment setup or inspection and file and log inspection related to source & workspace.
1 call · #0092–#0092
env <vars>awk <path> <val>cut <flag>head -n <n>Requested script or workload execution and source searches related to source & workspace.
2 calls · #0093–#0094
python3 -m <module> <path>grep -c <path> <path>cd <path>python3 <script> <val> <n> >& <path>grep -v <val>Requested environment setup or inspection, script or workload execution and source searches related to runtime processes.
1 call · #0095–#0095
env <vars>python3 - <script>grep <val> <val>head -n <n>cut <flag>Requested workspace inspection, file and log inspection and environment setup or inspection related to source & workspace.
3 calls · #0096–#0098
find <path> -maxdepth <n> -type <val> <n> > <path>head -n <n>du <flag> <args>headls -l -a <path> <n> > <path>ls <path> <n> > <path>ls -l -a <path> <path> <n> > <path>envgrep -i -E <val>find <path> -maxdepth <n> -name <val> -o -maxdepth <n> -name <val> -type <val> <args>grep -v <val>find <path> -maxdepth <n> <flag> <args>find <path> -maxdepth <n>Requested workspace inspection, source searches and file and log inspection related to attention kernels.
3 calls · #0099–#0101
cd <path>ls <path>grep -r -n <val> <path>head -n <n>sed -n <val> <path>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0102–#0102
cd <path>grep -r -n <val> <path>head -n <n>Requested service requests, script or workload execution and source searches related to source & workspace.
1 call · #0103–#0103
cd <path>curl -s -X <val> <url> -H <path> -d <path>echopython3 <script> <val> <n> >& <path>grep -v <val>head -n <n>sleep <n>curl -s -X <val> <url> <val> -la <path> <n> > <path>headRequested environment setup or inspection, workspace inspection and file and log inspection related to source & workspace.
9 calls · #0104–#0112
env <vars>find <val> -name <val>headdu <flag> <args>python3 - <script>Requested script or workload execution related to attention kernels.
1 call · #0113–#0113
python3 - <script>Requested source searches and file and log inspection related to device memory.
2 calls · #0114–#0115
cd <path>grep -r -n <val> <path> <n> > <path>headgrep -r -l -n <val> <path>head -n <n>sed -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0116–#0116
python3 - <script>Requested file and log inspection related to attention kernels.
2 calls · #0117–#0118
cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to runtime processes.
3 calls · #0119–#0121
cd <path>grep -r -n <val> <path>headsed -n <val> <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0122–#0122
cd <path>grep -n <val> <path>head -n <n>Requested code edits related to attention kernels.
1 call · #0123–#0123
Edit <path>Requested file and log inspection related to attention kernels.
1 call · #0124–#0124
Read <path>Requested code edits related to attention kernels.
2 calls · #0125–#0126
Edit <path>Requested file and log inspection and source searches related to runtime processes.
4 calls · #0127–#0130
cd <path>sed -n <val> <path>Read <path>grep -n <val> <path>head -n <n>Requested code edits related to runtime processes.
3 calls · #0131–#0133
Edit <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0134–#0134
cd <path>grep -r -n <val> <path>sed -n <path> <path> <n> > <path>grep -r -n <flag> <args>Requested source searches, file and log inspection and script or workload execution related to attention kernels.
1 call · #0135–#0135
cd <path>grep -n <val> <path>head -n <n>python3 -c <script>Requested file and log inspection related to runtime processes.
1 call · #0136–#0136
cd <path>sed -n <val> <path>tr <val> <val>Requested file and log inspection and source searches related to batching & scheduling.
1 call · #0137–#0137
cd <path>sed -n <val> <path> <n> > <path>grep -r -n <val> <path> <path>Requested task coordination related to source & workspace.
1 call · #0138–#0138
Update task list <tasks>Requested process termination, execution waits and runtime inspection related to source & workspace.
1 call · #0139–#0139
kill <n> <n> > <path>sleep <n>kill <flag> <args>ps <val>grep -E <val>grep -v <val>awk <val>xargs -r <val> <flag> <args>echo <val>Requested environment setup or inspection related to prefix caching.
1 call · #0140–#0140
cd <path>env <vars> nohup <path> -m <val> <flag> <args>echo <val>Requested source searches related to runtime processes.
1 call · #0141–#0141
<command> <args>grep -E <val> <path>cut <flag>Requested script or workload execution, source searches and file and log inspection related to source & workspace.
2 calls · #0142–#0143
cd <path>python3 <script> <val> <n> >& <path>grep -v <val>tail -n <n>grep -r -n <val> <path>headgrep -r -n <val> <path> <n> > <path>head -n <n>ls <path> <n> > <path>Requested script or workload execution related to source & workspace.
1 call · #0144–#0144
cd <path>python3 - <script>Requested file and log inspection and source searches related to batching & scheduling.
3 calls · #0145–#0147
cd <path>sed -n <path> <path>grep -r -n <val> <path>head -n <n>grep -v <path>Requested script or workload execution related to source & workspace.
1 call · #0148–#0148
python3 - <script>Requested process termination, execution waits and runtime inspection related to runtime processes.
1 call · #0149–#0149
kill <n> <n> > <path>sleep <n>ps <val>grep -E <val>grep -v <val>awk <val>xargs -r <val> <flag> <args>grep -c <val>echo <val>Requested runtime inspection, source searches and file and log inspection related to runtime processes.
1 call · #0150–#0150
ps <val>grep <val>head -n <n>pkill <flag> <args>sleep <n>wc -lRequested runtime inspection, source searches and file and log inspection related to device memory.
1 call · #0151–#0151
ps <val>grep -E <val>awk <val>xargs -r <val> <flag> <args>sleep <n>wc -lnpu-smi info <n> > <path>head -n <n>trueRequested script or workload execution related to benchmark & validation setup.
1 call · #0152–#0152
bash <script> > <path> <n> >& <path>echo <val>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0153–#0153
grep -E <val> <path>head -n <n>cut <flag>Requested execution waits related to source & workspace.
1 call · #0154–#0154
Wait for <task>Requested script or workload execution and source searches related to benchmark & validation setup.
1 call · #0155–#0155
python3 -c <script>grep -E <val> <path>cut <flag>Requested task coordination related to source & workspace.
1 call · #0156–#0156
Update task list <tasks>Requested script or workload execution related to benchmark & validation setup.
1 call · #0157–#0157
bash <script> > <path> <n> >& <path>echo <val>Requested code edits related to source & workspace.
1 call · #0158–#0158
Write <path>Requested repository inspection, execution waits and workspace inspection related to source & workspace.
2 calls · #0159–#0160
cd <path>git status --shortgit diff --statsleep <n>ls <path> <n> > <path>wc -ltail -n <n> <path> <n> > <path>cut <flag>Requested file and log inspection, workspace inspection and script or workload execution related to benchmark & validation setup.
1 call · #0161–#0161
cat <path>ls -l -a <path> <n> > <path>python3 <script>Requested environment setup or inspection, source searches and file and log inspection related to source & workspace.
1 call · #0162–#0162
env <vars>grep -E <path> <val>head -n <n>cut <flag>echo <flag>Requested source searches and file and log inspection related to runtime processes.
2 calls · #0163–#0164
cd <path>grep -n <path> <path>head -n <n>Read <path>Requested code edits related to runtime processes.
2 calls · #0165–#0166
Edit <path>Requested file and log inspection related to runtime processes.
1 call · #0167–#0167
Read <path>Requested code edits related to runtime processes.
4 calls · #0168–#0171
Edit <path>Requested file and log inspection related to runtime processes.
1 call · #0172–#0172
Read <path>Requested code edits related to runtime processes.
1 call · #0173–#0173
Edit <path>Requested file and log inspection related to runtime processes.
1 call · #0174–#0174
Read <path>Requested code edits related to runtime processes.
1 call · #0175–#0175
Edit <path>Requested script or workload execution and source searches related to runtime processes.
1 call · #0176–#0176
cd <path>python3 -c <script>grep -n <val> <path>Requested environment setup or inspection related to prefix caching.
1 call · #0177–#0177
cd <path>env <vars> nohup <path> -m <val> <flag> <args>echo <val>Requested task coordination related to source & workspace.
1 call · #0178–#0178
Update task list <tasks>Requested source searches and execution waits related to runtime processes.
1 call · #0179–#0179
<command> <args>cut <flag>grep -q <path>sleep <n>grep -E <val> <path>Requested process termination, execution waits and runtime inspection related to runtime processes.
1 call · #0180–#0180
kill <n> <n> > <path>sleep <n>ps <val>grep -E <val>awk <val>xargs -r <val> <flag> <args>wc -lRequested script or workload execution related to benchmark & validation setup.
1 call · #0181–#0181
bash <script> > <path> <n> >& <path>echo <val>Requested execution waits related to source & workspace.
1 call · #0182–#0182
Wait for <task>Requested script or workload execution related to benchmark & validation setup.
1 call · #0183–#0183
python3 -c <script>date -uRequested script or workload execution related to benchmark & validation setup.
1 call · #0184–#0184
bash <script> > <path> <n> >& <path>echo <val>Requested repository inspection, workspace inspection and file and log inspection related to source & workspace.
2 calls · #0185–#0186
cd <path>git diffls <path> <n> > <path>wc -ltail -n <n> <path>cut <flag>Requested execution waits related to source & workspace.
1 call · #0187–#0187
Wait for <task>Requested script or workload execution, file and log inspection and task coordination related to source & workspace.
2 calls · #0188–#0189
python3 <script> <n> >& <path>head -n <n>Update task list <tasks>Requested script or workload execution, file and log inspection and runtime inspection related to source & workspace.
1 call · #0190–#0190
bash <script> <n> >& <path>tail -n <n>ps <val>grep -E <val>wc -l<command> <args>echo <val>head -c <n>echols <path> <n> > <path>Requested repository inspection, workspace file updates and workspace inspection related to source & workspace.
1 call · #0191–#0191
cd <path>git status --shortgit <val> <val>rm -rf <path>du <flag> <args>ls <path>Requested runtime inspection, source searches and file and log inspection related to latency & request handling.
1 call · #0192–#0192
ps <val>grep -E <val>head -n <n>echo <flag>python3 -c <script>Requested task coordination related to source & workspace.
1 call · #0193–#0193
Update task list <tasks>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
@@ -171,6 +171,7 @@ from sglang.srt.utils import ( delete_directory, get_bool_env_var, is_mps,+ is_npu, kill_process_tree, set_uvicorn_logging_configs, )@@ -1826,15 +1827,19 @@ async def available_models(): served_model_names = [_global_state.tokenizer_manager.served_model_name] model_cards = [] - # Add base model- for served_model_name in served_model_names:- model_cards.append(- ModelCard(- id=served_model_name,- root=served_model_name,- max_model_len=_global_state.tokenizer_manager.model_config.context_len,+ # While NPU startup compile priming is still running, report no models so+ # readiness probes keep waiting and no external traffic can overlap the+ # priming requests.+ if not _NPU_COMPILE_PRIMING_PENDING:+ # Add base model+ for served_model_name in served_model_names:+ model_cards.append(+ ModelCard(+ id=served_model_name,+ root=served_model_name,+ max_model_len=_global_state.tokenizer_manager.model_config.context_len,+ ) )- ) # Add loaded LoRA adapters if _global_state.tokenizer_manager.server_args.enable_lora:@@ -2158,6 +2163,108 @@ async def _send_disaggregation_warmup_requests( ) +# Starts as "pending" so that readiness probes hitting /v1/models cannot latch+# before the startup warmup (including NPU compile priming) has completed.+# Cleared once warmup finishes (or is skipped) in _wait_and_warmup.+_NPU_COMPILE_PRIMING_PENDING = True+++def _priming_input_ids(length: int, seed: int) -> List[int]:+ """Deterministic in-vocabulary token ids for startup compile priming.++ Fixed pseudo-random ids (never fixture-derived): the only purpose is to+ drive real model forwards over the shapes production traffic will use.+ """+ ids = []+ x = seed+ for _ in range(length):+ x = (1103515245 * x + 12345) % (2**31)+ ids.append(100 + x % 50000)+ return ids+++def _execute_npu_compile_priming(+ server_args: ServerArgs,+ url: str,+ headers: Dict[str, str],+ ssl_verify: Union[bool, str],+) -> None:+ """Prime one-time device kernel compilations before reporting readiness.++ Eager (non-graphed) forwards on Ascend compile operator kernels the first+ time each shape family is seen, which otherwise surfaces as multi-second+ stalls inside live traffic. Running a small, fixed set of real generate+ requests at startup moves that cost into the warmup window. Best effort:+ priming failures are logged and never fail the launch.+ """+ import concurrent.futures++ global _NPU_COMPILE_PRIMING_PENDING+ _NPU_COMPILE_PRIMING_PENDING = True+ timeout = envs.SGLANG_WARMUP_TIMEOUT.get()+ timeout = timeout if timeout > 0 else 600+ started = time.monotonic()++ def fire(payload: Dict[str, Any]) -> int:+ res = requests.post(+ url + "/generate",+ json=payload,+ headers=headers,+ timeout=timeout,+ verify=ssl_verify,+ )+ return res.status_code++ def short_req(seed: int, out_len: int = 8) -> Dict[str, Any]:+ return {+ "input_ids": _priming_input_ids(512, seed),+ "sampling_params": {+ "temperature": 0.0,+ "max_new_tokens": out_len,+ "ignore_eos": True,+ },+ }++ executor = concurrent.futures.ThreadPoolExecutor(max_workers=12)+ try:+ # Phase A: a burst of short requests (batched prefill + steady decode).+ futures = [executor.submit(fire, short_req(17 + i)) for i in range(8)]+ # Phase B: one long chunked-prefill request admitted while short+ # requests are decoding (mixed extend+decode shapes at full occupancy).+ delayed_long = executor.submit(+ lambda: (time.sleep(0.25), fire(+ {+ "input_ids": _priming_input_ids(16384, 999983),+ "sampling_params": {+ "temperature": 0.0,+ "max_new_tokens": 8,+ "ignore_eos": True,+ },+ }+ ))[1]+ )+ futures.append(delayed_long)+ # Phase C: a second short burst (post-chunk admission shapes).+ futures += [executor.submit(fire, short_req(1000 + i)) for i in range(8)]+ failures = [f.result() for f in futures if f.result() != 200]+ if failures:+ logger.warning(+ "NPU startup compile priming saw non-200 responses: %s", failures+ )+ logger.info(+ "NPU startup compile priming finished in %.1f s",+ time.monotonic() - started,+ )+ except Exception:+ logger.warning(+ "NPU startup compile priming failed (continuing launch): %s",+ get_exception_traceback(),+ )+ finally:+ executor.shutdown(wait=True)+ _NPU_COMPILE_PRIMING_PENDING = False++ def _execute_server_warmup(server_args: ServerArgs): headers = {} url = server_args.url()@@ -2282,6 +2389,10 @@ def _execute_server_warmup(server_args: ServerArgs): verify=ssl_verify, ) assert res.status_code == 200, f"{res.text}"+ if is_npu() and get_bool_env_var(+ "SGLANG_NPU_STARTUP_COMPILE_PRIMING", default="true"+ ):+ _execute_npu_compile_priming(server_args, url, headers, ssl_verify) # Skip server_status update for Rust server if not envs.SGLANG_RUST_SERVER.get(): _global_state.tokenizer_manager.server_status = ServerStatus.Up@@ -2351,6 +2462,11 @@ def _wait_and_warmup( else: _global_state.tokenizer_manager.server_status = ServerStatus.Up + # Warmup (including any compile priming) is done: allow readiness probes+ # to see the served model from here on.+ global _NPU_COMPILE_PRIMING_PENDING+ _NPU_COMPILE_PRIMING_PENDING = False+ # The server is ready for requests logger.info("The server is fired up and ready to roll!") @@ -430,7 +430,14 @@ class AscendAttnBackend(AttentionBackend): def init_forward_metadata(self, forward_batch: ForwardBatch): """Init the metadata for a forward pass.""" self.forward_metadata = ForwardMetadata()- seq_lens_max = forward_batch.seq_lens.max()+ # Compute the max sequence length on the host whenever the CPU copy is+ # available. Using the device scalar as a slice bound forces a+ # device-to-host sync in the middle of batch preparation, which stalls+ # the kernel-launch pipeline of every eager forward.+ if forward_batch.seq_lens_cpu is not None:+ seq_lens_max = int(forward_batch.seq_lens_cpu.max().item())+ else:+ seq_lens_max = int(forward_batch.seq_lens.max().item()) if forward_batch.forward_mode.is_target_verify(): seq_lens_max += self.speculative_num_draft_tokens elif (@@ -459,9 +466,16 @@ class AscendAttnBackend(AttentionBackend): ) if forward_batch.extend_seq_lens is not None: self.forward_metadata.extend_seq_lens = forward_batch.extend_seq_lens- self.forward_metadata.extend_seq_lens_cpu_int = (- forward_batch.extend_seq_lens.cpu().int()- )+ if forward_batch.extend_seq_lens_cpu is not None:+ # Build the CPU int32 copy from the host-side lengths instead of+ # a device->host round trip on every eager batch.+ self.forward_metadata.extend_seq_lens_cpu_int = torch.tensor(+ forward_batch.extend_seq_lens_cpu, dtype=torch.int32+ )+ else:+ self.forward_metadata.extend_seq_lens_cpu_int = (+ forward_batch.extend_seq_lens.cpu().int()+ ) if forward_batch.seq_lens is not None: self.forward_metadata.seq_lens = forward_batch.seq_lens.int() else: