Qwen4-Max 2.02×

Harness: Qwen Code · switches: SLIME_OPT_DROP_ZERO_KL=1 SGLANG_OPT_BATCH_TOPK_D2H=1 SGLANG_OPT_COMPACT_TOPK_RESPONSE=1 SLIME_OPT_NO_FULL_RECOMPUTE=1 SGLANG_OPT_BATCH_TOPK_COPY=1 SGLANG_OPT_TUNE_GC=1 NCCL_PROTO=^LL SGLANG_OPT_NO_TOPP_SYNC=1 OMP_NUM_THREADS=16 SLIME_OPT_KEEP_PROCESS_GROUPS=1

The first final judge (2.0386×) used a reference frozen on 11-19 and timed the candidate 12.5 h later, both with an ops keepalive running on the GPUs. With the keepalive gone (removed 11-20), the same submission (same source digest) was judged again on 11-21 with a freshly measured reference (spread 1.56%): PASS, N1, 2.0176×. The judge warned that the candidate's own three windows differ by 5.3% (above 5%).

Judged
2.02×
Tier
N1
Self-best
1.99×
Rounds
20
Hours
10.0
API cost
$13.1
Input tokens · 93.5% cached
71 M
Output tokens
0.3 M
Requests
560
Candidate, three windows (s)
97.4 / 92.5 / 94.1
Rollout side
2.32×
round 17 full check (round 8 single-side time: 2.3247×)
Train side
1.77×
round 20 single-side time; the round 17 full check, taken before round 20, had 1.58×
Rollout host-side fixes
✓ round 8 removed the sampler's per-decode-step return_top_p_log_probs.any().item() (host-side copy of the flag), rollout 1.5137 → 2.3247×, the largest single item of the run; round 3 stopped building the nested top-k triples slime never reads (post-rollout tail ~36 → ~3 s; timed together with recompute off, rollout 1.3619×); round 4 merged the per-row pinned copies in copy_to_cpu into one (→ 1.5039×); round 5 scheduler GC freeze (→ 1.5137×, +0.7%); routing unchanged
Round 2 first batched tolist() in the scheduler, but the rows are already on the CPU there: 0.9965×, switch left on but inert; round 16 cut another 8.4% of scheduler host samples (unbind, batched tolist), 2.3152×, no gain; it concluded the rollout is now GPU-bound and turned both switches off
Skip zero-coefficient reference forward
✓ round 1 (reference forward 12.7–19.1 s/step), train 1.2009×, step-0 mismatch bitwise equal to the frozen reference
Train-side main levers
partial: zero-coefficient reference forward skipped (round 1, 1.2009×), no recompute (round 3, → 1.3586×), NCCL_PROTO=^LL (round 6, → 1.3800×; the round 19 profile still shows RING_LL kernels, it suspects the switch never took effect), OMP_NUM_THREADS=16 (round 10; the CPU-offloaded Adam had 96 threads per process, 4 ranks on 48 physical cores, → 1.6103×; 12 / 24 threads the same), 58 NCCL groups kept resident instead of torn down and rebuilt every step (round 20, ~4.5 s/step saved, → 1.771×); per-step sleep / wake still there, GDN untouched
Round 13 switched to cuDNN fused attention to get around the implicit sync in TE's CP backward: NaN gradients at step 0, reverted; round 14 merged the per-parameter H2D event syncs (1.6002×) and round 18 froze the training process's GC (1.5744×), no gain, switches off
Raw work log23 sections
0.6 hRound 1 — profile the reference; drop the zero-coefficient KL term (train side)
Start 06:53, GPU lock 06:56. End 07:26.

### Profile findings

profile --side rollout on the unchanged tree → /tmp/r1/prof_rollout (200 decode steps, TP0):
- window 3189.9 ms, 97969 kernels, GPU busy only 30.4% (968 ms). ~495 kernels per decode step.
- top classes: nvjet_sm90_tst_128x40… 19.5%, two nvjet_64x40… 19.2%,
  fused_recurrent_gated_delta_rule_packed_decode_kernel 9.2%,
  flashinfer allreduce_fusion…lamport 10.3%, nvjet_64x8 splitK 6.0%, LM head nvjet_256x40 4.4%.
- the per-step (200-call) eager tail: cunn_SoftMaxForward 77 us, mbtopk chain ~125 us,
  _all_gather_kernel_inner 72 us (4 blocks, SM cov 0.03), copies/argmax/sampling ~150 us.
- stream 72: 87003 kernels, busy 995 ms, gaps 2213 ms, 12956 gaps > 1 us.
- Real (uninstrumented) decode: ~3500 tok/s per engine at 32 running requests → ~9.1 ms/step,
  vs ~4.9 ms of GPU work ⇒ roughly 4 ms/step of host-side stall. Bottleneck class: host syncs.

profile --side train: the judge's own reference train profile already exists read-only at
runs/bootstrap/control_profile_train/kernel_report.md (rank 2, one step, 107 s window):
- GPU busy 53.2%; NCCL ≈ 28% of kernel time (AllGather 17.0%, ReduceScatter 7.7%, SendRecv 2.8%),
  GEMMs ≈ 37%, elementwise ≈ 15%, gated-delta-rule kernels ≈ 10%.
- Reference train log timers (runs/bootstrap/timing_train_3/train_ref_0/train.log):
  ref_log_probs 12.7–19.1 s, actor_train 51.8–64.0 s, sleep 3.9 s, wake_up 1.5 s,
  data_preprocess 0.7 s, step_time 74.5–93.1 s.

Hotspot chosen (kind 1: dead work by configuration). The recipe passes `--use-kl-loss
--kl-loss-coef 0.00 and kl_coef defaults to 0. placement_group.py` sets
with_ref = kl_coef != 0 or use_kl_loss, so a whole reference model is loaded and forwarded every
step, and loss = loss + 0.0 * kl_loss. Both the forward and the term are exactly zero regardless
of the data — explicitly removable under the task rules.

### Change

slime/slime/backends/megatron_utils/loss.py: kl_term_is_dead(args) (opt-in
SLIME_OPT_DROP_ZERO_KL=1), guards the KL term and its reported metric.
slime/slime/backends/megatron_utils/actor.py: with_ref = False when the term is dead, so the
reference checkpoint is never loaded and never forwarded.
Commit d959e6e4 (slime).

### Result

time --side train → /tmp/r1/time_train:
windows [67.983, 62.340, 65.110] vs reference [78.411, 75.444, 80.687];
window ratios [1.1534, 1.2102, 1.2392]; train speedup 1.2009, projected step speedup 1.0734.
first_use 0 in every window. train_rollout_logprob_abs_diff step 0 = 0.008139924526357157,
bit-for-bit the frozen reference value (task/train_ref.json mismatch) — strong N0 evidence.

---
0.6 hRound 2 — one D2H per top-k field instead of one per request (rollout side)
Start 07:26, GPU lock 07:28.

### Hotspot (kind 1: an existing fast path was missed)

sglang/python/sglang/srt/managers/scheduler_components/batch_result_processor.py,
move_logprobs_to_cpu and _normalize_decode_outputs:
[v.tolist() for v in logits_output.next_token_top_logprobs_val] and the same for _idx.
With top_logprobs_num=128 and 32 running requests per engine that is **64 stream syncs per decode
step**, each on a 128-element device tensor. This is the host stall the rollout profile shows.
The decode path already keeps top-k on GPU (no_copy_to_cpu=True in OutputLogprobProcessor);
only the final copy was per-row.

### Change

_topk_rows_to_lists(rows): when every row is a CUDA tensor of the same shape/dtype, torch.stack(rows).tolist()
— one D2H per field, identical values and order (N0). Falls back to the per-row path otherwise.
Opt-in SGLANG_OPT_BATCH_TOPK_D2H=1. Commit cb06eb9 (sglang).

### Result — NO GAIN, hypothesis was wrong

time --side rollout → /tmp/r2/time_rollout (log /tmp/r2_time_rollout.log):
windows [120.165, 116.681, 115.137] vs reference [120.215, 116.628, 113.949];
window ratios [1.0004, 0.9995, 0.9897]; rollout speedup 0.9965 — no gain.

Root cause: by the time the scheduler sees them the rows are already CPU tensors.
GenerationBatchResult.copy_to_cpu (sglang/python/sglang/srt/managers/utils.py:160-182) has
already run _async_d2h on every row, so the torch.stack branch never fires. The per-row cost is
real but it lives one layer earlier — see Round 4. The switch is left in the tree (off-path, inert)
so the measurement stays reproducible; it is kept ON in the switch file only because it is a no-op.

---
1.1 hRound 3 — compact top-k response + no full activation recompute (both sides)
Start 07:35, GPU lock 07:50. Two independent changes, one per side, timed together.

### 3a rollout (kind 1: dead work by configuration)

tokenizer_manager.add_logprob_to_meta_info detokenizes every top-k head into nested
(logprob, token_id, None) triples: 8192 tokens × 128 ≈ **1 M Python tuples and ~30 MB of JSON per
request**, on top of the compact binary output_topk_token_ids/log_probs/shape fields that carry the
same numbers. slime reads *only* the binary fields (slime/utils/score_centering.py
extract_sampler_topk / decode_score_centering_response); output_top_logprobs is never read
anywhere in slime/slime or slime_plugins. Accounting that motivated this: sglang e2e_latency
mean ~76 s but slime sees the first completion only at ~88 s and the rollout window is ~117 s
⇒ ~36 s/rollout of response post-processing.
Change: skip building output_top_logprobs when the binary heads are emitted
(SGLANG_OPT_COMPACT_TOPK_RESPONSE=1). The internal cursor is still advanced so streaming state is
unchanged. Commit 17ce4a3 (sglang).

### 3b train (kind: memory/offload strategy, explicitly allowed)

The recipe forces --recompute-granularity full --recompute-method uniform --recompute-num-layers 1,
i.e. a whole extra forward pass per micro-batch. Training runs with the rollout engines paused:
peak used_GB ≈ 38 of 139.8, free_GB ≈ 102. The recompute buys nothing here.
Change: in model_provider(), clear config.recompute_granularity/method/num_layers
(SLIME_OPT_NO_FULL_RECOMPUTE=1). Arithmetic is unchanged (same kernels, same order); only
activations are kept instead of recomputed. Verified the only consumers are
transformer_block.py:624, models/hybrid/hybrid_block.py:348, ssm/gated_delta_net/common.py:264,
all reading config, not args. Commit 60156f27 (slime).

### Result — both sides gained

time (both sides) → /tmp/r3/time_both (log /tmp/r3/time_both.log), finished 08:18:
- rollout 1.3619×: windows [83.072, 91.500, 83.548] vs [120.215, 116.628, 113.949],
  ratios [1.4471, 1.2746, 1.3639]. mismatch_steps empty, layout_problems empty.
- train 1.3586×: windows [58.517, 59.275, 55.146] vs [78.411, 75.444, 80.687],
  ratios [1.3400, 1.2728, 1.4632]. first_use 0 in every window (no autotuning inside the windows).
- projected step speedup 1.3707×.
- train_rollout_logprob_abs_diff step 0 = 0.008139924526357157 — again bit-for-bit the frozen
  reference value, so neither change moved the training trajectory at step 0.
- actor_train timer: 45.7–47.6 s here vs 53.0–57.1 s in Round 1 ⇒ the recompute removal alone is
  ~1.18× on the actor update; the rest of the train gain is Round 1's dropped reference forward.
- Rollout accounting after 3a: generation pbar finishes at 1:20, sglang e2e_latency max 80.3 s,
  rollout window 83.5 s ⇒ the response-post-processing tail fell from ~36 s to ~3 s.
  Decode itself is now the whole cost: ~3300 tok/s at 31 running requests = 9.4 ms/step
  against ~4.9 ms of GPU work.

---
1.9 hRound 4 — one pinned D2H per top-k field, at the real site (rollout side)
Start 08:24, GPU lock 08:30. End 08:44.
0.6 hHotspot (kind 1: per-row host copies; Round 2's hypothesis moved one layer down)
GenerationBatchResult.copy_to_cpu (sglang/python/sglang/srt/managers/utils.py) runs
_async_d2h on every request's top-k row: at bs≈31 and k=128 that is 62 pinned-host
allocations + 62 512-byte cudaMemcpyAsync launches + 62 record_stream calls per decode step.
async_d2h (srt/utils/common.py:562) allocates a *fresh* pinned tensor each call, and PyTorch's
caching host allocator polls every outstanding copy event on each allocation — so the cost is
super-linear in the number of rows.
Direct evidence that this is host-bound: during a rollout each sglang::scheduler process sits at
~98% of one core (96 cores available, load ~8), while the rollout profile shows only ~4.9 ms of GPU
work per ~9.4 ms decode step.

### Change

_async_d2h_topk_rows(rows): get_top_logprobs_raw leaves each row as values[i][:k], i.e. a view
of one [bs, k] topk tensor. When every row is a contiguous 1-D CUDA view of the same storage at
consecutive offsets, one as_strided((n, k), (k, 1), offset) covers them all → one pinned
allocation and one D2H, then per-row views of the pinned buffer. record_stream still records the
same original storage, so lifetime safety is unchanged. Anything else (mixed k, non-tensors,
independent tensors, CPU tensors) falls back to the exact original per-row path.
Opt-in SGLANG_OPT_BATCH_TOPK_COPY=1. Commit 7a74b4b (sglang).
Correctness checked on GPU against the per-row path for: uniform-k views, idx views, mixed k, an
empty-list entry, a single row, independent tensors, CPU tensors, and an offset sub-range — all
identical (/tmp/r4/test_topk_rows.py).

### Result — gain

time --side rollout → /tmp/r4/time_rollout (log /tmp/r4/time_rollout.log):
windows [77.483, 77.520, 78.280] vs [120.215, 116.628, 113.949];
ratios [1.5515, 1.5045, 1.4557]; rollout speedup 1.5039 (was 1.3619 after Round 3).
mismatch_steps empty, layout_problems empty. The windows are also far more uniform than
Round 3's [83.1, 91.5, 83.5], consistent with removing an allocator/GC-driven jitter source.
With Round 3's train 1.3586× this projects a step speedup of ~1.41×.

---
1.9 hRound 5 — generational GC in the scheduler process (rollout side)
Start 08:44, GPU lock 08:47.
1.9 hHotspot (kind: memory strategy; same host-bound class as Round 4)
_apply_decode_logprobs appends one 128-element Python list per token per request to
req.logprob.output_top_logprobs_val, and output_streamer only *slices* that list (it never
truncates it). At ~8000 response tokens × 31 running requests that is ~500 k live lists and ~32 M
live floats per engine by the end of a rollout. freeze_gc("Scheduler") exists but is only reached
through an explicit FreezeGCReq, which slime never sends, so the default thresholds
(700, 10, 10) keep walking that growing graph.

### Change

In run_scheduler_process, after init and before the event loop: `gc.collect(); gc.freeze();
gc.set_threshold(50_000, 100, 100). Opt-in SGLANG_OPT_TUNE_GC=1`. No values change; only when
cycles are collected. Commit 5804caa (sglang).

### Result — marginal gain, kept

time --side rollout → /tmp/r5/time_rollout (log /tmp/r5/time_rollout.log), finished 09:00:
windows [77.184, 77.348, 77.218] vs Round 4's [77.483, 77.520, 78.280];
ratios [1.5575, 1.5078, 1.4757]; rollout speedup 1.5137 (Round 4: 1.5039).
So ~+0.7%, at the edge of noise but consistent across all three windows and with a tighter spread.
The big GC win I hypothesised did not materialise — the retained-list graph is apparently not the
dominant host cost. Kept because it is free and cannot change any value.

---
2.3 hRound 6 — NCCL protocol for the TP/CP collectives (train side)
Start 09:03, GPU lock 09:06.

### Hotspot (kind: communication; from the reference train profile)

runs/bootstrap/control_profile_train/kernel_report.md (rank 2, one step, 107 s window):
ncclDevKernel_AllGather_RING_LL 9812 ms / 17.0% (23809 calls, median 92.1 us, p90 1075 us,
24 blocks, SM cov 0.18, under-filled skewed), ReduceScatter_Sum_bf16_RING_LL 4414 ms / 7.7%,
SendRecv 1631 ms / 2.8%, AllReduce_Sum_f32_RING_LL 518 ms / 0.9% — NCCL ≈ 28% of kernel time.
All of it on the LL protocol, which spends half of every 8-byte word on a flag and reaches only
a fraction of NVLink bandwidth on messages of this size. LL128/Simple are the bandwidth protocols.

### Change

NCCL_PROTO=^LL in /submission/switches.json — exclude LL, let NCCL pick LL128 or Simple.
Environment only, no code change (NCCL_PROTO is not in the judge's reserved_env; NCCL_ALGO is,
and is left alone, so the judge's deterministic record runs still force Ring).
Ring order is unchanged by the protocol, so the per-element reduction order should be identical.

### Result — small gain, kept

time --side train → /tmp/r6/time_train (log /tmp/r6/time_train.log), finished 09:20:
windows [56.254, 55.043, 58.657] vs Round 3's [58.517, 59.275, 55.146];
ratios [1.3939, 1.3706, 1.3756]; train speedup 1.3800 (Round 3: 1.3586). first_use 0 everywhere.
actor_train 44.6–45.4 s vs 45.7–47.6 s without the switch, so the ~2% is consistent with the
timer as well as the windows. Much smaller than the 17% AllGather share suggested — most of that
kernel time is the skewed wait for the peer rank, not transfer, so a faster protocol cannot remove it.

Numerics sanity across rounds: train_rollout_logprob_abs_diff step 0 is **0.008139924526357157 in
every round** (bit-for-bit the frozen reference). Steps 1–7 differ by ~0.5% relative *between every
pair of rounds*, including Round 1 vs Round 3 which had no communication change — i.e. this is the
reference's own run-to-run nondeterminism (task/train_ref.json repeatable: false), not an effect
of the switches.

---
2.5 hRound 7 — correctness gates on the accumulated best (no new change)
Start 09:22. check --quick → /tmp/r7/quick (log /tmp/r7/quick.log), detached.
Judges both sides: structure, layout, rollout exact items + token forcing through the reference
engine + top-k + train/inference mismatch, and the training record (exact items, SHA-256 / statistical).
This is the first gate evidence for the compact top-k response (which removes a response field slime
never reads) and for the recompute removal.

### Result — PASS, tier N1 (/tmp/r7/quick/check.json, finished 10:01)

Both sides judged. Every gate green, with wide margins:
- rollout exact: ok; token forcing over 2 070 816 tokens: mean_abs_ratio 1.0067 (limit 2),
  tail events 3 vs the reference's rate (p = 0.974), sampler paired t = −0.98 (|t| ≤ 4).
- top-k score centering: missing 0, overlap_deficit_ratio 0.9973, mean_abs_ratio 0.998,
  bias t = −0.042. So the compact response carries exactly the same top-128 ids and log-probs.
- rollout train/inference mismatch ratio 1.0064 (limit 2).
- train exact: ok; bitwise: false (6376 tensors differ from step 1 — the reference itself is not
  bitwise repeatable), statistical gate PASS: update_norm d = 3.9e−5 vs tolerance 3.2e−4,
  exp_avg_sq_norm d = 1.9e−8 vs 4.8e−7, loss_mean d = 1.8e−6 vs 2.6e−5, grad_norm d = −2.7e−5 vs 8.0e−3,
  update-direction cos 0.99628 vs min 0.97898 — better than the reference's own repeatability
  (reference_noise_cos 0.99580).
- train mismatch ratio 1.0 (step 0 bit-for-bit the frozen reference).
- The check's own rollout windows were [73.093, 76.159, 73.785] (mean 74.35), i.e. even a little
  faster than Round 5's timing run — host variance, same code.

---
3.3 hRound 8 — remove the per-decode-step top-p device sync (rollout side)
Start 10:05, GPU lock 10:08.

### Hotspot

The py-spy profile above: 57.1% of the scheduler thread's samples blocked on
sampler.py:321, bool(sampling_info.return_top_p_log_probs.any().item()).

### Change

Keep a host twin of the mask, SamplingBatchInfo.return_top_p_log_probs_cpu, built from the same
per-request custom_params flags as the device tensor and maintained by filter_batch (index with
keep_indices) and merge_batch (rebind to a new list, like the torch.cat above it, because
copy_for_forward shares fields by reference). New any_return_top_p_log_probs() returns
any(host_list); the sampler calls it instead of .any().item().
Opt-in SGLANG_OPT_NO_TOPP_SYNC=1; with the switch off the original device read is used.
Same predicate, same values, same output. Commit 0378e74 (sglang).

### Result — largest gain so far

time --side rollout → /tmp/r8/time/rollout (log /tmp/r8/time_rollout.log), finished 10:19:
windows [48.281, 52.491, 50.368] vs [120.215, 116.628, 113.949];
ratios [2.4899, 2.2219, 2.2623]; rollout speedup 2.3247 (was 1.5137).
mismatch_steps empty, layout_problems empty. The prime run also fell from 314 s to 267 s.
One dead .item() was costing ~27 s per rollout.

With train 1.3800× this projects a step speedup of ~1.788×, and the train side is now the
*larger* term (0.296 of 0.559), so the next rounds belong to training.

### Follow-up host profile (45 s, 3848 samples, /tmp/r8/sched_raw.txt)

sampler.py:321 is gone from the profile. The top frame is now
synchronize (torch/cuda/streams.py:254) at 38.9% — that is copy_done.synchronize() in
process_batch_result_decode, the *intended* overlap wait, i.e. the scheduler now runs ahead of the
GPU instead of blocking mid-launch. Remaining CPU work: record_batch_in_overlap 4.4%
(dataclasses.fields(batch) rebuilt every step), _topk_rows_to_lists 4.0%,
get_top_logprobs_raw 6.1% (of which 3.9% is the per-row values[i][:k] Python slicing),
zmq send/recv/broadcast 3.7%.

---
2.5 hHost-side profile of the scheduler (diagnostic, taken during Round 7's rollout run)
The judge's profile only reports GPU kernels, and the rollout is host-bound, so I sampled the
scheduler's Python stacks from outside the process with the image's own py-spy
(py-spy record --pid <sglang::scheduler> --duration 60 --rate 100 --nonblocking, 5467 samples,
/tmp/r7/sched_raw.txt). No code path changed and the process was never paused. Top leaf frames:

| share | frame |
|---:|---|
| 57.12% | forward (layers/sampler.py:321) |
| 3.02% | _topk_rows_to_lists (batch_result_processor.py:67) |
| 2.34% | record_batch_in_overlap (scheduler.py:4308) |
| 1.96% | _async_d2h_topk_rows (managers/utils.py:65) |
| 4.47% | get_top_logprobs_raw (logprob_processor.py:108/118/119) |
| 1.68% | send_pyobj (zmq) |

sampler.py:321 is
if sampling_info.return_top_p_log_probs is not None and bool(sampling_info.return_top_p_log_probs.any().item()):
— a device→host sync on every decode step. return_top_p_log_probs is a device bool tensor
built from a *host* list of per-request custom_params flags, and this recipe runs with
rollout_top_p == 1, so slime never sets the flag (score_centering.py:86 only sets it when
top_p < 1): the tensor is all-False and the sync buys nothing.
It sits inside launch_batch_sample_if_needed → delay_sample_func(), i.e. exactly where the
overlap scheduler is supposed to run ahead of the GPU. Blocking there means the scheduler cannot
prepare or launch step N+1 until the GPU has finished step N's forward *and* sampling.

---
3.9 hRound 9 — host-profile the training actor (train side, no change)
Start 10:44. time --side train → /tmp/r9/time_train (log /tmp/r9/time_train.log) as a replicate
of Round 6's train number, with py-spy attached to a MegatronTrainRayActor while it runs.
The judge's own profile --side train costs ~41 min, and its GPU-kernel report for the reference is
already read; what is missing is the *host* side, which is where Round 8's 2.3× came from.

### Direction ruled out before spending a round on it

The separate "old log-probs" forward (compute_log_prob(store_prefix="") in train_actor) is
already skipped by slime here: can_reuse_log_probs_in_loss requires
len(num_microbatches) == 1, and build_dp_schedule appends one entry per *optimizer step*
(num_steps = len(rollout_ids) // global_batch_size = 1), not per micro-batch. Confirmed by the
timers: perf/train_time 47.51 s vs perf/actor_train_time 47.20 s — only 0.30 s outside the actor
update, far too little for a full forward. Also verified from the args dump that
pg_loss_type=reinforce, get_mismatch_metrics=False, use_rollout_logprobs=False,
use_opsm=False, advantage_estimator=grpo, entropy_coef=0.0, and that the reference logs
train/ppo_kl 0.0 and train/ois 1.0 exactly. So there is no redundant forward left to drop.

### Host profile of the training actor (60 s, 4889 samples, /tmp/r9/train_raw.txt)

| share | leaf frame |
|---:|---|
| 23.17% | _fused_adam (torch/optim/adam.py:879) — the CPU-offloaded Adam |
| 15.44% | backward (transformer_engine/.../context_parallel.py:2869) — CP attention backward |
| 4.13% | param_copy_back_gpu_hook (core/optimizer/cpu_offloading/hybrid_optimizer.py:124) |
| 2.58% | clear_memory (slime/utils/memory_utils.py:45) |
| 2.02% | general_gemm (TE gemm.py:212) |
| 1.94% | get_score_centering_terms (loss.py:1119) |
| 1.84% | synchronize (torch/cuda/__init__.py:1219) |
| 1.60% | pause (torch_memory_saver/entrypoint.py:252) |

The CPU Adam is the single largest item, and the host is badly oversubscribed for it.
lscpu: 2 sockets × 48 cores × 2 threads = 192 logical CPUs, 2 NUMA nodes, but the container's
cpu.max is 96 CPUs. OMP_NUM_THREADS is not set anywhere (not in the actor's environment, not
in launch.sh), so torch.get_num_threads() defaults to 96 — per process. With 4 training ranks
that is 384 intra-op threads on a 96-CPU quota (the actor has 228 threads live), all doing a
memory-bandwidth-bound fp32 Adam over ~4 B parameters per rank, unbound across two sockets.

---

### Result (replicate)

/tmp/r9/time_train: windows [57.697, 55.308, 56.908], train 1.3803× — matches Round 6's 1.3800×
to 0.02%, and step-0 mismatch is again exactly 0.008139924526357157. So the train measurement is
stable and attaching py-spy did not perturb it.

---
4.2 hRound 10 — size the intra-op thread pool for the CPU-offloaded Adam (train side)
Start 11:03, GPU lock 11:04.

### Hotspot

Round 9's host profile: _fused_adam is 23.2% of the actor's time, and the pool is 4× oversubscribed
(96 intra-op threads × 4 ranks on a 96-CPU quota, unbound across 2 NUMA nodes).

### Change

OMP_NUM_THREADS=16 in /submission/switches.json — 4 ranks × 16 = 64 threads inside the 96-CPU
quota, leaving headroom for the main threads and the paused engines. Environment only, no code
change; OMP_NUM_THREADS is not in the judge's reserved_env. Thread count does not change the
arithmetic of _fused_adam_ (each parameter is updated independently).

### Result

time --side train → /tmp/r10/time_train (log /tmp/r10/time_train.log):
train 1.6103×, windows [48.157, 47.803, 49.672] vs reference [78.411, 75.444, 80.687]
(per-window 1.6282 / 1.5782 / 1.6244). +16.7% over Round 9's 1.3803× from one environment
variable. Kept.

Why it is this large: --optimizer-offload-fraction defaults to 1.0, so *every* parameter is
updated on the host. Each rank owns ~4.3 B fp32 params (TP2, DP1) and AdamW reads/writes
param + grad + exp_avg + exp_avg_sq ≈ 126 GB per rank per step, ~500 GB over the 4 ranks.
At the ~13 s the profile attributes to _fused_adamw_ that is only ~39 GB/s aggregate on a
2-socket host — nowhere near DRAM bandwidth, i.e. the cost was thread scheduling, not memory.
384 spinning OMP threads on a 96-CPU quota was the whole problem.

---
4.6 hRound 11 — second thread-count point for the host Adam (train side)
Start 11:26, GPU lock 11:26.

### Hotspot

Same as Round 10. Even at 16 threads/rank the host Adam moves ~500 GB per step in roughly 4 s
(≈116 GB/s aggregate), still well under this 2-socket host's DRAM bandwidth, so the pool may
still be too small.

### Change

OMP_NUM_THREADS=24 (was 16) — 4 ranks × 24 = 96, exactly the cgroup quota. Single variable.

### Result

time --side train → /tmp/r11/time_train (log /tmp/r11/time_train.log):
train 1.6188×, windows [47.652, 49.942, 47.455]. A tie with Round 10's 1.6103×
(+0.5%, windows overlap) — the curve is flat between 16 and 24 threads/rank.
Step-0 mismatch 0.008139924526357157, identical to the frozen reference ⇒ the thread count
does not perturb the arithmetic, as expected.

### Host topology, measured during this run (read-only /proc inspection)

This corrects the assumption every earlier round made about the CPU budget:

- /sys/fs/cgroup/cpuset.cpus.effective = 48-95,144-191, and Cpus_allowed_list of every
  actor is the same. lscpu says node0 = 0-47,96-143, node1 = 48-95,144-191.
  The container is pinned to NUMA node 1: 48 physical cores / 96 hyperthreads, not 96 cores.
  cpu.max = 9600000 100000 (96 CPUs of time) matches the 96 logical CPUs.
- Mems_allowed_list = 0-1, and /proc/<actor>/numa_maps shows each of the four actors holds
  57.8 GiB on node1 and 0.8 GiB on node0 — the pinned optimizer buffers are already
  node-local, so there is no cross-socket traffic to fix and no point trying numactl.
- All 287 threads of an actor last ran on node1 CPUs. Node0's 48 cores are unusable from here.

Consequence for the thread pool: 4 ranks × 16 = 64 OMP threads on 48 physical cores
(1.33× oversubscribed), and 4 × 24 = 96 is 2× oversubscribed. For a bandwidth-bound fp32
AdamW, hyperthread siblings add no bandwidth, so the useful range is ~8–12 threads per rank,
not 24. Round 11 is therefore expected to be at or past the optimum; Round 12 goes the other way.

---
4.8 hRound 12 — one OMP thread per physical core per rank, and a fresh host profile (train side)
Start 11:42, GPU lock 11:42.

### Hotspot

Rounds 10/11 bracket the optimum from above (16 ≈ 24). With 48 physical cores and 4 ranks,
12 threads/rank is the point where every OMP thread owns a distinct physical core and no two
ranks' workers share a core's hyperthread sibling.

### Change

OMP_NUM_THREADS=12 (was 24). Single variable. A py-spy sample of one actor is taken during
the run to re-rank the host hotspots now that the Adam pool is right-sized — the Round 9
profile was taken with the 4×-oversubscribed pool and is no longer representative.

### Result

time --side train → /tmp/r12/time_train (log /tmp/r12/time_train.log):
train 1.6177×, windows [48.158, 47.186, 49.62]. 12 / 16 / 24 threads are a three-way tie
(1.6177 / 1.6103 / 1.6188, windows overlap) — the pool size is settled, kept 16 because it
leaves headroom for the main threads and the colocated engines. Step-0 mismatch unchanged.

### Fresh host profile (py-spy, 11 552 samples, one actor, /tmp/r12/train_raw.txt)

Right-sizing the pool moved the bottleneck. Leaf-frame shares, Round 9 → Round 12:

| frame | R9 (96 thr) | R12 (12 thr) |
|---|---|---|
| _fused_adam (torch/optim/adam.py:879) | 23.17% | 4.18% |
| TE CP attention backward (context_parallel.py:2869) | 15.44% | 18.27% |
| param_copy_back_gpu_hook (hybrid_optimizer.py:124) | 4.13% | 6.69% |
| clear_memory (slime/utils/memory_utils.py:45) | 2.58% | 3.42% |
| pause (torch_memory_saver/entrypoint.py:252) | 1.60% | 2.48% |

Inclusive: all_gather 7.3%, reduce_scatter 7.2%, all_reduce 5.2%, synchronize 7.8%.
The host Adam is no longer the problem; the new top stall is a GPU→CPU sync inside TE.

context_parallel.py:2869 is dq[cu_seqlens_q_padded[-1]:].fill_(0) — a CUDA scalar used as a
Python slice bound, i.e. an implicit .item(). It runs three times (dq, dk, dv) per attention
layer per micro-batch, and the block is guarded by
qkv_format == "thd" and not ctx.use_fused_attention and cu_seqlens_*_padded is not None.
slime passes cu_seqlens_*_padded = None; TE's backends.py:2117 defaults them to the CUDA
cu_seqlens_q, so the guard is satisfied on the FlashAttention path.

---
5.2 hRound 13 — cuDNN fused attention to delete the CP-backward host syncs (train side)
Start 12:05, GPU lock 12:05.

### Hotspot

Round 12's profile: 18.27% of the actor's host samples sit on
context_parallel.py:2869, the padded-tail zero-fill whose slice bound is a CUDA scalar.
Eight full-attention layers × three tensors × every micro-batch, each one draining the stream.

### Change

SLIME_OPT_FUSED_ATTN=1 → slime/slime/backends/megatron_utils/model_provider.py sets
config.attention_backend = AttnBackend.fused next to the existing recompute override.
Megatron's _set_attention_backend then exports NVTE_FUSED_ATTN=1 / NVTE_FLASH_ATTN=0, so TE
routes core attention through cuDNN. On that path ctx.use_fused_attention is True and the
whole zero-fill block is skipped — the same correction is done on-device by
tex.thd_grad_correction, which the thd path already uses for the dq accumulation.

This is a kernel choice (explicitly allowed), not a change to the recipe's data, batch,
parallel layout, precision or optimizer. --attention-backend flash in launch.sh is left
alone; batch_invariant_mode is off in this recipe, so nothing asserts on the backend.
Risk: cuDNN must support head_dim 256 + thd + CP2 in bf16, otherwise TE raises and the round
fails outright. Numerics will differ (different kernel) → tier N1, needs a gate check.

### Result

time --side train → /tmp/r13/time_train (log /tmp/r13/time_train.log):
FAILED, rc=1, wall 360 s. The run died in iteration 0:

```
RuntimeError: Rank 1, ... iteration 0: Unexpected result nan
(message='found NaN in local grad norm for bucket #0 in backward pass
 before data-parallel communication collective')
```

cuDNN's fused attention does not produce usable gradients for this configuration
(head_dim 256, thd packing, CP2, bf16, gated attention). No timing was produced.
Reverted: the SLIME_OPT_FUSED_ATTN block was removed from model_provider.py and the
switch dropped from /submission/switches.json, so the tree is back to the Round 10 state.
The obvious route to use_fused_attention=True is closed; the flash path's host syncs stay.

---
5.6 hRound 14 — one H2D ordering pair per step instead of one per parameter (train side)
Start 12:27, GPU lock 12:28.

### Hotspot

Round 12's profile: 6.69% of host samples in
param_copy_back_gpu_hook (core/optimizer/cpu_offloading/hybrid_optimizer.py:124), reached from
hybrid_optimizer.py:174 (cpu_optimizer.step(closure)).

Root cause found by reading the code: with --overlap-cpu-optimizer-d2h-h2d,
HybridDeviceOptimizer.build_cpu_optimizer_list creates **one CPU sub-optimizer per parameter
tensor** ("we naively assign each parameter to an individual optimizer"). The copy-back hook is
registered on every one of them, so each step pays, per parameter tensor:
_h2d_stream.wait_stream(current) + torch.cuda.stream(...) + one copy +
_h2d_stream.record_event().wait(current) — two freshly created CUDA events and two stream
waits, ~1000× per rank per step. (This is also why the Adam was so thread-sensitive in Round 10:
_fused_adamw_ is invoked once per tensor, so an OMP parallel region per parameter.)

### Change

MEGATRON_OPT_HOIST_H2D_SYNC=1 →
Megatron-LM/megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py:
step() does wait_stream once before the sub-optimizer loop, runs the loop inside a single
torch.cuda.stream(self._h2d_stream) context, and publishes one event afterwards; the hook then
only issues its copy. Same copies, same order, same stream, and the ordering guarantees are
identical (nothing is enqueued on the compute stream between sub-optimizer steps, and the
compute stream ends up waiting on an event that covers *all* copies rather than the last one).
Guarded by overlap_cpu_optimizer_d2h_h2d so the non-overlap path is untouched.

sub_optimizers, their names, their state and every arithmetic op are unchanged, so the
parameter-record gate sees exactly the same shards. Expected tier: N0 on this change alone.

### Result

time --side train → /tmp/r14/time_train (log /tmp/r14/time_train.log):
train 1.6002×, windows [48.872, 48.15, 49.521] — no gain (Round 10 was 1.6103×; the
difference is inside the window noise). Step-0 mismatch 0.008139924526357157, unchanged.

Conclusion: the 6.69% attributed to the hook is not event/launch overhead — it is the host
blocking inside copy_ while the H2D transfer itself drains. Removing ~2000 CUDA event calls
per step just moved the same wait into the copy. Same lesson as Rounds 2 and 6: a py-spy-hot
line that waits for *real* work is not a lever; only a wait for work that need not happen is.
Switch turned off (MEGATRON_OPT_HOIST_H2D_SYNC removed from the switch file); the code
stays behind its default-off switch, inert.

---
5.9 hRound 15 — gate check of the two unvalidated changes (both sides)
Start 12:47, GPU lock 12:47.

Round 7's check --quick PASS covered Rounds 1–6. Since then two changes went in unvalidated:
Round 8 (SGLANG_OPT_NO_TOPP_SYNC, rollout) and Round 10 (OMP_NUM_THREADS=16, train).
Round 13 was reverted and Round 14 is default-off, so the tree under test is exactly
"Round 8 + Round 10 on top of the Round-7-validated state".

check --quick --tree /submission/slime_grpo --config /submission/switches.json
→ /tmp/r15/quick (log /tmp/r15/quick.log). Both sides are judged (the diff touches both).
No new code change in this round. While it runs, a py-spy sample of the rollout scheduler is
taken to re-rank the rollout hotspots after Round 8's 2.32× win — the old rollout profile was
dominated by the sync that is now gone, so its percentages are stale.

### Result

check --quick PASS, tier N1 — /tmp/r15/quick/check.json, finished 13:20, both sides
judged, 5 GPU runs / 2.115 GPU-hours. Rounds 8 and 10 are now gate-validated.

- rollout exact: ok; windows [48.047, 52.379, 49.014] (mean 49.813, consistent with 2.32×).
- token forcing over 2 070 816 tokens: mean_abs_ratio 0.9967, tail events 4 at
  p = 0.944 (reference's own rate is higher), sampler t = 0.418 (|t| ≤ 4).
- top-k: missing 0, overlap_deficit_ratio 1.0077, mean_abs_ratio 1.005,
  bias t = −0.427. So Round 8's host-side top-p flag did not disturb the top-k payload.
- rollout mismatch ratio 1.0016 (≤ 2.0).
- train exact: ok, bitwise: false (6392 tensors differ from step 1), statistical PASS:
  update_norm d = 9.6e−5 vs tol 3.2e−4; exp_avg_sq_norm d = 3.1e−8 vs 4.8e−7;
  loss_mean d = 7.1e−7 vs 2.6e−5; grad_norm d = −3.4e−4 vs 8.0e−3;
  update-direction cos 0.99672 vs min 0.97898 (reference's own noise cos 0.99580).
- train mismatch ratio 1.0 — candidate 0.008139924526357157 = reference exactly.

### Fresh rollout profile (py-spy, 5 334 samples, sglang::scheduler_TP0, /tmp/r15/rollout_raw.txt)

Taken during this check's rollout x4 sub-run. The scheduler is still pegged at 100% of one
core, so host work — not the GPU — is the rollout bottleneck. Leaf shares:

| frame | share |
|---|---|
| synchronize (torch/cuda/streams.py:254) | 30.75% |
| get_top_logprobs_raw (logprob_processor.py:108/118/119) | 6.04% |
| record_batch_in_overlap (scheduler.py:4308) | 4.12% |
| _topk_rows_to_lists (batch_result_processor.py:67) | 2.40% |
| send_pyobj / recv_pyobj / broadcast_pyobj (zmq) | 6.13% |
| _async_d2h_topk_rows (managers/utils.py:65) | 1.59% |
| broadcast (torch/distributed) | 1.46% |

The 30.75% synchronize is the *intended* copy_done.synchronize() — real GPU work, not a
lever (Round 8 removed the dead one that used to be 57%). What is left that is genuinely
removable is per-step Python bookkeeping:

- get_top_logprobs_raw DECODE does values[i][:k] per row: two tensor ops per row per
  field. Every request asks for the same k (=128 = max_k), so the slice is a no-op and the
  whole loop is values.unbind(0) — one dispatch instead of 2·bs.
- record_batch_in_overlap calls dataclasses.fields(batch) every step; dataclasses.fields
  rebuilds a filtered tuple from the class __dataclass_fields__ dict on every call.
- _topk_rows_to_lists receives CPU rows here (Round 4 already moved the D2H into
  copy_to_cpu), so it falls through to a per-row .tolist() — bs·2 dispatches per step.
- _async_d2h_topk_rows re-validates ~8 tensor properties per row to prove contiguity.

---
6.7 hRound 16 — one dispatch per field instead of one per request in the top-k path (rollout)
Start 13:31, GPU lock 13:36.

### Hotspot

Round 15's fresh rollout profile: get_top_logprobs_raw 6.04% and _topk_rows_to_lists 2.40%
of the scheduler's host time. One class: per-request handling of what is really one dense
[bs, 128] array.

### Change (two switches, same class)

1. SGLANG_OPT_TOPK_UNBIND=1 — sglang/python/sglang/srt/layers/logprob_processor.py.
   The DECODE branch does values[i][:k] and indices[i][:k] per row: 2·bs
   Tensor.__getitem__ calls per field per step. Every request in this recipe asks for
   k = 128 = max_k, so the slice is a no-op and the loop is exactly values.unbind(0) —
   one dispatch producing the same views. Guarded on torch.is_tensor(values) (the
   no_copy_to_cpu=False path gets lists) and all(k == max_k); otherwise the old loop runs.
2. SGLANG_OPT_BATCH_TOPK_TOLIST=1 — .../scheduler_components/batch_result_processor.py.
   _topk_rows_to_lists only batched *device* rows, but since Round 4 the rows arrive on the
   host, so it fell through to bs separate .tolist() calls. For 1-D host tensors it now does
   one torch.stack(rows).tolist(); stack itself rejects mixed shapes/dtypes/devices and
   non-tensors, so the fallback is a try/except around it rather than a per-row validation loop.

Verified bit-identical on CPU before spending a GPU round: for equal k, unbind(0) views match
the per-row slices in value, shape, stride and storage offset (so Round 4's contiguity
proof still holds), and torch.stack(rows).tolist() == [r.tolist() for r in rows].

### Result

time --side rollout → /tmp/r16/time_rollout (log /tmp/r16/time_rollout.log):
rollout 2.3152×, windows [49.053, 51.97, 50.628] vs Round 8's 2.3247×
[48.281, 52.491, 50.368] — no gain, the two window sets overlap.

This is a useful negative result, not just a miss. 8.4% of the scheduler's host samples were
removed and the steady-state rollout time did not move, so **the rollout is no longer
host-bound**. Stream.synchronize() busy-waits, so "scheduler at 100% of one core" never
proved host-boundedness; the 30.75% synchronize share is the GPU being the critical path.
Round 8's win came from removing a sync that *serialized* host and device (the host had to
wait, then do a lot of Python before the next launch, leaving GPU bubbles). With that gone the
host runs far enough ahead that the GPU limits the step, and further Python trimming is hidden.
Consequence: the remaining rollout lever is GPU kernel time, not scheduler code.

Both switches turned off; the code stays behind its default-off switches (bit-identical by
construction and checked on CPU, so it is inert either way).

---
7.0 hRound 17 — full `check`: gate 1 (the full RL loop) plus every correctness gate
Start 13:52, GPU lock 13:52.

No code change. Rounds 13/14/16 are reverted or default-off, so the tree is byte-for-byte the
configuration that passed check --quick in Round 15. This round adds the one thing --quick
skips: gate 1, the full RL loop timed reference → candidate → reference, which is the actual
scored quantity, and re-runs all correctness gates against it.

check --tree /submission/slime_grpo --config /submission/switches.json
→ /tmp/r17/full (log /tmp/r17/full.log).

### Result

FULL check PASS — speedup 1.9906×, tier N1. /tmp/r17/full/check.json, finished 14:37
(51 min, 6 GPU runs / 2.95 GPU-hours). This is the scored quantity: one RL step of the full
loop, candidate against this host's frozen reference.

| side | reference windows | candidate windows | speedup |
|---|---|---|---|
| rollout | 120.215 / 116.628 / 113.949 | 48.206 / 52.417 / 51.125 | 2.3159× |
| train | 78.411 / 75.444 / 80.687 | 51.127 / 48.025 / 49.323 | 1.5802× |

Combined with the frozen fractions (0.6116 / 0.4089) → 1.9906×, against a benefit bar of
1.0866 → benefit.passed: true. layout_problems: [] on both sides (TP2×CP2, DP1/PP1/EP1,
sequence parallel, 2 engines × TP2 preserved).

Correctness: verdict: equivalent, measured_tier: N1, both sides PASS, exact: ok on both.
Train bitwise: false → the statistical gate carries it (as in Rounds 7 and 15).
Step-0 train mismatch 0.008139924526357157 = the reference value exactly.

---
8.1 hRound 18 — freeze the train actor's permanent heap (train side)
Start 14:58, GPU lock 15:00.

### Hotspot

Round 12's profile: clear_memory (slime/utils/memory_utils.py:45) is 3.42% of host samples,
and line 45 is gc.collect(), not empty_cache(). The stacks show it is reached twice per
step, from actor.sleep() (1.87%) and actor.wake_up() (1.55%).

Why this one is worth a round when Rounds 14 and 16 were not: sleep/wake_up are **serial
host phases** around the GPU compute, not work hidden behind kernels. The same was true of the
CPU Adam in Round 10 (+17%) and untrue of the copy-back hook and the scheduler's Python.

### Change

SLIME_OPT_TUNE_TRAIN_GC=1 → at the end of MegatronTrainRayActor.init(),
gc.collect(); gc.freeze(); gc.set_threshold(50_000, 100, 100). Everything reachable at that
point is permanent — model, optimizer and its ~1000 per-parameter sub-optimizers, weight
backups — so the two explicit collects per step stop walking it. Same trick as Round 5 on the
sglang scheduler. No arithmetic, no allocation pattern, no data touched.

### Result

time --side train → /tmp/r18/time_train (log /tmp/r18/time_train.log):
train 1.5744×, windows [51.079, 50.009, 48.041] — no gain (Round 10: 1.6103×,
Round 17's full check: 1.5802×). Step-0 mismatch unchanged. Switch turned off, code kept
default-off (commit c7bf7374).

Note on noise: Rounds 10/11/12 measured 1.6103/1.6188/1.6177 and Rounds 17/18 measured
1.5802/1.5744 on essentially the same train path. There is a ~2% drift between measurement
sessions, so any single-round effect below ~3% is not resolvable here. That is the third
independent sign (with Rounds 14 and 16) that the train step is now GPU-bound.

---
8.5 hRound 19 — re-profile the train GPU kernels against the *current* tree
Start 15:20, GPU lock 15:20.

No code change. The kernel report every earlier round reasoned from is the reference
profile, taken before Round 3 removed full recompute — it therefore describes a workload that
no longer exists (an extra forward pass per micro-batch). Rounds 14, 16 and 18 all failed to
gain, which says both sides are GPU-bound now, so the next lever has to come from a current
GPU-side breakdown rather than another host-side guess.

profile --side train --tree /submission/slime_grpo --config /submission/switches.json
→ /tmp/r19/profile_train (log /tmp/r19/profile_train.log).

Arithmetic that motivates it: actor_train_tflops ≈ 136.7 per rank against an Hopper bf16 dense
peak near 990, i.e. ~14% of peak, while the reference report shows GEMMs at SM coverage 1.00.
So the useful FLOPs are not the problem — the ~63% of kernel time that is *not* GEMM is
(NCCL ≈28%, elementwise ≈15%, gated-delta ≈10%).

### Result — no code change; a new GPU-side breakdown

/tmp/r19/profile_train/kernel_report.md, rank 2, window 58910 ms, 344281 kernels,
179 classes, 5 streams. GPU busy 38208 ms = 64.9% of the window (sum of durations 39245 ms).
Flags: under-filled 35.8% of kernel time, skewed 40.2%, short 6.4%.

| kernel | calls | ms | % | median µs | p90 µs | blocks | SM cov |
|---|---:|---:|---:|---:|---:|---:|---:|
| ncclDevKernel_AllGather_RING_LL | 12481 | 8030 | 20.5 | 107.6 | 1906.6 | 24 | 0.18 |
| ncclDevKernel_ReduceScatter_Sum_bf16_RING_LL | 6784 | 2454 | 6.3 | 167.6 | 572.2 | 24 | 0.18 |
| ncclDevKernel_SendRecv | 1536 | 1511 | 3.9 | 59.3 | 2871.6 | 16 | 0.12 |
| ncclDevKernel_AllReduce_Sum_f32_RING_LL | 3172 | 841 | 2.1 | 26.6 | 1035.5 | 1 | 0.02 |
| 8 × nvjet_sm90_* GEMMs | 36497 | 12827 | 32.7 | 270–557 | — | 132 | 1.00 |
| elementwise / copy (many classes) | — | ~5900 | ~15 | — | — | — | mixed |
| gated-delta + causal_conv1d fwd/bwd | — | ~3100 | ~8 | — | — | — | 1.00 |

Stream 7 alone: 314649 kernels, 35718 ms busy, 23192 ms of gaps.

Two conclusions:

1. The GEMMs are already saturated (SM coverage 1.00, 132 blocks) and are only a third of
   kernel time. There is no FLOP-side lever left; the 14%-of-peak actor_train_tflops figure is
   explained by NCCL + elementwise + the 35% of the window where the GPU is idle.
2. **Every NCCL kernel is still _RING_LL even though NCCL_PROTO=^LL has been set since
   Round 6.** RING is expected (NCCL_ALGO=Ring is a reserved bench env var), but LL is not.
   NCCL here is 2.29.7, which supports the ^ exclusion syntax, and nothing in slime, sglang or
   Megatron sets NCCL_PROTO (only Megatron's GTP warning and an unrelated functional-test
   script mention it). So Round 6's +1.6% was probably noise and the protocol never changed.
   LL doubles wire traffic (a 4-byte flag per 4-byte payload); the sequence-parallel AllGather is
   ~8 MB per call (1024 tokens × 4096 hidden × bf16), far above LL's useful range, and its
   p90 is 1.9 ms. That makes the protocol a real, untried lever worth ~19% of the step
   (NCCL ≈ 29% of kernel time × 64.9% busy).

Also re-read from the same run's actor log: `reloadable_process_group.py:367 - Reloading 65
process groups … {'nccl': 58, 'gloo': 7}` once per RL step, destroy 15:23:06 → reload
15:23:10 (~4 s) and 15:27:10 → 15:27:15 (~5 s). print_memory on rank 0: used 37.72 GB before
offload, 2.08 GB after offload, 33.86 GB after wake_up ⇒ the communicators hold only
~3.86 GB, against ~36 GB of headroom left by sglang's 0.7 × 139.8 = 97.9 GB static pool.
That is Round 20.

---
9.7 hRound 20 — keep the NCCL communicators resident across the rollout (train side)
Start 16:19, GPU lock 16:19:30.

Round 19's actor log showed destroy_process_groups() → reload_process_groups() rebuilding
58 NCCL groups every RL step, costing ~4–5 s. The reason slime does this is memory: it hands
the device back to sglang for the rollout. But the print_memory lines quantify the actual
stake — 37.72 GB used before offload, 2.08 GB after, 33.86 GB after wake_up ⇒ the communicators
hold only ~3.86 GB, and sglang's static pool (0.7 × 139.8 = 97.9 GB) leaves ~36 GB spare.
So the teardown buys memory that nothing needs.

Change (slime/slime/utils/reloadable_process_group.py, +9 lines): a module constant
_KEEP_PROCESS_GROUPS = os.environ.get("SLIME_OPT_KEEP_PROCESS_GROUPS", "0") == "1" and an
early return at the top of both destroy_process_groups() and reload_process_groups().
Off by default. This is a memory/offload-strategy change only — no collective is added, removed,
reordered or resized, so every reduction happens in exactly the same order on the same
communicators. Commit 699324bd.

Switch: "SLIME_OPT_KEEP_PROCESS_GROUPS": "1".
time --side train → /tmp/r20/time_train (log /tmp/r20/time_train.log).

### Result — gain, kept: train 1.771×

/tmp/r20/time_train/time.json, status ok, rc=0, wall 697 s, layout_problems: [].

| | windows (s) | mean | speedup |
|---|---|---:|---:|
| frozen reference | 78.411 / 75.444 / 80.687 | 78.181 | — |
| Round 20 | 44.535 / 44.77 / 43.214 | 44.173 | 1.771× |

Window ratios 1.7607 / 1.6851 / 1.8671. Previous best train readings were 1.5744–1.6188×
(Rounds 10–12, 14, 18), so this is +10%, far outside the ~2% session drift — the largest
train-side gain since Round 10. ~4.5 s/step saved, matching the measured destroy→reload gap.

Exactness evidence: step-0 train_rollout_logprob_abs_diff = 0.008139924526357157, identical
to the frozen reference to the last digit, as in every previous round. `grep -c "Reloading 65
process groups"` on the run's actor log = 0, confirming the rebuild really was skipped
rather than the switch being inert. Memory after wake_up: 32.76–38.31 GB used, 101–107 GB
free, i.e. no pressure.

Because this is a real gain, a full check is required to keep /submission at the best
*evidenced* version — the 1.9906× verdict only covers the previous 9-switch configuration.

---
↑ Slime GRPO