Inspect · Task requirements
Requested workspace inspection and file and log inspection related to task requirements.
1 call · #0001–#0001
echo <val>ls -l -a <val>cat <path>echo <flag>DeepSeek-V4-Pro · 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 agentDeepSeek-V4-Pro · 158 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 task requirements.
1 call · #0001–#0001
echo <val>ls -l -a <val>cat <path>echo <flag>Requested workspace inspection and file and log inspection related to runtime processes.
1 call · #0002–#0002
cd <val>find <path> -maxdepth <n> -type <val>sortsed -n <val>echo <flag>cat <path>sed -n <val> <path>Requested file and log inspection, environment setup or inspection and source searches related to source & workspace.
3 calls · #0003–#0005
cd <val><command> <args>cat <val>envsortgrep -E <val>sed -n <val>echo <val>pwdls <path>headpython3 <script> <n> >& <path>Requested script or workload execution related to source & workspace.
1 call · #0006–#0006
cd <val>bash <script>echo <val>Requested file and log inspection related to source & workspace.
1 call · #0007–#0007
cd <val>sed -n <val> <path>Requested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0008–#0008
cd <val>grep -n <val> <path>sed -n <val>wc -l <path>Requested file and log inspection related to source & workspace.
2 calls · #0009–#0010
cd <val>sed -n <val> <path>Requested source searches related to task requirements.
1 call · #0011–#0011
cd <val>grep -n <val> <path>Requested file and log inspection, environment setup or inspection and workspace inspection related to source & workspace.
8 calls · #0012–#0019
cd <val>sed -n <val> <path>env <vars> bash <script>echo <val>ls -l -a <val>cat <path> <n> > <path>head -c <n>cd <path>git status --shortgit log <flag> <args>git <val> -vheadls <path>head -n <n>ls <val>Requested workspace inspection, source searches and file and log inspection related to attention kernels.
1 call · #0020–#0020
cd <path>find <path> -maxdepth <n> -type <val>grep -E <val>head -n <n>wc -l <path>grep -n <val> <path>Requested file and log inspection related to batching & scheduling.
1 call · #0021–#0021
cd <path>sed -n <val> <path>Requested environment setup or inspection, file and log inspection and workspace inspection related to benchmark & validation setup.
1 call · #0022–#0022
cd <val>env <vars> bash <script> > <path> <n> >& <path>env <vars>echo <val>tail -c <n> <path>echo <flag>ls -l -a <path>python3 - <script>Requested file and log inspection and script or workload execution related to task requirements.
1 call · #0023–#0023
cd <val>cat <path>echo <flag>head -n <n> <path>python3 - <script>Requested script or workload execution and file and log inspection related to task requirements.
1 call · #0024–#0024
cd <val>python3 - <script>head -n <n> <path>python3 -c <script>Requested file and log inspection and script or workload execution related to task requirements.
1 call · #0025–#0025
cd <val>cat <path>echo <flag>python3 -m <module>sed -n <val>python3 - <script>Requested file and log inspection and script or workload execution related to task requirements.
1 call · #0026–#0026
cd <val>cat <path>python3 -m <module>echo <flag>python3 - <script>Requested file and log inspection and workspace inspection related to benchmark & validation setup.
1 call · #0027–#0027
cd <val>cat <path>echo <flag>cat <val>echofind <path> -maxdepth <n> -type <val> <flag> <args>sortRequested environment setup or inspection, file and log inspection and runtime inspection related to benchmark & validation setup.
3 calls · #0028–#0030
cd <val><command> <args>env <vars> bash <script> > <path> <n> >& <path>env <vars>echo <val> <val>tail -c <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <path>tail -c <n> <path> <n> > <path>cat <path> <n> > <path>tail -n <n> <path> <n> > <path>ls -l -a <path> <n> > <path>Requested runtime inspection, source searches and workspace inspection related to runtime processes.
1 call · #0031–#0031
ps <flag> <args>grep -E <val>grep -v <val><command> <args>grep <n>truels -l -a <path>head -c <n> <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0032–#0032
ls -l -a <path>tail -n <n>find <path> -name <val> -o -name <val>sorttail -n <n> <path> <n> > <path>echo <val>Requested script or workload execution related to latency & request handling.
1 call · #0033–#0033
cd <path>python3 - <script>Requested environment setup or inspection, file and log inspection and execution waits related to task requirements.
1 call · #0034–#0034
cd <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>cat <path>sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>Requested execution waits, file and log inspection and workspace inspection related to source & workspace.
1 call · #0035–#0035
sleep <n>echo <val> <val> <path> <val> -p <val> <path> -o <val>echo <val>tail -n <n> <path>ls -l -a <val>tail -n <n>Requested execution waits, file and log inspection and workspace inspection related to runtime processes.
5 calls · #0036–#0040
sleep <n>tail -n <n> <path>ls -l -a <val>tail -n <n>ps <flag> <args>grep -E <val>grep -v <val>Requested file and log inspection and source searches related to batching & scheduling.
2 calls · #0041–#0042
cd <path>sed -n <val> <path>grep -n <val> -R <path>Requested file and log inspection and source searches related to source & workspace.
4 calls · #0043–#0046
cd <path>sed -n <val> <path>grep -n <val> <path>grep -n <val> -n <path>headRequested source searches and file and log inspection related to batching & scheduling.
1 call · #0047–#0047
cd <path>grep -R <val> -n <path>head -n <n>grep -n <val> -R <path>grep -n <val> <path>Requested script or workload execution related to latency & request handling.
2 calls · #0048–#0049
cd <path>python3 - <script>Requested source searches and file and log inspection related to batching & scheduling.
2 calls · #0050–#0051
cd <path>grep -n <val> <path>sed -n <val>head -n <n>sed -n <val> <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0052–#0052
cd <path>grep -R <val> -n <path>sed -n <val> <path>headgrep -n <val> <flag> <args>Requested file and log inspection and source searches related to prefix caching.
2 calls · #0053–#0054
cd <path>sed -n <val> <path>grep -n <val> <path>head -n <n>grep -n <val> -n <path>headgrep -R <val> -n <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0055–#0055
cd <path>grep -R <val> -n <path>head -n <n>Requested file and log inspection and source searches related to kv-cache management.
1 call · #0056–#0056
cd <path>sed -n <val> <path>grep -n <val> -R <path> <path>head -n <n>Requested file and log inspection related to source & workspace.
1 call · #0057–#0057
cd <path>sed -n <val> <path>Requested source searches and file and log inspection related to batching & scheduling.
4 calls · #0058–#0061
cd <path>grep -R <val> -n <path>head -n <n>sed -n <val> <path>grep -n <val> <path>grep -n <val> <flag> <args>Requested file and log inspection and source searches related to source & workspace.
3 calls · #0062–#0064
cd <path>sed -n <val> <path>grep -n <val> -n <path>grep -n <val> -R <path>head -n <n>Requested file and log inspection and source searches related to prefix caching.
1 call · #0065–#0065
cd <path>sed -n <val> <path>grep -R <val> -n <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0066–#0066
cd <path>grep -n <val> <path>head -n <n>grep -n <val> <flag> <args>Requested source searches and file and log inspection related to batching & scheduling.
7 calls · #0067–#0073
cd <path>grep -n <val> <path>head -n <n>grep -R <val> -n <path> <path> <path>sed -n <val> <path>headRequested script or workload execution, repository inspection and file and log inspection related to prefix caching.
1 call · #0074–#0074
cd <path>python3 - <script>git diff <flag> <args>sed -n <val>Requested script or workload execution, environment setup or inspection and execution waits related to batching & scheduling.
1 call · #0075–#0075
cd <path>python3 -m <module> <script> <script>echo <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>Requested environment setup or inspection, execution waits and file and log inspection related to task requirements.
1 call · #0076–#0076
cd <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>Requested execution waits, file and log inspection and runtime inspection related to benchmark & validation setup.
3 calls · #0077–#0079
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <val>tail -n <n>grep <val>Requested file and log inspection and source searches related to benchmark & validation setup.
2 calls · #0080–#0081
tail -n <n> <path>sed -n <val>grep -n <val> <path>tail -n <n>grep -v <val>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0082–#0082
grep -n <val> <path>sed -n <val>head -n <n>Requested file and log inspection related to source & workspace.
1 call · #0083–#0083
cd <val>sed -n <val> <path>Requested script or workload execution and repository inspection related to batching & scheduling.
1 call · #0084–#0084
cd <path>python3 - <script>python3 -m <module> <script>echo <val>git diff --checkRequested environment setup or inspection, execution waits and file and log inspection related to benchmark & validation setup.
3 calls · #0085–#0087
cd <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <path>python3 - <script>Requested workspace file updates, script or workload execution and environment setup or inspection related to task requirements.
1 call · #0088–#0088
cp <path> <path> <n> > <path>truepython3 - <script>cd <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>cat <path>sleep <n>tail -n <n> <path>Requested execution waits, file and log inspection and runtime inspection related to runtime processes.
3 calls · #0089–#0091
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <val>tail -n <n>cat <path>ps -p <val> <path> -o <val>Requested file and log inspection, script or workload execution and execution waits related to benchmark & validation setup.
2 calls · #0092–#0093
cat <path>python3 -m <module>sed -n <val>sleep <n>tail -n <n> <path>ls -l -a <val>tail -n <n>ls -l -a <path>python3 -c <script>ps <flag> <args>grep -E <val>grep -v <val>Requested execution waits, file and log inspection and workspace inspection related to runtime processes.
1 call · #0094–#0094
sleep <n>tail -n <n> <path>ls -l -a <val>tail -n <n>ps <flag> <args>grep -E <val>grep -v <val>Requested script or workload execution related to latency & request handling.
1 call · #0095–#0095
cd <path>python3 - <script>Requested script or workload execution, source searches and file and log inspection related to batching & scheduling.
1 call · #0096–#0096
cd <path>python3 - <script>grep -n <val> <path>sed -n <val>Requested execution waits, file and log inspection and runtime inspection related to runtime processes.
1 call · #0097–#0097
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <val>tail -n <n>Requested source searches and file and log inspection related to latency & request handling.
1 call · #0098–#0098
cd <val>grep -n <val> <path>head -n <n>sed -n <val> <path>Requested source searches and file and log inspection related to benchmark & validation setup.
2 calls · #0099–#0100
cd <val>grep -n <val> <path>head -n <n>sed -n <val> <path>Requested script or workload execution related to latency & request handling.
1 call · #0101–#0101
cd <path>python3 - <script>Requested script or workload execution related to batching & scheduling.
1 call · #0102–#0102
python3 - <script>Requested file and log inspection related to benchmark & validation setup.
1 call · #0103–#0103
cd <val>sed -n <val> <path>Requested script or workload execution related to source & workspace.
3 calls · #0104–#0106
cd <path>python3 - <script>Requested script or workload execution related to benchmark & validation setup.
1 call · #0107–#0107
python3 - <script>Requested source searches and file and log inspection related to source & workspace.
1 call · #0108–#0108
cd <path>grep -R <val> -n <path>head -n <n>sed -n <val> <path>grep -n <val> <path>Requested script or workload execution related to source & workspace.
1 call · #0109–#0109
cd <path>python3 - <script>Requested source searches, file and log inspection and script or workload execution related to batching & scheduling.
3 calls · #0110–#0112
cd <path>grep -R <val> -n <path>head -n <n>grep -R <val> -n <path> <path> <path> <path>grep -R <val> -n <path> <path>python3 - <script>python3 -m <module> <script>git diff --checkRequested environment setup or inspection, execution waits and file and log inspection related to benchmark & validation setup.
2 calls · #0113–#0114
cd <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>Requested runtime inspection, source searches and file and log inspection related to benchmark & validation setup.
1 call · #0115–#0115
ps -p <val> <path> -o <val>ps <flag> <args>grep -E <val>grep -v <val>tail -n <n> <path>ls -l -a <path>Requested execution waits, file and log inspection and runtime inspection related to benchmark & validation setup.
1 call · #0116–#0116
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>python3 - <script>Requested environment setup or inspection, execution waits and file and log inspection related to task requirements.
1 call · #0117–#0117
cd <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>Requested execution waits, file and log inspection and runtime inspection related to runtime processes.
2 calls · #0118–#0119
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <val>tail -n <n>Requested script or workload execution related to latency & request handling.
1 call · #0120–#0120
cd <path>python3 - <script>Requested execution waits, file and log inspection and runtime inspection related to runtime processes.
1 call · #0121–#0121
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <val>tail -n <n>Requested script or workload execution related to latency & request handling.
1 call · #0122–#0122
cd <path>python3 - <script>Requested execution waits, file and log inspection and runtime inspection related to latency & request handling.
1 call · #0123–#0123
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>cd <path>python3 - <script>Requested script or workload execution related to latency & request handling.
1 call · #0124–#0124
python3 - <script>Requested script or workload execution, repository inspection and source searches related to prefix caching.
1 call · #0125–#0125
cd <path>python3 - <script>python3 -m <module> <script>git diff --checkgrep -n <val> -n <path>Requested environment setup or inspection, execution waits and file and log inspection related to task requirements.
1 call · #0126–#0126
cd <val>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>Requested execution waits, file and log inspection and runtime inspection related to runtime processes.
2 calls · #0127–#0128
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>ls -l -a <val>tail -n <n>Requested script or workload execution related to latency & request handling.
1 call · #0129–#0129
cd <path>python3 - <script>Requested execution waits, file and log inspection and runtime inspection related to latency & request handling.
1 call · #0130–#0130
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>cd <path>python3 - <script>Requested file and log inspection related to source & workspace.
1 call · #0131–#0131
cd <val>sed -n <val> <path>Requested environment setup or inspection, file and log inspection and script or workload execution related to benchmark & validation setup.
2 calls · #0132–#0133
cd <val>env <vars> bash <script> > <path> <n> >& <path>env <vars>echo <val>tail -c <n> <path>python3 - <script>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>Requested repository inspection and file and log inspection related to batching & scheduling.
1 call · #0134–#0134
cd <path>git status --shortgit diff --statgit diff <flag> <args>sed -n <val>Requested execution waits, file and log inspection and runtime inspection related to benchmark & validation setup.
2 calls · #0135–#0136
sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>python3 - <script>Requested file and log inspection, environment setup or inspection and source searches related to source & workspace.
3 calls · #0137–#0139
cd <val>sed -n <val> <path>envgrep -E <val>truegrep -n <val> <path>tail -n <n>Requested script or workload execution and repository inspection related to batching & scheduling.
1 call · #0140–#0140
cd <path>python3 - <script>python3 -m <module> <script> <script>git diff --checkgit diff --statRequested environment setup or inspection, file and log inspection and workspace inspection related to batching & scheduling.
1 call · #0141–#0141
cd <val>env <vars> bash <script> > <path> <n> >& <path>env <vars>echo <val>cat <path>echo <flag>ls -l -a <val>grep <val>trueRequested runtime inspection, source searches and workspace inspection related to runtime processes.
1 call · #0142–#0142
ps <flag> <args>grep -E <val>grep -v <val>truels -l -a <path> <n> > <path>echo <val>python3 - <script>cd <val>env <vars> bash <script> > <path> <n> >& <path>env <vars>cat <path>Requested script or workload execution related to benchmark & validation setup.
2 calls · #0143–#0144
python3 - <script>Requested script or workload execution related to batching & scheduling.
1 call · #0145–#0145
python3 - <script>Requested workspace inspection and file and log inspection related to source & workspace.
1 call · #0146–#0146
ls -l -a <path>tail -n <n> <path>head -n <n> <path>cut <flag>Requested script or workload execution related to batching & scheduling.
3 calls · #0147–#0149
python3 - <script>Requested repository inspection, file and log inspection and workspace inspection related to batching & scheduling.
2 calls · #0150–#0151
cd <path>git diff --checkgit status --shortsed -n <val> <path>stat -c <val> <path> <path>stat -c <val> <path> <path> <path> <path>Requested environment setup or inspection, script or workload execution and execution waits related to benchmark & validation setup.
3 calls · #0152–#0154
cd <val>env <vars> bash <script> > <path> <n> >& <path>env <vars>echo <val>python3 - <script>env <vars> nohup <val> <path> > <path> <n> >& <path>echo <val> > <path>sleep <n>tail -n <n> <path>ps <flag> <args>grep -E <val>grep -v <val>Requested environment setup or inspection, file and log inspection and runtime inspection related to runtime processes.
1 call · #0155–#0155
cd <val>env <vars> bash <script> > <path> <n> >& <path>echo <val>cat <path>ps <flag> <args>grep -E <val>grep -v <val>truepython3 - <script>Requested script or workload execution and repository inspection related to benchmark & validation setup.
1 call · #0156–#0156
python3 - <script>cd <path>git diff --statgit status --shortRequested repository inspection and file and log inspection related to batching & scheduling.
1 call · #0157–#0157
cd <path>git diff <flag> <args>sed -n <val>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0158–#0158
ls -l -a <path> <path> <path> <path> <n> > <path>tail -n <n> <path>head -c <n>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
@@ -472,8 +472,12 @@ class PrefillAdder: if self.dllm_config is not None: self._init_dllm_meta(dllm_config) - if self.rem_chunk_tokens is not None:- self.rem_chunk_tokens -= num_mixed_decode_tokens+ # ``rem_chunk_tokens`` is a budget on freshly prefilled tokens. Do not+ # subtract one token per running decode request here: mixed batches use+ # the same per-request KV reservation path (``rem_total_token_offset``+ # and ``cur_rem_token_offset`` below) for safety, and shaving the chunk+ # budget by the number of running sequences can needlessly prevent a+ # second small prefill from fitting in the configured chunk budget. self.rem_total_token_offset = num_mixed_decode_tokens self.cur_rem_token_offset = num_mixed_decode_tokens @@ -1037,17 +1041,18 @@ class PrefillAdder: if self.rem_chunk_tokens <= 0: return AddReqResult.OTHER - # Chunked prefill+ # Chunked prefill. A request can resume here after an earlier+ # chunk was parked (e.g. when the scheduler briefly yields to+ # shorter waiting requests), so the next chunk starts at the+ # current prefix length instead of assuming a fresh request. trunc_len = self.rem_chunk_tokens+ prefix_len = len(req.prefix_indices) - assert len(req.prefix_indices) == 0- req.set_extend_range(- len(req.prefix_indices), len(req.prefix_indices) + trunc_len- )+ req.set_extend_range(prefix_len, prefix_len + trunc_len) self.can_run_list.append(req) self.new_chunked_req = req self._update_prefill_budget(- 0,+ prefix_len, trunc_len, 0, req.retracted_stain,@@ -334,6 +334,15 @@ TEST_RETRACT = envs.SGLANG_TEST_RETRACT.get() TEST_RETRACT_INTERVAL = envs.SGLANG_TEST_RETRACT_INTERVAL.get() TEST_RETRACT_NO_PREFILL_BS = envs.SGLANG_TEST_RETRACT_NO_PREFILL_BS.get() +# When a chunked prefill request is much longer than the requests waiting+# behind it, let at most this many shorter requests borrow dedicated prefill+# passes while its chunks are briefly parked. This keeps interactive TTFT low+# without allowing the long request to be starved by an unbounded stream of+# shorter arrivals.+CHUNKED_PREFILL_SHORT_YIELD_LIMIT = int(+ os.environ.get("SGLANG_CHUNKED_PREFILL_SHORT_YIELD_LIMIT", "8")+)+ DECODE_STEP_MAX_US = 2_000_000 @@ -2836,6 +2845,75 @@ class Scheduler( def stash_chunked_request(self, req: Req): maybe_cache_unfinished_req(req, self.tree_cache, chunked=True) + def _maybe_yield_chunked_req_to_shorter(self) -> None:+ """Yield one prefill pass to a shorter waiting request.++ FCFS normally parks a long chunked prefill in ``self.chunked_req`` and+ keeps feeding it chunks until the whole prompt is consumed. With mixed+ chunking, that means every shorter interactive request that arrives+ while the long prompt is being prefilled waits for all remaining long+ chunks, producing a large TTFT tail.++ When the active chunked request still has substantially more input to+ prefill than the first waiting request, move it back into the waiting+ queue right after that shorter request and skip it for the current+ admission loop. The current pass is dedicated to the shorter waiting+ request(s), and the parked long request resumes with a full chunk on+ the following pass. A per-request counter caps the number of such+ yields so a long request cannot be starved by a continuous stream of+ shorter arrivals.+ """+ chunked_req = self.chunked_req+ if (+ chunked_req is None+ or not self.is_mixed_chunk+ or not self.waiting_queue+ or self.schedule_policy != "fcfs"+ or self.enable_priority_scheduling+ or not getattr(self.tree_cache, "disable", True)+ # Mixed prefill batches with per-token logprobs require careful+ # logprob-offset bookkeeping; keep them on the legacy path.+ or chunked_req.return_logprob+ ):+ return++ chunked_remaining = len(chunked_req.full_untruncated_fill_ids) - len(+ chunked_req.prefix_indices+ )+ if chunked_remaining <= 0:+ return++ for index, req in enumerate(self.waiting_queue):+ if req.return_logprob:+ continue+ waiting_remaining = len(req.full_untruncated_fill_ids) - len(+ req.prefix_indices+ )+ if waiting_remaining <= 0 or waiting_remaining >= chunked_remaining:+ continue++ yield_count = getattr(+ chunked_req, "_chunked_prefill_short_yield_count", 0+ )+ if yield_count >= CHUNKED_PREFILL_SHORT_YIELD_LIMIT:+ return++ chunked_req._chunked_prefill_short_yield_count = yield_count + 1+ # ``init_next_round_input(tree_cache)`` performs a fresh prefix+ # match for ordinary waiting requests. For a parked chunk with a+ # disabled radix cache that would reset ``prefix_indices``, so keep+ # the already-computed prefix for exactly one admission attempt.+ # The yielded request is skipped for this pass as well: the pass is+ # dedicated to the shorter waiting request(s), and the parked long+ # request resumes with a full chunk on the following pass. That+ # keeps the short prefill and the long chunk from sharing one+ # forward, which is gentler on the decode side of a mixed batch.+ chunked_req._chunked_prefill_preserve_prefix = True+ chunked_req._chunked_prefill_yield_skip = True+ self.chunked_req = None+ self.waiting_queue.insert(index + 1, chunked_req)+ return+ def process_pending_chunked_abort(self) -> None: """Abort an in-flight chunked-prefill request once it is safe to do so. @@ -3141,6 +3219,11 @@ class Scheduler( # Get priority queue self.policy.calc_priority(self.waiting_queue, running_batch) + # With FCFS and mixed chunking, briefly share the prefill budget with+ # shorter waiting requests instead of letting every new arrival wait+ # behind all remaining chunks of a long prompt.+ self._maybe_yield_chunked_req_to_shorter()+ if TEST_RETRACT and running_bs > TEST_RETRACT_NO_PREFILL_BS: # If we are testing retraction and the running batch size exceeds # TEST_RETRACT_NO_PREFILL_BS, we skip the prefill to keep the requests@@ -3199,6 +3282,13 @@ class Scheduler( if self.enable_lora and not self._can_schedule_lora_req(req, running_loras): continue + if getattr(req, "_chunked_prefill_yield_skip", False):+ # This parked long request already gave up the current prefill+ # pass to shorter arrivals. Leave it queued and schedule it+ # normally on the next pass (prefix preservation is still armed).+ req._chunked_prefill_yield_skip = False+ continue+ running_bs = len(running_batch.reqs) if len(adder.can_run_list) >= self.get_num_allocatable_reqs(running_bs): running_batch.batch_is_full = True@@ -3225,7 +3315,15 @@ class Scheduler( if loaded_tokens > 0: req.storage_hit_length = loaded_tokens - req.init_next_round_input(self.tree_cache)+ if getattr(req, "_chunked_prefill_preserve_prefix", False):+ # This request was just parked mid-chunk and reinserted behind a+ # shorter request. It must continue from the KV prefix already+ # produced; skip the fresh prefix match (which is a no-op reset+ # for the disabled radix cache used with ignore_eos requests).+ req.init_next_round_input(None)+ req._chunked_prefill_preserve_prefix = False+ else:+ req.init_next_round_input(self.tree_cache) res = adder.add_one_req( req, has_chunked_req=(self.chunked_req is not None),