Inspect · Source & workspace
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
ls -l -a <path> <n> > <path>echo <flag>echo <val>ls -l -a <val> <n> > <path>GLM-5.3 · RL
Qwen3-0.6B CodeOpt GRPO 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 agentGLM-5.3 · 178 visible calls
02 / EVENT SEQUENCE
Requests are grouped by agent, activity and topic. Delegations open into child branches. Summaries describe visible requests; tool errors and missing responses are flagged. A recorded response does not establish command success or a performance improvement.
Scroll within this panel to view all events. Command sketches retain familiar programs and options. Values become <val> or <n>; paths, addresses and script bodies are hidden as <path>, <url> and <script>.
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
ls -l -a <path> <n> > <path>echo <flag>echo <val>ls -l -a <val> <n> > <path>Requested file and log inspection and workspace inspection related to task requirements.
3 calls · #0002–#0004
Read <path>cd <path>find <path> -type <val>head -n <n>echo <val>ls -l -a <val> <val> <path> <val> <val> <val>Requested file and log inspection related to source & workspace.
1 call · #0005–#0005
Read <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0006–#0006
cat <path>echo <val>Requested environment setup or inspection, source searches and runtime inspection related to device memory.
1 call · #0007–#0007
envgrep -i -E <val>sortecho <val>npu-smi info <n> >& <path>head -n <n>Requested file and log inspection related to source & workspace.
1 call · #0008–#0008
cat <path> <n> > <path>head -n <n>echo <val>cat <path>Requested script or workload execution and source searches related to dependencies & build setup.
1 call · #0009–#0009
python3 -c <script>echo <val>python3 -m <module> <val> <n> > <path>grep -i -E <val>Requested script or workload execution, workspace inspection and runtime inspection related to source & workspace.
1 call · #0010–#0010
date -uecho <val>python3 -c <script>ls <path> <n> > <path><command> <args>free -ghead -n <n>Requested workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0011–#0011
mkdir -p <path>cd <path>bash <script> > <path> <n> >& <path>echo <val>Requested workspace inspection and file and log inspection related to checkpoints & weight state.
2 calls · #0012–#0013
cd <path>ls <path>echo <val>ls <path> <n> > <path>ls <path> <path> <path> <path>wc -l <path> <path>Requested file and log inspection related to rollout generation.
1 call · #0014–#0014
Read <path>Requested file and log inspection, execution waits and workspace inspection related to benchmark & validation setup.
2 calls · #0015–#0016
tail -n <n> <path> <n> > <path>echo <val>sleep <n>ls -l -a <path> <n> > <path>echo <flag>Requested file and log inspection related to source & workspace.
1 call · #0017–#0017
Read <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0018–#0018
ls -l -a <path> <n> > <path>echo <flag>tail -n <n> <path> <n> > <path>Requested runtime inspection, file and log inspection and workspace inspection related to runtime processes.
1 call · #0019–#0019
ps <flag> <args>head -n <n>echo <val>ls -l -a <path>grep <val>Requested workspace inspection and file and log inspection related to rollout generation.
2 calls · #0020–#0021
cd <path>ls <path> <path>wc -l <path> <path> <path> <path>Read <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0022–#0022
ls -l -a <path> <n> > <path>tail -n <n> <path> <n> > <path>cut <flag>Requested workspace inspection and file and log inspection related to source & workspace.
1 call · #0023–#0023
ls -t <path>head -n <n>echo <val><command> <args>head <flag>tail -n <n> <val>cut <flag>Requested file and log inspection related to checkpoints & weight state.
1 call · #0024–#0024
Read <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0025–#0025
ls -l -a <path>tail -c <n> <path>cut <flag>Requested workspace inspection, file and log inspection and source searches related to source & workspace.
3 calls · #0026–#0028
cd <path>ls <path>wc -l <path>grep -n <val> <path>head -n <n>Read <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0029–#0029
ls -l -a <path>tail -c <n> <path>cut <flag>Requested file and log inspection related to rollout generation.
1 call · #0030–#0030
Read <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0031–#0031
ls -l -a <path>tail -c <n> <path>cut <flag>Requested runtime inspection, source searches and file and log inspection related to runtime processes.
2 calls · #0032–#0033
dateps <flag> <args>grep -v <val>grep -E <val>head -n <n>echo <val>ls -t <path>grep -r -n <val> <path> --include <path>Requested file and log inspection related to source & workspace.
1 call · #0034–#0034
Read <path>Requested file and log inspection related to runtime processes.
1 call · #0035–#0035
tail -n <n> <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0036–#0036
ls -l -a <path>tail -c <n> <path>cut <flag>Requested workspace inspection, source searches and file and log inspection related to runtime processes.
1 call · #0037–#0037
ls -t <path>grep -E <val>head -n <n><command> <args>head <flag>tail -n <n> <val>cut <flag>Requested file and log inspection related to runtime processes.
1 call · #0038–#0038
tail -n <n> <path>cut <flag>Requested execution waits, file and log inspection and workspace inspection related to benchmark & validation setup.
1 call · #0039–#0039
sleep <n>tail -n <n> <path>cut <flag>echo <val>ls <path>Requested file and log inspection related to rollout generation.
1 call · #0040–#0040
Read <path>Requested file and log inspection and workspace inspection related to benchmark & validation setup.
1 call · #0041–#0041
tail -n <n> <path>cut <flag>echo <val>ls <path>dateRequested file and log inspection related to rollout generation.
1 call · #0042–#0042
Read <path>Requested file and log inspection and workspace inspection related to source & workspace.
1 call · #0043–#0043
tail -n <n> <path>cut <flag>echo <val>ls <path>dateRequested source searches and file and log inspection related to batching & scheduling.
1 call · #0044–#0044
grep -r -n <val> <path>headecho <flag>sed -n <val> <path>Requested file and log inspection and workspace inspection related to source & workspace.
2 calls · #0045–#0046
Read <path>tail -n <n> <path>cut <flag>echo <val>ls <path>datesed -n <val> <path>Requested source searches and file and log inspection related to batching & scheduling.
1 call · #0047–#0047
grep -n <val> -A <n> <path>head -n <n>Requested file and log inspection and workspace inspection related to source & workspace.
2 calls · #0048–#0049
Read <path>tail -n <n> <path>cut <flag>ls <path>dateRequested execution waits, file and log inspection and workspace inspection related to benchmark & validation setup.
1 call · #0050–#0050
sleep <n>tail -n <n> <path>cut <flag>ls <path>dateRequested script or workload execution related to checkpoints & weight state.
1 call · #0051–#0051
cd <path>python3 -c <script>Requested script or workload execution and file and log inspection related to benchmark & validation setup.
1 call · #0052–#0052
cd <path>python3 -c <script>echo <val>tail -n <n> <path>cut <flag>Requested file and log inspection and source searches related to benchmark & validation setup.
1 call · #0053–#0053
tail -n <n> <path>grep -v <val>cut <flag>tail -n <n>echo <val>Requested script or workload execution related to checkpoints & weight state.
1 call · #0054–#0054
cd <path>python3 -c <script>Requested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0055–#0055
grep -n -E <val> <path>tail -n <n>cut <flag>Requested source searches, file and log inspection and workspace inspection related to rollout generation.
2 calls · #0056–#0057
grep -n <val> <path>head -n <n>echo <val>grep <flag> <args>headls <path>grep -r -n <val> <path> <n> > <path>Requested script or workload execution, execution waits and workspace inspection related to benchmark & validation setup.
1 call · #0058–#0058
nohup <val> <path> > <path> <n> >& <path>echo <val>sleep <n>ls <path>Requested source searches and file and log inspection related to source & workspace.
1 call · #0059–#0059
grep -r -n <val> <path> <path> <n> > <path>head -n <n>Requested file and log inspection and source searches related to device memory.
8 calls · #0060–#0067
sed -n <val> <path>echo <val>grep -r -n <val> <path> <path> <n> > <path>head -n <n>grep -r -n <val> <path> --include <path>headgrep -r -n <val> -A <n> <path> <n> > <path>grep -r -n <val> <path> <path> --include <path>Read <path>echo <path>grep -r -n <val> <path>Requested source searches, file and log inspection and workspace inspection related to device memory.
1 call · #0068–#0068
grep -r -n <val> -A <n> <path>head -n <n>echo <val>ls <path>tail -n <n> <path> <n> > <path>cut <flag>Requested file and log inspection related to device memory.
1 call · #0069–#0069
sed -n <val> <path>Requested file and log inspection related to source & workspace.
2 calls · #0070–#0071
Read <path>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0072–#0072
ls <path>tail -n <n> <path> <n> > <path>cut <flag>dateRequested task coordination related to device memory.
1 call · #0073–#0073
Create task <task>Requested task coordination related to runtime processes.
1 call · #0074–#0074
Create task <task>Requested task coordination related to prefix caching.
1 call · #0075–#0075
Create task <task>Requested task coordination related to batching & scheduling.
1 call · #0076–#0076
Create task <task>Requested source searches, file and log inspection and workspace inspection related to source & workspace.
5 calls · #0077–#0081
grep -r -l -n <val> <path> --include <path>headecho <val>sed -n <val> <path> <n> > <path>wc -l <path>grep -n <val> <path>head -n <n>Read <path>grep -r -n <val> <path> --include <path>ls -t <path> <n> > <path>tail -n <n> <val> -t <path> <n> > <path>head <flag> <args>cut <flag>datesed -n <val> <path>Requested file and log inspection related to task requirements.
1 call · #0082–#0082
cd <path>cat <val> <val>echo <val>head -c <n> <val>Requested file and log inspection related to source & workspace.
1 call · #0083–#0083
cd <path>diff < <path> <path> <val> < <path> <path> <val>head -n <n>Requested source searches and file and log inspection related to rollout generation.
1 call · #0084–#0084
cd <path>grep -n <val> <path>head -n <n>Requested workspace inspection and file and log inspection related to benchmark & validation setup.
1 call · #0085–#0085
ls <path>headtail -n <n> <val> -t <path> <n> > <path>head <flag> <args>cut <flag>dateRequested source searches related to source & workspace.
1 call · #0086–#0086
grep -r -n <val> -A <n> <path>Requested source searches, file and log inspection and workspace inspection related to kv-cache management.
1 call · #0087–#0087
grep -n <val> <path> <path> <path> <n> > <path>head -n <n>echo <val>ls <path>dateRequested source searches and file and log inspection related to source & workspace.
1 call · #0088–#0088
grep -r -n <val> <path> --include <path>head -n <n>Requested file and log inspection and source searches related to device memory.
1 call · #0089–#0089
sed -n <val> <path>echo <val>grep -r -n <val> <path> <path> <n> > <path>head -n <n>Requested file and log inspection and source searches related to source & workspace.
3 calls · #0090–#0092
sed -n <val> <path>echo <val>grep -r -n <val> <path>headgrep -r -n <val> <path> <path> --include <path>grep -r -n <val> <path> --include <path>Requested source searches and file and log inspection related to kv-cache management.
2 calls · #0093–#0094
grep -n <val> -A <n> <path>head -n <n>Requested file and log inspection related to source & workspace.
1 call · #0095–#0095
sed -n <val> <path>Requested workspace inspection, source searches and file and log inspection related to benchmark & validation setup.
1 call · #0096–#0096
ls <path>grep -c <val>tail -n <n> <val> -t <path> <n> > <path>head <flag> <args>cut <flag>dateRequested source searches related to source & workspace.
1 call · #0097–#0097
grep -n <val> -A <n> <path>Requested execution waits, workspace inspection and source searches related to benchmark & validation setup.
3 calls · #0098–#0100
sleep <n>ls <path>grep <val>tail -n <n> <val> -t <path> <n> > <path>head <flag> <args>cut <flag>dategrep -E <val> <path> <n> > <path>tail -n <n><command> <args>head <flag>grep -n -E <val> <val>ls -d <path> <n> > <path>Requested script or workload execution related to checkpoints & weight state.
1 call · #0101–#0101
cd <path>python3 -c <script>Requested file and log inspection related to rollout generation.
1 call · #0102–#0102
sed -n <val> <path>Requested source searches and file and log inspection related to checkpoints & weight state.
1 call · #0103–#0103
<command> <args>grep <flag> <args>head -n <n>echo <path>sortuniq -cRequested source searches and file and log inspection related to benchmark & validation setup.
1 call · #0104–#0104
grep <flag> <args>wc -lhead -n <n>echo <val>cut <flag>Requested source searches and file and log inspection related to source & workspace.
4 calls · #0105–#0108
grep -r -n <val> -A <n> <path>head -n <n>sed -n <val><command> <args>head <flag>echo <val>grep -n <val> -A <n> <val>grep -n <val> -A <n> <path>Requested code edits related to rollout generation.
1 call · #0109–#0109
Edit <path>Requested task coordination related to source & workspace.
2 calls · #0110–#0111
Update task <task>Requested code edits related to rollout generation.
3 calls · #0112–#0114
Edit <path>Requested file and log inspection related to source & workspace.
1 call · #0115–#0115
Read <path>Requested code edits related to source & workspace.
6 calls · #0116–#0121
Edit <path>Requested source searches and file and log inspection related to device memory.
2 calls · #0122–#0123
grep -r -n <val> -A <n> <path>head -n <n>Requested script or workload execution related to rollout generation.
1 call · #0124–#0124
cd <path>python3 -c <script>Requested script or workload execution and source searches related to prefix caching.
2 calls · #0125–#0126
cd <path>python3 -c <script> <n> >& <path>grep -v <val>Requested workspace inspection and file and log inspection related to rollout generation.
1 call · #0127–#0127
cd <path>ls <path>head -n <n>ls <path> <n> > <path>headfind <val> -name <val> -o -name <val>Requested script or workload execution and file and log inspection related to batching & scheduling.
1 call · #0128–#0128
cd <path>timeout <n> <path> -m <val> <path> <path> -q <n> >& <path>tail -n <n>Requested file and log inspection related to source & workspace.
1 call · #0129–#0129
tail -n <n> <path>Requested source searches, file and log inspection and script or workload execution related to batching & scheduling.
2 calls · #0130–#0131
grep -A <n> <val> <path>head -n <n>grep <flag> <args>grep -E <val>echo <val>cd <path>timeout <n> <path> -c <val> <n> >& <path>tail -n <n>Requested repository inspection, script or workload execution and file and log inspection related to benchmark & validation setup.
2 calls · #0132–#0133
cd <path>git status --shorttimeout <n> <path> -m <val> <path> -q -p <val> <n> >& <path>tail -n <n>git stashgit stash <val>Requested workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0134–#0134
rm -rf <path>nohup <val> <path> > <path> <n> >& <path>echo <val>dateRequested task coordination related to source & workspace.
1 call · #0135–#0135
Update task <task>Requested execution waits, file and log inspection and source searches related to rollout generation.
1 call · #0136–#0136
sleep <n><command> <args>head <flag>grep <flag> <args>head -n <n>echo <flag>tail -n <n> <val> <n> > <path>cut <flag>dateRequested execution waits and file and log inspection related to runtime processes.
1 call · #0137–#0137
sleep <n><command> <args>head <flag>echo <val>head -n <n>Requested execution waits, environment setup or inspection and source searches related to rollout generation.
1 call · #0138–#0138
sleep <n>env <vars>grep <flag> <args>head -n <n>echo <flag>tail -n <n> <val>cut <flag>dateRequested workspace inspection, source searches and file and log inspection related to rollout generation.
1 call · #0139–#0139
ls <path>grep -i <val>tail -c <n> <path> <n> > <path>grep <flag> <args>head -n <n>dateRequested script or workload execution and file and log inspection related to checkpoints & weight state.
1 call · #0140–#0140
cd <path>python3 -c <script> <n> >& <path>tail -n <n>Requested script or workload execution related to benchmark & validation setup.
1 call · #0141–#0141
cd <path>python3 -c <script>Requested file and log inspection and source searches related to source & workspace.
2 calls · #0142–#0143
Read <path>grep -r -n <val> -A <n> <path>head -n <n>Requested code edits related to source & workspace.
3 calls · #0144–#0146
Edit <path>Requested repository inspection, file and log inspection and script or workload execution related to source & workspace.
1 call · #0147–#0147
cd <path>git diff --statgit diff <path>head -n <n>python3 -c <script>Requested workspace file updates, script or workload execution and execution waits related to benchmark & validation setup.
3 calls · #0148–#0150
rm -f <path>nohup <val> <path> > <path> <n> >& <path>echo <val>datesleep <n>ls <path>grep -i <val>tail -c <n> <path> <n> > <path>grep <flag> <args>tail -n <n>Requested script or workload execution related to checkpoints & weight state.
1 call · #0151–#0151
cd <path>python3 -c <script>Requested workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0152–#0152
rm -f <path>nohup <val> <path> > <path> <n> >& <path>echo <val>dateRequested task coordination related to source & workspace.
2 calls · #0153–#0154
Update task <task>Requested repository inspection related to source & workspace.
1 call · #0155–#0155
cd <path>git diffRequested execution waits, workspace inspection and source searches related to benchmark & validation setup.
2 calls · #0156–#0157
sleep <n>ls <path>grep -i <val>tail -n <n> <val> -t <path> <n> > <path>head <flag> <args>cut <flag>datecd <path>ls <path> <n> > <path>timeout <n> <path> -m <val> <path> -q -p <val> <n> >& <path>tail -n <n>Requested source searches, file and log inspection and script or workload execution related to source & workspace.
2 calls · #0158–#0159
cd <path>grep <flag> <args>head -n <n>python3 -m <module> --version <n> > <path>echo <val>ls <path> <n> > <path>grep -n <val> <path> <n> > <path>cat <path> <n> > <path>Requested file and log inspection and script or workload execution related to rollout generation.
2 calls · #0160–#0161
sed -n <val> <path>echo <val>cd <path>timeout <n> <path> <path> <flag> <args>sed -n <path> <path> > <path>head -n <n> <path> > <path>cat <path> <path> > <path>diff <path> <path>Requested file and log inspection related to source & workspace.
1 call · #0162–#0162
head -n <n> <path>cat -Ahead -n <n>sed -n <val> <path> > <path>echo >> <path>cat <path> <path> > <path>diff <path> <path>echo <val>Requested execution waits, workspace inspection and source searches related to benchmark & validation setup.
2 calls · #0163–#0164
sleep <n>ls <path>grep -i <val>datetail -c <n> <path> <n> > <path>grep <flag> <args>tail -n <n>Requested script or workload execution, file and log inspection and workspace inspection related to checkpoints & weight state.
1 call · #0165–#0165
cd <path>python3 -c <script> <n> >& <path>tail -n <n>ls <path>ps <flag> <args>grep -c <val>Requested execution waits, workspace inspection and source searches related to benchmark & validation setup.
3 calls · #0166–#0168
sleep <n>ls <path>grep -i -E <val>datetail -c <n> <path> <n> > <path>cut <flag>cd <path>python3 -c <script>Requested script or workload execution related to source & workspace.
1 call · #0169–#0169
bash <script> > <path> <n> >& <path>echo <val>cd <path>python3 -c <script>Requested workspace inspection, script or workload execution and workspace file updates related to benchmark & validation setup.
2 calls · #0170–#0171
ls <path>echo <val>cd <path>python3 -c <script>rm -f <path>nohup <val> <path> > <path> <n> >& <path>dateRequested code edits related to source & workspace.
1 call · #0172–#0172
Write <path>Requested execution waits, workspace inspection and source searches related to benchmark & validation setup.
2 calls · #0173–#0174
sleep <n>ls <path>grep -i <val>dateRequested script or workload execution, source searches and file and log inspection related to rollout generation.
1 call · #0175–#0175
cd <path>python3 -c <script>grep <flag> <args>head -n <n>Requested source searches related to rollout generation.
1 call · #0176–#0176
cd <path>grep <flag> <args>sortuniq -cRequested task coordination related to source & workspace.
1 call · #0177–#0177
Update task <task>Requested repository inspection and file and log inspection related to source & workspace.
1 call · #0178–#0178
cd <path>git diff --statecho <flag>git status --shorthead -n <n>echo <val>03 / CANDIDATE ARTIFACT
Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
Base commit: 0b2151ec61de5d99e0811b01c09e43a99a23e69d
@@ -399,7 +399,12 @@ def rearrange_micro_batches( if min_num_micro_batch is not None: # used to support pp num_micro_batches = max(min_num_micro_batch, num_micro_batches)- if dist.is_initialized() and same_micro_num_in_dp and dp_group is not None:+ if (+ dist.is_initialized()+ and same_micro_num_in_dp+ and dp_group is not None+ and dist.get_world_size(dp_group) > 1+ ): num_micro_batches = torch.tensor([num_micro_batches], device=get_device_name()) dist.all_reduce(num_micro_batches, op=dist.ReduceOp.MAX, group=dp_group) num_micro_batches = num_micro_batches.cpu().item()@@ -211,6 +211,16 @@ class RolloutConfig(BaseConfig): max_model_len: Optional[int] = None max_num_seqs: int = 1024 + # Cap on the KV cache size, expressed as a multiple of the largest number of+ # tokens the rollout engine can have in flight (``max_num_seqs *+ # max_model_len``). vLLM otherwise derives the KV cache from+ # ``gpu_memory_utilization``, which on a single accelerator shared with the+ # training engine reserves far more KV cache than the rollout can ever use.+ # That excess has to be unmapped and re-mapped on every sleep/wake cycle, so+ # it is pure overhead in a colocated training loop. Set to None or 0 to keep+ # the vLLM default.+ kv_cache_token_multiplier: Optional[float] = 4.0+ # note that the logprob computation should belong to the actor log_prob_micro_batch_size: Optional[int] = None log_prob_micro_batch_size_per_gpu: Optional[int] = None@@ -620,9 +620,10 @@ class FSDPEngine(BaseEngine): # compute num_tokens in global batch for loss normalization batch_num_tokens = data["loss_mask"].sum().to(get_device_id())- torch.distributed.all_reduce(- batch_num_tokens, op=torch.distributed.ReduceOp.SUM, group=self.get_data_parallel_group()- )+ if self.get_data_parallel_size() > 1:+ torch.distributed.all_reduce(+ batch_num_tokens, op=torch.distributed.ReduceOp.SUM, group=self.get_data_parallel_group()+ ) tu.assign_non_tensor(data, batch_num_tokens=batch_num_tokens.item()) tu.assign_non_tensor(data, dp_size=self.get_data_parallel_size()) @@ -339,6 +339,11 @@ class LLMServerManager: servers=dict(zip(self.server_addresses, self.server_handles, strict=True)), max_cache_size=DEFAULT_ROUTING_CACHE_SIZE, )+ # Force the actor (and its worker process) to finish starting up here.+ # Ray starts the actor in the background, and importing this module pulls+ # in the whole inference stack, so the first routing call would otherwise+ # block for that entire import inside the first generate() request.+ await self.global_load_balancer.get_status.remote() def get_client(self, client_cls=LLMServerClient, **kwargs) -> LLMServerClient: """Get the LLMServerClient to request LLM server replicas.@@ -221,6 +221,10 @@ class vLLMHttpServer: self._preprocess_engine_kwargs(engine_kwargs) + kv_blocks_override = self._get_kv_cache_blocks_override()+ if kv_blocks_override is not None:+ engine_kwargs.setdefault("num_gpu_blocks_override", kv_blocks_override)+ # Override default generation config from hugging face model config, # user can still override them by passing kwargs in each request. override_generation_config = self._get_override_generation_config()@@ -832,6 +836,53 @@ class vLLMHttpServer: """Return the key under config.engine_kwargs for this engine (e.g. 'vllm').""" return "vllm" + def _get_kv_cache_blocks_override(self) -> Optional[int]:+ """Right-size the KV cache of a colocated rollout server.++ vLLM derives the KV cache size from ``gpu_memory_utilization``, so on a+ single accelerator that is shared with the training engine it reserves+ every spare byte for KV cache. The rollout can only ever hold+ ``max_num_seqs * max_model_len`` tokens, so the rest is never used, and+ every sleep/wake cycle of the colocated loop pays to unmap and re-map+ it. Capping the cache to a small multiple of the reachable token count+ makes those cycles proportional to the actual workload.++ Returns None when the cap is disabled or cannot be computed reliably, in+ which case vLLM keeps its own sizing.+ """+ multiplier = getattr(self.config, "kv_cache_token_multiplier", None)+ if not multiplier or multiplier <= 0:+ return None+ max_model_len = self.config.max_model_len+ max_num_seqs = self.config.max_num_seqs+ if max_model_len is None or max_num_seqs is None:+ return None+ # The block size is only known to the platform. vllm-ascend fixes it to+ # 128 whenever chunked prefill or prefix caching is enabled, which is+ # how verl launches its rollout servers; stay quiet rather than guess on+ # any other configuration.+ if not is_torch_npu_available(check_device=False):+ return None+ if not (self.config.enable_chunked_prefill or self.config.enable_prefix_caching):+ return None+ block_size = 128+ token_budget = int(max_num_seqs * max_model_len * multiplier)+ num_blocks = -(-token_budget // block_size)+ if num_blocks <= 0:+ return None+ logger.info(+ "Capping rollout KV cache at %d blocks of %d tokens "+ "(%d tokens = max_num_seqs %d x max_model_len %d x %.1f); "+ "vLLM would otherwise size it from gpu_memory_utilization alone.",+ num_blocks,+ block_size,+ num_blocks * block_size,+ max_num_seqs,+ max_model_len,+ multiplier,+ )+ return num_blocks+ def _preprocess_engine_kwargs(self, engine_kwargs: dict) -> None: """Mutate engine_kwargs in-place before the CLI args dict is built. No-op by default.""" pass