Step-5 Preview 1.33×

Harness: Claude Code · switches: SLIME_RECOMPUTE_GRANULARITY=none SLIME_OPD_INLINE_ADVANTAGE=1 SLIME_OPD_SKIP_WAKEUP_CACHE_CLEAR=1

Judged
1.33×
Tier
N1
Self-best
1.30×
Rounds
6
Hours
10.3
API cost
$192
Input tokens · 99.8% cached
1869 M
Output tokens
0.8 M
Requests
3,459
Candidate, three windows (s)
110.8 / 132.2 / 108.0
Rollout side
~1.23× (derived from the final-judge rollout run; self-test full check 1.25–1.26×)
Teacher side
≈1.00× (unchanged; in the final-judge replay bitwise identical to the reference)
Train side
~1.63× (self-test full check 1.631–1.643×; no train-only timing in the final judge)
Per-step sampler sync
✓ (round 2, rollout 1.263×)
Train-side main levers
partial: skip zero-coefficient reference forward, no recompute (round 3 1.298×), advantages computed directly from training-forward logprobs (round 5 SLIME_OPD_INLINE_ADVANTAGE, → 1.5675×), allocator cache not cleared on wake (→ 1.631×); no GDN split, CPU Adam threads or kept comm groups; wider micro-batches OOM
Teacher-side changes
✗ only tried chunk 8192 (teacher 1.03×); judged it only 0.3% of the whole step and it would lose bitwise identity, not adopted
Raw work log7 sections
0.3 hRound 1 - profile the unchanged reference
- rollout profile (tree /tmp/ref-tree, profile --side rollout, 200 decode steps of
  rollout 1, both student engines): /tmp/r1/profile/trace/*.trace.json.gz,
  report via bench/kernel_util.py.
- train profile (profile --side train): /tmp/r1/tprofile.
- Findings (rollout, per decode step at bs=32/engine):
  - profiled step 10.11 ms, GPU kernel busy 4.22 ms; the *real* step is 6.58 ms
    (measured gen throughput 4850-4914 tok/s per engine, 32 running requests).
  - kernel time split: cuBLAS nvjet GEMMs ~61%, GDN packed decode 9.9%,
    FlashInfer allreduce-fusion 8.2%, fa3 attention 2.6%, sampler path ~9%.
  - one aten::item() per decode step blocks ~3.8 ms: sampler.py
    bool(sampling_info.return_top_p_log_probs.any().item()) is evaluated on a GPU
    bool tensor every step even though score centering is off. It drains the pipeline,
    so the GPU sits idle for the batch-prep that follows.
  - under-filled tiny GEMM nvjet_..._1x1_h_bz_splitK_TNT: 4752 calls, 13.1 us each,
    3 blocks / 2% SM coverage, 6.2% of kernel time (the GDN a/b projection).
- Roofline check: weights 8.65 GB + KV reads 4.33 GB + GDN state 0.8 GB per GPU per
  step at seq len ~8300 => ~14 GB; the lm_head GEMM alone sustains ~4.1 TB/s, so the
  memory roofline is ~3.0 ms/step and we are at 6.58 ms.
0.3 hRound 2 - remove the per-step GPU sync in the sampler (rollout side) - RESULT
time --side rollout (tree /submission/slime_opd, switches empty), windows from
/tmp/r2/time_rollout/rollout_tree/judge/rollout_clock.jsonl:
- candidate windows: 61.114 / 59.442 / 59.468 s (mean 60.008)
- frozen reference: 75.611 / 76.071 / 75.633 s (mean 75.772)
- side speedup 1.2629, projected step speedup 1.1143 (rollout side only)
- engine log: gen throughput 4850-4914 -> 6712-7046 tok/s at bs=32/engine
0.4 hRound 3 - train side: dead reference pass + recompute override - RESULT
time --side train with SLIME_RECOMPUTE_GRANULARITY=none:
- candidate windows: 56.516 / 56.184 / 55.719 s (mean 56.14)
- frozen reference: 73.779 / 72.317 / 72.521 s (mean 72.872)
- side speedup 1.298, first_use 0 s in every window

Breakdown from the run's own timers (step 1, warm): the reference model's log-prob pass
is gone and actor train runs at 2.0 vs the reference's 1.55 microbatches/s.
Numerics: step 0's train/loss, train/pg_loss, train/entropy_loss, train/pg_clipfrac,
train/ppo_kl and train/train_rollout_logprob_abs_diff are bitwise identical to the
reference run's step 0 (0.05341373383998871 / 0.3821689486503601 / 0.0 / 0.0 /
0.008052160032093525). train/grad_norm differs by 3.9e-5 relative (0.9966256618 vs
0.9966646433) because recompute=none moves the recompute out of the backward; that is the
only visible numeric change and it is far inside the N1 statistical gate.

Combined projection (both sides): 1 / (1 - (0.4926*0.2080 + 0.4738*0.2296)) = 1.27.
1.6 hRound 4 - full correctness check: `check --quick` PASS (tier N1)
/tmp/r4/quick/check.json -> {"status": "PASS", "tier": "N1"}, judged sides
rollout + teacher + train. Numbers:
- rollout windows 59.574 / 60.230 / 59.632 (mean 59.812) vs frozen 75.772 -> 1.267
- rollout teacher tail 16.9 / 15.9 / 15.7 s
- teacher replay windows 18.318 / 18.275 / 17.905 (mean 18.166) vs frozen 18.132 -> 0.998
  (the teacher replay's log-probabilities are bitwise identical to the frozen
  reference replay: candidate mean|d| = 0.0)
- rollout token forcing: mean|d| 0.0077267 vs the reference's own 0.0077868
  (ratio 0.992), event rate identical, sampler t = 1.13 (< 4)
- rollout teacher log-probs: mean|d| 0.0069426 vs 0.0069976 (ratio 0.992), bias t = -0.68
- train-inference mismatch 0.008033 vs the reference's 0.008085 (ratio 0.994)
- train statistical gate (N1): update norm d = -2.3e-5 (tol 1.2e-3), exp_avg_sq norm
  d = 8.1e-5 (tol 4.4e-4), mean loss d = 1.5e-5 (tol 3.8e-5), first grad norm
  d = -1.2e-4 (tol 1.65e-3), update direction cosine 0.99541 (min 0.95660). All within.

Projected step speedup from the two measured sides:
1 / (1 - (0.4926*(1-1/1.267) + 0.4738*(1-1/1.298))) = 1.27.
2.1 hRound 5 - train side: form the OPD advantage inside the training forward
The actor's forward-only log-prob pass existed only to give the OPD advantage the
student's log-probs of the current weights - which the training forward computes anyway.
When both KL terms are dead and the advantages are not whitened the two are the same
tensors, so the loss can apply the reverse KL to what it just computed
(SLIME_OPD_INLINE_ADVANTAGE=1).

First attempt was wrong: the inline advantage carried the forward's graph, so the policy
gradient picked up an extra d(advantage)/d(log_probs) term (grad_norm 1.088 vs the
reference's 0.9966). The reference's advantage comes from a graph-free forward, so the
substitution has to detach it; with that, step 0's loss, pg_loss, entropy_loss,
pg_clipfrac, ppo_kl and train_rollout_logprob_abs_diff are bitwise identical to the
reference's and grad_norm is 0.99655 vs 0.99666 (d = 1.2e-4, tolerance 1.65e-3).

time --side train with both switches: windows 46.320 / 48.323 / 44.952 (mean 46.532) vs
the frozen 73.779 / 72.317 / 72.521 -> side speedup 1.5675 (was 1.298 without it).
The log-prob timer disappears from the run's own timer log.

Combined projection: 1 / (1 - (0.4926*0.2109 + 0.4738*0.3620)) = 1.38.

Teacher attempt (logged as no-gain): OPD_TEACHER_SERVER_ARGS=--chunked-prefill-size 8192
gives teacher windows 17.579/17.860/17.358 vs the frozen 18.284/18.251/17.861, side
speedup 1.0303 - 0.3% of the step, and it would trade the teacher's currently
bitwise-identical replay log-probabilities for a tolerance-based match. Not taken.
2.7 hRound 6 - full correctness check with both switches: PASS (N1)
check --quick with SLIME_RECOMPUTE_GRANULARITY=none +
SLIME_OPD_INLINE_ADVANTAGE=1 (/tmp/r8/quick/check.json) -> {"status": "PASS"},
passed: true, measured_tier: N1, verdict: equivalent, judged sides rollout +
teacher + train. Train statistical gate (all within: true):

| metric | candidate | reference | d | tolerance |
|---|---|---|---|---|
| update norm | 0.148315 | 0.148452 | -1.37e-4 | 1.20e-3 |
| exp_avg_sq norm | 0.0017041 | 0.0016418 | +6.23e-5 | 4.36e-4 |
| mean loss | 0.05169098 | 0.05169092 | +6.1e-8 | 3.75e-5 |
| first grad norm | 0.996532 | 0.996736 | -2.05e-4 | 1.65e-3 |
| update direction cos | 0.99325 | - | min 0.95660 | |

Rollout windows in the same run: 59.574 / 60.230 / 59.632 (mean 59.812) vs frozen
75.772. Teacher replay windows 18.318 / 18.275 / 17.905 (mean 18.166) vs 18.132.

Current submission state (/submission/switches.json):
{"environment": {"SLIME_RECOMPUTE_GRANULARITY": "none", "SLIME_OPD_INLINE_ADVANTAGE": "1"}}
- rollout side speedup 1.263 (time --side rollout), train side 1.5675
  (time --side train), teacher side 1.00 (unchanged).
- projected step speedup 1 / (1 - (0.4926*0.2109 + 0.4738*0.3620)) = 1.38.
0.4 hRound 3 - train-side profile and the dead reference pass
profile --side train timer breakdown of one warm train step (72.9 s total):
- ref_log_probs (reference model's forward-only log-prob pass): 10.8 s
- log_probs (actor's forward-only log-prob pass): 9.9 s
- actor_train (fwd + full-recompute + bwd): 45.9 s
- sleep/wake of the colocated Megatron: 5.7 s
The recipe passes --use-kl-loss --kl-loss-coef 0.00 and --kl-coef defaults to 0, so
the reference model's log-probs feed only terms multiplied by zero. Change: the actor
skips that forward pass when both KL coefficients are zero, and policy_loss_function
follows the data's presence. Tier N0 (the loss and its gradient are unchanged bitwise:
loss + 0 * kl_loss == loss).

Also added SLIME_RECOMPUTE_GRANULARITY (Megatron training/arguments.py): an opt-in
override of the activation-recompute granularity. Full recompute costs one extra
forward per layer; the colocated engines release their pools during training, so there
is device headroom to keep the activations instead.

Bug found and fixed while timing this: DataIterator.get_next fills a requested key
with None when the rollout data does not carry it, so "ref_log_probs" in batch is
True with a None value. The first version of the loss guard used in batch and
crashed with TypeError: cat(): argument 'tensors' ... not NoneType. The guard now
tests batch.get("ref_log_probs") is not None, and kl_loss is reported only when it
was computed.


---
↑ Slime OPD