Gemini 4 Neon 1.95×
Harness: Antigravity · switches: SLIME_OPT_SKIP_DEAD_REF=1 SLIME_OPT_REUSE_OPD_LOGPROBS=1 SLIME_OPT_SKIP_DEAD_ENTROPY=1 SLIME_OPT_RECOMPUTE=none SLIME_OPT_GPU_OPTIMIZER=1 SLIME_OPT_KEEP_OPT_ON_GPU=1 SLIME_OPT_FAST_SLEEP=1 SLIME_OPT_SKIP_DEFAULT_PAUSE=1 SLIME_OPT_SHARD_GDN=1 OPD_TEACHER_SERVER_ARGS=--chunked-prefill-size 16384 --mem-fraction-static 0.15 --disable-radix-cache --disable-cuda-graph --enable-layernorm-sp SGLANG_OPT_TP_LOCAL_INPUT_LOGPROBS=1 SGLANG_OPT_QWEN35_LAYERNORM_SP=1 SLIME_OPT_POOLED_TEACHER_HTTP=1 SLIME_OPT_TRIM_TEACHER_LOGPROB_START=1 SGLANG_OPT_NO_SAMPLER_SYNC=1 SGLANG_OPT_FUSED_SAMPLER=1 SGLANG_OPT_CUDA_FUSED_GDN_IN_PROJ=1 SLIME_OPT_STUDENT_DISABLE_RADIX=1 SLIME_OPT_STUDENT_CUDA_GRAPH_MAX_BS=48 SLIME_OPT_STUDENT_DISABLE_PREFILL_CG=1 SLIME_OPT_FUSED_LOGPROB=1 SLIME_OPT_FAST_UPDATE_WEIGHTS=1
- Judged
- 1.95×
- Tier
- N1
- Self-best
- 2.00×
- Rounds
- 7
- Hours
- 10.0
- API cost
- $62.2
- Input tokens · 96.5% cached
- 195 M
- Output tokens
- 0.9 M
- Requests
- 671
- Candidate, three windows (s)
- 78.8 / 80.3 / 78.1
- Rollout side
- 1.40×
- Teacher side
- 1.33×
- Train side
- 3.18×
- Per-step sampler sync
- ✓ (round 6; same round swapped in a Triton fused Gumbel-Max sampler and turned off the student radix cache; rollout 1.40×)
- Train-side main levers
- ✓ skip zero-coefficient reference forward and entropy, OPD reuses training-forward logprobs (round 2, 1.35×); no recompute, optimizer moved from CPU offload to fused AdamW on GPU, optimizer state kept in GPU memory during sleep, NCCL comm groups not rebuilt (round 3, 2.11×); GDN split 4-way by head in Ulysses all-to-all layout with forward bitwise identical, default memory segment not swapped out during sleep (sleep+wake 3.1→0.38 s) (round 4, 3.08×); BF16 Triton vocab-parallel logprob, 4 GB weight-sync buckets (round 7, 3.18×)
Round 7 also packed microbatches by descending length, two samples each; train side measured 4.18× and the three-side check passed (projected overall 2.00×); train-only memory already at 105–109 GB, held back pending a full-loop check with the teacher; the log ends there, not in the submission - Teacher-side changes
- ✓ teacher input logprobs computed locally per GPU (BF16 lm_head + logsumexp + two small all-reduces), logprobs only for the response part, LayerNorm sequence parallel on the teacher, symmetric memory fusing TP comm into the GEMMs, chunk 16384, radix cache and CUDA graph off, static memory fraction 0.15 (teacher memory 39.5→22.6 GiB), pooled HTTP connections; teacher side 1.33× (round 5)
Raw work log8 sections
1.1 hRound 1: Baseline Profiling (Unchanged Reference)
- Start: 2026-11-19 18:03 UTC - End: 2026-11-19 19:15 UTC - Hardware: 4x Hopper (Hopper SM90, 132 SMs, 141 GB HBM3e, NV18 NVLink interconnect, 700W TDP), 192 CPU threads (2x Xeon 8558), 2 TiB RAM. - Frozen Reference Timing (task/timing_ref.json): - Full step: 153.815 s (spread 3.76%) - Rollout: 75.772 s (49.26% of step; includesteacher_tail_s= 16.391 s, so student generation ~59.38 s) - Train: 72.872 s (47.38% of step; spread 6.88%) - Teacher standalone: 18.132 s (10.66% of step on critical path) - Inter-stage (weight sync + offload/onload): ~5.17 s (3.36% of step) - Fixture lengths: 1073/1152 samples (93.1%) hit the 8192-token cap; mean prompt ~165 tokens, mean response ~8076 tokens. ### Profile Findings #### 1. Teacher Profile (/tmp/r1/profile_teacher, wall=258s) - Window 9202 ms (64 prefill chunks of 4096 tokens), GPU busy 92.5% (8512 ms). - Top hotspots: 1. GEMMs (nvjet_sm90_tst_*): 50.9% (4334 ms) — compute/roofline baseline. 2. Missed FlashInfer AllReduce Fusion -> NCCL RING_LL + separate RMSNorm [Kind 1: missed fast path]: -ncclDevKernel_AllReduce_Sum_bf16_RING_LL(21.9%, 1863 ms, 24 blocks = 18% SM cov) +FusedAddRMSNormKernel(4.0%, 339 ms) = 25.9%. - Root cause:FUSE_ALLREDUCE_MAX_BATCH_SIZE = 2048insglang/srt/layers/layer_boundary/residual/add_norm.py:139, while teacher uses--chunked-prefill-size 4096-> misses fusion on every full chunk! AlsoNCCL_CUMEM_ENABLE=0disables NVLS. 3. Full-vocab Logits AllGather + Cast + Logsumexp [Kind 3: algorithmic/rewrite]: -ncclDevKernel_AllGather_RING_LL(3.6%, 309 ms) +direct_copypermute/cast fp32 (4.1%, 353 ms) +vectorized_gather(1.6%, 137 ms) +_row_logsumexp_kernel(0.7%, 59 ms) = 10.0% (~858 ms). - Root cause: gathers full[2048, 248320]logits across TP=4 and casts to fp32 just to extract 1 target token logprob per row. Replaceable with TP-local vocab-parallel logprobs (32 KB allreduce). 4. GDN Prefill & Attention:FullyFusedDeltaRule(3.1%, 24 blocks under-filled) +CPDeltaRule*(2.0%) +FlashAttnFwdSm90(2.3%) + repeated small kernel chains (~3.5%). 5. Host/Client:on_policy_distillation.pycreates a freshaiohttp.ClientSessionper sample;max_mamba_cache_size=280capsmax_running_requests=56 < 64. #### 2. Train Profile (/tmp/r1/profile_train, wall=2710s) - Unprofiled step 6 breakdown (perf 6: 75.37 s total; peak GPU used only 36.9 GB / 139.8 GB!): 1.perf/ref_log_probs_time: 11.05 s (14.7%) [Kind 2: dead config work] —--use-kl-loss --kl-loss-coef 0.00still instantiatesrefmodel, swaps weights, and runs a full 64-microbatch forward pass whose result is multiplied by0.00. 2.perf/log_probs_time: 9.99 s (13.3%) [Kind 3: redundant forward pass] —can_reuse_log_probs_in_lossis False whenuse_opd=True, even thoughlen(num_microbatches)==1andnormalize_advantages=False, so OPD reverse KL & advantages can be computed directly from the training forward pass'slog_probs. 3.perf/actor_train_time: 46.20 s (61.3%) (~40.0 s fwd+recomp+bwd + ~6.2 s CPU-offloaded optimizer): - Full activation recomputation (--recompute-granularity full): ~10 s extra forward pass despite ~67 GB free GPU memory even with teacher resident! - 4x duplicated GatedDeltaNet compute (hf_attention.py+qwen3_5.py) [Kind 3]: 24/32 layers gather full sequence across TP=2 x CP=2 (AllGather19.8%,ReduceScatter6.9% = 26.7% of GPU kernel time!) and run unsharded GDN GEMMs + conv1d + FLA chunk GDN duplicated 4x across all 4 GPUs! Head-sharding GDN across all 4 ranks cuts 75% of GDN compute while keeping identical replicated parameter names/shapes/dtypes. - CPU-offloadedHybridDeviceOptimizer: ~6.2 s/step on CPU;HybridDeviceOptimizernatively supportsoffload_fraction=0.0(GPU FusedAdam) with identical state schema. - Dead entropy & unfused ops:with_entropy=Truedespiteentropy_coef=0.00; unfusedQwen3NextRMSNorm(pow+mean= ~710 ms);_VocabParallelLogProbEntropychunked eager softmax (~2.5 s). 4.perf/sleep_time(5.30 s) +perf/wake_up_time(1.53 s) +backup("actor")(~0.8 s) = ~7.6 s (10.1%) [Kind 2: offload/NCCL teardown overhead] — destroys and recreates ALL NCCL process groups every step +gc.collect()+_host_emptyCache()+ 10.5 GB CPU<->GPU weight copies. #### 3. Rollout Profile (/tmp/r1/profile_rollout, wall=466s) - Unprofiled rollout 0 (perf 0: 79.55 s;e2e_latency/max62.61 s; median decode 143 tok/s = 6.99 ms/step; pre-contention 5041 tok/s = 6.35 ms/step). - Profiled 200 decode steps: window 2203.9 ms, GPU busy 44.9% (990.5 ms -> 5.00 ms/step actual GPU kernels). - Top hotspots: 1. Host/Scheduler gaps & GPU idle (~1.35–2.25 ms/step unprofiled, ~30% of decode step) [Kind 2/3]:pop_and_process->stream_output->ingest_requests/broadcast_pyobj->prepare_for_decode->set_mamba_track_indices_from_reqs->decode_cuda_graph_runner.load_batchrun every single token (num_continuous_decode_steps=1,scheduler_recv_interval=1,uses_mamba_radix_cache=Truewith 0.0% prefix cache hit rate!). 2. Student-Teacher GPU contention: when early samples finish (~6112 tokens) and hit the colocated TP=4 teacher server, student decode throughput drops 32–50% (4634 -> 3159 -> 1688 tok/s). 3. Missed fusedin_proj_baGEMM [Kind 1]:nvjet_sm90_tst_64x32...(in_proj_ba, 3 blocks = 2% SM cov, 61.3 ms = 5.7% of GPU decode time) running separately fromin_proj_qkvz. 4. Decode AllReduce Fusion:allreduce_fusion_kernel_oneshot_lamport(14.2%, 154.3 ms, p90 skew 129.9 us). 5. GDN Decode:fused_recurrent_gated_delta_rule_packed_decode_kernel(8.9%, 96.5 ms) + conv1d (1.3%) + norm (1.0%). 6. Decode GEMMs: 43.2% of GPU time (gate_up_proj19.5%,in_proj_qkvz9.6%,down_proj9.2%,out_proj4.9%), running at ~61% of HBM3e peak (96/132 SMs). 7. Sampling + Logprobs:lm_head(4.5%) +_all_gather_kernel_inner(1.2%, 4 blocks) +cunn_SoftMaxForward(1.4%, 32 blocks) + eager clamp/div/log/copy/argmax (2.6%) = 9.7%. ### Fast-Path Inventory (Initial) - sglang FlashInfer AllReduce Fusion (sglang/srt/layers/layer_boundary/residual/add_norm.py:142): enabled on SM90 for Qwen3.5, guarded bybatch_size <= FUSE_ALLREDUCE_MAX_BATCH_SIZE (2048)— silently falls back to NCCL RING_LL + separate RMSNorm on teacher 4096-token chunks. - sglang Fused QKVZ+BA Input Projection (sglang/srt/models/qwen3_5.py:632,795): mergesin_proj_qkvz+in_proj_baforseq_len <= 1024, investigate why missed in rollout decode. - sglang FlashInfer GDN (sglang/srt/layers/attention/linear/kernels/gdn_flashinfer.py): active for prefill on SM90; decode defaults toTritonGDNKernel(packed_decode=True). - slimecan_reuse_log_probs_in_loss(slime/backends/megatron_utils/actor.py:488): guarded bynot self.args.use_opd-> silently forces full extraactor forwardpass. - MegatronHybridDeviceOptimizer(Megatron-LM/megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py): supportsoffload_fractionin[0.0, 1.0], defaults to1.0when--optimizer-cpu-offloadis passed. ---
1.6 hRound 2: Train Side — Eliminate Dead & Redundant Forward Passes (Ref Forward, Actor LogProbs Forward, Dead Entropy)
- Start: 2026-11-19 19:16 UTC - End: 2026-11-19 19:43 UTC - Hotspot targeted: From Round 1 train profile:ref_log_probs(11.05s, 14.7% — dead because--kl-loss-coef 0.00),log_probs(9.99s, 13.3% — redundant single-step OPD forward pass), andentropycalculation inpolicy_loss_function(dead because--entropy-coef 0.00). - Changes (slime/slime/backends/megatron_utils/actor.py,loss.py): -SLIME_OPT_SKIP_DEAD_REF=1: Skip loading/runningrefmodel whenkl_coef == 0and(not use_kl_loss or kl_loss_coef == 0), and emitkl_loss=0.0inreported_loss; also guard_switch_model("actor")when already active. -SLIME_OPT_REUSE_OPD_LOGPROBS=1: Enablecan_reuse_log_probs_in_lossfor single-step sglang OPD whennot normalize_advantagesand computereverse_kl = old_log_probs - teacher_log_probsand OPD advantages directly insidepolicy_loss_functionusing training-forwardlog_probs.detach(). -SLIME_OPT_SKIP_DEAD_ENTROPY=1: Passwith_entropy=Falsetoget_log_probs_and_entropywhenentropy_coef == 0.0, reportingentropy_loss=0.0. - Verification (/tmp/r2/check/check.json): - Status:PASS(tierN1, train side judged) - Train windows:[53.968, 55.029, 52.535](mean 53.844 s vs frozen ref 72.872 s) -> train speedup 1.3539x, projected step speedup 1.1414x (bar 1.1376x) - Numerics:update_direction_cos = 0.99301(ref noise 0.9913, min 0.9566),loss_mean d = -5.67e-6(tol 3.75e-5),grad_norm_first d = -1.50e-4(tol 1.65e-3),mismatch ratio = 1.0000. - Committed:slimebranchopt; promoted switches to/submission/switches.json. ---
2.4 hRound 3 — Train: No Recompute + GPU Fused AdamW + Fast TMS Sleep/Wake (Persistent NCCL)
- Hypothesis: After Round 2 (53.84s), remaining train time was dominated by full activation recomputation (~10s), CPU-offloadedHybridDeviceOptimizer(~6.3s), andsleep()/wake_up()destroying/reloading NCCL process groups +gc.collect()/_host_emptyCache()(~6.4s in train, ~10s+ in full loop). MovingHybridDeviceOptimizerto GPUtorch.optim.AdamW(fused=True)(preserving exact 188-entrysub_optimizersschema via lightweight_GpuSubOptimizerView), placing optimizer tensors in TMS"optimizer"tag sosleep()doesn't copy 29.5 GiB via slow pageable TMS backup, keeping NCCL communicators outside TMS tracking (eliminatingdestroy_process_groups/reload_process_groups), and disabling full recomputation should cut train time nearly in half. - Changes (behind env switches, default OFF): -slime(a03ecdd3): -slime/backends/megatron_utils/model_provider.py:SLIME_OPT_RECOMPUTE(none,block:N,selective). -slime/backends/megatron_utils/model.py:SLIME_OPT_GPU_OPTIMIZER=1setsoptimizer_offload_fraction=0.0,use_torch_optimizer_for_cpu_offload=True. -slime/backends/megatron_utils/actor.py:SLIME_OPT_FAST_SLEEP=1(keeps NCCL outside TMS viadisable()warmup + fast C-leveltms_set_interesting_regioncollective wrappers excludingisend/irecvforP2POpidentity, skipsdestroy_process_groups/reload_process_groupsinsleep/wake_up/update_weights, skipsgc.collect()/_host_emptyCache()) andSLIME_OPT_KEEP_OPT_ON_GPU=1(selective TMS pause/resume ofparam_buffer,grad_buffer,default, leavingoptimizertag on GPU). Added peak GPU memory logging on rank 0. -Megatron-LM(9d7cdd3): -megatron/core/optimizer/__init__.py: honoruse_torch_optimizer_for_cpu_offloadunderSLIME_OPT_GPU_OPTIMIZER=1(uses CUDA fusedtorch.optim.AdamW, matching CPU AdamW tocos=0.9999997in ~21ms). -megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py:_GpuSubOptimizerViewpreserving exactc0.s0.p0..c0.s187.p0layout;_optimizer_tms_regiontagging fp32 masters & moments under"optimizer"; fixed_d2h_streamrace; fusedtorch._foreach_copy_writeback. -megatron/core/optimizer/distrib_optimizer.py: freed throwaway pre-shardHybridDeviceOptimizerbefore constructing sharded one (reclaiming 20.8 GiB VRAM). - Result (/tmp/r3/check2/check.json): - Status:PASS, Tier:N1(exact: ok,update_direction_cos=0.99419vs min0.9566/ ref noise0.9913,update_norm d=-8.15e-5tol1.20e-3,exp_avg_sq_norm d=+3.47e-5tol4.36e-4,loss_mean d=+1.64e-5tol3.75e-5,grad_norm_first d=-1.70e-4tol1.65e-3,mismatch ratio=1.0000). - Timing: train windows[34.761, 34.743, 34.126](mean 34.543s vs frozen ref 72.872s) -> train speedup 2.1097x, projected full-step speedup 1.3319x. (actor_train_timedropped46.3s -> 30.5s;sleep+wake6.4s -> 3.1s). - Full-loop VRAM finding: WithSLIME_OPT_RECOMPUTE=noneBEFORE Round 4 (unsharded GDN),peak_alloc=93.53GB,peak_res=95.58GB,post_used=102.20GB. Since resident teacher uses ~41.5GB in full loop (102.2 + 41.5 = 143.7 > 139.81GB), we holdSLIME_OPT_RECOMPUTE=noneout of/submission/switches.jsonuntil Round 4 shrinks GDN activations by 4x (-22GB -> ~80GB peak, safely <98GB). - Note on remainingsleep_time(2.2s): TMS backed up ~2.76 GB/rank of"default"segments via pageable malloc+memcpy after step 0 (vs0.12sat init). Will eliminate or shrink"default"backup alongside Round 4. ---
5.0 hRound 4 — Train: Ulysses AllToAll 4x Head-Sharded GatedDeltaNet + Skip TMS Default Pause
- Hypothesis: InQwen3.5-9B, 24 of 32 layers areQwen3_5GatedDeltaNet(HuggingfaceAttention), which gathers the full sequence across TP×CP=4 ranks and runs the entire layer redundantly 4x (holding 4x activation memory and performing 4x redundant compute + 2x AllGather/ReduceScatter per layer). Replacing replicated GDN with Ulysses-style AllToAll 4x head-sharding (local input_layernorm + local in_proj_* on S/4 tokens -> AllToAllHeadToSeq -> 1/4 causal_conv1d + repeat_interleave(2) + 1/4 chunk_gated_delta_rule + 1/4 rms_norm_gated -> AllToAllSeqToHead -> local out_proj on S/4 tokens, with a single coalesced FP32 TP AllReduce of GDNmain_grads once at_finalize_model_grads) cuts GDN compute and saved activations by 4x, cuts communication by 25–75%, eliminates 9,216 per-microbatch weight-grad collectives, AND keeps forward + backwarddx100% bitwise identical to baseline (H_max=0.0across 8 real layers). Also skip TMS pausing"default"tag (SLIME_OPT_SKIP_DEFAULT_PAUSE=1) to eliminate 2.76 GB pageable TMS backup (sleep+wake3.1s -> 0.38s). - Diagnostic lesson (what didn't work first): - Round 4a/4b (split-Kout_proj+ ReduceScatter + mergedin_proj_qkvzba+ native GVA) ran fast (24.2s) but failedgrad_norm_firstandupdate_direction_cos(0.9506vs min0.9566). Root cause:Qwen3.5-9Blayers L00–L08 have extreme backward sensitivity (~2–17x gradient spikes on specific microbatches even from1e-4BF16 cuBLAS split-K /N=32tiling differences inout_proj/in_proj_a/in_proj_b). - Switching to Ulysses AllToAll keepsin_proj_qkv/in_proj_z/out_projunsplit onS/4tokens (bitwise0.0match), uses_ExactSmallLinearforin_proj_a/in_proj_b(N=32full-M tiling without saving padded activations), andrepeat_interleave(2)on 1/4 heads (bitwise0.0in FLA GDN) -> 0.00000000000000000 forward diff (mismatch=1.000000000000000) andupdate_direction_cos=0.99381(exceeding reference noise0.99132!). - Changes (behind env switches, default OFF): -slime(75049ccc): -slime/slime_plugins/models/qwen3_5.py:SLIME_OPT_SHARD_GDN=1(_ExactSmallLinear,_AllToAllHeadToSeq,_AllToAllSeqToHead,_forward_head_sharded). -slime/slime/backends/megatron_utils/model.py: coalesced once-per-step FP32 TPall_reduceon_slime_gdn_tp_sum_gradparameters inside_finalize_model_grads. -slime/slime/backends/megatron_utils/actor.py:SLIME_OPT_SKIP_DEFAULT_PAUSE=1(skips TMS pause/resume of"default"tag) and warms upall_to_all_singleoutside TMS in_warmup_nccl_groups. -Megatron-LM(f895809): -megatron/core/optimizer/distrib_optimizer.py: clear throwaway pre-shard HDO tensor containers beforegc.collect(); torch.cuda.empty_cache()(~10 GiB init reserved reclaimed). - Verification (/tmp/r4/check3/check.json): - Status:PASS, Tier:N1(exact: ok,mismatch ratio = 1.000000,loss_mean d = +3.56e-6tol3.75e-5,grad_norm_first = 0.996486vs ref0.996736(d = -2.50e-4tol1.65e-3),update_direction_cos = 0.993811vs min0.956603/ ref noise0.991321,update_norm d = -1.07e-4tol1.20e-3,exp_avg_sq_norm d = +8.78e-5tol4.36e-4). - Timing: train windows[23.440, 23.296, 24.333](mean 23.690 s vs frozen ref 72.872 s) -> train speedup 3.0774x, projected full-step speedup 1.4702x! - Peak VRAM:peak_alloc=77.43 GB,peak_res=84.85 GB,post_used=94.84 GB(flat across all 8 steps; fits with resident teacher94.84 + 41.5 = 136.34 < 139.81 GB, and Round 5 will free an extra ~14 GiB from teacher static pool). - Committed:slime(75049ccc),Megatron-LM(f895809); promoted all Round 2+3+4 switches (includingSLIME_OPT_RECOMPUTE=none,SLIME_OPT_SKIP_DEFAULT_PAUSE=1,SLIME_OPT_SHARD_GDN=1) to/submission/switches.json. ---
7.2 hRound 5 — Teacher: Qwen3.5 LayerNorm SP (`symm_mem` Fused Collectives) + TP-Local Input Logprobs + Trimmed Start Len + Pooled HTTP + Slim VRAM
- Hypothesis: In the baseline teacher profile (18.132 s), TP=4 NCCLAllReducetook 21.9%,FusedAddRMSNormtook 4.0%, full-vocablm_headAllGather + permute + FP32 cast + copy took 9.3%, and teacher held 39.5 GiB VRAM (--mem-fraction-static 0.25+ CUDA graphs). - Enabling Megatron-style LayerNorm Sequence Parallelism (--enable-layernorm-sp,SGLANG_OPT_QWEN35_LAYERNORM_SP=1) onQwen3_5ForConditionalGenerationwithtorch.ops.symm_mem.fused_matmul_reduce_scatter+fused_all_gather_matmul(including multi-weightcolumn_parallel_g_matmul_multifor GDNin_proj_qkvz + in_proj_ba) overlaps TP=4 communication directly with the GEMMs (cutting comm overhead by 63% in microbenchmarks) and shrinksGemmaRMSNormby 4x. - Computing TP-local BF16lm_head+row_logsumexp+ 2 tiny AllReduces (SGLANG_OPT_TP_LOCAL_INPUT_LOGPROBS=1) eliminates the 1.02 GB logits AllGather + 2 GB FP32 cast + 2 GB copy. - Trimminglogprob_start_lentolen(tokens) - response_length - 1(SLIME_OPT_TRIM_TEACHER_LOGPROB_START=1) avoids computinglm_headon prompt tokens; poolingaiohttp.ClientSessionper event loop (SLIME_OPT_POOLED_TEACHER_HTTP=1) removes per-request TCP setup. - Passing--chunked-prefill-size 16384 --mem-fraction-static 0.15 --disable-radix-cache --disable-cuda-graph --enable-layernorm-spboosts prefill throughput to ~39k tok/s AND cuts teacher VRAM from 39.5 GiB -> 22.6 GiB (17 GiB freed per GPU for full-loop colocated training!). - Diagnostic lesson (what didn't work): - Raising FlashInfertrtllmAR fusion cap (FUSE_ALLREDUCE_MAX_BATCH_SIZE) to 4096/8192 was slower than plain NCCL+RMSNorm (288/561 usvs250/470 us); revertedadd_norm.pyandlayernorm.pyand replaced withsymm_memfused LayerNorm SP (+185.7 usvs+501.7 usNCCL at M=8192). - Changes (behind env switches, default OFF): -sglang(bb90a13):layernorm_sp.py(SGLANG_OPT_QWEN35_LAYERNORM_SP=1allowlist +column_parallel_g_matmul_multi),qwen3_5.py(GDN multi-weight SP input proj +seq_len = qkv.shape[0]fix inforward_prepare_cuda_fused),logits_processor.py(SGLANG_OPT_TP_LOCAL_INPUT_LOGPROBS=1). -slime(e1670b30):slime/rollout/on_policy_distillation.py(SLIME_OPT_POOLED_TEACHER_HTTP=1,SLIME_OPT_TRIM_TEACHER_LOGPROB_START=1). - Timing sweep (bench.py time --side teacher): -5a(chunk 4096 + trtllm AR):16.452 s(1.1021x) -5b(chunk 8192 + trtllm AR):15.787 s(1.1485x) -5c(chunk 8192 + LayerNorm SP):14.383 s(1.2606x) -5d(chunk 16384 + LayerNorm SP):13.643 s(1.3291x),22.6 GiBVRAM,corr=0.99977vs ref. ---
7.2 hRound 6 — Rollout: Eliminate 99.4% Decode Host-Sync Bug + Triton Fused Gumbel-Max Sampler + CUDA Fused GDN `in_proj` + Disable Student Radix Cache
- Hypothesis: Baseline rollout (75.772 s) had 55.1% GPU idle time during decode because slime's sglang patch insampler.py:321calledbool(sampling_info.return_top_p_log_probs.any().item())on every decode step, causing 99.4% (797 ms / 802 ms) of all main-threadcudaStreamSynchronizestalls and breakingevent_loop_overlap(~4.25 ms CPU stall/step). Additionally, sampling ran 9 separate[32, 248320]FP32 kernels (~250 us/step), GDN ranin_proj_ba(N=32, 3 blocks) separately onalt_stream, and student radix cache tracked 112 mamba states per 32 requests. - Changes (behind env switches, default OFF): -sglang(bb90a13): -sampling_batch_info.py+sampler.py:SGLANG_OPT_NO_SAMPLER_SYNC=1(CPU boolneed_return_top_p_log_probsmirrorsneed_return_top_p_token_ids, eliminating the per-step.any().item()sync). -sampler.py:SGLANG_OPT_FUSED_SAMPLER=1(2-stage Triton fused Gumbel-Max + exact FP32 logprob kernel in 1 read pass over[B, V],250 us -> 46 us, deterministic TP-shared seed fromserver_args.random_seed+ step counter). -qwen3_5.py:SGLANG_OPT_CUDA_FUSED_GDN_IN_PROJ=1(enables CUDA BF16 fusedin_proj_qkvz + in_proj_bainsidememory_saver_adapter.region(GPU_MEMORY_TYPE_WEIGHTS)for TMS sleep/wake + in-placeupdate_weightssafety; addsprepare_before_cuda_graph_captureforwarding onQwen3_5ForConditionalGeneration). -slime(e1670b30): -slime/ray/serving.py+slime/ray/rollout.py:SLIME_OPT_STUDENT_DISABLE_RADIX=1,SLIME_OPT_STUDENT_CUDA_GRAPH_MAX_BS=48,SLIME_OPT_STUDENT_DISABLE_PREFILL_CG=1(wired inServingClusterso student engines runmamba num: 32without radix state tracking and cut startup by ~150 s). - Negative / break-even directions: -SLIME_OPT_DEFER_TEACHER_RM=1(6b:54.184 svs6a:54.162 s): sped up generation by 1.21 s (41.73s -> 40.52s) but increased teacher tail by 1.23 s (12.43s -> 13.66s) — net break-even; revertedsglang_rollout.pyto keep diff minimal. -ReplaySSM(36.23 us) andCuteDSL(136.88 us) GDN decode backends were slower than baseline Triton (31.97 us) atB=32. - Full 3-Side Verification (/tmp/r6/check_r56/check.json): - Status:PASS, Tier:N1, Projected Full-Step Speedup:1.859x! - Train:[23.366, 23.264, 23.296]-> mean23.309 s(vs72.872 s= 3.126x),mismatch=1.0000,exact: ok,PASS. - Teacher:[13.722, 13.634, 13.581]-> mean13.646 s(vs18.132 s= 1.329x),mean_abs_ratio=1.0052,bias t=-0.092,events p=0.646,PASS. - Rollout:[54.392, 54.043, 54.366]-> mean54.267 s(vs75.772 s= 1.396x;reported_rollout_time53.20 s), token forcingmean_abs_ratio=0.9814,sampler t=2.20,mismatch ratio=1.0004, rollout teachermean_abs_ratio=0.9743,PASS. - Committed:sglang(bb90a13),slime(e1670b30); promoted all Round 2–6 switches to/submission/switches.json.
9.7 hRound 7 — Train: BF16 Triton `FusedVPLogProb` + First-Fit-Decreasing Microbatch Packing (`MAX_TOKENS_PER_GPU=9216`) + Fast 4 GB `update_weights`
- Profile & Hypothesis: Post-R6 train profile (23.309 s) showed: 1._ChunkedLogProbEntropy+Float16ModuleFP32 logits casts took ~1.5 s (12 fwd + 12 bwd TP AllReduces, 4-chunk autograd recompute, 2.03 GB FP32 fwd+bwd casts per microbatch). Using MegatronFloat16Module's nativefp32_output=False+ a 1-pass Triton BF16_FusedVocabParallelLogProbkernel (FP32 online LSE + target gather, 2 tiny AllReduces, zero-grad fast-zero-store in bwd) cuts logprob to ~59 ms/step and saves ~2.5 GB VRAM. 2. With defaultmax_tokens_per_gpu=4096(max_per_bin=8192for CP=2), nearly all 64 samples (~8.4–8.7K tokens each) landed in 1-sample microbatches (64 microbatches/step), leaving FLAchunk_gated_delta_ruleat 48% SM coverage (64 blocks on 132 SMs) and doubling all per-microbatch kernel/NCCL/main_gradlaunches. Repacking DP-local microbatches inactor.pywith First-Fit Decreasing (SLIME_OPT_MAX_TOKENS_PER_GPU=9216->max_per_bin=18432) packs 2 samples per microbatch (64 -> 32microbatches/step), and sorting bins descending by token length puts the peak bin first to cut PyTorch caching allocator fragmentation (peak_res104.3 GB -> 95.4–99.2 GB). 3. Colocatedupdate_weights(0.89 sinMODE=full) used 512 MB buckets (~36 sync IPC round-trips + per-chunkempty_cache()). Raising bucket size to 4 GB and skipping per-chunkempty_cache()(SLIME_OPT_FAST_UPDATE_WEIGHTS=1) cuts IPC round-trips ~8x. - Changes (behind env switches, default OFF, strictlytrainside): -slime(6948da05): -slime/backends/megatron_utils/model.py: passfp32_output=FalsewhenSLIME_OPT_FUSED_LOGPROB=1(bf16/fp16, policy_loss without entropy/top-p/score-centering). -slime/backends/megatron_utils/loss.py: add Triton_vp_logprob_fwd_kernel,_vp_logprob_bwd_kernel,_FusedVocabParallelLogProb(fusedinv_temp+g==0fast zero-store in bwd), dispatch insideget_log_probs_and_entropywhenSLIME_OPT_FUSED_LOGPROB=1. -slime/backends/megatron_utils/actor.py: FFD + descending-size microbatch repacking insidetrain_actorwhenSLIME_OPT_MAX_TOKENS_PER_GPU > 0(DP=1, VPP=1). -slime/backends/megatron_utils/update_weight/{hf_weight_iterator_direct.py,update_weight_from_tensor.py}:SLIME_OPT_FAST_UPDATE_WEIGHTS=1(4 GB buckets + skip per-chunkempty_cache()). - Timing progression (bench.py time --side train): -7a(FUSED_LOGPROB=1+FAST_UPDATE_WEIGHTS=1):22.948 s(3.177x,peak_alloc 74.95 GB,peak_res 82.80 GB,-2.5 GBVRAM vs R6). -7b(+ MAX_TOKENS_PER_GPU=8192, unsortedfirst_fit_pack, 57/64 mbs):21.855 s(3.335x,peak_res 104.30 GB). -7c(+ MAX_TOKENS_PER_GPU=9216, FFD + descending bin sort, 32/32 mbs):17.451 s(4.176x,actor_train_time 16.18 s,403 TFLOPS/GPU,peak_res 95.4–99.2 GB). - Full 3-Side Verification (/tmp/r7/check_7c/check.json): - Status:PASS, Tier:N1, Projected Full-Step Speedup:2.0045x! - Train:[17.603, 17.415, 17.320]-> mean17.446 s(vs72.872 s= 4.177x),update_norm d=-4.3e-5,loss_mean d=5.0e-6,grad_norm_first d=-3.3e-5,cos=0.9622 >= 0.9566,mismatch=0.9959,PASS. - Teacher:[13.696, 13.597, 13.564]-> mean13.619 s(1.331x),PASS. - Rollout:[53.682, 54.490, 54.198]-> mean54.124 s(1.400x),token_forcing mean_abs_ratio=0.9923,sampler t=0.78,PASS. - Full-Loop VRAM Note & Promotion: PromotedSLIME_OPT_FUSED_LOGPROB=1andSLIME_OPT_FAST_UPDATE_WEIGHTS=1immediately to/submission/switches.json(lowersMODE=fullpeak VRAM by ~2.5 GB). HoldingSLIME_OPT_MAX_TOKENS_PER_GPU=9216(post_used105–109 GB train-only) until Round 8 adds teacher idleempty_cache()+ lower--mem-fraction-static(~18 GB freed) and we verifyMODE=fullpeak VRAM comfortably fits under 139.81 GB. ---
9.7 hCurrent Summary (after Round 7)
- Current switches (/submission/switches.json): - Train:SLIME_OPT_SKIP_DEAD_REF=1,SLIME_OPT_REUSE_OPD_LOGPROBS=1,SLIME_OPT_SKIP_DEAD_ENTROPY=1,SLIME_OPT_RECOMPUTE=none,SLIME_OPT_GPU_OPTIMIZER=1,SLIME_OPT_KEEP_OPT_ON_GPU=1,SLIME_OPT_FAST_SLEEP=1,SLIME_OPT_SKIP_DEFAULT_PAUSE=1,SLIME_OPT_SHARD_GDN=1,SLIME_OPT_FUSED_LOGPROB=1,SLIME_OPT_FAST_UPDATE_WEIGHTS=1(SLIME_OPT_MAX_TOKENS_PER_GPU=9216verified PASS incheck_7cat 2.0045x, pending teacher VRAM slimming in R8 for safeMODE=fullpromotion). - Teacher:OPD_TEACHER_SERVER_ARGS="--chunked-prefill-size 16384 --mem-fraction-static 0.15 --disable-radix-cache --disable-cuda-graph --enable-layernorm-sp",SGLANG_OPT_TP_LOCAL_INPUT_LOGPROBS=1,SGLANG_OPT_QWEN35_LAYERNORM_SP=1,SLIME_OPT_POOLED_TEACHER_HTTP=1,SLIME_OPT_TRIM_TEACHER_LOGPROB_START=1. - Rollout:SGLANG_OPT_NO_SAMPLER_SYNC=1,SGLANG_OPT_FUSED_SAMPLER=1,SGLANG_OPT_CUDA_FUSED_GDN_IN_PROJ=1,SLIME_OPT_STUDENT_DISABLE_RADIX=1,SLIME_OPT_STUDENT_CUDA_GRAPH_MAX_BS=48,SLIME_OPT_STUDENT_DISABLE_PREFILL_CG=1. - Latest check:/tmp/r7/check_7c/check.json->PASS(N1, all 3 sides) — Train 4.177x (72.872s -> 17.446s), Teacher 1.331x (18.132s -> 13.619s), Rollout 1.400x (75.772s -> 54.124s), Projected Full-Step Speedup:2.0045x. - Gains by round: - Round 2 (Train dead compute): train72.87s -> 53.84s(1.354x), step 1.141x - Round 3 (Train no-recompute + GPU AdamW + fast sleep): train53.84s -> 34.54s(2.110x), step 1.332x - Round 4 (Train Ulysses AllToAll 4x head-sharded GDN + skip TMS default pause): train34.54s -> 23.31s(3.126x), step 1.470x - Round 5 (Teacher LayerNorm SP + TP-local input logprobs + chunk 16384 + 22.6 GiB): teacher18.13s -> 13.65s(1.329x) - Round 6 (Rollout zero-sync sampler + Triton fused Gumbel-Max + CUDA fused GDNin_proj+ disable student radix): rollout75.77s -> 54.27s(1.396x), combined step1.859x(1.941xrealMODE=full). - Round 7 (Train BF16 TritonFusedVPLogProb+ FFDMAX_TOKENS_PER_GPU=9216+ 4 GBupdate_weights): train23.31s -> 17.45s(4.177x), combined step2.0045x! - Negative directions: - Train: split-Kout_proj+ mergedin_proj_qkvzba+ native GVA failed N1 grad_norm/cos due to L00–L08 sensitivity (replaced with bitwise-exact Ulysses AllToAll). - Teacher: FlashInfertrtllmAR fusion at 4096/8192 slower than NCCL+RMSNorm (replaced withsymm_memLayerNorm SP). - Rollout:SLIME_OPT_DEFER_TEACHER_RM=1was net break-even (54.18svs54.16s);ReplaySSMandCuteDSLGDN decode backends were slower than Triton atB=32;flashinfertinygemm/cudnn/cutileand hand-rolled Stream-Kmmawere slower than cuBLAS in CUDA graphs on Hopper SM90 (28.36 us/3.55 TB/sforgate_up).