Gemini 4 Carbon 2.22×

Harness: Antigravity · switches: OPT_FAST_OPTIM=1 OPT_FUSED_ADAM_BF16=1 OPT_FAST_DDP=1 OPT_DDP_BUCKET_MB=128 OPT_FUSED_RMSNORM=1 OPT_FUSED_SUBLN_SWIGLU=1 OPT_FUSED_LOSS=1 OPT_FUSED_RETENTION=1 OPT_FAST_GRAD_SYNC=1 OPT_MERGED_PROJ=1 OPT_PIPELINED_TAIL=1 OPT_OSS_PIPE_CHUNKS=8 TORCH_NCCL_HIGH_PRIORITY=1 OPT_FAST_KERNELS_V2=1 OPT_DIRECT_DDP_BUCKETS=1 OPT_OSS_IPC_DMA=1 OPT_OSS_IPC_SLICES=28 OPT_IPC_TAPERED=1 OPT_SPARSE_EMB_SYNC=1 OPT_FAST_CUBLASLT=1 OPT_FAST_CUBLASLT_V2=1 OPT_FAST_RMS_BWD_V3=1 OPT_IPC_ALLREDUCE=1 OPT_IPC_AR_CTAS=528 OPT_FUSED_CROSS_QKV=1 OPT_ADAM_READ_G16=1 OPT_SM90_FLASH_RETENTION=1 OPT_VEC_U4_ROPE_PREP=1 OPT_FUSED_CROSS_ATTN=1 OPT_SHARDED_L2NORM=1

API stalls passed the 6 h pause allowance, so the lost time was run as a continuation of the same conversation on the saved submission (105 min); the judged result is the continuation's. The time axis leaves out the held time of both segments.

Judged
2.22×
Tier
N1
Self-best
2.25×
Rounds
14
Hours
10.0
API cost
$113
Input tokens · 95.3% cached
225 M
Output tokens
1.4 M
Requests
760
Cross-GPU exchange via CUDA IPC + copy engine (no SMs)
✓ round 10 OPT_OSS_IPC_DMA, weight exchange as 24 copy-engine slices, optimizer tail 31.65 → 18.25 ms, 1.895× → 2.058×; round 12 OPT_IPC_ALLREDUCE does grad ReduceScatter + AllGather on the copy engine (backward + reduction standalone 54.39 → 46.66 ms), that round with cuBLASLt 2.087× → 2.206× (both full check); still exchanges fp32 master weights
Forward / backward CUDA graph
✗ not in the log; fusion cut main-stream kernels per step from 3,233 (round 4 profile) to 1,017 (round 14)
Newer cuBLAS
✗ no library swap, still PyTorch 2.3.1's bundled cuBLAS 12.1; round 12 OPT_FAST_CUBLASLT bypasses torch.mm to call cuBLASLt with per-shape preselected algorithms, with RMSNorm backward 2.085× → 2.100×; round 13 2×1 cluster for ffn2 forward (4.09 → 3.82 ms)
Retention / attention kernel swap
✓ round 4 OPT_FUSED_RETENTION hand-written CUDA retention (13 layers fwd + bwd standalone 38.90 → 5.76 ms), full check 1.578× → 1.680×; round 14 OPT_SM90_FLASH_RETENTION hand-written sm_90a WGMMA flash retention (standalone 3.91 → 2.68 ms, 624 MB fewer saved activations), that round (four items) full check 2.194× → 2.225×; attention kernel not swapped, only projections and RoPE folded into one autograd node with it
Other main levers
round 1 OPT_FAST_OPTIM (dead zeroing removed, norm on bf16, bidirectional exchange, merged stat sync) → 1.28× (N0); round 2 inline-PTX Adam bitwise-equal to Apex, also writing bf16 → 1.37× (N0); round 3 hand-written CUDA residual + RMSNorm, subln + SwiGLU, cross-entropy, 1.37× → 1.58×; round 6 OPT_MERGED_PROJ shared-storage merged projections, 1.70× → 1.78×; round 9 C++ comm hook + dW written straight into DDP buckets, 1.84× → 1.89×; round 11 embedding grads exchange only the used 12.6 MB (−2.15 ms); round 13 Adam reads bf16 grads
Raw work log16 sections
-8.0 hRound 1: Baseline Profiling & Post-Backward Optimizer / OSS Broadcast Pipeline (`OPT_FAST_OPTIM`)
- Start time: 2026-11-19T19:30:24Z (resumed 2026-11-20T03:12:56Z)
- Baseline Profile (/tmp/r1/profile):
  - Steady-state instrumented step: ~260.2 ms (1.47 s over 5 updates; GPU busy 74.6%, kernel sum 1256.4 ms / 5 updates = 251.3 ms/update).
  - Kernel categories (5 updates): nccl 380.6 ms (30.3%), gemm 327.5 ms (26.1%), memcpy/cast 218.9 ms (17.4%), elementwise 153.5 ms (12.2%), optimizer (multi_tensor) 91.5 ms (7.3%), flash-attention 29.7 ms (2.4%), reduce 19.3 ms (1.5%), triton 13.8 ms (1.1%), jiterator (swiglu) 11.2 ms (0.9%), loss 8.8 ms (0.7%).
  - Single-step GPU timeline (train_step-6, 260.2 ms):
    - zero_grad (p32.grad.zero_()): 4.8 ms (dead store: overwritten before read — *missed fast path*).
    - forward: 59.3 ms (self_decoder 40.1 ms [of which self.mixer GateRetention 26.8 ms, self.ffn 6.5 ms], cross_decoder 15.8 ms [cross.mixer 4.5 ms, cross.ffn 6.4 ms], output_projection 1.6 ms, criterion 1.5 ms).
    - backward + overlapped DDP all_reduce: 103.6 ms.
    - Post-backward clip-grads + optimizer + OSS broadcast + fp32->bf16 sync: 90.9 ms (34.9% of step; 95.7 ms = 36.8% incl. zero_grad):
      - clip-grads (_sync_fp16_grads_to_fp32 240 loop copies + fp32 L2 norm + _check_grad_norms all_reduce/sync): 15.5 ms.
      - _unscale_grads (240 loop mul_ kernels): 12.7 ms.
      - FusedAdamV2.step: 14.5 ms.
      - OSS._broadcast_params (cuda.synchronize() + 2 serial dist.broadcast calls over NV18): 37.1 ms (*configuration/backend bottleneck: half-duplex serial broadcasts*).
      - _sync_fp32_params_to_fp16 (240 loop copy_ kernels + end-of-step .item() metric syncs): 12.2 ms.
- Change (OPT_FAST_OPTIM=1):
  - Eliminate dead p32.grad.zero_() in FP16Optimizer.zero_grad().
  - Compute L2 grad norm directly on bf16 gradients via multi_tensor_total_norm (verified bitwise identical to fp32), fuse bf16 -> fp32 copy + unscale/clip multiply into a single amp_C.multi_tensor_scale call.
  - Replace OSS._broadcast_params (cuda.synchronize() + 2 serial dist.broadcast) with non-blocking full-duplex dist.batch_isend_irecv over bidirectional NV18, overlapping local shard torch._foreach_copy_(my_p16, my_p32) with P2P transfer, followed by torch._foreach_copy_(peer_p16, peer_p32).
  - Pack Trainer._fast_stat_sync_sum into 1 all_reduce returning Python floats and skip redundant _check_grad_norms all_reduce when finite, removing end-of-step GPU syncs and fp64 meter kernels.
  - Expected numerics tier: N0 (bitwise identical).
- Timing result (/tmp/r1/time/time.json):
  - s_per_update: 0.1847 s (vs frozen reference 0.2357 s; windows [1.850, 1.844] s, range 0.003).
  - speedup_vs_frozen_reference: 1.2803x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 61.75 GiB.
- Quick check result (/tmp/r1/quick/check.json):
  - status: PASS, measured_tier: N0, bitwise_identical: 9616 / 9616, exact_failures: 0.
- Commit: promoted OPT_FAST_OPTIM=1 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T03:40:15Z

---
0.1 hRound 2: Profile `OPT_FAST_OPTIM=1` & Eliminate Remaining Copy/DDP/Optimizer Memory Traffic (`OPT_FAST_DDP` + `OPT_FUSED_ADAM_BF16`)
- Start time: 2026-11-20T03:40:20Z
- Profile (/tmp/r2/profile):
  - Instrumented steady-state cycle: 188.64 ms (GPU busy rose from 74.6% -> 81.1%; phase:clip-grads 54.4 ms -> 3.7 ms, phase:optimizer 243.4 ms -> 53.8 ms; all CPU stalls inside forward removed).
  - Kernel categories (5 updates, 1040.9 ms total): gemm 327.3 ms (31.4%), nccl 259.9 ms (25.0%), memcpy/cast 181.9 ms (17.5%), optimizer (multi_tensor) 116.6 ms (11.2%), elementwise 70.2 ms (6.7%), flash-attention 30.0 ms (2.9%), reduce 19.3 ms (1.9%), triton 13.8 ms (1.3%), swiglu 11.4 ms (1.1%), loss 8.8 ms (0.8%).
  - Stream 7 (compute) 1-cycle breakdown (188.64 ms wall):
    - forward+loss: 37.51 ms wall (33.76 ms kernels across 1460 launches; GEMM ~21.4 ms, FlashAttn 1.64 ms, non-GEMM norms/retention/swiglu/loss ~14.5 ms).
    - backward: 98.59 ms wall (85.99 ms kernels across 3459 launches; GEMM ~43.6 ms, FlashAttn ~4.4 ms, Memcpy DtoD 5.21 ms [*missed fast path: DDP gradient_as_bucket_view=False + 25 MB buckets = 119 all_reduces*], non-GEMM elementwise/norms/retention ~45 ms).
    - clip-grads: 3.88 ms wall (2.86 ms L2NormFunctor<bf16>).
    - optimizer+sync: 48.67 ms wall (14.23 ms FusedAdam [82 launches], 12.78 ms direct_copy_kernel [*missed fast path: torch._foreach_copy_(bf16, fp32) falls back to a 240-kernel loop for mixed dtypes, and contends with NVLink P2P*], 6.20 ms ScaleFunctor [165 launches], 21.19 ms P2P SendRecv).
- Action: Built yoco_cuda_ext (sm_90) single-launch vectorized fused_adam_bf16 (inline-PTX matching Apex AdamFunctor SASS bit-for-bit, verified max_diff=0.0, writes my_p16 inside Adam eliminating 6.9 GB HBM re-read + P2P bandwidth contention) + single-launch fp32->bf16 copy for peer_p16 + single-launch bf16->fp32 grad scale, plus DDP gradient_as_bucket_view=True and OPT_DDP_BUCKET_MB=100 (OPT_FAST_DDP=1).
- Timing result (/tmp/r2/time/time.json):
  - s_per_update: 0.1729 s (windows [1.728, 1.729] s, range 0.0006).
  - speedup_vs_frozen_reference: 1.3677x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 61.75 GiB (reserved: 62.24 GiB, down from 63.31 GiB).
- Full check verdict (/tmp/r2/check/check.json):
  - status: PASS, performance.speedup: 1.37x (0.1726 s/update vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (1.37 > 1.0398). Gate 2: PASS (N0, 9616 / 9616 tensors bitwise identical). Gate 3: PASS (equivalent, all 6 trajectory endpoints within 3σ).
- Commit: 85c7af2 — promoted OPT_FUSED_ADAM_BF16=1, OPT_FAST_DDP=1, OPT_DDP_BUCKET_MB=100 to /submission/switches.json.
- End time: 2026-11-20T04:06:57Z

---
0.6 hRound 3: Profile `1.37x` Tree & Fuse Norms + Residuals + SubLN-SwiGLU + Cross-Entropy (`OPT_FUSED_RMSNORM`, `OPT_FUSED_SUBLN_SWIGLU`, `OPT_FUSED_LOSS`)
- Start time: 2026-11-20T04:06:57Z
- Profile (/tmp/r3/profile):
  - Host time per update: 0.174 s (GPU busy 79.2%, kernel sum 916.7 ms over 5 updates = 183.3 ms/update).
  - Kernel categories (5 updates): gemm 322.3 ms (35.2%), nccl 230.8 ms (25.2%), memcpy/cast 129.0 ms (14.1%), optimizer 78.3 ms (8.5%), elementwise 70.1 ms (7.6%), flash-attention 31.7 ms (3.5%), reduce 18.7 ms (2.0%), triton 13.8 ms (1.5%), swiglu 10.7 ms (1.2%), loss 8.9 ms (1.0%).
  - Top remaining hotspot class: ~1,550 memory-bound forward/backward kernels per update across 54 affine RMSNorms + 52 residual adds (~25+ ms/upd), 13 GateRetention (cross + inner) + subln + transpose + swiglu chains (~5 ms/upd), and CrossEntropyCriterion fp32 log_softmax + nll_loss (~3 ms/upd + 2.46 GB traffic).
- Action:
  - Added deterministic sm_90 CUDA kernels in csrc_ext/model_kernels.cu (compiled without --use_fast_math for IEEE-754 fp32 accuracy; verified against fp64 gold):
    1. OPT_FUSED_RMSNORM=1: fused_rms_norm_fwd / _bwd (fuses pre-norm residual add + RMSNorm, plus parallel kv_layer_norm + layers[0].mixer_layer_norm at CrossDecoder entry, deterministic 2-stage dw reduction without atomics, cached rel_pos). Microbenchmark: 53× fwd+bwd = 2.95 ms.
    2. OPT_FUSED_SUBLN_SWIGLU=1: fused_add_subln_swiglu_fwd / _bwd (warp-shuffle register kernel fusing cross + inner, subln(128), .transpose(1, 2), and swiglu(g, o)). Microbenchmark: 13× fwd+bwd = 0.50 ms.
    3. OPT_FUSED_LOSS=1: fused_cross_entropy_fwd / _bwd (online-softmax directly on [2048, 100288] bf16 logits without materializing fp32 lprobs). Microbenchmark: 1× fwd+bwd = 0.42 ms.
  - Expected numerics tier: N1 (deterministic, unchanged dtypes/accumulation precision).
- Timing result (/tmp/r3/time/time.json):
  - s_per_update: 0.1494 s (windows [1.494, 1.494] s, range 0.0003).
  - speedup_vs_frozen_reference: 1.5828x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.84 GiB (down from 61.75 GiB!).
- Full check verdict (/tmp/r3/check/check.json):
  - status: PASS, performance.speedup: 1.5775x (0.1499 s/update vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (1.5775 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0). Gate 3: PASS (equivalent, max endpoint drift 0.405σ <= 3.0σ).
- Commit: promoted OPT_FUSED_RMSNORM=1, OPT_FUSED_SUBLN_SWIGLU=1, OPT_FUSED_LOSS=1 to /submission/switches.json and committed to /submission/yoco.
- End time: 2026-11-20T04:29:30Z

---
1.0 hRound 4: Profile `1.58x` Tree & Full CUDA Fusion of `GateRetention` + Interleaved RoPE (`OPT_FUSED_RETENTION`)
- Start time: 2026-11-20T04:29:40Z
- Profile (/tmp/r4/profile):
  - Host time per update: 0.150 s (GPU busy 70%, kernel sum 832.1 ms over 5 updates = 166.4 ms/update).
  - Kernel categories (5 updates): gemm 333.0 ms (40.0%), nccl 244.3 ms (29.4%), optimizer 78.3 ms (9.4%), memcpy/cast 60.4 ms (7.3%), elementwise 35.3 ms (4.2%), flash-attention 32.8 ms (3.9%), other 16.9 ms (2.0%), triton 14.1 ms (1.7%), swiglu 11.3 ms (1.4%), reduce 5.7 ms (0.7%).
  - Single-step timeline (train_step-6, 149.67 ms GPU cycle):
    - forward + loss: 28.61 ms (self_decoder 15.62 ms [self.mixer GateRetention 9.37 ms GPU, 32.33 ms CPU vs cross.mixer FlashAttn 3.65 ms GPU], cross_decoder 10.06 ms, output_projection + loss 1.86 ms).
    - backward + DDP: 75.92 ms (~47.1 ms GEMMs, ~4.9 ms FlashAttn bwd, ~21.8 ms unfused GateRetention elementwise/strided-copy/RoPE/cumsum/Triton ops + norms/SwiGLU).
    - post-backward: 45.14 ms (1.57 ms CPU-sync/launch gap + 3.30 ms L2NormFunctor [165 launches] + 0.69 ms .item() sync + 5.19 ms bf16->fp32 grad scale + 12.79 ms fused_adam_bf16 + 19.14 ms OSS P2P + 2.44 ms fp32->bf16 peer copy).
  - Screened multi-chunk pipelining of Adam + OSS P2P (K = 2..12 chunks, TORCH_NCCL_HIGH_PRIORITY=1, and CUDA IPC CE DMA): fused_adam_bf16 already sustains 4,013 GB/s (95% of Hopper's 4,242 GB/s HBM bandwidth), so overlapping P2P with Adam saves only 1.2–1.9 ms due to HBM bandwidth contention; deferred in favor of GateRetention fusion (33.1 ms microbenchmark savings).
- Action (OPT_FUSED_RETENTION=1):
  - Implemented deterministic sm_90 CUDA kernels in csrc_ext/model_kernels.cu and FusedGateRetentionFn / FusedInterleavedRoPEFn in fused_ops.py:
    1. fused_gt_cumsum_fwd/bwd: fuses gt transpose + logsigmoid(gt)/16 + fp32 prefix/suffix scan + cross_decay.
    2. fused_qkv_rope_scale_fwd/bwd: single warp-per-head uint2 vectorized kernel fusing q, k interleaved RoPE, k * 128**-0.5, transpose to contiguous [B, H, N_c, 256, 128], and q_scaled/v_scaled exponential decay scaling (plus deterministic dg_qv warp reduction in bwd).
    3. fused_chunk_recurrent_fwd/bwd & fused_inner_mask_fwd/bwd: replaces Triton recurrence + @torch.compile inner_chunk causal decay mask (zero cold-compile overhead, zero atomics via 4-strip register column accumulation + warp row reduction).
    4. fused_rope_interleaved: replaces Triton rotary_kernel in CrossAttention and CrossDecoder (max_diff = 0.0 bitwise identical).
  - Standalone check (test_fused_retention.py): 100% bitwise deterministic across runs; dk/dgt closer to fp64 gold than upstream; 13× GateRetention core fwd+bwd dropped from 38.90 ms -> 5.76 ms (-33.14 ms).
  - Expected numerics tier: N1 (deterministic, unchanged dtypes/accumulation precision).
- Timing result (/tmp/r4/time/time.json):
  - s_per_update: 0.1415 s (windows [1.415, 1.415] s, range 0.0006; check cand run: 0.1408 s, windows [1.406, 1.409] s).
  - speedup_vs_frozen_reference: 1.6712x (check: 1.6795x, beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.38 GiB (down from 58.84 GiB; 3.37 GiB below reference 61.75 GiB).
- Full check verdict (/tmp/r4/check/check.json):
  - status: PASS, performance.speedup: 1.6795x (0.1408 s/update vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (1.6795 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true). Gate 3: PASS (equivalent, max endpoint drift 0.124σ <= 3.0σ).
- Commit: promoted OPT_FUSED_RETENTION=1 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T05:05:30Z

---
1.6 hRound 5: Profile `1.68x` Tree & Optimize DDP Gradient Reduction / Single-Launch L2Norm / Deferred Stat Sync (`OPT_FAST_GRAD_SYNC`)
- Start time: 2026-11-20T05:05:35Z
- Profile (/tmp/r5/profile):
  - Host time per update: 0.143 s (GPU busy rose from 70% -> 79%; Stream 7 kernel launches/update dropped from 3,233 -> 2,258; CPU forward dropped from 43.97 ms -> 21.83 ms; self_decoder GPU fwd dropped from 15.62 ms -> 12.95 ms).
  - Kernel categories (5 updates): gemm 334.6 ms (42.0%), nccl 238.3 ms (29.9%), optimizer 78.9 ms (9.9%), memcpy/cast 39.6 ms (5.0%), flash-attention 33.1 ms (4.2%), elementwise 30.3 ms (3.8%), other 27.6 ms (3.5%), swiglu 11.4 ms (1.4%), reduce 3.3 ms (0.4%).
  - Top remaining gradient-sync / norm waste identified from trace:
    1. **DDP post-AllReduce / world_size (* 0.5) loop**: 240 AUnaryFunctor<bf16, Mul> launches per update (22.89 ms / 5 = 4.58 ms/update, 13.8 GB HBM traffic during backward) dividing every parameter's bf16 gradient by 2, immediately undone by Trainer.train_step multiplying by 2.0 / sample_size.
    2. Post-backward host sync + 165-launch multi_tensor_l2norm: _fast_stat_sync_sum .cpu() blocked CPU until GPU finished backward + DDP, leaving GPU idle for 1.22 ms while CPU launched 165 L2NormFunctor kernels (3.42 ms), followed by a second .item() sync (0.68 ms idle gap).
- Action (OPT_FAST_GRAD_SYNC=1):
  - Registered a DDP SUM communication hook (dist.ReduceOp.SUM without / world_size) and folded / world_size into FP16Optimizer.multiply_grads ((2.0 / 4096) / 2.0 = 1.0 / 4096), eliminating all 240 AUnaryFunctor kernels (4.6 ms/update).
  - Added deterministic uint4-vectorized l2norm_bf16_part_kernel + fp64 l2norm_final_reduce_kernel (run_l2norm_bf16_plan in yoco_cuda_ext, reusing _opt_scale_plan) replacing Fairseq's 165-launch multi_tensor_l2norm.
  - Deferred _fast_stat_sync_sum .cpu() via _PendingSyncState / _DeferredVal so run_l2norm_bf16_plan is enqueued onto Stream 7 ~42 ms ahead of backward completion, merging stat_buf + norm_out_f64 into a single .cpu() transfer.
  - Expected numerics tier: N1 (N0 relative to Round 4 except fp64 final sum in L2 norm, which is closer to fp64 gold than Apex fp32 sum).
- Timing result (/tmp/r5/time/time.json):
  - s_per_update: 0.1389 s (windows [1.389, 1.388] s, range 0.0008, 29,498.9 tokens/s).
  - speedup_vs_frozen_reference: 1.7024x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.38 GiB.
- Gate 0 + Gate 3 check (/tmp/r5/n1/check.json):
  - status: PASS, verdict: equivalent (all 6 trajectory endpoints within 3σ; loss_u005_015 = 0.0055σ, max 1.42σ).
- Commit: promoted OPT_FAST_GRAD_SYNC=1 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T05:21:40Z

---
1.8 hRound 6: Profile `1.70x` Tree & Shared-Storage Merged Projections + Fused Packed SwiGLU (`OPT_MERGED_PROJ`)
- Start time: 2026-11-20T05:21:45Z
- Profile (/tmp/r6/profile):
  - Host time per update: 0.140 s (GPU busy 78%; l2norm_bf16_part_kernel dropped to 7.51 ms / 5 = 1.50 ms/update in 1 launch vs 14.99 ms / 5 = 3.00 ms across 165 launches).
  - Trace finding on Python register_comm_hook: PyTorch DDP's Python comm-hook path copied fut.value()[0] back into all 240 .grad tensors (Memcpy DtoD jumped from 0.11 ms -> 18.32 ms / 5 = 3.66 ms/update) and made loss.backward() wait on CPU until the last nccl:all_reduce (1.28 ms idle gap). Gated Python register_comm_hook off (OPT_DDP_SUM_HOOK) while keeping l2norm_bf16_plan + _PendingSyncState.
  - Top remaining compute/launch bottleneck class:
    - gemm: 333.8 ms / 5 = 66.76 ms/update across 529 GEMM launches/update (2 split GEMMs [fc1, gate] in all 26 FFN layers, 5 split GEMMs [q, k, v, g, gt] in all 13 GateRetention layers, 2 split GEMMs [k_proj, v_proj] in CrossDecoder), plus 79 CUDAFunctor_add (aten::add_) launches summing dx across split projections, 52 jiterator swiglu launches (1.82 ms/upd), and 394 dummy Megatron mp_size=1 autograd nodes.
- Action (OPT_MERGED_PROJ=1):
  - Added pack_shared_projection_buffers in opt_runtime.py (invoked after model.to(device) and before DistributedDataParallel), backing (fc1.weight, gate.weight) with contiguous [16384, 3072] storage, (q, k, v, g, gt) weights with contiguous [12312, 3072] storage, and CrossDecoder (k_proj, v_proj) weights with contiguous [2048, 3072] storage while keeping every nn.Parameter name, shape, dtype, alignment, and YocoAdapter._trainable_sha 100% unchanged.
  - Added uint4-vectorized fused_packed_swiglu_fwd / _bwd and packed-row fused_retention_packed_prep_fwd / fused_add_subln_swiglu_packed_bwd / fused_retention_packed_prep_bwd in csrc_ext/model_kernels.cu (eliminating 237 GEMM launches, 79 dx add_ kernels, 52 jiterator SwiGLU launches, all torch.cat/split copies, and 394 Megatron mp=1 autograd nodes per update).
  - Verified on 4-layer YOCO model (out rel_L2 = 3.04e-3, worst param grad rel_L2 = 7.23e-3). Expected numerics tier: N1.
- Timing result (/tmp/r6/time/time.json):
  - s_per_update: 0.1335 s (windows [1.335, 1.334] s, range 0.001; check cand run: 0.1330 s, windows [1.331, 1.330] s, 30,791.8 tokens/s).
  - speedup_vs_frozen_reference: 1.7713x (check: 1.7780x, beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.38 GiB.
- Full check verdict (/tmp/r6/check/check.json):
  - status: PASS, performance.speedup: 1.7780x (0.1330 s/update vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (1.778 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true). Gate 3: PASS (equivalent, loss_u005_015 = 0.003σ, loss_u100_200 = 0.194σ, max 0.72σ <= 3.0σ).
- Commit: promoted OPT_MERGED_PROJ=1 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T05:44:30Z

---
2.2 hRound 7: Profile `1.78x` Tree & Pipelined Post-Backward Tail (`OPT_PIPELINED_TAIL`)
- Start time: 2026-11-20T05:44:35Z
- Profile (/tmp/r7/profile):
  - Host time per update: 0.133–0.135 s (GPU busy 79%; Stream 7 launches/update down to 1,542; gemm dropped from 333.8 ms -> 312.1 ms [aten::mm 2,775 -> 1,590], CUDAFunctor_add 5.46 ms -> 0.71 ms, CPU forward 22.26 ms -> 15.56 ms, CPU backward 65.88 ms -> 51.41 ms).
  - Trace findings on the exposed 43.1 ms post-backward tail ([126.4, 169.5] ms):
    1. torch.tensor(cpu_vals, dtype=torch.float64, device=self.device) in fast_stat_sync_sum performed a pageable HtoD copy calling cudaStreamSynchronize (55.9 ms CPU block!), causing a 1.22 ms GPU idle gap ([126.61, 127.82] ms) before l2norm_bf16_part_kernel.
    2. Syncing norm_out_f64 to CPU before launching bf16_to_fp32_scale_vec_kernel caused a 0.71 ms GPU idle gap ([129.34, 130.05] ms).
    3. fused_adam_bf16 (12.78 ms) -> OSS P2P (19.05 ms) -> fp32_to_bf16 peer copy (2.44 ms) ran sequentially (34.27 ms).
- Action (OPT_PIPELINED_TAIL=1, OPT_OSS_PIPE_CHUNKS=8, TORCH_NCCL_HIGH_PRIORITY=1):
  - Replaced pageable torch.tensor(cpu_vals, device=...) with a 2-slot pinned-memory HtoD ring buffer (non_blocking=True), removing the 55.9 ms cudaStreamSynchronize CPU block and 1.22 ms idle gap.
  - Added run_l2norm_and_scale_bf16_plan (l2norm_final_reduce_and_scale_kernel + bf16_to_fp32_scale_gpu_kernel, verified 0.0 bit difference vs separate CPU-scaled plan) so l2norm + clip-scale + bf16->fp32 grad cast are all enqueued onto Stream 7 ~56 ms ahead of backward completion, before .cpu() runs (0.71 ms idle gap eliminated).
  - Implemented 8-chunk pipelined Adam + OSS P2P + PeerCopy, overlapping P2P[0..6] with Adam[1..7] and overlapping peer_copy[0..6] (2.14 ms) with P2P[7].
  - Expected numerics tier: N1 (N0 0.0-bit difference relative to Round 6).
- Timing result (/tmp/r7/time/time.json):
  - s_per_update: 0.1307 s (windows [1.307, 1.306] s, range 0.0006; check cand run: 0.1299 s, windows [1.298, 1.300] s, 31,534.1 tokens/s).
  - speedup_vs_frozen_reference: 1.8093x (check: 1.8204x, beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.38 GiB.
- Full check verdict (/tmp/r7/check/check.json):
  - status: PASS, performance.speedup: 1.8204x (0.1299 s/update vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (1.8204 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1268 / 9616 identical — exact same tensor sketches as Round 6). Gate 3: PASS (equivalent, loss_u005_015 = 0.0016σ, max 1.11σ <= 3.0σ).
- Commit: promoted OPT_PIPELINED_TAIL=1, OPT_OSS_PIPE_CHUNKS=8, TORCH_NCCL_HIGH_PRIORITY=1 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T06:06:30Z

---
2.6 hRound 8: Profile `1.82x` Tree, Async Early DtoH Sync & Occupancy/Vectorized Bwd Kernels (`OPT_FAST_KERNELS_V2`)
- Start time: 2026-11-20T06:06:35Z
- Profile (/tmp/r8/profile):
  - Steady-state step: 130.18 ms (forward+loss 23.5 ms, backward+DDP 67.7 ms, clip+scale+Adam+OSS+PeerCopy 35.7 ms).
  - Concrete bottlenecks identified in /tmp/r8/profile:
    1. 1.61 ms GPU idle gap ([126.34, 127.96] ms) before fused_adam_bf16_kernel: torch.cat([pending.buf, norm_out_f64]).cpu() was enqueued on Stream 7 *after* bf16_to_fp32_scale_gpu_kernel (5.19 ms), delaying CPU wakeup until bf16_to_fp32_scale finished.
    2. Low SM occupancy in fused_rms_norm_bwd (10.96 + 1.59 = 12.55 ms / 5 = 2.51 ms/update): G = 128 blocks on 132 SMs left 4 SMs idle at 12.5% occupancy (1 block/SM), and reduce_dw_rows_kernel launched only 12 blocks (2 launches for parallel w, w1).
    3. Scalar bf16 loads/stores in fused_inner_mask_bwd_kernel (4.77 ms / 5 = 0.95 ms/update vs 0.20 ms/update fwd).
- Action (OPT_FAST_KERNELS_V2=1):
  - Split run_l2norm_reduce_for_scale_plan + run_bf16_to_fp32_scale_gpu_plan in csrc_ext/yoco_cuda_ext.cu and recorded norm_ready_ev on Stream 7 in yoco/opt_runtime.py so a high-priority dtoh_stream copies pending.buf + norm_out_f64 to pinned host memory while bf16_to_fp32_scale_gpu_kernel executes concurrently (0.0-bit diff vs run_l2norm_and_scale_bf16_plan, waking CPU 5.2 ms earlier and eliminating the 1.61 ms idle gap).
  - Raised fused_rms_norm_bwd grid cap G = 128 -> 512 (4 blocks/SM on 132 SMs) and added 192-block float4/uint2 reduce_dw_rows_vec4_kernel fusing (dw, dw1) reduction (39.9 us -> 29.4 us in standalone microbench, 100% deterministic).
  - Added uint2-vectorized fused_inner_mask_bwd_vec_kernel (75.2 us -> 36.3 us, 2.07x faster, 0.0 diff on d_attn, 100% deterministic).
  - Expected numerics tier: N1.
- Timing result (/tmp/r8/time/time.json):
  - s_per_update: 0.1277 s (windows [1.274, 1.280] s, 32,067.1 tokens/s).
  - speedup_vs_frozen_reference: 1.8518x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.38 GiB.
- Full check verdict (/tmp/r8/check/check.json):
  - status: PASS, performance.speedup: 1.8417x (0.1284 s/update, 31,905.8 tokens/s vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (1.8417 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1272 / 9616 identical). Gate 3: PASS (equivalent, loss_u005_015 = -0.010σ, loss_u025_035 = 0.005σ, max 0.99σ <= 3.0σ).
- Commit: promoted OPT_FAST_KERNELS_V2=1 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T06:37:00Z

---
4.3 hRound 9: Profile `1.85x` Tree, C++ `NoDivAllReduceCommHook`, Zero-Copy Direct-to-DDP-Bucket `dW` & Deterministic Scaled Embedding (`OPT_DIRECT_DDP_BUCKETS`)
- Start time: 2026-11-20T06:39:35Z
- Profile (/tmp/r9/profile):
  - Steady-state step: 127.82 ms (GPU clip-grads -> Optimizer.step idle gap reduced to 0.00 ms by Round 8's dtoh_stream).
  - Concrete bottlenecks identified in /tmp/r9/profile:
    1. 4.80 ms/update (242 calls/step = 24.03 ms / 5 on Stream 7 + 1.11 ms CPU) in AUnaryFunctor (torch::distributed::reducer::mul_out): DDP's mark_variable_ready_dense multiplied all 240 freshly-allocated bf16 parameter gradients by 0.5 (1 / world_size) while copying them into DDP buckets, right on the 100%-busy Stream 7 critical path.
    2. 0.91 ms/update (4.55 ms / 5) in VocabParallelEmbedding (mp=1 redundant <0 / >=V masks + masked_fill + 0.36 ms FillFunctor zeroing a temporary 616 MB embed_tokens grad tensor + 0.37 ms mul_out right before the final 2.07 ms embed_tokens AllReduce).
- Action (OPT_DIRECT_DDP_BUCKETS=1, OPT_DDP_BUCKET_MB=128):
  - Added csrc_ext/ddp_ext.cpp: pure C++ NoDivAllReduceCommHook (c10d::CppCommHookInterface, zero Python/GIL overhead) + align_and_get_ddp_bucket_views ordering DDP buckets by Rank-0-synced reducer.get_backward_stats() (so output_projection 616 MB stays in Bucket 0 at the start of backward) while keeping merged groups ([fc1, gate], [q, k, v, g, gt], [k, v]) contiguous inside 128 MiB buckets.
  - Updated FusedMergedFFNFn, FusedMergedGateRetentionFn, FusedMergedKVFn, FusedRMSNormFn (fused_rms_norm_bwd_out), and new FusedDirectLinearFn (CrossAttention, output_projection) to write dW directly into out=bucket_view, assign p.grad = bucket_view, and return None to autograd (eliminating all 240 reducer::mul_out kernels, 0 Memcpy DtoD, 0 AccumulateGrad clones, and saving 0.77 GiB reserved memory).
  - Added deterministic zero-atomic fused_scaled_embedding_fwd + fused_scaled_embedding_bwd (shared-memory bitonic sort of 2048 (token, pos) pairs + fp32 unique-run scatter directly into embed_tokens DDP bucket view).
  - Expected numerics tier: N1.
- Timing result (/tmp/r9/time/time.json):
  - s_per_update: 0.1252 s (windows [1.246, 1.257] s, 32,728.0 tokens/s).
  - speedup_vs_frozen_reference: 1.8887x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.17 GiB (peak_memory_reserved_gib: 58.66 GiB).
- Full check verdict (/tmp/r9/check/check.json):
  - status: PASS, performance.speedup: 1.8948x (0.1248 s/update, windows [1.245, 1.251] s, 32,831.7 tokens/s vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (1.8948 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1269 / 9616 identical). Gate 3: PASS (equivalent, loss_u005_015 = -0.031σ, loss_u015_025 = 0.052σ, max 0.74σ <= 3.0σ).
- Commit: promoted OPT_DIRECT_DDP_BUCKETS=1, OPT_DDP_BUCKET_MB=128 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T07:52:00Z

---
4.9 hRound 10: Profile `1.895x` Tree & 24-Slice NVLink Hardware Copy Engine IPC DMA Pipeline (`OPT_OSS_IPC_DMA`)
- Start time: 2026-11-20T07:53:00Z
- Profile (/tmp/r10/profile):
  - Steady-state step: 124.92 ms (backward finished at 119.41 ms with 0 reducer::mul_out and 0 Memcpy DtoD).
  - Concrete bottleneck identified in /tmp/r10/profile:
    - 31.65 ms/update ([126.15, 157.80] ms) in Adam + NCCL SendRecv + PeerCopy tail:
      1. SM Contention: NCCL SendRecv kernels occupied streaming multiprocessors concurrently with memory-bound fused_adam_bf16_kernel (41 GB HBM traffic) and fp32_to_bf16_kernel (10.3 GB HBM traffic), stretching fused_adam_bf16 from ~13.5 ms solo to 24.85 ms (124.25 ms / 5).
      2. Whole-Parameter Tail Skew: output_projection (308M elems = 1.23 GB) could not split across OSS chunks, creating a single 479M-element final chunk (6.8 ms unoverlapped tail after Adam finished).
- Action (OPT_OSS_IPC_DMA=1, OPT_OSS_IPC_SLICES=24):
  - Replaced NCCL SM-based SendRecv in the OSS tail with 24 equal-element (~72M fp32 elems = 287 MB) NVLink Hardware Copy Engine DMA slices (cudaMemcpyPeerAsync on dedicated dma_stream + interprocess cudaIpcEventHandle_t ring synchronization in csrc_ext/yoco_cuda_ext.cu, using cuMemGetAddressRange_v2 via libcuda.so.1 + cudaIpcGetMemHandle and atexit oss_ipc_cleanup for zero PyTorch IPC destructor warnings):
    1. All 132 Hopper SMs stay 100% dedicated to fused_adam_bf16_kernel + fp32_to_bf16_kernel on Stream 7 while NVLink Copy Engines push updated fp32 master slices directly into the peer's peer_buf in parallel (0 SMs used for communication).
    2. Arbitrary contiguous sub-slice boundaries split 308M-element embeddings/LM-head cleanly across slices (287 MB tail instead of 1.92 GB), cutting standalone 2-GPU tail wall time from 31.65 ms -> 18.25 ms/step (-13.40 ms/update) with 0.0-bit difference vs Round 9.
  - Expected numerics tier: N1 (0.0-bit diff relative to Round 9).
- Timing result (/tmp/r10/time/time.json):
  - s_per_update: 0.1157 s (windows [1.157, 1.157] s, range 0.0005, 35,399.3 tokens/s).
  - speedup_vs_frozen_reference: 2.0438x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.17 GiB (peak_memory_reserved_gib: 58.66 GiB).
- Full check verdict (/tmp/r10/check/check.json):
  - status: PASS, performance.speedup: 2.0581x (0.1149 s/update, windows [1.149, 1.148] s, median 0.1146 s, 35,660.3 tokens/s vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (2.0581 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1269 / 9616 identical — exact same tensor sketches as Round 9). Gate 3: PASS (equivalent, loss_u005_015 = -0.038σ, loss_u015_025 = +0.0016σ, max 0.50σ <= 3.0σ).
- Commit: promoted OPT_OSS_IPC_DMA=1, OPT_OSS_IPC_SLICES=24 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T08:28:00Z

---
5.5 hRound 11: Profile `2.058x` Tree, Bitwise-Exact 2-Rank NVLink IPC Sparse Embedding Sync & Tapered IPC Schedule (`OPT_SPARSE_EMB_SYNC`, `OPT_IPC_TAPERED`)
- Start time: 2026-11-20T08:30:10Z
- Profile (/tmp/r11/profile):
  - Steady-state GPU step ([emb_fwd[1] -> emb_fwd[2]]): 113.98 ms (Stream 7 busy 106.64 ms, non-S7 / wait 7.35 ms).
  - Concrete bottlenecks identified in /tmp/r11/profile:
    1. 2.35 ms/update unoverlapped critical path at the end of backward (+60.24..+62.78 ms): FillFunctor<BFloat16> zeroed all 616 MB (100,288 × 3,072) of embed_tokens.weight._opt_bucket_view (0.363 ms), followed by sort + scatter (0.183 ms), and then Stream 7 stalled completely idle for 1.992 ms waiting for ncclDevKernel_AllReduce_Sum_bf16 on embed_tokens.weight's 616 MB DDP bucket (1.979 ms on Stream 18) even though at most 2 × 2,048 = 4,096 rows (<= 25 MB) are active per update.
    2. 0.65 ms/update startup + tail drain bubbles in uniform 24-slice OSS IPC DMA (+69.53..+89.31 ms): dma_stream waited 0.521 ms for Slice 0 (287 MB) of Adam to finish before starting NVLink DMA, and Stream 7 waited 0.12 ms at the end for Slice 23 fp32_to_bf16.
- Action (OPT_SPARSE_EMB_SYNC=1, OPT_IPC_TAPERED=1, OPT_OSS_IPC_SLICES=28):
  - Implemented EmbIpcEngine (csrc_ext/yoco_cuda_ext.cu + csrc_ext/model_kernels.cu + csrc_ext/ddp_ext.cpp):
    1. zero_dirty_embedding_rows_kernel zeros only the previous step's <= 4,096 dirty rows (~0.01 ms vs 0.363 ms), and pack_emb_ipc_kernel + NVLink Copy Engine cudaMemcpyAsync exchanges each rank's (indices [2048], dy [2048, 3072]) (12.60 MB = 0.034 ms vs 616 MB = 1.98 ms) concurrently with SelfDecoder[0]'s AllReduce.
    2. sort_tokens_bitonic_2rank_kernel (4096 pairs in shared memory) + scatter_sorted_embedding_2rank_bwd_kernel computes bf16(acc_rank0) + bf16(acc_rank1) directly into embed_tokens.weight._opt_bucket_view (0-bit difference vs 2-rank bf16 AllReduce verified across 5 steps in standalone 2-GPU test; 2.648 ms -> 0.494 ms, -2.15 ms/step), and arm_nodiv_skip_bucket makes NoDivAllReduceCommHook::runHook return a pre-completed Future(buf) skipping the 616 MB AllReduce.
  - Added OPT_IPC_TAPERED=1 (28 slices with [0.22 .. 0.84, 1.0 x 18, 0.22] ramp) so dma_stream starts NVLink P2P 0.40 ms earlier with zero mid-stream underflow (0.0-bit diff; alone improved time from 0.1157 -> 0.1149 s, and with OPT_SPARSE_EMB_SYNC=1 bound to YOCO.embed_tokens.weight reached 0.1134 s).
  - Expected numerics tier: N1 (0.0-bit diff relative to Round 10).
- Timing result (/tmp/r11/time/time.json):
  - s_per_update: 0.1134 s (windows [1.132, 1.136] s, median 0.1132 s, 36,112.8 tokens/s).
  - speedup_vs_frozen_reference: 2.0853x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 58.22 GiB (peak_memory_reserved_gib: 58.71 GiB).
- Full check verdict (/tmp/r11/check/check.json):
  - status: PASS, performance.speedup: 2.0871x (0.1133 s/update, windows [1.130, 1.135] s, 36,161.4 tokens/s vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (2.0871 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1269 / 9616 identical — exact same tensor sketches as Round 10). Gate 3: PASS (equivalent, loss_u005_015 = +0.0024σ, loss_u015_025 = +0.029σ, max 0.67σ <= 3.0σ).
- Commit: promoted OPT_SPARSE_EMB_SYNC=1, OPT_IPC_TAPERED=1, OPT_OSS_IPC_SLICES=28 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T09:03:30Z

---
7.1 hRound 12: Profile `2.087x` Tree, Direct Tuned `cuBLASLt` GEMM/BMM Dispatch, 384-Thread `RMSNorm` Bwd & Zero-SM NVLink Copy-Engine DDP `AllReduce` (`OPT_FAST_CUBLASLT`, `OPT_FAST_RMS_BWD_V3`, `OPT_IPC_ALLREDUCE`)
- Start time: 2026-11-20T09:04:00Z
- Profile (/tmp/r12/profile):
  - Steady-state GPU step ([emb_fwd[1] -> emb_fwd[2]]): 111.26 ms (Stream 7 busy 106.39 ms = 95.62%).
  - Concrete bottlenecks identified in /tmp/r12/profile:
    1. 40.23 ms/update (54x, grid=[24,1,1]) high-priority ncclDevKernel_AllReduce_Sum_bf16 SM contention with backward Stream-K GEMMs: 24 high-priority NCCL CTAs occupied 18.2% of the 132 Hopper SMs throughout backward, stalling 132-CTA persistent/Stream-K sm90_xmma_gemm kernels (14.67 ms concurrent vs 9.31 ms solo on ret_dx + ffn1_dx alone, and 54.39 ms vs 40.07 ms solo across all 212 backward GEMMs).
    2. 65.16 ms/update (318x 2D GEMMs) + 3.18 ms/update (156x cutlass_80 BMMs): PyTorch 2.3.1's torch.mm used a 32 MiB workspace with heuristic #0 and ATen .t() dispatch, and torch.bmm dispatched sm80 cutlass_80 kernels instead of Hopper sm90 strided-batched cuBLASLt kernels.
    3. 1.51 ms/update (53x) fused_rms_norm_bwd_kernel: 512-thread loop over N=3072.
- Action (OPT_FAST_CUBLASLT=1, OPT_FAST_RMS_BWD_V3=1, OPT_IPC_ALLREDUCE=1):
  - Created csrc_ext/cublaslt_ext.cpp (cublaslt_mm & cublaslt_bmm) with persistent per-device 128 MiB workspace, cached cublasLtMatmul descriptors, and pre-verified deterministic Hopper sm90 heuristic indices across all 18 2D GEMM shapes and 6 strided-batched GateRetention BMM shapes (23/24 shapes bitwise identical max_err=0.0 vs torch.mm/torch.bmm, 1/24 lm_dx 1 bf16 ULP & det_diff=0).
  - Added templated 384-thread (1 × uint4 per thread for N=3072) fused_rms_norm_bwd_3072_v3_kernel (OPT_FAST_RMS_BWD_V3=1, -0.20 ms). Together with OPT_FAST_CUBLASLT=1, bench.py time improved from 0.1134 -> 0.1126 s/update (2.1001x).
  - Implemented DdpIpcArEngine (OPT_IPC_ALLREDUCE=1 in csrc_ext/yoco_cuda_ext.cu + csrc_ext/ddp_ext.cpp + yoco/opt_runtime.py): 16-slot NVLink Copy Engine ReduceScatter + AllGather pipeline using cudaMemcpyAsync on two dedicated DMA streams (0 SMs used for data movement), cuStreamWriteValue32_v2/cuStreamWaitValue32_v2 GPU-side synchronization (0 host barriers), and a single-wave 132-CTA ddp_add_bf16_u4_kernel computing rank0 + rank1 in identical order on both ranks (0-bit diff vs NCCL verified across 53 × 118 MB buckets and 20 E2E DDP steps; standalone concurrent backward + AllReduce dropped from 54.39 -> 46.66 ms, -7.73 ms/step).
  - Also tested and discarded in Round 12 exploration: Hopper __stcs cache-streaming stores (5.21 -> 7.77 ms regression due to bypassing L2 write-combining) and custom nvcuda::wmma causal inner-retention kernels (5.18 ms vs 2.43 ms cuBLASLt strided-batched BMM).
  - Expected numerics tier: N1.
- Timing result (/tmp/r12/time_v2/time.json):
  - s_per_update: 0.1070 s (windows [1.067, 1.073] s, median 0.10665 s, range 0.0058, 38,277.4 tokens/s).
  - speedup_vs_frozen_reference: 2.2100x (beyond_reference_noise: true).
  - peak_memory_allocated_gib: 62.88 GiB (peak_memory_reserved_gib: 63.36 GiB).
- Full check verdict (/tmp/r12/check/check.json):
  - status: PASS, performance.speedup: 2.2059x (0.1072 s/update, windows [1.074, 1.071] s, median 0.10675 s, range 0.0025, 38,196.8 tokens/s vs 0.23647 s/update frozen mean).
  - Gate 0: PASS. Gate 1: PASS (2.2059 > 1.0398). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1267 / 9616 identical). Gate 3: PASS (equivalent, loss_u005_015 = +0.0028σ, loss_u015_025 = +0.067σ, max 0.78σ <= 3.0σ).
- Commit: promoted OPT_FAST_CUBLASLT=1, OPT_FAST_RMS_BWD_V3=1, OPT_IPC_ALLREDUCE=1 to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T10:37:00Z

---
7.1 hCurrent Summary (Updated after Round 12)
- Current /submission/switches.json:
  {"environment": {"OPT_FAST_OPTIM": "1", "OPT_FUSED_ADAM_BF16": "1", "OPT_FAST_DDP": "1", "OPT_DDP_BUCKET_MB": "128", "OPT_FUSED_RMSNORM": "1", "OPT_FUSED_SUBLN_SWIGLU": "1", "OPT_FUSED_LOSS": "1", "OPT_FUSED_RETENTION": "1", "OPT_FAST_GRAD_SYNC": "1", "OPT_MERGED_PROJ": "1", "OPT_PIPELINED_TAIL": "1", "OPT_OSS_PIPE_CHUNKS": "8", "TORCH_NCCL_HIGH_PRIORITY": "1", "OPT_FAST_KERNELS_V2": "1", "OPT_DIRECT_DDP_BUCKETS": "1", "OPT_OSS_IPC_DMA": "1", "OPT_OSS_IPC_SLICES": "28", "OPT_IPC_TAPERED": "1", "OPT_SPARSE_EMB_SYNC": "1", "OPT_FAST_CUBLASLT": "1", "OPT_FAST_RMS_BWD_V3": "1", "OPT_IPC_ALLREDUCE": "1"}}
- Latest full check (/tmp/r12/check/check.json): PASS — 2.2059x speedup (0.1072 s/update, 38,196.8 tokens/s; time: 2.2100x, 0.1070 s/update), Tier N1 (0 exact failures, Gate 3 trajectory equivalent with max |d| = 0.78σ vs 3σ limit), peak memory 62.88 GiB (63.36 GiB reserved)
- Breakdown of gains by change:
  - Round 1 — OPT_FAST_OPTIM=1 (Tier N0): 0.2357 -> 0.1847 s/update (1.2803x, -51.0 ms/update) — eliminated dead p32.grad.zero_(), bf16 grad L2 norm, fused bf16->fp32 grad cast+scale, full-duplex NVLink batch_isend_irecv OSS exchange, removed end-of-step GPU metric syncs.
  - Round 2 — OPT_FUSED_ADAM_BF16=1 + OPT_FAST_DDP=1 + OPT_DDP_BUCKET_MB=100 (Tier N0): 0.1847 -> 0.1726 s/update (1.3700x, -12.1 ms/update) — yoco_cuda_ext (sm_90) single-launch inline-PTX fused_adam_bf16 writing local bf16 weights inside Adam, single-launch vectorized fp32->bf16 peer copy & bf16->fp32 grad scale, DDP gradient_as_bucket_view=True (100 MB buckets).
  - Round 3 — OPT_FUSED_RMSNORM=1 + OPT_FUSED_SUBLN_SWIGLU=1 + OPT_FUSED_LOSS=1 (Tier N1): 0.1726 -> 0.1494 s/update (1.5828x, -23.2 ms/update, -2.91 GiB peak memory) — yoco_cuda_ext deterministic fused_rms_norm (fusing all 52 residual adds + 54 affine RMSNorms incl. parallel CrossDecoder entry + cached rel_pos), warp-shuffle fused_add_subln_swiglu, and online-softmax fused_cross_entropy.
  - Round 4 — OPT_FUSED_RETENTION=1 (Tier N1): 0.1494 -> 0.1408 s/update (1.6795x, -8.6 ms/update, -0.46 GiB peak memory, -15s cold startup) — yoco_cuda_ext deterministic FusedGateRetentionFn + FusedInterleavedRoPEFn (max_diff=0.0).
  - Round 5 — OPT_FAST_GRAD_SYNC=1 (Tier N1): 0.1408 -> 0.1389 s/update (1.7024x, -1.9 ms/update) — single-launch uint4 l2norm_bf16_plan (fp64 final sum) and deferred single-sync stat/norm resolution.
  - Round 6 — OPT_MERGED_PROJ=1 (Tier N1): 0.1389 -> 0.1330 s/update (1.7780x, -5.9 ms/update) — shared-storage merged projections ([fc1; gate], [q; k; v; g; gt], [k; v]), uint4 packed SwiGLU & packed GateRetention prep/bwd kernels, bypassing Megatron mp=1 dummy autograd nodes, and disabling DDP Python comm-hook Memcpy DtoD.
  - Round 7 — OPT_PIPELINED_TAIL=1 + OPT_OSS_PIPE_CHUNKS=8 + TORCH_NCCL_HIGH_PRIORITY=1 (Tier N1, 0.0-bit diff vs Round 6): 0.1330 -> 0.1299 s/update (1.8204x, -3.1 ms/update) — pinned non-blocking HtoD stat ring buffer (-1.22 ms cudaStreamSynchronize idle gap), GPU-fused run_l2norm_and_scale_bf16_plan enqueued ahead of host sync (-0.71 ms idle gap), and 8-chunk pipelined Adam + OSS P2P + PeerCopy.
  - Round 8 — OPT_FAST_KERNELS_V2=1 (Tier N1): 0.1299 -> 0.1284 s/update (check 1.8417x; time 0.1277 s/update 1.8518x, -2.2 to -3.0 ms/update) — async dtoh_stream early norm/stat sync eliminating 1.61 ms GPU idle gap before Adam, G=512 + float4 fused_rms_norm_bwd, and uint2-vectorized fused_inner_mask_bwd_vec_kernel.
  - Round 9 — OPT_DIRECT_DDP_BUCKETS=1 + OPT_DDP_BUCKET_MB=128 (Tier N1): 0.1284 -> 0.1248 s/update (check 1.8948x; time 0.1252 s/update 1.8887x, -3.6 ms/update, -0.21 GiB peak / -0.77 GiB reserved memory) — C++ NoDivAllReduceCommHook, backward-stats-aligned zero-copy direct-to-DDP-bucket dW GEMMs/RMSNorm (0 reducer::mul_out, 0 Memcpy DtoD), and deterministic bitonic-sort fused_scaled_embedding.
  - Round 10 — OPT_OSS_IPC_DMA=1 + OPT_OSS_IPC_SLICES=24 (Tier N1, 0.0-bit diff vs Round 9): 0.1248 -> 0.1149 s/update (check 2.0581x; time 0.1157 s/update 2.0438x, -9.9 ms/update) — 24-slice NVLink Hardware Copy Engine cudaMemcpyPeerAsync + cudaIpcEventHandle_t OSS pipeline eliminating NCCL SM contention with Adam and cutting tail skew (31.65 -> 18.25 ms).
  - Round 11 — OPT_SPARSE_EMB_SYNC=1 + OPT_IPC_TAPERED=1 + OPT_OSS_IPC_SLICES=28 (Tier N1, 0.0-bit diff vs Round 10): 0.1149 -> 0.1133 s/update (check 2.0871x; time 0.1134 s/update 2.0853x, -1.6 to -2.3 ms/update) — 2-rank NVLink IPC 12.6 MB sparse embedding sync + dirty-row zeroing skipping 616 MB embed_tokens AllReduce, and 28-slice tapered OSS IPC schedule.
  - Round 12 — OPT_FAST_CUBLASLT=1 + OPT_FAST_RMS_BWD_V3=1 + OPT_IPC_ALLREDUCE=1 (Tier N1): 0.1133 -> 0.1072 s/update (check 2.2059x; time 0.1070 s/update 2.2100x, -6.1 to -6.4 ms/update) — direct cuBLASLt 128 MiB tuned Hopper sm90 GEMM/BMM dispatch, 384-thread RMSNorm bwd, and zero-SM NVLink Copy-Engine + cuStreamMemOps DDP AllReduce eliminating 24-CTA NCCL SM contention during backward Stream-K GEMMs.
- Directions that did not work:
  - Hopper __stcs (st.global.cs) cache-streaming stores & K > 28 OSS IPC slices in Round 12 exploration: bypassed L2 write-combining and slowed bf16_to_fp32_scale_gpu (5.21 -> 7.77 ms) and OSS IPC tail (19.27 -> 19.90+ ms); reverted.
  - Custom nvcuda::wmma (m16n16k16) causal inner-retention kernels in Round 12 exploration: 5.18 ms vs 2.43 ms cuBLASLt strided-batched sm90 BMM; removed.
  - torch._foreach_copy_(bf16_list, fp32_list) in Round 1: fell back to a 240-kernel unrolled loop (12.78 ms/update) due to mixed dtypes; replaced in Round 2 with yoco_cuda_ext single-launch vectorized fp32->bf16 + fused Adam bf16 write.
  - PyTorch DDP Python register_comm_hook (SUM without / world_size) in Round 5/6 trace: triggered 240 Memcpy DtoD copies (3.66 ms/update) and made loss.backward() wait on CPU (1.28 ms idle gap); solved in Round 9 via pure C++ NoDivAllReduceCommHook + direct-to-bucket out= writes.
  - Naive reverse-definition bucket ordering in Round 9 prototype: placed output_projection (616 MB, index 1 in YOCO.__init__) at Bucket N-2 instead of Bucket 0, costing 2.5 ms; fixed immediately by sorting via Rank-0-synced reducer.get_backward_stats().
  - Using PyTorch UntypedStorage._share_cuda_() for IPC export in early Round 10 prototype: emitted a Producer process has been terminated warning at process exit due to PyTorch's internal IPC refcounter; solved cleanly in oss_ipc_get_mem_handle using cuMemGetAddressRange_v2 + cudaIpcGetMemHandle + atexit oss_ipc_cleanup.
8.7 hRound 13: Profile `2.206x` Tree, Compact `big_slot` DDP Scratch (`-3.37 GiB`), `528`-CTA DDP Reduction, `Adam` `bf16`-Grad Read, Fused `CrossAttention` Q/KV+RoPE & `ffn2_fwd` Cluster Kernel (`OPT_FAST_CUBLASLT_V2`, `OPT_FUSED_CROSS_QKV`, `OPT_ADAM_READ_G16`, `OPT_IPC_AR_CTAS=528`) · continuation
- Start time: 2026-11-20T10:39:15Z (continued across machine migration at 11:47:16Z to host 32483aa277f5, where frozen reference mean is 0.23367 s/update with 0.30% spread and Round 12 baseline measured 0.1083 s/update = 2.1576x)
- Profile (/tmp/r13/profile):
  - Steady-state GPU step: 105.32 ms (host 8e3bd42d831a) / 107.90 ms (host 32483aa277f5 before big_slot fix).
  - Concrete bottlenecks identified in /tmp/r13/profile:
    1. Scratch Memory & output_projection (616 MB) Bucket Handling: sizing all 16 ring slots to 308 MB used 4.93 GiB (62.88 GiB peak > 61.75 GiB ref), and an initial ((bbytes + 15) / 2) check rejected output_projection by 7 bytes (3.41 ms NCCL RING_LL fallback caught immediately in new-host profile). Furthermore, 132-CTA persistent strided ddp_add_bf16_u4_kernel held SMs for ~40 us (45.11 ms vs 44.51 ms at 528 CTAs).
    2. Adam fp32-Grad HBM Traffic (6.89 GB): fused_adam_bf16_kernel re-read 6.89 GB of p32.grad (fp32) concurrently with 18.70 ms NVLink P2P DMA even though float(g16) * (*scale_ptr) (3.445 GB bf16) is bit-for-bit identical (13.87 -> 13.05 ms solo).
    3. CrossDecoder / CrossAttention Unfused RoPE & KV Split/Cat: 28x fused_rope_interleaved_kernel (0.27 ms) + 26 × 12 MB q copies (624 MB HBM) + kv .contiguous() / torch.cat copies.
    4. ffn2_fwd (26x (2048, 3072, 8192, F, T)): exhaustive 499-config cuBLASLt search found (algo=39, tile=23, stage=35, cluster=2x1x1, sp=-1) (4.09 -> 3.82 ms, -0.27 ms, det=1).
- Action (OPT_FAST_CUBLASLT_V2=1, OPT_FUSED_CROSS_QKV=1, OPT_ADAM_READ_G16=1, OPT_IPC_AR_CTAS=528):
  - Added dedicated 308 MB big_slot alongside 16 × 64 MB regular ring slots in DdpIpcArEngine (with exact half1_b = bbytes - ((bbytes / 2) & ~15LL) check) and OPT_IPC_AR_CTAS=528, cutting peak allocated memory from 62.88 -> 59.51 GiB (-3.37 GiB, below 61.75 GiB ref) and eliminating output_projection NCCL fallback.
  - Added build_adam_plan_g16 + OPT_ADAM_READ_G16=1 so fused_adam_bf16_kernel loads uint2 (bf16) gradients and multiplies by scale_out_f32 in registers (0-bit diff vs g32, -3.445 GB HBM reads).
  - Added fused_rope_interleaved_inplace, fused_split_kv_rope_fwd, fused_pack_dkv_rope_bwd, FusedCrossAttnQFn, and FusedMergedKVRopeFn (0-bit diff verified in standalone test), plus OPT_FAST_CUBLASLT_V2=1 2x1x1 cluster override on ffn2_fwd.
  - Also tested and discarded: OPT_IPC_TAPERED_V2 (0.10 start slice starved DMA), direct-SM NVLink P2P load without Copy Engine (49.79 ms vs 46.66 ms), and uint4 shared-memory bf16->fp32 scale (5.70 ms vs 5.49 ms).
- Timing result (/tmp/r13/time/time.json, host 32483aa277f5, ref 0.2335 s):
  - Baseline Round 12 on host 32483aa277f5: 0.1083 s/update (2.1576x).
  - Round 13 s_per_update: 0.1067 s (-1.6 ms/update, windows [1.063, 1.072] s, 38,372.3 tokens/s, 2.1900x vs 0.2335 s).
  - peak_memory_allocated_gib: 59.51 GiB (peak_memory_reserved_gib: 59.99 GiB).
- Full check verdict (/tmp/r13/check/check.json, host 32483aa277f5, ref 0.23367 s):
  - status: PASS, performance.speedup: 2.1941x (0.1065 s/update, windows [1.064, 1.066] s, 38,457.4 tokens/s vs 0.23367 s frozen check ref; -1.8 ms/update faster than Round 12 baseline 0.1083 s on this host).
  - Gate 0: PASS. Gate 1: PASS (2.1941 > 1.006). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1264 / 9616 identical). Gate 3: PASS (equivalent, loss_u005_015 = -0.018σ, loss_u015_025 = +0.062σ, max 0.88σ <= 3.0σ).
- Commit: promoted Round 13 switches to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T12:15:45Z

---
9.9 hRound 14: Profile `2.194x` Tree, Native Hopper `sm_90a` WGMMA Causal Flash-Retention (`-624 MB`), 2-Rank NVLink IPC Sharded `L2Norm`, `uint4` RoPE/RMS/Retention Prep & Fused `CrossAttention` (`OPT_SM90_FLASH_RETENTION`, `OPT_SHARDED_L2NORM`, `OPT_VEC_U4_ROPE_PREP`, `OPT_FUSED_CROSS_ATTN`) · continuation
- Start time: 2026-11-20T12:18:00Z
- Profile (/tmp/r14/profile):
  - Steady-state GPU step ([emb_fwd[1] -> emb_fwd[2]]): 104.494 ms (Stream 7 1,017 launches, 98.30 ms kernel duration; Stream 158 5.87 ms ddp_add_bf16_u4_kernel; 0.000 ms bf16 NCCL).
  - Concrete bottlenecks identified in /tmp/r14/profile:
    1. GateRetention Inner & Cross-Chunk BMMs + Mask + SubLN (~2.85 ms + 104 launches + 624 MB saved tensors): across 13 SelfDecoder layers, inner chunk retention materialized [192, 256, 256] attn_3d and attn_masked_3d (624 MB saved for backward) across 8 BMMs + 2 mask kernels + add_subln_swiglu_fwd per layer, with 78x BMMs (1.138 ms) falling back to sm_80 cutlass_80_tensorop_bf16_s16816gemm kernels and computing masked upper-triangular tiles needlessly.
    2. Duplicated Full-Model l2norm_bf16_part_kernel (1.501 ms): both ranks independently read all 6.89 GB (52,575 blocks) of already-AllReduced identical bf16 gradients to compute the identical total_norm.
    3. uint2 (8B) Memory Transactions in RoPE, GateRetention Packed Prep/Bwd, & RMSNorm Fwd (~1.85 ms + 53 dw_part allocations): fused_rope_interleaved_inplace (0.251 ms), fused_qkv_rope_scale_packed (0.912 ms fwd+bwd), and fused_add_subln_swiglu_packed_bwd (0.300 ms) used 32 threads/head (8B loads/stores), while fused_rms_norm_fwd (0.641 ms) used 3 × uint2/thread and fused_rms_norm_bwd_out allocated fresh dw_part tensors 53x/step.
    4. CrossDecoder Per-Layer Autograd & Shared-KV dk/dv Sum (24x CUDAFunctor_add + 39 autograd nodes): 13 CrossDecoder layers sharing (key, value) spawned 3 autograd nodes per layer and 24 separate elementwise add kernels + tensor allocations to sum dk and dv.
- Action (OPT_SM90_FLASH_RETENTION=1, OPT_SHARDED_L2NORM=1, OPT_VEC_U4_ROPE_PREP=1, OPT_FUSED_CROSS_ATTN=1):
  - Created csrc_ext/sm90_retention.cu compiled with -gencode=arch=compute_90a,code=sm_90a:
    - sm90_retention_fwd_kernel: 1-warpgroup (128-thread) Hopper wgmma.mma_async (ss m64n128k16, ss m64n64k16, and register-A rs m64n128k16 with 128B-swizzled cp.async shared memory and LPT wave scheduling) fusing cross = qs @ S (skipping n_c = 0) + causal inner = mask(qr @ kr^T) @ vt (10/16 causal tiles) + in-register SubLN + SwiGLU (0 register spills, 0-bit run-to-run diff).
    - sm90_retention_bwd_dq_kernel & sm90_retention_bwd_dkv_kernel: Hopper sm_90a WGMMA backward kernels fusing d_q_scaled = do @ S^T, d_kr_cross = vs @ d_kv^T, d_v_scaled = kr @ d_kv, and causal inner d_qr_inner, d_kr_inner, d_vt_inner, and in-place dg_in = dg_in_row - dg_in_col (0 spills, eliminating all 78x cutlass_80 BMMs, 104 launches, and 624 MB saved activations; 3.91 -> 2.68 ms standalone GPU kernel time).
  - Implemented try_sharded_l2norm_part (OPT_SHARDED_L2NORM=1 in csrc_ext/yoco_cuda_ext.cu + yoco/opt_runtime.py): shards 52,575 l2norm_bf16 blocks 50/50 across the 2 ranks, exchanges 105 KB of partial float sums via DdpIpcArEngine NVLink IPC + cuStreamWriteValue32_v2/cuStreamWaitValue32_v2, and reduces 0 .. 52,574 in identical order on both ranks (0-bit diff, ~0.73 ms saved).
  - Added uint4 (16B, 16 threads/head, 8 heads/CTA) kernels for RoPE, split_kv_rope, pack_dkv_rope, qkv_rope_scale_packed fwd/bwd, add_subln_swiglu_packed_bwd, 384-thread uint4 RMSNorm fwd (0-bit diff), and persistent dw_part workspace (OPT_VEC_U4_ROPE_PREP=1).
  - Added FusedCrossAttentionFn + self-counting kv_grad_acc (OPT_FUSED_CROSS_ATTN=1), merging q_proj + RoPE + FlashAttention + out_proj into 1 autograd node/layer and accumulating (dk, dv) in-place via fused_bf16_add_inplace (0-bit diff in deterministic mode).
  - Also tested and discarded: single-CTA last-block dW reduction in RMSNorm bwd (2.49 ms vs 1.38 ms due to 1-SM serialization vs 192-CTA reduce_dw_rows_vec4), and cold-L2 cuBLASLt 2D GEMM sweep (probe_cold_sm90.cu, confirming current 18 2D shapes are already at cuBLASLt 12.1 optimum).
- Timing result (/tmp/r14/time1/time.json, host 32483aa277f5, ref 0.2335 s):
  - s_per_update: 0.1046 s (-2.1 ms/update vs 0.1067 s Round 13 time, windows [1.043, 1.050] s, 39,144.0 tokens/s, 2.2339x vs 0.2335 s).
  - peak_memory_allocated_gib: 58.90 GiB (peak_memory_reserved_gib: 59.39 GiB, -0.61 GiB vs Round 13 and -2.85 GiB below 61.75 GiB ref).
- Full check verdict (/tmp/r14/check1/check.json, host 32483aa277f5, ref 0.23367 s):
  - status: PASS, performance.speedup: 2.2254x (0.1050 s/update, median 0.1048 s, windows [1.049, 1.052] s, 39,002.6 tokens/s; -1.5 ms/update faster than Round 13 0.1065 s check; equivalent to ~2.252x on 0.23647 s ref).
  - Gate 0: PASS. Gate 1: PASS (2.2254 > 1.02). Gate 2: NOT_BITWISE (N1, exact_failures: 0, dtype_changes: 0, bitwise_trusted: true, 1265 / 9616 identical). Gate 3: PASS (equivalent, loss_u005_015 = -0.019σ, loss_u015_025 = -0.021σ, max 0.41σ <= 3.0σ).
- Commit: promoted Round 14 switches to /submission/switches.json and committed to /submission/yoco (opt branch).
- End time: 2026-11-20T13:25:30Z

---
9.9 hCurrent Summary (Updated after Round 14) · continuation
- Current /submission/switches.json:
  {"environment": {"OPT_FAST_OPTIM": "1", "OPT_FUSED_ADAM_BF16": "1", "OPT_FAST_DDP": "1", "OPT_DDP_BUCKET_MB": "128", "OPT_FUSED_RMSNORM": "1", "OPT_FUSED_SUBLN_SWIGLU": "1", "OPT_FUSED_LOSS": "1", "OPT_FUSED_RETENTION": "1", "OPT_FAST_GRAD_SYNC": "1", "OPT_MERGED_PROJ": "1", "OPT_PIPELINED_TAIL": "1", "OPT_OSS_PIPE_CHUNKS": "8", "TORCH_NCCL_HIGH_PRIORITY": "1", "OPT_FAST_KERNELS_V2": "1", "OPT_DIRECT_DDP_BUCKETS": "1", "OPT_OSS_IPC_DMA": "1", "OPT_OSS_IPC_SLICES": "28", "OPT_IPC_TAPERED": "1", "OPT_SPARSE_EMB_SYNC": "1", "OPT_FAST_CUBLASLT": "1", "OPT_FAST_CUBLASLT_V2": "1", "OPT_FAST_RMS_BWD_V3": "1", "OPT_IPC_ALLREDUCE": "1", "OPT_IPC_AR_CTAS": "528", "OPT_FUSED_CROSS_QKV": "1", "OPT_ADAM_READ_G16": "1", "OPT_SM90_FLASH_RETENTION": "1", "OPT_VEC_U4_ROPE_PREP": "1", "OPT_FUSED_CROSS_ATTN": "1", "OPT_SHARDED_L2NORM": "1"}}
- Latest full check (/tmp/r14/check1/check.json, host 32483aa277f5, ref 0.23367 s): PASS — 2.2254x speedup (0.1050 s/update, median 0.1048 s, 39,002.6 tokens/s; time: 0.1046 s = 2.2339x, 39,144.0 tokens/s; equivalent to ~2.252x against the pre-migration 0.23647 s ref), Tier N1 (0 exact failures, Gate 3 trajectory equivalent with max |d| = 0.41σ vs 3σ limit), peak memory 58.90 GiB (59.39 GiB reserved, vs 61.75 GiB ref)
- Breakdown of gains by change:
  - Round 1 — OPT_FAST_OPTIM=1 (Tier N0): 0.2357 -> 0.1847 s/update (1.2803x, -51.0 ms/update) — eliminated dead p32.grad.zero_(), bf16 grad L2 norm, fused bf16->fp32 grad cast+scale, full-duplex batch_isend_irecv OSS exchange, packed stat sync.
  - Round 2 — OPT_FUSED_ADAM_BF16=1 + OPT_FAST_DDP=1 + OPT_DDP_BUCKET_MB=100 (Tier N0): 0.1847 -> 0.1726 s/update (1.3700x, -12.1 ms/update) — inline-PTX fused_adam_bf16, vectorized fp32<->bf16, DDP gradient_as_bucket_view=True.
  - Round 3 — OPT_FUSED_RMSNORM=1 + OPT_FUSED_SUBLN_SWIGLU=1 + OPT_FUSED_LOSS=1 (Tier N1): 0.1726 -> 0.1494 s/update (1.5828x, -23.2 ms/update) — fused residual+RMSNorm, fused_add_subln_swiglu, online-softmax fused_cross_entropy.
  - Round 4 — OPT_FUSED_RETENTION=1 (Tier N1): 0.1494 -> 0.1408 s/update (1.6795x, -8.6 ms/update) — FusedGateRetentionFn + FusedInterleavedRoPEFn.
  - Round 5 — OPT_FAST_GRAD_SYNC=1 (Tier N1): 0.1408 -> 0.1389 s/update (1.7024x, -1.9 ms/update) — single-launch uint4 l2norm_bf16_plan + deferred stat sync.
  - Round 6 — OPT_MERGED_PROJ=1 (Tier N1): 0.1389 -> 0.1330 s/update (1.7780x, -5.9 ms/update) — shared-storage merged projections ([fc1; gate], [q; k; v; g; gt], [k; v]) & packed SwiGLU/Retention kernels.
  - Round 7 — OPT_PIPELINED_TAIL=1 + OPT_OSS_PIPE_CHUNKS=8 + TORCH_NCCL_HIGH_PRIORITY=1 (Tier N1): 0.1330 -> 0.1299 s/update (1.8204x, -3.1 ms/update) — pinned HtoD stat ring, GPU-fused l2norm_and_scale, 8-chunk pipelined OSS tail.
  - Round 8 — OPT_FAST_KERNELS_V2=1 (Tier N1): 0.1299 -> 0.1284 s/update (1.8417x, -1.5 ms/update) — async dtoh_stream early norm sync, G=512 RMSNorm bwd, uint2 inner_mask bwd.
  - Round 9 — OPT_DIRECT_DDP_BUCKETS=1 + OPT_DDP_BUCKET_MB=128 (Tier N1): 0.1284 -> 0.1248 s/update (1.8948x, -3.6 ms/update) — C++ NoDivAllReduceCommHook, direct-to-bucket dW, bitonic-sort fused_scaled_embedding.
  - Round 10 — OPT_OSS_IPC_DMA=1 + OPT_OSS_IPC_SLICES=24 (Tier N1): 0.1248 -> 0.1149 s/update (2.0581x, -9.9 ms/update) — 24-slice NVLink Copy Engine cudaMemcpyPeerAsync OSS pipeline.
  - Round 11 — OPT_SPARSE_EMB_SYNC=1 + OPT_IPC_TAPERED=1 + OPT_OSS_IPC_SLICES=28 (Tier N1): 0.1149 -> 0.1133 s/update (2.0871x, -1.6 ms/update) — 2-rank NVLink IPC 12.6 MB sparse embedding sync & 28-slice tapered OSS IPC schedule.
  - Round 12 — OPT_FAST_CUBLASLT=1 + OPT_FAST_RMS_BWD_V3=1 + OPT_IPC_ALLREDUCE=1 (Tier N1): 0.1133 -> 0.1072 s/update (2.2059x on pre-migration host; 0.1083 s / 2.1576x on post-migration host, -6.1 ms/update) — direct cuBLASLt 128 MiB tuned Hopper GEMM/BMM dispatch, 384-thread RMSNorm bwd, and zero-SM NVLink Copy-Engine DDP AllReduce.
  - Round 13 — OPT_FAST_CUBLASLT_V2=1 + OPT_FUSED_CROSS_QKV=1 + OPT_ADAM_READ_G16=1 + OPT_IPC_AR_CTAS=528 (Tier N1): 0.1083 -> 0.1065 s/update (2.1941x on post-migration host 0.23367 s ref, -1.8 ms/update, -3.37 GiB peak memory) — compact big_slot DDP scratch + output_projection IPC fix, 528-CTA DDP reduction, bf16-grad read in Adam, fused CrossAttention q/kv+RoPE, and 2x1x1 cluster ffn2_fwd.
  - Round 14 — OPT_SM90_FLASH_RETENTION=1 + OPT_SHARDED_L2NORM=1 + OPT_VEC_U4_ROPE_PREP=1 + OPT_FUSED_CROSS_ATTN=1 (Tier N1): 0.1065 -> 0.1050 s/update (time: 0.1046 s = 2.2339x, check: 2.2254x, -1.5 to -2.1 ms/update, -0.61 GiB peak memory) — native Hopper sm_90a WGMMA causal Flash-Retention + fused cross-chunk qs@S / do@S^T / vs@d_kv^T / kr@d_kv + SubLN + SwiGLU, 2-rank NVLink IPC sharded L2-norm, uint4 RoPE/RMS/retention prep, and fused CrossAttention with kv_grad_acc.
- Directions that did not work:
  - torch._foreach_copy_(bf16_list, fp32_list) (Round 1), Python DDP comm hook Memcpy DtoD (Round 5/6), naive reverse-definition bucket ordering (Round 9), PyTorch UntypedStorage._share_cuda_() exit warning (Round 10).
  - Hopper __stcs cache-streaming stores & K > 28 OSS IPC slices, and nvcuda::wmma (sm_80 m16n16k16) inner-retention kernels (Round 12).
  - Direct-SM NVLink P2P load without Copy Engine (49.79 ms vs 46.66 ms), OPT_IPC_TAPERED_V2 0.10 start slice, and uint4 shared-memory bf16->fp32 scale (Round 13).
  - Single-CTA last-block dW reduction in RMSNorm bwd (2.49 ms vs 1.38 ms) (Round 14).
↑ YOCO