Gemini 4 Carbon 2.99×
Harness: Antigravity · switches: none
- Judged
- 2.99×
- Tier
- N1
- Self-best
- 3.00×
- Rounds
- 18
- Hours
- 10.0
- API cost
- $106
- Input tokens · 96.2% cached
- 243 M
- Output tokens
- 1.1 M
- Requests
- 868
§ 02Key levers
- Sequence packing
- ✓ round 2
LLAVA_UNPAD_LLM(plusLLAVA_SPARSE_LM_HEADfor labeled positions only, recompute cut 22 → 12 layers), 2447.4 → 1552.8 ms - Recompute / activations
- ✓ round 1 recompute 22/32 layers, round 2 12; round 3
LLAVA_GRAD_CKPT=0after fused kernels dropped the big saved tensors, peak memory actually 119.08 → 114.77 GiB - Optimizer
- ✓ round 1 fused AdamW cut into ≤1e9-element views (avoids the 231 overflow); round 4
LLAVA_FAST_ZERO2single-pass Triton AdamW reads bf16 grads, writes bf16 weights (~115 → 23.9 ms); round 11 16 chunks overlapped with P2P weight exchange (standalone 45.07 → 33.04 ms); round 19LLAVA_IPC_ADAMWone kernel writes both the local GPU and, over NVLink IPC, the peer GPU (35.45 → 26.13 ms) - Communication & libraries
- ✓ ZeRO-2 (round 1, reproduces the
zero.InitRoPE cache); round 6NCCL_PROTO=Simple+ all-reduce with AVG; round 8 torch 2.1.2 kept, only cuBLAS 12.8 swapped in viaLD_PRELOAD(1064.9 → 1021.1 ms); round 10 self-built FA3 (1002.8 → 979.7 ms); round 14 reduce-scatter over odd/even-layer partitions (965.1 → 961.1 ms); round 16 dW GEMMs write straight into the reduce-scatter buffer (with CLIP fusion 956.4 → 944.0 ms) - Other main levers
- round 3 Triton fused RMSNorm + residual (174.4 → 19.7 ms), QK RoPE (101.7 → 8.4 ms), SwiGLU (35.3 → 19.0 ms); CLIP runs 23 layers with FlashAttention (34.29 → 14.50 ms); QKV and gate/up merged GEMMs over adjacent views in the ZeRO-2 flat buffer (1021.1 → 1006.9 ms); each step's 32 samples re-split across the two GPUs by estimated FLOPs (961.1 → 956.4 ms); persistent grad buffers, loss
.item()moved from before to after backward (944.0 → 933.8 ms); ends at 922.8 ms/step (round 20)
§ ARaw trace
Raw work log22 sections
0.0 hRound 1: Baseline Profile & L0 Distributed / Memory-Saving / Optimizer Switches
- Start time: 2026-11-19T19:06:00Z - End time: 2026-11-19T20:19:52Z - Baseline profile findings (/tmp/r1/profile/profile_tree.md, 2 steps): - Total Rank 0 GPU kernel time: 2882 ms/step (2561.3 mscompute +320.9 msNCCL; Rank 1 NCCL wait+comm1675.2 ms/step). - Top hotspots:4b_bwd_grad1162.4 ms (45.4%),4a_bwd_recompute_fwd609.4 ms (23.8%),2_llm_fwd_layers228.5 ms (8.9%), ZeRO-3AllGather235.5 ms +ReduceScatter84.4 ms, non-GEMM elementwise/copy 985.3 ms (including unfused_foreachAdamW 65.2 ms + copies 34.3 ms, FlashAttn unpad/pad 55.4 ms). - Changes made (2c6128b): -LLAVA_ZERO_STAGE=2(scripts/zero2_opt.json:stage: 2,overlap_comm: true,contiguous_gradients: false,sub_group_size: 1e12,reduce_bucket_size: 5e8), exactzero.InitRoPE cache reproduction. -LLAVA_GRAD_CKPT=22+PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True. -LLAVA_FUSED_ADAMW=1: chunked zero-copy<=1e9-element views fortorch._fused_adamw_. - Results: -check --quick(/tmp/r1/quick/check.json): PASS (tier N1, 0 exact failures, 25/4724 minor diagnostic violations). -time(/tmp/r1/time/time_tree.json): 2447.4 ms/step,speedup_vs_frozen_reference = 1.1292,window_spread = 0.0038,peak_memory_allocated_gib = 129.62. ---
1.2 hRound 2: Unpadded Packed 1D LLM + Supervised-Only LM Head + Lower Gradient Checkpointing
- Start time: 2026-11-19T20:19:55Z - End time: 2026-11-19T20:38:45Z - Round 2 profile findings (/tmp/r2/profile/profile_tree.md, 2 steps): - GPU kernel time: 2344 ms/step (down from 2882 ms/step;AllGatherdown 10x to 22.0 ms/step). - Top hotspots: 1. Padded LLM GEMMs (sm90_xmma_gemm= 1296.5 ms/step, 55.3%) + padded elementwise/norm/RoPE/SwiGLU (~880 ms/step, 37.5%) operating on 31%–64% zero padding tokens. 2. Per-layer_get_unpad_datahost syncs (aten::nonzeroblocking 1357.4 ms/step,aten::item49.8 ms/step) +IndexFirstAxis/pad_input(~95 ms/step). 3. Remaining22/32checkpointed layers (CheckpointFunctionBackward1193.5 ms/step). - Changes made: -LLAVA_UNPAD_LLM=1: Single compact DtoH metadata sync per micro-batch, single batchedembed_tokenscall across all samples, packed[1, total_nnz, 4096]execution through all 32LlamaDecoderLayers, direct zero-transposeunsqueeze_dim=2RoPE +flash_attn_varlen_funcwith precomputed(cu_seqlens, max_seqlen)(0unpad_input/pad_input, 0nonzero/.item()syncs inside layers). -LLAVA_SPARSE_LM_HEAD=1: Filterhidden_statesto supervised label positions (shift_labels != -100, ~10% of tokens) beforelm_headand fp32 cross-entropy. -LLAVA_GRAD_CKPT=12: Lowered checkpointed layers from 22 to 12 (leaving 20 GiB HBM headroom including Gate 2's deterministic FlashAttn workspace). - Results: -check --quick(/tmp/r2/quick/check.json): PASS (tier N1, 0 errors, 0 exact failures, 25/4724 minor diagnostic violations). -time(/tmp/r2/time/time_tree.json): 1552.8 ms/step,speedup_vs_frozen_reference = 1.7797(windows[15.795s, 15.262s],window_spread = 0.0121,peak_memory_allocated_gib = 119.08, step-1 loss diff7e-5, step-24 loss0.9654vs ref0.9646). ---
1.2 hFull Check #1 (After Round 2)
- Start time: 2026-11-19T20:39:00Z - End time: 2026-11-19T20:46:28Z - Result (/tmp/r2/full_check/check.json): PASS (tier N1,speedup = 1.7787,1553.7 ms/stepvs2763.6 ms/step,peak_memory_allocated_gib = 119.08). - Gate 0: PASS (reference partition) - Gate 1: PASS (1553.7 ms/step, windows[15.74s, 15.335s],1.7787x) - Gate 2: NOT_BITWISE (0errors,0exact failures,25/4724minor diagnostic deviations) - Gate 3: PASS (train_loss_last20_canonicalbias+0.000275=+0.087σvs3σ = 0.009458;probe_loss_last20bias-0.000242=-0.084σvs3σ = 0.008624; trajectory wall131.4s). ---
1.7 hRound 3: Profile R2 & Custom Fused Triton Kernels (RMSNorm + Residual, RoPE, SwiGLU) + Full Removal of Gradient Checkpointing
- Start time: 2026-11-19T20:47:15Z - End time: 2026-11-19T21:17:30Z - Profile of R2 (/tmp/r3/profile/profile_tree.md): -1612 ms/stepRank 0 GPU kernel time: GEMMs1007.7 ms/step(including 12/32 recomputed forward layers~98 ms), non-GEMM elementwise/copy/cat/silu/reduce461.5 ms/step(LlamaRMSNorm~160 ms,RoPE+CatArrayBatchedCopy~92 ms,SwiGLU~56 ms, residual adds),FusedAdamW58.0 ms/step, DeepSpeedscaled_global_norm+ cast/unscale/copy~55 ms/step,CLIPVisionTower34.75 ms/step, and cross-rank NCCLAllReducestraggler wait (50.3 msr0 vs318.5 msr1). - Changes implemented (llava/train/triton_ops.py+llava/train/opt_patches.py): -LLAVA_FUSED_OPS=1: -fused_rms_norm&fused_add_rms_norm: Custom fixed-config Triton kernels (fwd + deterministic grouped-CTA bwd,fp32variance/reduction, zero[N, 4096]fp32 saved tensors, fused post-attention residual add + RMSNorm + backward branch grad sum). Reduced 32-layer norm+add time from174.4 msto19.7 ms(8.8x). -fused_qk_rope: Custom single-launch Triton kernel rotating Q and K together (fwd + bwd, 0 bytes of[N, 4096]saved activation tensors, bitwise identical to PyTorchapply_rotary_pos_emb). Reduced 32-layer RoPE time from101.7 msto8.4 ms(12.1x). -fused_swiglu: Custom Triton kernel (silu(gate) * upfwd + bwd, eliminating[N, 11008]silu(gate)saved tensor, achieving 89.4% of Hopper HBM3e peak bandwidth). Reduced 32-layer SwiGLU time from35.3 msto19.0 ms(1.85x). -LLAVA_GRAD_CKPT=0: Eliminated all remaining activation checkpointing (0/32layers recomputed); because the fused Triton kernels cut saved activations by >35 GiB across 32 layers, peak allocated memory actually decreased from119.08 GiBto114.77 GiB! - Verification: -time(/tmp/r3/time/time_tree.json):1182.5 ms/step(2.3371xspeedup vs frozen reference2763.6 ms/step),window_spread = 0.0153,logged_loss_first_step_rel_diff = 0.0,logged_loss_max_rel_diff = 0.0028,peak_memory_allocated_gib = 114.77,problems = []. -check --quick(/tmp/r3/quick/check.json): PASS (tier N1,0exact failures,27/4724minor diagnostic deviations). ---
2.8 hRound 4: Profile R3 & Fused Triton ZeRO-2 AdamW + 2-Slot Event-Bounded Backward Overlap
- Start time: 2026-11-19T21:18:00Z - End time: 2026-11-19T21:55:00Z - Profile of R3 (/tmp/r4/profile/profile_tree.md): -1246 ms/stepRank 0 GPU kernel time: cuBLAS SM90 GEMMs865.7 ms(69.5%), FlashAttn274.9 ms(6.0%), our 4 custom Triton LLM ops44.5 ms(3.6% total!),FusedAdamW58.8 ms+ DeepSpeed Stage 2scaled_global_norm(.double()17.2 ms,norm7.8 ms, 152×aten::itemsyncs) +.to(fp32)(10.2 ms) +mul_(1.0)(6.3 ms) +bf16.copy_(fp32)(9.4 ms) + 14 per-buckettorch.cuda.synchronize()stalls insideallreduce_and_copywhencontiguous_gradients: false,CLIPVisionTower~35 ms/step, and Rank 1AllReducestraggler wait (225.8 msvs48.4 msr0). - Changes implemented (llava/train/triton_ops.py+llava/train/opt_patches.py): -LLAVA_FAST_ZERO2=1: -triton_zero2_adamw_step: Single-passint64-indexed Triton AdamW kernel over3.37Belements readingbf16flattened gradients directly, updatingfp32master weights +exp_avg+exp_avg_sqin registers, and writingbf16partition weights in the same pass (23.9 ms/stepat 3.95 TB/s = 82.3% HBM3e peak, down from~115 ms/step), while skipping unusedscaled_global_norm(clip_grad == 0.0,bf16) andmul_(1.0). Properly initializes step counter fromstate["step"](whichinitialize_optimizer_statespre-advances to1). -fast_allreduce_and_copy: Replaced DeepSpeed's per-buckettorch.cuda.synchronize()insideallreduce_and_copywith CUDA stream event ordering (stream.wait_stream(cur_stream)+record_stream(stream)) bounded by a 2-slot event ring soreduction_streamnever queues >2 bucket buffers (peak_memory_reserved_gibdropped from125.05 GiBto118.64 GiB). - Also disabled redundantgradient_checkpointingflags on frozenvision_towersubmodules. - Verification: -time(/tmp/r4/time/time_tree.json):1094.7 ms/step(2.5245xspeedup vs frozen reference2763.6 ms/step),window_spread = 0.0161,peak_memory_allocated_gib = 114.77,peak_memory_reserved_gib = 118.64,problems = []. -check --quick(/tmp/r4/quick/check.json): PASS (tier N1,0exact failures,27/4724minor diagnostic deviations — 0 additional deviations over Round 3). ---
3.0 hRound 5: Fast CLIP Vision Tower (23/24 Layer Truncation + Fused QKV + FlashAttention2 + Bitwise Triton QuickGELU)
- Start time: 2026-11-19T21:55:50Z - End time: 2026-11-19T22:05:20Z - Motivation from R4 Profile: -CLIPVisionToweraccounted for~34.75 ms/step(12.2 mseagerbmmattention +4.2 mssoftmax+2.8 msscale +2.0 mscontiguous()copies +2.5 msQuickGELU+ dead Layer 23 + deadpost_layernormsincemm_vision_select_layer == -2). - Changes implemented (llava/train/triton_ops.py+llava/train/opt_patches.py): -LLAVA_FAST_CLIP=1: - TruncatedCLIPEncoderexecution atlen(layers) + select_layer + 1 = 23layers, skipping dead Layer 23,encoder_statestuple construction, andpost_layernorm. - Cached fused QKV weight/bias inattn.__dict__["_llava_qkv_cache"](preservingnamed_parameters()andnamed_buffers()unchanged) and ranflash_attn_qkvpacked_funcdirectly on[B, 577, 3, 16, 64]with zero transposes or contiguous copies. - Added bitwise-matchingtriton_quick_gelu(x * sigmoid(1.702 * x)) intriton_ops.py. - Standalone Hopper benchmark cutCLIPVisionTower[16, 3, 336, 336]wall time from34.29 msto14.50 ms(2.37x). - Verification: -time(/tmp/r5/time/time_tree.json):1075.2 ms/step(2.5703xspeedup vs frozen reference2763.6 ms/step),window_spread = 0.0178,logged_loss_first_step_rel_diff = 0.00036,logged_loss_max_rel_diff = 0.0016,peak_memory_allocated_gib = 114.91,peak_memory_reserved_gib = 118.84,problems = []. -check --quick(/tmp/r5/quick/check.json): PASS (tier N1,0exact failures,34/4724minor diagnostic deviations). ---
3.0 hFull Check #2 (After Round 5)
- Start time: 2026-11-19T22:06:00Z - End time: 2026-11-19T22:12:35Z - Result (/tmp/r5/full_check/check.json): PASS (tier N1,speedup = 2.5674,1076.4 ms/stepvs2763.6 ms/step). - Gate 0: PASS (reference partition) - Gate 1: PASS (1076.4 ms/step,2.5674x) - Gate 2: NOT_BITWISE (0errors,0exact failures,34/4724minor diagnostic deviations) - Gate 3: PASS (train_loss_last20_canonicalbias-0.000065=-0.020σvs3σ = 0.009458;probe_loss_last20bias-0.000162=-0.056σvs3σ = 0.008624). ---
3.4 hRound 6: Profile R5 & NVLink-18 Collective Polish (`NCCL_PROTO=Simple`, `ReduceOp.AVG`, Partition-Filtered Grad Copy) + 64-Op Cross-Layer `FusedAddRMSNorm`
- Start time: 2026-11-19T22:14:00Z - End time: 2026-11-19T22:28:40Z - Profile of R5 (/tmp/r6/profile/profile_tree.md): -1138 ms/stepRank 0 GPU kernel time: cuBLAS SM90 GEMMs870.1 ms(76.5%), FlashAttn2 (LLM+CLIP)78.2 ms(6.9%), custom Triton ops45.9 ms(4.0%), Triton ZeRO-2 AdamW24.5 ms(2.2%), NCCLAllReduce49.4 ms+AllGather25.2 ms(runningRING_LLinstead ofSimpleover NVLink-18!),div_(2.0)10.4 ms, and remaining inter-layer residualCUDAFunctor_add15.0 ms. - Also microbenchmarked runtime-concatenated QKV (CatLinear3:219.8 msvs210.5 msseparate) and Gate+Up (CatLinear2:401.2 msvs385.1 msseparate) atM=14500: rejected before end-to-end run because[14500, 4096]SM90 GEMMs are already TensorCore/700W saturated (~665 TFLOP/s). - Changes implemented (llava/train/opt_patches.py+switches.json): -NCCL_PROTO=Simpleover 18-link NVLink (NV18), cuttingAllGatherfrom25.2 msto~20.3 msandAllReducefrom50.4 msto42.2 ms. - Replacedtensor.div_(2.0)+all_reduce(SUM)insidefast_allreduce_and_copywith single-passdist.all_reduce(..., op=dist.ReduceOp.AVG)(-10.4 mskernel time /-27 GBHBM traffic) and skippedbuf.copy_(synced)for parameters outside the current rank's partition (-13.5 GBHBM traffic). - ExtendedLLAVA_FUSED_OPS=1inLlamaModel.forwardto fuse all 32 post-MLP inter-layer residual adds directly into the next layer'sinput_layernorm(and finalself.norm) viafused_add_rms_norm, fusing 64/64 residual adds across the entire 7B LLM. - Verification: -time(/tmp/r6/time/time_tree.json):1064.9 ms/step(2.5951xspeedup vs frozen reference2763.6 ms/step,30.05 samples/s),window_spread = 0.0158,logged_loss_first_step_rel_diff = 0.00036,logged_loss_max_rel_diff = 0.0021,peak_memory_reserved_gib = 118.92,problems = []. -check --quick(/tmp/r6/quick/check.json): PASS (tier N1,0exact failures,34/4724minor diagnostic deviations). ---
3.8 hRound 7: Intra-Step FLOP-Balanced Micro-Batching (`LLAVA_BALANCE_TOKENS=1`) — Tested, Not Activated
- Start time: 2026-11-19T22:30:00Z - End time: 2026-11-19T22:36:45Z - Result (/tmp/r7/time/time_tree.json):1064.9 -> 1062.1 ms/step(-2.8 ms/step,0.26%, inside the0.42%reference noise band) while movingrepartitioned = true. Left inactive so/submissionpreserves the exact reference micro-batch partition (repartitioned = false). ---
3.8 hRound 8: Hopper SM90 CUDA 12.8 cuBLAS Upgrade in `/opt/candidate-env`
- Start time: 2026-11-19T22:37:30Z - End time: 2026-11-19T22:53:25Z - Motivation: - In the Round 6 profile,cuBLASSM90bf16GEMMs accounted for870.1 ms/step(81.7% of total wall time) ontorch 2.1.2+cu121(cuBLAS 12.1.3), while the host driver is570.148.08(CUDA 12.8). - Changes implemented (/opt/candidate-env+/submission/switches.json): - Installednvidia-cublas-cu12==<ip>andnvidia-nvjitlink-cu12==12.8.61into/opt/candidate-envand enabled them viaLD_PRELOADin/submission/switches.json(torch 2.1.2+cu121,deepspeed 0.12.6,transformers 4.37.2, andflash-attn 2.5.8unchanged). - Standalone Hopper 32-layer DecoderLayer (fwd+bwd) benchmark dropped from981.82 msto950.99 ms(-30.8 ms). - Also benchmarkednvidia-nccl-cu12==2.26.2(42.7 msAR /20.3 msAG vs42.2 ms/20.3 msbuilt-in withNCCL_PROTO=Simple): no extra gain overNCCL_PROTO=Simple, so omitted. - Verification: -time(/tmp/r8/time/time_tree.json):1021.1 ms/step(2.7065xspeedup vs frozen reference2763.6 ms/step,31.34 samples/s),window_spread = 0.0161,logged_loss_first_step_rel_diff = 0.00036,logged_loss_max_rel_diff = 0.0012,peak_memory_reserved_gib = 118.92,problems = []. -check --quick(/tmp/r8/quick/check.json): PASS (tier N1,0exact failures,34/4724minor diagnostic deviations — 0 additional deviations). ---
3.8 hFull Check #3 (After Round 8)
- Start time: 2026-11-19T22:54:15Z - End time: 2026-11-19T23:00:46Z - Result (/tmp/r8/full_check/check.json): PASS (tier N1,speedup = 2.7067,1021.0 ms/stepvs2763.6 ms/step). - Gate 0: PASS (reference partition) - Gate 1: PASS (1021.0 ms/step,2.7067x) - Gate 2: NOT_BITWISE (0errors,0exact failures,34/4724minor diagnostic deviations) - Gate 3: PASS (train_loss_last20_canonicalbias+0.000247=+0.078σvs3σ = 0.009458;probe_loss_last20bias+0.000124=+0.043σvs3σ = 0.008624). ---
4.6 hCurrent Summary (Superseded by Round 9 below)
- Round 9 profile logged at /tmp/r9/profile/profile_tree.md.
---4.6 hRound 9: Zero-Copy Adjacent `Gate+Up` SwiGLU and `QKV+RoPE+FlashAttn` GEMMs (`LLAVA_FUSED_GEMM=1`)
- Start time: 2026-11-19T23:08:30Z - End time: 2026-11-19T23:40:05Z - Motivation: - In/tmp/r9/profile/profile_tree.md,cuBLASSM90nvjetGEMMs accounted for824.2 ms/step(80.7%of1021.0 mswall time) andCUDAFunctor_add(dX_gate + dX_upanddX_q + dX_k + dX_vbranch sums) took9.8 ms/step. - Earlier runtimetorch.catof weights/gradients lost+9.4 ms/+16.1 msdue to HBM concatenation copies, whereas DeepSpeed Stage 2 (round_robin_gradients=Falsedefault) already places(q_proj.weight, k_proj.weight, v_proj.weight)and(gate_proj.weight, up_proj.weight)immediately adjacent inself.bit16_groups_flat[0]. - Changes implemented (llava/train/triton_ops.py,llava/train/opt_patches.py,/submission/switches.json): - Addedadjacent_view_2andadjacent_view_3zero-copyUntypedStorageviews (w_gu [22016, 4096]andw_qkv [12288, 4096]), preserving allnn.Parameternames/shapes untouched. - Added 2D strided_swiglu_gu_fwd_kerneland_swiglu_gu_bwd_kernel(BLOCK_N=1024, 100% bitwise identical to unfusedfused_swiglu) +_FusedGateUpSwiGLUFn(1 fwd GEMM, 1 dX GEMM, 1 dW GEMM, 0 copies, 0dXbranch adds). - Added_FusedQKVRoPEFn(1 fwd GEMM + in-place strided_qk_rope_kernelonqkv[:, 0:2]+flash_attn_varlen_qkvpacked_func+ in-place strided backward_qk_rope_kernelondqkv[:, 0:2]+ 1 dX GEMM + 1 dW GEMM, 0dXbranch adds). - Eliminated 288 GEMM launches and 96dXadd kernels per step. - Verification: -time(/tmp/r9/time_gemm/time_tree.json):1006.9 ms/step(2.7446xspeedup vs frozen reference2763.6 ms/step,31.78 samples/s, Window 1 at988.6 ms/step),window_spread = 0.0141,logged_loss_first_step_rel_diff = 0.00036,logged_loss_max_rel_diff = 0.002,peak_memory_allocated_gib = 114.91,peak_memory_reserved_gib = 118.88,problems = []. -check --quick(/tmp/r9/quick_gemm/check.json): PASS (tier N1,0errors,0exact failures,36/4724minor diagnostic deviations). ---
5.2 hRound 10: Direct Partitioned Gradient Buffer (`LLAVA_DIRECT_GRAD_PART=1`) + Hopper SM90 FlashAttention-3 (`LLAVA_FA3=1`)
- Start time: 2026-11-19T23:44:30Z - End time: 2026-11-20T03:26:00Z - Motivation: - InLLAVA_FAST_ZERO2,fast_stepcalledself.flatten(self.averaged_gradients[i])(CatArrayBatchedCopyover3.37Belements =~4.5 ms/stepexposed GPU time). - LLM variable-lengthFlashAttention-2(flash-attn 2.5.8) took75.2 ms/step(58.2 msbwd +17.0 msfwd) without Hopper SM90 TMA +wgmmawarp-specialization. - Changes implemented (/opt/candidate-env,llava/train/triton_ops.py,llava/train/opt_patches.py,/submission/switches.json): - Direct Partitioned Gradient Buffer (LLAVA_DIRECT_GRAD_PART=1): Allocated a step-scoped flat partition bufferparts[i]([partition_size[i]] bf16) at the first backward reduction bucket, copied reduced bucket slices directly intoparts[i]onself.reduction_stream, freed per-parameter.gradbuffers immediately on the next bucket flush, exposed zero-copy.narrow()views inself.averaged_gradients[i]for Gate 2safe_get_full_grad, and passedparts[i]directly intotriton_zero2_adamw_step(1006.9 -> 1002.8 ms/step,2.7560x). - Hopper SM90 FlashAttention-3 (LLAVA_FA3=1): Compiled minimal-templateflash_attn_3-3.0.0b1(sm_90a,bf16,hdim=128fwd+bwd usingnvcc 12.6.85+ptxas 12.8.93+ CUTLASS 4.0) into/opt/candidate-env, and added zero-copy_FA3VarlenQKVPackedFnhonoringtorch.are_deterministic_algorithms_enabled()(61.51 ms -> 37.72 ms=1.63xfaster standalone,0RNG state mutation). - Verification: -time(/tmp/r10/time_fa3/time_tree.json):979.7 ms/step(2.8210xspeedup vs frozen reference2763.6 ms/step,32.66 samples/s, windows[9.980s, 9.613s]),window_spread = 0.0152,logged_loss_first_step_rel_diff = 0.00087,logged_loss_max_rel_diff = 0.0019,peak_memory_allocated_gib = 114.85,peak_memory_reserved_gib = 120.56,problems = []. - Full Check #4 (/tmp/r10/full_check/check.json): PASS (tier N1,speedup = 2.8194,980.2 ms/stepvs2763.6 ms/step). - Gate 0: PASS (reference partition) - Gate 1: PASS (980.2 ms/step,2.8194x) - Gate 2: NOT_BITWISE (0errors,0exact failures,37/4724minor diagnostic deviations) - Gate 3: PASS (train_loss_last20_canonicalbias+0.000277=+0.088σvs3σ = 0.009458;probe_loss_last20bias+0.000115=+0.040σvs3σ = 0.008624). ---
5.7 hRound 11: 16-Chunk Pipelined `AdamW + NVLink P2P` Overlap (`LLAVA_OVERLAP_STEP=1`) + Fused Triton `bf16` Cross-Entropy + Async `DtoH`/CLIP Overlap + Single-Cat Packing
- Start time: 2026-11-20T03:27:30Z - End time: 2026-11-20T03:54:20Z - Motivation: - After Round 10 (979.7 ms/step),_zero2_adamw_bf16g_kernel(25.2 ms) andAllGather(20.8 ms) ran back-to-back (46.0 msserialized),F.cross_entropy(logits.float(), labels)allocated[N_valid, 32000]fp32buffers on the critical path (2.14 ms),packed_llava_forwardwaited on synchronousDtoHcopies and CPU packing before launching CLIPencode_images, and per-rowtorch.cat(emb_segs)launched 16 redundantCatArrayBatchedCopykernels beforepacked_embeds. - Changes implemented (llava/train/triton_ops.py,llava/train/opt_patches.py,/submission/switches.json): - 16-Chunk PipelinedAdamW + NVLink P2P(LLAVA_OVERLAP_STEP=1): Splittriton_zero2_adamw_stepinto 16 contiguous chunks on the compute stream overlapped via CUDA events with 16batch_isend_irecvP2P exchanges on an auxiliary stream (45.07 ms -> 33.04 msstandalone, 100% bitwise identical, zero self-copy). Also benchmarked CUDA IPCcopy_(209 msdue to non-P2P staging across process devices) anddist.all_gather(list)(76.5 ms), selectingbatch_isend_irecv. - Fused Tritonbf16Cross-Entropy (fused_bf16_cross_entropy): Onlinefp32logsumexp + backward softmax in registers directly frombf16logits (2.14 ms -> 0.22 ms,0.00e+00fp32loss diff,0[N, V]fp32temporary allocation). - Immediate CLIP Launch Overlapped with Auxiliary-Stream PinnedDtoH+ Single-Passpacked_embedsConcat: Queuedinput_ids/labels/attention_maskDtoHonto a dedicateddtoh_stream, immediately launched 23-layer CLIPencode_images(images)on the default stream att=0so CPU packing runs in parallel with CLIP GPU execution, and flattenedemb_segsdirectly intopacked_embed_partsfor a singletorch.cat. - Verification: -time(/tmp/r11/time_full/time_tree.json):968.5 ms/step(2.8535xspeedup vs frozen reference2763.6 ms/step,33.04 samples/s, windows[9.867s, 9.502s],1377.8 Wacross both 700W GPUs),window_spread = 0.0154,logged_loss_first_step_rel_diff = 0.00087,logged_loss_max_rel_diff = 0.0018,peak_memory_allocated_gib = 114.81,peak_memory_reserved_gib = 119.78,problems = []. - Full Check #5 (/tmp/r11/full_check/check.json): PASS (tier N1,speedup = 2.8486,970.2 ms/stepvs2763.6 ms/step). - Gate 0: PASS (reference partition) - Gate 1: PASS (970.2 ms/step,2.8486x) - Gate 2: NOT_BITWISE (0errors,0exact failures,37/4724minor diagnostic deviations) - Gate 3: PASS (train_loss_last20_canonicalbias+0.000381=+0.121σvs3σ = 0.009458;probe_loss_last20bias+0.000093=+0.032σvs3σ = 0.008624). ---
6.6 hRound 13: Step-Boundary Idle-Bubble Elimination + Async `bf16` HtoD + Zero-`DtoH` Sequence Packing (`LLAVA_FAST_STEP_BOUNDARY=1`)
- Start time: 2026-11-20T04:18:50Z - End time: 2026-11-20T04:34:15Z - Motivation: - Chrome trace timeline inspection (/tmp/r13/profile/detail_tree.r0.json) revealed step-boundary CPU stalls, blockingTrainer._prepare_inputHtoD transfers (77.4 MBfp32images + GPU cast),cudaHostAllocpinned allocations +dtoh_stream.synchronize()+ 5 blocking pageable-to-device.to(device)copies inpacked_llava_forward, repeatedPreTrainedModel.num_parameters/DeepSpeedEngine.zero_grad/DeepSpeedEngine.train(True)/CLIPVisionTowerparameter walks, and redundant 23-layer frozen CLIP execution on all-zero dummy images in text-only micro-batches. - Changes implemented (llava/train/opt_patches.py,llava/train/llava_trainer.py,/submission/switches.json): - Castimage.to(torch.bfloat16)inLazySupervisedDataset.__getitem__inside background CPU DataLoader workers (halving/dev/shmIPC,pin_memory, and PCIe HtoD bytes while keepingbatch_digest100% bitwise identical). - OverrodeLLaVATrainer._prepare_input/_prepare_inputsto usenon_blocking=Trueon pinned tensors (with a 4-slot reference hold) and attach_llava_cpureferences on integer/boolean inputs sopacked_llava_forwardpacks on CPU with 0DtoHcopies and 0 stream syncs. - Added a 4-slot CUDA-event-guarded pinnedHtoDstaging ring for packed metadata (all_text_ids,packed_pos_ids,valid_idx,valid_labels,cu_seqlens), cachedPreTrainedModel.num_parameters, skipped redundantDeepSpeedEngine.zero_grad/train(True)/CLIPVisionTowerparameter walks, and bypassed frozen 23-layerCLIPVisionTowerwhen(ids_cpu == IMAGE_TOKEN_INDEX).any()is False while preservingmm_projectorautograd hooks via a[1, 1, 1024]zero feature. - Verification: -time(/tmp/r13/time_2/time_tree.json):965.1 ms/step(2.8637xvs frozen reference2763.6 ms/step,window_spread = 0.0097). ---
6.6 hRound 14: Alternating-Layer Balanced ZeRO-2 Partition + Coalesced `ReduceScatter` (`LLAVA_REDUCE_SCATTER=1`)
- Start time: 2026-11-20T04:35:00Z - End time: 2026-11-20T04:47:00Z - Motivation: - Telemetry (/tmp/r13/time_2/power_tree.csv) showed both Hopper GPUs pinned against the700Whardware TDP power cap (1380.0 Wtotal =690 W/GPU, throttling SM clocks from1980 MHzto1365–1485 MHz), making step time directly proportional to Joules/step. Microbenchmarking1 GB bf16NCCL collectives measuredReduceScatter(AVG)at1.940 ms(515.4 GB/s) vsAllReduce(AVG)at2.985 ms(335.0 GB/s), with half the NVLink and HBM write traffic. - Changes implemented (llava/train/opt_patches.py,llava/train/llava_trainer.py,/submission/switches.json): - Addedreorder_decay_params_for_reduce_scatterorderingbit16_groups[0]into even transformer layers (30, 28, ..., 0, preserving[down, gate, up, o, q, k, v]within-layer order soLLAVA_FUSED_GEMM=1zero-copyGate+UpandQKVviews remain active on all 32 layers) +embed_tokens+mm_projector.2on Rank 0, andlm_head+ odd transformer layers (31, 29, ..., 1) +mm_projector.0on Rank 1. - Built_ensure_all_rank_fragsand_coalesce_1dinfast_allreduce_and_copyso every backward bucket sorts Rank 0 and Rank 1 fragments deterministically by destination partition offset, coalesces adjacent storage views (dw_gu,dw_qkv, and contiguousparts[0]destination ranges), and executes symmetricdist.reduce_scatter_tensor(..., op=dist.ReduceOp.AVG)directly intoparts[0]whenevertotal_r0 == total_r1. - Standalone 2-GPU bitwise test (/tmp/r14/verify_rs.py) confirmedmax_grad_diff = 0.0,max_param_diff = 0.0,max_ea_diff = 0.0. - Verification: -time(/tmp/r14/time_1/time_tree.json):961.1 ms/step(2.8754xspeedup vs frozen reference2763.6 ms/step,33.29 samples/s, windows[9.787s, 9.435s]),window_spread = 0.0144,logged_loss_first_step_rel_diff = 0.00087,logged_loss_max_rel_diff = 0.0015,peak_memory_allocated_gib = 115.78,problems = []. -check --quick(/tmp/r14/quick_check/check.json): PASS (tier N1,0errors,0exact failures, exact same37/4724diagnostic deviations as Full Check #5 because Rounds 13–14 are 100% bitwise identical to Round 11). ---
6.8 hRound 15: Batched SentencePiece Joint FLOP- & Label-Balanced Intra-Step Micro-Batching (`LLAVA_TRUE_BALANCE=1`)
- Start time: 2026-11-20T04:48:15Z - End time: 2026-11-20T04:59:00Z - Motivation: - Comparing Rank 0 vs Rank 1 Chrome traces revealed Rank 1 spending271.2 ms/stepspinning insidencclKernelwaiting for Rank 0, because upstreamLazySupervisedDataset.modality_lengthsuses rough whitespace word count without image tokens, leaving1.316%mean (8.527%max) true FLOP imbalance and7.94%(23.36%max) supervised label-count imbalance across timed steps5..24. - Changes implemented (llava/train/llava_trainer.py,/submission/switches.json): - Added_compute_dataset_true_costsexecuting a single batched C++sp.EncodeAsIds(all_turns)call (148 msonce at startup for all 26,618 turns oftiming.json) to estimate each sample's packed sequence lengthL_i = min(model_max_length, 42 + 575 * has_img + sum_turns)and supervised GPT label countest_lab_i, with quadratic attention FLOP costC_i = L_i + 0.055 * L_i^2 / 1000. - Added_balance_megabatch_2wayinsideLengthGroupedSampler.__iter__preserving upstream's exacttorch.randpermRNG calls and exact 32-sample per-step multisets, while repartitioning each 32-sample megabatch into two 16-sample micro-batches via greedy +O(1)-delta 2-opt swaps minimizing|C_0 - C_1| / (C_0 + C_1) + 0.15 * |L_0 - L_1| / (L_0 + L_1). Across timed steps5..24, true FLOP max-over-mean imbalance dropped1.316% -> 0.029%(max8.527% -> 0.093%) and label skew dropped7.943% -> 0.522%. - Verification: -time(/tmp/r15/time_1/time_tree.json):956.5 ms/step(2.8892xspeedup vs frozen reference2763.6 ms/step,33.45 samples/s, windows[9.772s, 9.359s]),window_spread = 0.0209,peak_memory_allocated_gib = 115.06,problems = []. - Full Check #6 (/tmp/r15/full_check/check.json): PASS (tier N1,speedup = 2.8897,956.4 ms/stepvs2763.6 ms/step). - Gate 0: PASS (every optimizer step trains on the exact reference sample multiset) - Gate 1: PASS (956.4 ms/step,2.8897x, windows[9.752s, 9.375s]) - Gate 2: NOT_BITWISE (0errors,0exact failures) - Gate 3: PASS (train_loss_last20_canonicalbias+0.002657=+0.843σvs3σ = 0.009458;probe_loss_last20bias+0.000232=+0.081σvs3σ = 0.008624). ---
7.1 hRound 16: Zero-Copy Direct-to-`ReduceScatter` `dW` GEMMs (`LLAVA_DIRECT_DW=1`) + Fused CLIP `Bias+Add+LayerNorm` & `Bias+QuickGELU` (`LLAVA_FAST_CLIP_LN=1`)
- Start time: 2026-11-20T05:00:55Z - End time: 2026-11-20T05:18:20Z - Motivation: - Profile breakdown (/tmp/r13/profile/profile_tree.md) showedCatArrayBatchedCopy<bf16>taking15.2 ms/step(25.9 GBHBM read/write during700W-capped backward GEMMs) to flatten per-parameter.gradtensors into reduction buckets, plusFillFunctor<bf16>(1.1 ms) +vectorized_layer_norm_kernel(1.2 ms) + residual adds across CLIP's 23 layers (159extra kernel launches per step). - Changes implemented (llava/train/triton_ops.py,llava/train/opt_patches.py,/submission/switches.json): - Zero-Copy Direct-to-ReduceScatterdWGEMMs (LLAVA_DIRECT_DW=1): Added a 3-slot CUDA-event-guarded pair buffer ring ([2 * L_lin]=404.75Mbf16elements) and_DirectLinearFn+out_dwsupport in_FusedGateUpSwiGLUFn/_FusedQKVRoPEFn. During backward, all 4dWGEMMs (down_proj,gate+up,o_proj,q+k+v) of even layer2pwrite directly intopair_buf[slot][0 : L_lin]and odd layer2p+1write directly intopair_buf[slot][L_lin : 2*L_lin], while548 KBofRMSNorm/bias grads are deferred tofast_epilogue. Each 14-parameter 2-layer pair flushes viadist.reduce_scatter_tensor(parts[0][dst], pair_buf[slot], op=AVG)with 0param.gradallocations, 0CatArrayBatchedCopy, and 0rs_outcopies (max_grad_diff = 0.0,max_param_diff = 0.0verified in/tmp/r16/verify_r16.py). - Fused CLIPno_gradKernels (LLAVA_FAST_CLIP_LN=1): Added_bias_add_layer_norm_fwd_kerneland_bias_quick_gelu_fwd_kernelfusing linear bias epilogues, residual additions, cross-layer LayerNorms, and QuickGELU in-place across CLIP's 23 layers (159kernel launches and69FillFunctorbias broadcasts eliminated per step). - Verification: -time(/tmp/r16/time_1/time_tree.json):944.1 ms/step(2.9271xspeedup vs frozen reference2763.6 ms/step,33.89 samples/s, windows[9.679s, 9.204s]),window_spread = 0.0281,logged_loss_first_step_rel_diff = 0.00058,peak_memory_allocated_gib = 119.57,problems = []. - Full Check #7 (/tmp/r16/full_check/check.json): PASS (tier N1,speedup = 2.9274,944.0 ms/stepvs2763.6 ms/step). - Gate 0: PASS (exact reference per-step sample multisets) - Gate 1: PASS (944.0 ms/step,2.9274x, windows[9.668s, 9.213s]) - Gate 2: NOT_BITWISE (0errors,0exact failures) - Gate 3: PASS (train_loss_last20_canonicalbias+0.003035=+0.963σvs3σ = 0.009458;probe_loss_last20bias-0.000018=-0.006σvs3σ = 0.008624). ---
7.8 hRound 18: Persistent Grad/Pair Buffers (`LLAVA_PERSIST_BUFS=1`) + Async `DataLoaderShard` HtoD + Zero-Sync `DeepSpeedEngine.backward` + CLIP-Overlapped CPU Packing
- Start time: 2026-11-20T05:30:00Z - End time: 2026-11-20T06:00:00Z - Motivation: - Detailed 2-step Chrome trace (/tmp/r18/profile/detail_tree.r0.json) of Round 16 (33088ee) exposed four distinct CPU/GPU bubbles: 1.DeepSpeedEngine.backward(engine.py:1935) executedself.losses += loss.mean().item()beforeself.optimizer.backward(loss), blocking the Python CPU thread for230–250 ms/step(aten::item = 249.8 ms/step) until 100% of forward GPU kernels drained, exposing a5.1–6.6 msfwd -> bwdGPU idle gap while autograd and cuBLAS initialized backward. 2. Clearing_llava_flat_grad_part(6.76 GiB) and_llava_dw_pair_ring(2.43 GiB) every step triggered7.0 ms+3.0 msexpandable_segments:TruecuMemCreate/cuMemMapOS stalls during peak-sequence steps (including a172 msstall on timed Step 14) plus2.7 ms/stepof redundant_update_model_bit16_weightsparameter re-linking. 3.accelerate.data_loader.DataLoaderShard.__iter__calledsend_to_device(current_batch, self.device)(non_blocking=False) *before*LLaVATrainer._prepare_input, blocking CPU on38.7 MBimage transfers, bypassing_llava_cpuattachment (forcingdtoh_stream.synchronize()), and preventing the frozen-CLIP bypass on text-only steps (Steps 11 and 14). 4.packed_llava_forwardran its per-row CPU sequence/label/position loop *after*encode_images+embed_tokens, leaving a1.84 msGPU idle gap before Llama Layer 0. - Changes implemented (llava/train/opt_patches.py,/submission/switches.json): - Persistent Buffers (LLAVA_PERSIST_BUFS=1): Kept_llava_flat_grad_part(6.76 GiB),_llava_part_views,_llava_param_frag_map, and the 3-slot_llava_dw_pair_ring(2.43 GiB) persistent across steps, and cached_llava_linked_flat_ptrsto skip redundant_update_model_bit16_weightscalls once linked. - Zero-Syncfast_ds_backward: ReplacedDeepSpeedEngine.backwardon the standard ZeRO-2bf16path soself.optimizer.backward(loss)launches immediately att = 50 mswhile forward is executing on the GPU (self-paced to<= 2buckets ahead byfast_allreduce_and_copy's 2-slot event ring), deferringself.losses += loss.detach().mean().item()until *after*optimizer.backwardcompletes (0.005 ms, zero stream stall). -DataLoaderShardAsync Pinned HtoD +_llava_cpuAttachment: Patchedaccelerate.data_loader.send_to_devicewith a 4-slot pinned-reference ring (_pinned_hold),non_blocking=t.is_pinned(), andout._llava_cpu = t, eliminating blocking HtoD transfers, eliminatingdtoh_stream, and activating the frozen-CLIP bypass on text-only steps (-16 mson Step 11,-172 mscombined on Step 14). - CLIP-Overlapped CPU Packing + Single-Buffer Pinned HtoD: Moved all per-row CPU label/position/offset construction and coalescedall_long_gpu(text_ids + pos_ids + valid_idx + valid_labels) async HtoD immediately after launchingencode_images(images), hiding CPU packing completely underneath CLIP's14.5 msGPU execution. - *(Ablated & reverted inside Round 18)*: TestedBLOCK=2048, num_warps=8+eviction_policy="evict_first"in_zero2_adamw_bf16g_kernel(/tmp/r18/time_1&/tmp/r18/profile_cand), which saturated SM warp slots and starved concurrentag_streamncclKernel_SendRecvP2P overlap (+4.03 ms/step:35.37 -> 39.40 ms); reverted toBLOCK=1024, num_warps=4(94%P2P overlap). - Verification: -time(/tmp/r18/time_2/time_tree.json):933.8 ms/step(2.9594xspeedup vs frozen reference2763.6 ms/step,34.27 samples/s, windows[9.471s, 9.205s]),window_spread = 0.0061(down from0.0281),peak_memory_allocated_gib = 118.81,peak_memory_reserved_gib = 120.50,problems = []. -check --quick(/tmp/r18/quick_check/check.json): PASS (tier N1,0errors,0exact failures; Gate 2 summary100%identical to Round 16 Full Check #7 since zero math/kernel numerics changed). ---
8.6 hRound 19: Precompiled `llava_cuda_ipc` Extension + Single-Kernel Fused ZeRO-2 `AdamW + Direct NVLink-18 IPC Dual-Store` (`LLAVA_IPC_ADAMW=1`)
- Start time: 2026-11-20T06:01:30Z - End time: 2026-11-20T06:57:30Z - Motivation: - Round 19 baseline profile (/tmp/r19/profile/profile_tree.md) showedfast_steptaking~35.5 ms/step(_zero2_adamw_bf16g_kernel33.2 ms+ 16-chunkag_streamncclKernel_SendRecv25.3 ms), wherencclKernel_SendRecvre-read6.76 GiBof updatedbf16weights from local HBM, bounced through NCCL's IPC staging buffer (+13.52 GiBextra HBM write+read), and competed for SM warps (preventingnum_warps=8in_zero2_adamw_bf16g_kernel). - Note: PyTorchexpandable_segments:True(cuMemCreate) tensors rejectcudaIpcGetMemHandle(cudaErrorInvalidValue), which is why naive IPC failed unless backed bycudaMalloc. - Changes implemented (/opt/candidate-envllava_cuda_ipc,llava/train/triton_ops.py,llava/train/opt_patches.py,/submission/switches.json): - Built and installed precompiled C++/CUDA extensionllava_cuda_ipc-0.1.0into/opt/candidate-env(alloc_cuda_malloc_bf16,get_ipc_mem_handle,open_ipc_mem_handle,close_ipc_mem_handle; zero runtime JIT compilation). - HookedDeepSpeedZeroOptimizer.initialize_gradient_partitioning_data_structures(beforecreate_reduce_and_remove_grad_hookscreatesparam_tmpviews) to replacebit16_groups_flat[0](7.26Bbf16elements =13.52 GiB) with acudaMalloc-backed tensor, immediately freeing the original13.52 GiBCUDACachingAllocatorbuffer (peak_memory_allocated_gibdropped118.81 -> 106.22 GiB) and mapping the peer GPU'sbit16_groups_flat[0]directly into local virtual address space viacudaIpcOpenMemHandle(..., cudaIpcMemLazyEnablePeerAccess). - Added_zero2_adamw_bf16g_ipc_kernel(BLOCK=1024, num_warps=8) intriton_ops.pythat computes thefp32AdamW update once in registers and simultaneously storesp.to(bf16)to localmy_partHBM AND directly over NVLink-18 to the peer GPU'speer_partHBM (-27.0 GiBHBM traffic eliminated, zeroag_stream, zeroncclKernel_SendRecv;35.45 -> 26.13 msat700Win/tmp/r19/bench_ipc_full.py,0.0e+00bitwise diff). - Verification: -time(/tmp/r19/time_2/time_tree.json):926.8 ms/step(2.9818xspeedup vs frozen reference2763.6 ms/step, windows[9.403s, 9.133s]),window_spread = 0.0066,peak_memory_allocated_gib = 106.22,problems = []. - Full Check #8 (/tmp/r19/full_check/check.json): PASS (tier N1,speedup = 2.9846,926.0 ms/stepvs2763.6 ms/step). - Gate 0: PASS (every optimizer step trains on the exact reference sample multiset) - Gate 1: PASS (926.0 ms/step,2.9846x, windows[9.381s, 9.138s],window_spread = 0.0040,34.56 samples/s,peak_memory_allocated_gib = 106.22) - Gate 2: NOT_BITWISE (0errors,0exact failures) - Gate 3: PASS (train_loss_last20_canonicalbias+0.002718=+0.862σvs3σ = 0.009458;probe_loss_last20bias+0.000374=+0.130σvs3σ = 0.008624). ---
9.2 hRound 20: Custom `sm_90` `uint4` CUDA `QkRoPE` + Single-Kernel Multimodal Embed Gather/Scatter + Zero-Padding Asymmetric `Reduce` + Non-Blocking `fast_step` (`LLAVA_FAST_R20=1`)
- Start time: 2026-11-20T07:01:50Z - End time: 2026-11-20T07:31:30Z - Motivation: - Round 20 baseline profile (/tmp/r20/profile/detail_tree.r0.json) revealed four critical-path inefficiencies: 1.packed_llava_forwardindexedimage_features[s_idx]16 times, creating 16SelectBackward0autograd nodes that executed31serial[16, 576, 4096](75.5 MB)FillFunctor+CUDAFunctor_addkernels (2.28 ms/step) at the backward tail right beforefast_epilogue. 2. Asymmetric non-layer buckets (lm_head262 MBon Rank 1 at backward start;embed_tokens + mm_projector.2296 MBon Rank 0 vsmm_projector.08.4 MBon Rank 1 at backward end) allocated524–591 MBrs_inbuffers, zero-filled262–287 MBof padding, and ranReduceScatteron2xpadded buffers. 3. Triton_qk_rope_kernel(8.78 ms/step) issued strided 2D loads with 128-byte holes across Q and K heads (7.90 ms/stepwithuint4-vectorized SM90 CUDA C++). 4. DeepSpeedself.timers(...).start()/stop()insidefast_stepcalledtorch.cuda.synchronize()6 times per step (20.4 msCPU stall) even whenwall_clock_breakdown: false. - Changes implemented (/opt/candidate-envllava_cuda_ipc-0.2.0,llava/train/triton_ops.py,llava/train/opt_patches.py,/submission/switches.json): - Extendedllava_cuda_ipc(0.2.0) withsm_90uint4-vectorizedqk_rope_inplace_bf16(0.0bitwise diff fwd+bwd),pack_mm_embeds_fwd_bf16, andpack_mm_embeds_bwd_bf16. - Added_PackMultimodalEmbedsFnand vectorized CPUdst_src_map/text_bwd_map/img_bwd_mapconstruction insidehtod_entry[1]pinned memory (overlapped under CLIP GPU execution), replacingtorch.split+48-waytorch.catin forward and replacing all31serial[16, 576, 4096]backward kernels with two0.04 msuint4gather kernels (0.0bitwise diff). - Used zero-padding per-sidedist.reduce(op=AVG)infast_allreduce_and_copywhenevermin(total_r0, total_r1) * 4 < half_cap(0.0bitwise diff), and skippedself.timerscuda.synchronize()calls infast_stepwhenwall_clock_breakdownis disabled. - Verification: -time(/tmp/r20/time_1/time_tree.json):922.8 ms/step(2.9949xspeedup vs frozen reference2763.6 ms/step,window_spread = 0.0054),peak_memory_allocated_gib = 106.22,problems = []. -check --quick(/tmp/r20/quick_check/check.json): PASS (tier N1,0errors,0exact failures; all R20 kernels verified0.0bitwise diff vs R19). ---