Gemini 4 Neon 3.12×
Harness: Antigravity · switches: none
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 (58 min); the judged result is the continuation's. The time axis leaves out the held time of both segments.
- Judged
- 3.12×
- Tier
- N1
- Self-best
- 3.15×
- Rounds
- 13
- Hours
- 10.0
- API cost
- $88.3
- Input tokens · 97.7% cached
- 286 M
- Output tokens
- 1.8 M
- Requests
- 1,005
§ 02Key levers
- Sequence packing
- ✓ round 3
LLAVA_OPT_UNPAD(plus LM head only at labeled positions), 2636.0 → 1784.1 ms (1.48×) with full recompute still on - Recompute / activations
- ✓ round 3 down to 16/32 recomputed layers (1.7586×); round 4
LLAVA_OPT_GC_LAYERS=0once fused kernels freed activation memory (in-place RoPE saves ~27 GiB); only batches above 16500 tokens recompute (made proportional in continuation round 20) - Optimizer
- ✓ round 3 full check hit torch 2.1 fused AdamW skipping updates past 231 elements (27.8% of params not updated, caught by gate 2), fixed by chunking; round 4
LLAVA_OPT_FAST_DS_STEPone Triton kernel for bf16 grad → fp32 AdamW → bf16 weight; rounds 10–12LLAVA_OPT_NVLINK_ADAMwrites new weights straight into the peer GPU via CUDA IPC (36.95 → 24.21 ms); round 19 folds the two-GPU grad average into that kernel - Communication & libraries
- ✓ ZeRO-2 (round 2,
LLAVA_OPT_MATCH_Z3_ROPEreproduces ZeRO-3's bf16 RoPE positions, first-loss gap 0.585% → 0.007%); round 5 candidate env swapped to torch 2.8 + cuBLAS 12.8 + NCCL 2.27.3 + DeepSpeed 0.16.5 (1074.3 → 1020.4 ms); round 7 FA3 (996.0 → 974.4 ms); round 15 backward grad reduction pushed peer-to-peer by the copy engine instead of NCCL reduce (−6.3 ms); continuation round 20 own cuBLASLt extension pins algorithms for dW GEMMs - Other main levers
- Triton fused residual + RMSNorm, in-place QK RoPE, SwiGLU (round 4, with the new optimizer step and no recompute → 1097.5 ms); QKV and gate/up as merged GEMMs over adjacent views in the ZeRO-2 flat buffer; last layer only on the labeled suffix (−15.3 ms), trailing unlabeled tokens trimmed; GEMM speed of both GPUs measured at 700 W at startup, samples split in that ratio (903.0 → 899.4 ms); packed token count padded to N mod 16 = 8 to avoid cuBLAS slow tiles (897.4 → 895.5 ms); ends at 888.8 ms/step (continuation round 20)
§ ARaw trace
Raw work log13 sections
-7.4 hRound 1 — Baseline Profile (Unchanged Reference)
- Start / End: 2026-11-19 19:03:00Z – 19:09:30Z - Command / Output:bench.py profile --tree /submission/llava --config /submission/switches.json --out /tmp/r1/profile --detail- Profile Findings (Step 6, rank 0 GPU trace span 2616.6 ms; rank 1 span 2613.2 ms; GPU busy union 2387.5 ms, idle 229.1 ms): - Stage GPU breakdown (rank 0, kernel sum 2685.7 ms): -CkptBwd_Total: 1645.6 ms (61.3%) — includes ~570 ms activation recomputation + ~1075 ms backward -Forward_CkptLayers: 570.2 ms (21.2%) -NCCL_AllGather: 216.3 ms (8.1%, 758 calls — ZeRO-3 parameter gathering) -NCCL_ReduceScatter: 83.4 ms (3.1%, 293 calls — rank 1 total NCCL was 731.4 ms!) -Forward_Other(CLIP + projector + prepare_inputs): 69.1 ms (2.6%) -Optimizer(foreach AdamW + fp32->bf16 cast + norm): 65.0 ms (2.4%, 1141 kernels) -Backward_NonCkpt(lm_head + projector + embed): 32.0 ms (1.2%) - Kernel category breakdown (rank 0): -GEMM: 1375.0 ms (51.2%, 1097 calls; 384x(17808,4096)x(4096,4096), 160x(17808,4096)x(4096,11008), 128x(17808,11008)x(11008,4096)— 1/3 of forward+recompute+dX is grad ckpt recomputation!) -Elementwise(mul261 ms,add_61 ms,add52 ms,silu22 ms,neg19 ms,pow18 ms,div12 ms,silu_bwd11 ms): 476.8 ms (17.8%, 3456 calls) — unfused RMSNorm, RoPE, SwiGLU -Copy/Index/Cat/Fill/Mem(copy_185 ms,cat51 ms,gather35 ms,fill_31 ms,scatter_18 ms,_index_put_impl_18 ms): 348.0 ms (13.0%, 4781 calls) — RMSNorm fp32 casts, RoPErotate_halfcat/neg, 64x FlashAttnunpad_input/pad_input-NCCL(AllGather216 ms +ReduceScatter83 ms): 300.7 ms (11.2% rank 0; 731.4 ms rank 1) -Optimizer/MultiTensor: 65.0 ms (2.4%) -FlashAttn(bwd47.8 ms +fwd30.1 ms): 77.9 ms (2.9%) -Reduction/Norm: 30.6 ms (1.1%) - CPU syncs / Padding analysis: -aten::nonzero: 112 calls, 753.0 ms CPU inclusive (16xtorch.where+ 32x boolean indexing inprepare_inputs_labels_for_multimodal+ 64x_get_unpad_datainsideLlamaFlashAttention2). - Across timed steps 5–24: avg padded tokens/rank = 19,420 (max of 2 ranks = 20,146), vs real non-pad tokens/rank = 13,570 (30.1% padding waste, 1.48× token inflation!). - Valid supervised labels/rank = 1,963 (10.1% of padded tokens) — 90% oflm_head+CrossEntropyLosscompute and ~2.2–4.6 GiB fp32 logits memory is wasted onIGNORE_INDEX=-100. - Hotspot Classification: 1. Configuration (L0): ZeRO-3 (758 AllGathers, 300–731 ms NCCL) + Gradient Checkpointing (~570 ms recompute) + non-fused foreach AdamW (65 ms) despite 139.8 GiB VRAM/GPU. 2. Algorithmic / Graph Rewrite (L3): Full-model sequence unpadding (1.48× fewer tokens + zerounpad_input/pad_input/nonzerosyncs) + valid-label-onlylm_head(~10× less lm_head/CE work & memory). 3. Memory-bound Fusions (L1/L4): Fused Residual+RMSNorm, Fused Packed-Layout QK RoPE (no transpose), Fused SwiGLU (recomputing silu in bwd to cut activation memory 33%), CLIP SDPA/FlashAttn + compile. 4. Library/Backend Stack (L1): Upgrade/opt/candidate-envfrom torch 2.1.2+cu121 / triton 2.1.0 / flash-attn 2.5.8 to modern PyTorch (cu124/126/128 Hopper WGMMA cuBLASLt) + Triton 3.x + FlashAttention-3 / 2.7 +torch.compile. - Changes: None (profiling round). ---
-6.9 hRound 2 — L0 Distributed & Optimizer Config (ZeRO-2 + Fused AdamW + Z3-Parity RoPE)
- Start / End: 2026-11-19 19:10:00Z – 19:35:30Z - Hotspot Targeted: ZeRO-3 parameter AllGathers (216 ms r0 / 731 ms r1 NCCL), non-fused foreach AdamW (65 ms), gradient checkpointing. - Key Findings & Fixes: 1.LLAVA_OPT_NO_GC=1with padded unfused layers OOM'd at 139.8 GiB (torch.cuda.OutOfMemoryError, 134.85 GiB allocated) because unfusedLlamaRMSNorm(fp32 intermediates), unfusedRoPE(rotate_half), and unfusedLlamaMLPsave ~150 GiB activations on 20k padded tokens. Deferred fullNO_GCuntil after sequence unpadding (Round 3) and fused kernels (Round 4). 2.torch.optim.AdamW(fused=True)failed at__init__because DeepSpeed moves params to CUDA aftercreate_optimizer(). Fixed via_LazyFusedAdamWinllava_trainer.py(LLAVA_OPT_FUSED_ADAM=1), activatingfused=True, foreach=Falseon firststep(). 3. CRITICAL DISCOVERY — DeepSpeed ZeRO-3zero.Init(dtype=bf16)RoPE bug: Under ZeRO-3,deepspeed.zero.Init(dtype=bf16)interceptstorch.arange(4096, dtype=float32)insideLlamaRotaryEmbedding._set_cos_sin_cacheand createstinbfloat16(quantizing positions >256, e.g.257 -> 256), causing ZeRO-2 (which computes fp32t) to differ from the frozen ZeRO-3 reference by 0.585% on step-1 loss (1.3758vs1.3839), tripping Gate 1's 0.5% band! Verified exact bitwise reproduction (max diff: 0.0) viat = torch.arange(seq_len, device=device, dtype=torch.bfloat16).float()(LLAVA_OPT_MATCH_Z3_ROPE=1inLlavaLlamaModel). Also notedLinearFunctionForZeroStage3usesmatmul + biasvsF.linearaddmmon 3D CLIP/projector inputs (~0.007% loss diff, well within 0.5%). - Timing Result (/tmp/r2/time_z2t_fused_rope,LLAVA_OPT_DS_CONFIG=./scripts/zero2_tuned.json,LLAVA_OPT_FUSED_ADAM=1,LLAVA_OPT_MATCH_Z3_ROPE=1): -status:ok(problems: [], step-1 loss1.3838vs ref1.3839, rel diff0.007%) -ms_per_step:2636.0 ms(vs2780.8 msref) →1.0549×speedup (window_spread: 0.0014,beyond_reference_noise: true) -peak_memory_allocated_gib:76.28 GiB- Commit: Committed to/submission/llava(Round 2 (L0, N1)...). ---
-6.8 hRound 3 — L3 Full-Model Sequence Unpadding + Valid-Label-Only LM Head + Partial GC
- Start / End: 2026-11-19 19:36:00Z – 19:45:00Z - Hotspot Targeted: 30.1% padding token waste (1.48× token inflation), 64× per-layerunpad_input/pad_input/aten::nonzeroCPU syncs (753 ms CPU), 90% wastedlm_head+CrossEntropyLossonIGNORE_INDEX=-100, 31× redundant RoPEcos[pos]gathers, 64× QKV transpose roundtrips, and activation recomputation. - Changes: - Addedllava/model/language_model/packed_ops.pybehindLLAVA_OPT_UNPAD=1, wired intoLlavaLlamaForCausalLM.forward. - Packs valid multimodal tokens directly into[total_tokens, 4096]via CPU plan +_PackMultimodalFn, skips CLIP on pure text batches (keeping 0-rowmm_projectorgraph connection), precomputescos_pos/sin_posonce across all 32 layers, runsLlamaDecoderLayer+flash_attn_varlen_funcdirectly on[N, H, D]without transposes orunpad_input/pad_input, and runslm_head+CrossEntropyLossonly onshift_labels != -100. - AddedLLAVA_OPT_GC_LAYERS+LLAVA_OPT_GC_TOKEN_THRESH(checked all 80 steps oftiming.json: max real tokens/rank is 15,254 for seed 42 and ≤15,093 in steps 0–59 for seed 0). - Timing Results: -unpad+ GC 32/32 (/tmp/r3/time_unpad):1784.1 ms/step,1.5587×,window_spread: 0.0024,peak_mem: 76.28 GiB,status: ok. -unpad+ GC 12/32 (noexpandable_segments): OOM at 110.34 GiB allocated + 21.61 GiB fragmented reserved. -unpad+ GC 8/32 +PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True: steps 6–13 & 15–24 ran at ~1450 ms/step (~1.92×), but step 14 hit 132.39 GiB and stalled ~10s in allocator GC (window_spread: 0.5089). -unpad+ GC 16/32 +expandable_segments:True(/tmp/r3/time_unpad_gc16_exp):1581.3 ms/step,1.7586×,window_spread: 0.0042,peak_mem: 108.92 GiB,status: ok,problems: []. - Commit & Fullcheck(/tmp/r3/check2, commits6e8d09c+f426f94): - First fullcheckcaught a critical PyTorch 2.1.2 bug:torch.optim.AdamW(fused=True)overflowsint32on ZeRO-2's3.37B-element (>2^31) flat fp32 partition, leaving the first1.22Belements (27.8% of params) un-updated (cross_rank_patternGate 2 failure). Fixed inf426f94by chunking>1B-element tensors into 1B views inside_LazyFusedAdamW.step()while keepinglen(param_groups)==2intact. - Re-ran fullcheck(/tmp/r3/check2):STATUS: PASS,1602.5 ms/step,1.7353×(window_spread: 0.0038,peak_mem: 108.92 GiB,avg_power: 1352.8 W), Gate 0 PASS, Gate 2TIER: N1(exact_failures: []), Gate 3verdict: equivalent(train_loss_last20_canonical:+0.000169=+0.053σ;probe_loss_last20:-0.000290=-0.103σ). - Promoted/tmp/r3/sw_r3_unpad_gc16_exp.jsonto/submission/switches.json. ---
0.7 hRound 4 — L4/L3/L2 Custom Triton Fused Kernels + Zero GC + Merged QKV + Fast CLIP + Fast DeepSpeed Step
- Start / End: 2026-11-19 20:01:30Z – 2026-11-20 03:13:00Z - Profile of Round 3 (1606.7 msspan,/tmp/r4/profile/profile_tree.md): -GEMM: 1014.5 ms (including 16/32 GC layers recomputation ~145 ms) -Elementwise: 289.7 ms,Copy/Index/Mem: 161.3 ms,Reduce/Norm: 27.8 ms (478.8 ms total unfused RMSNorm/RoPE/SwiGLU + casts) -Optimizer + norm + casts: ~89.2 ms (56.9 mschunked FusedAdamW +289 msCPUaten::item/ 150×g.double().norm(2)+ 13.5 GiB fp32 grad cast +mul_(1.0)no-op + fp32->bf16 copy) -NCCL: 69.8 ms r0 (48.0 ms overlapped AllReduce + 21.6 ms final AllGather);FlashAttn: 74.3 ms;CLIP: 34.3 ms. - Changes (3 atomic commits to/submission/llava:7172f37,2ec8498,92205a0, all behind switches off by default): 1.llava/model/language_model/fused_llama_kernels.py+packed_ops.py(LLAVA_OPT_FUSED_KERNELS=1,LLAVA_OPT_MERGED_QKV=1,LLAVA_OPT_GC_LAYERS=0): -FusedRMSNormFn/FusedAddRMSNormFn: single-pass fused residual+RMSNorm forward & deterministic SM-persistent backward (7.08× faster in microbench, saves 144 ms + 6× less norm memory). -FusedInplaceQKRoPEFn/FusedInplaceQKRoPEPackedFn: in-place packed Q+K RoPE directly indexingcos/sintable byposition_ids(4.91× faster, bitwise identical0.00e+00, zero saved Q/K activations -> saves ~27 GiB VRAM). -FusedSwiGLUFn: fusedsilu(gate)*uprecomputing silu in backward (1.86× faster, 33% less MLP activation memory). -_MergedLinear3Fn+flash_attn_varlen_qkvpacked_func(saves ~9.3 ms; microbench showed merged Gate+Up lost 12.8 ms on cuBLAS 12.1 so kept separate behindLLAVA_OPT_MERGED_MLP). - Identity-keyed CPU metadata cache inLLaVATrainer._prepare_inputs-> zero D2H sync at start of forward. 2.llava/model/multimodal_encoder/fast_clip.py+clip_encoder.py(LLAVA_OPT_FAST_CLIP=1,LLAVA_OPT_CLIP_FA=1): - Skips unused CLIP layer 23 +post_layernormwhenselect_layer == -2(bitwise N0) + replaces eager CLIP attention withflash_attn_func(34.34 → 17.48 ms, 2.0× faster). 3.llava/train/fast_ds_step.py+llava_trainer.py(LLAVA_OPT_FAST_DS_STEP=1): - Patches DeepSpeed ZeRO-1/2zopt.stepviaTrainerCallback.on_train_begin(beforellava_adapterPausehook): skips unusedscaled_global_norm()and no-opmul_(1.0)whenclip_grad==0.0, eliminates 13.5 GiB fp32 grad allocation, and fuses bf16-grad -> fp32 AdamW -> bf16 weight writeback in 1 Triton kernel withint64indexing and CPU 0-dsteptensor (zero GPU-CPU sync,1.3e-10parity vstorch.optim.AdamW). - Timing & FullcheckResults: -sw_r4a(Fused Kernels + Fast DS Step +GC_LAYERS=0):1097.5 ms/step,2.5338×,peak_mem: 116.48 GiB,window_spread: 0.0033. -sw_r4b(+MERGED_QKV=1+FAST_CLIP=1+CLIP_FA=1):1076.2 ms/step,2.5839×. - Fullcheck(/tmp/r4/check_r4b/check.json):STATUS: PASS,1074.3 ms/step,2.5885×(29.79 samples/s,window_spread: 0.0102,peak_mem: 116.48 GiB,avg_power: 1367.4 W), Gate 0 PASS, Gate 2TIER: N1(exact_failures: []), Gate 3verdict: equivalent(train_loss_last20_canonical:+0.000141=+0.044σ;probe_loss_last20:+0.000822=+0.291σ). - Promoted/tmp/r4/sw_r4b.jsonto/submission/switches.json. ---
1.5 hRound 5 — L1 Library Stack Upgrade (`/opt/candidate-env`: PyTorch 2.8.0+cu128 + Triton 3.4 + cuBLAS 12.8 + NCCL 2.27.3 + FA 2.8.3 + DeepSpeed 0.16.5)
- Start / End: 2026-11-20 03:13:30Z – 03:27:10Z - Profile of Round 4 (1072.4 ms,/tmp/r5/profile/profile_tree.md): -GEMM(cuBLAS 12.1sm90_xmma_gemm): 840 ms (78.3% of step!);FlashAttn(2.5.8): 73.5 ms;Triton_Llama: 46.8 ms (10.2× faster than Round 3!);Triton_AdamW: 26.8 ms (3.3× faster);NCCL: 48.1 ms overlapped AllReduce + 22.7 ms AllGather;Idle: 15.5 ms. - Changes: - Built & validated staging venv/tmp/cand-next, then atomically swapped/opt/candidate-env/lib/python3.10/site-packages(keepingsite-packages-prevand/tmp/candidate-env-backupfor rollback): -torch 2.8.0+cu128,torchvision 0.23.0+cu128,triton 3.4.0,nvidia-cublas-cu12 <ip>,nvidia-cudnn-cu12 <ip>,nvidia-nccl-cu12 2.27.3,flash-attn 2.8.3.post2,deepspeed 0.16.5(withDS_BUILD_OPS=0, keepingnumpy 1.26.4). - Added DeepSpeed 0.16.5_lazy_init_hp_params_optimizer_state()linkage infast_ds_step.py(f68e451) so Gate 2safe_get_full_optimizer_stateworks seamlessly. - Timing Result (/tmp/r5/time_pt28): -ms_per_step:1020.4 ms(vs1074.3 mson Torch 2.1.2) →2.7253×speedup (window_spread: 0.0083,peak_mem: 116.42 GiB,avg_power: 1372.2 W, step-1 loss diff0.072%). - Profile (/tmp/r5/profile_pt28): GEMMs switched fromsm90_xmma_gemmto cuBLAS 12.8 Hopper cooperativenvjet_tstkernels (800.3 ms);Triton_AdamWsped up to22.9 ms(4.19 TB/s, 87% HBM3e peak);aten::itemdropped to0 ms. ---
1.5 hRound 6 — L4/L2 Zero-Copy Contiguous Weight Views + Pipelined AdamW/P2P AllGather Overlap + Tuned Triton + CLIP QuickGELU
- Start / End: 2026-11-20 03:28:00Z – 03:47:15Z - Changes (commits42c46d3,5e5c6cd,3acf71a): - Zero-copytorch.as_stridedviews (_cat_or_view3,_cat_or_view2) exploiting contiguous layout ofq/k/vandgate/upinside DeepSpeed ZeRO-2bit16_groups_flat[0](eliminates all 64× QKV & 64× GateUptorch.catcopies;CatArrayBatchedCopy5.1 → 1.0 ms; unlocks zero-overheadLLAVA_OPT_MERGED_MLP=1). - 8× SM persistent grid (1056CTAs) inFusedRMSNormFn/FusedAddRMSNormFnbackward (15.2 → 8.7 ms, deterministic) + 16-warpQKRoPE. - Pipelined 8-chunkTriton_AdamW+ async P2P NVLinkbatch_isend_irecvAllGather overlap (LLAVA_OPT_OVERLAP_ADAM_AG=1, strictly N0;44.7 → 34.7 ms). - Triton in-placeQuickGELUfor CLIP (3.1 → 0.8 ms) +LLAVA_OPT_NO_PY_GC=1+LLAVA_OPT_ASYNC_H2D=1(preserving DeepSpeed bf16 cast for CPU probe batches). - Timing Results: -sw_r6a(withoutMERGED_MLP):1004.1 ms/step(2.7695×). -sw_r6b(+ zero-copyMERGED_MLP=1):996.0 ms/step(2.7919×— broke sub-1s/step!peak_mem: 116.42 GiB,avg_power: 1377.1 W). ---
1.5 hRound 7a — L1/L4 Hopper FlashAttention-3 (`flash_attn_3` sm90 TMA WGMMA)
- Start / End: 2026-11-20 03:48:00Z – 04:01:20Z - Changes (commitb4d055c): - Installed prebuilt Hopperflash-attn-3(3.0.0+cu128torch2.8, cp39-abi3) into/opt/candidate-env. - Added zero-copy_FlashAttn3VarlenQKVPackedFninpacked_ops.py(passingqkv[:, 0/1/2]and pre-allocateddqkv[:, 0/1/2]directly toflash_attn_3custom ops, passingdeterministic=torch.are_deterministic_algorithms_enabled()for Gate 2) + CLIPflash_attn_3(LLAVA_OPT_FA3=1). - Microbench: Llama varlen 32L55.3 → 32.6 ms(1.70×faster), parity9.49e-4,deterministic eq: True True. - Verification (check_r7_fa3+check_r7_n1): - Gate 0: PASS. - Gate 1:974.4 ms/step,2.8537×speedup,peak_mem: 113.53 GiB(3 GiB lower than FA2!). - Gate 2:TIER: N1,exact_failures: []. - Gate 3 (check_r7_n1after_prepare_inputbf16 fix3acf71a):STATUS: PASS,verdict: equivalent(train_loss_last20_canonical:+0.263σ,probe_loss_last20:+0.270σ, 95.5s wall time). - Promoted/tmp/r7/sw_r7_fa3.jsonto/submission/switches.json. --- ## Rounds 8–9 — L4/L3/L2 Zero-Recompile Triton + 1-Way In-Placedist.reduce(AVG)+ Exact Cross-Rank Load Balancing - Changes (commitsd124bf2,a5b9882,d00782b): - Addeddo_not_specialize=("N",)on all 2D Triton kernels infused_llama_kernels.pyto prevent mid-window JIT recompiles on dynamic token counts. -LLAVA_OPT_FAST_DS_REDUCE=1: replaced ZeRO-2average_tensorAllReduce +div_(2)+ flatten + copy-back with 1-way in-placetdist.reduce(..., op=ReduceOp.AVG). -LLAVA_OPT_DIRECT_GRAD_PART=1: direct forward-ordered aligned grad partition buffers. -LLAVA_OPT_BALANCE_RANKS=1: deterministic cross-rank megabatch balancing using SentencePiecev1token + label + image counts (preserving exact per-step sample multiset, Gate 0 PASS). -LLAVA_OPT_NO_STORE_FLOS=1: skipped unusedstore_flos/floating_point_opswalk. - Verification (check_r9b): - Full 4-gateSTATUS: PASS:950.3 ms/step,2.9261×speedup. --- ## Rounds 10–12 — L4/L3/L2 Direct NVLink AdamW+AllGather + Lateexpandable_segments+ Zero Overhead + Exact Layer-31 Dead-Token Pruning - Changes (commits272444c,bb635fd): -LLAVA_OPT_NVLINK_ADAM=1: direct NV18 NVLink peer-store fused Triton AdamW+AllGather viacudaIpcGetMemHandle/cudaIpcOpenMemHandle+cuMemGetAddressRange_v2+ 1-elemall_reducebarriers (36.95 → 24.21 ms, 99.4% of Hopper HBM3e peak, strictly N0). -LLAVA_OPT_LATE_EXPANDABLE=1+LLAVA_OPT_PREWARM_MEM_GIB=76: establish CUDA IPC on staticcudaMallocweight buffers aton_train_begin, then switch caching allocator toexpandable_segments:Trueand pre-map 76 GiB VMM pool (peak_reserved: 137.2 → 120.75 GiB, eliminates mid-window VMM stalls). - FixedDIRECT_GRAD_PART=1(explicitly populatezopt.grad_positionwhencpu_offload=False, eliminating4.5 msflatten DtoD copy). -LLAVA_OPT_ASYNC_IPG_COPY=1+LLAVA_OPT_NO_EPILOGUE_SYNC=1: movedparam.grad → ipg_buffercopies toreduction_streamDMA engine and replaced epiloguecudaDeviceSynchronize()with stream wait. -LLAVA_OPT_FAST_STEP_OVERHEAD=1+LLAVA_OPT_FAST_DATALOADER=1+LLAVA_OPT_PINNED_META=1: eliminated per-stepengine.train()/engine.zero_grad()/ProgressCallback(removed inLLaVATrainer.__init__inbb635fd, avoiding callback-list mutation insideon_train_begin), non-blocking H2D with zero D2H syncs, 4-slot pinned ring buffer. -LLAVA_OPT_FUSED_CLIP=1+LLAVA_OPT_INPLACE_BWD=1: cached merged CLIP QKV + FA3qkvpacked+ in-place TritonAddLayerNorm(13.43 → 12.50 ms), in-placeFusedSwiGLUPackedFn.backward. -LLAVA_OPT_PRUNE_LAST_LAYER=1(−15.3 ms/step, mathematically exact): prunes dead non-label tokens (~79.6%) from Layer 31 (q_proj+ FA3 run only on[first_v[b]:L_b]suffix with bottom-right causal alignment;o_proj+ MLP +final_normrun only onvalid_label_idx). - Verification (/tmp/r12/check_r12_v2/check.json): - Full 4-gateSTATUS: PASS:922.2 ms/step,3.0153×speedup (window_seconds: [9.300, 9.124],peak_alloc: 111.6 GiB,peak_reserved: 120.75 GiB,avg_power: 1385.9 W), Gate 2TIER: N1(exact_failures: []), Gate 3verdict: equivalent(+1.001σ/+0.187σ). - Promoted/tmp/r12/sw_r12.jsonto/submission/switches.json. --- ## Rounds 13–14 — L4/L3/L2 Fix_reduce_partial_dwRegression + Exact Dead-Tail Trimming + Coalesced Zero-Copy Direct-to-Partition Gradient Reduction - Profile of Round 12/13 (/tmp/r13/prof_r13b/profile_tree.md): - Discovered_reduce_partial_dw_kernel(LLAVA_OPT_FUSED_REDUCE_DW=1) was taking10.4 ms/stepvs1.0 ms/stepfor PyTorchpartial_dw.sum(dim=0).to(bf16)(only 64 CTAs doing a serial stride-4096 loop overM=1056rows!). DisablingLLAVA_OPT_FUSED_REDUCE_DW=0+ addingLLAVA_OPT_TRIM_DEAD_TAIL=1jumped immediately to914.5 ms/step(3.0409×) in/tmp/r14/time_r14a. - Remaining non-GEMM time:GEMM ~745 ms(96–99% of 700W TDP ceiling687 TFLOP/s),FA3 ~42 ms,Triton_Fused ~44 ms,Triton_AdamW_NVLink ~24.5 ms, plus Stream 21NCCL Reduce 44.7 ms+Memcpy DtoD 13.9 ms. - Changes (commit4d9ede7): -LLAVA_OPT_FUSED_REDUCE_DW=0: disabled slow 64-CTA partial dW reduction (−9.4 ms). -LLAVA_OPT_TRIM_DEAD_TAIL=1(packed_ops.py): exact causal trimming of trailingIGNORE_INDEXtokens strictly afterlast_valid_pos[b]across all 32 layers (bitwise N0). -LLAVA_OPT_ZERO_COPY_GRAD=1+scripts/zero2_100m.json(fast_ds_step.py,packed_ops.py): computesdW = dout.T @ xdirectly into ZeRO-2's final aligned_direct_grad_bufviatorch.matmul(..., out=out_v)on the owning rank for all decoder layers + Layer 31 +lm_head, and coalesces(q, k, v)and(gate, up)into canonical single-slice in-placetdist.reduce(AVG)calls on both ranks (eliminating ~40.5 GB/step ofMemcpy DtoDand shrinkingipg_bufferfrom 2.0 GiB → 0.4 GiB). - Verification (/tmp/r14/check_r14d_zc100m/check.json): - Full 4-gateSTATUS: PASS:912.1 ms/step,3.0488×speedup (window_seconds: [9.220, 9.022],window_spread: 0.0014,peak_alloc: 114.98 GiB,peak_reserved: 115.36 GiB— 5.4 GiB lower!,avg_power: 1385.5 W,problems: []), Gate 0 PASS, Gate 2TIER: N1(exact_failures: []), Gate 3verdict: equivalent(+1.008σ/+0.184σ, 93.6s traj wall). - Promoted/tmp/r14/sw_r14c_zc100m.jsonto/submission/switches.json(commit4d9ede7). ---
4.6 hRound 15 — L4/L2/L3 0-SM NVLink Hardware DMA Gradient Push + CLIP-First Overlap + Layer-31 cuBLAS Padding/Prewarm + Zero-Sync Logging & DS Timers (`3.0795×`!)
- Profile of Round 14 (/tmp/r15/prof_r14/detail_tree.r0.json&r1.json): - Revealed 4 concrete bottlenecks: 1.ncclDevKernel_Reduce_Sum_bf16_RING_LLran for43.95 mson Rank 0 and124.18 mson Rank 1 during backward, spinning SMs and stealing 700W TDP headroom from cuBLAS GEMMs (2-GPU microbench confirmed+21.5 msGEMM-vs-NCCL overhead). 2.build_packed_plan+_h2d_packed_arrays(1.68 ms) ran on CPU while the GPU was completely idle before launching CLIP (12.5 ms). 3.Layer 31+lm_headsaw a freshN_valid/N_sufevery step, triggering2.2–2.5 mscuBLASLt CPU heuristic searches +CUDA_MODULE_LOADING=LAZYcuLaunchKernelExqueue drains (3.1–10.3 msdead GPU gaps). 4. DeepSpeedThroughputTimercalledcudaDeviceSynchronize()in_forward_prologueandstep(), and HF Trainer'slogging_nan_inf_filter+_nested_gatherran 3× DtoH syncs (1.8 ms/step). - Changes (commit4eb13ac): -LLAVA_OPT_DMA_GRAD_PUSH=1(fast_ds_step.py, −6.3 ms/step): allocates a staticcudaMalloc6.75 GiBpeer_grad_recvbuffer per rank (IPC-mapped beforelate_expandable), replaces all NCCL gradient reduces for eligible parameters during backward with 0-SM hardware Copy EnginecudaMemcpyPeerAsyncpushes (389 GB/s/dir), and averages once at epilogue with a single fused Triton_avg_inplace_bf16_kernel. Boosted sustained 700W clocks by+11.5 MHzon GPU 0 (1455 → 1466.5 MHz) and+8.0 MHzon GPU 1 (1492 → 1500.0 MHz)! -LLAVA_OPT_CLIP_FIRST=1(packed_ops.py, bitwise N0): launchesencode_images(images)beforebuild_packed_plan()so 1.5 ms of CPU plan building overlaps 100% behind 12.5 ms GPU CLIP. -LLAVA_OPT_PAD_L31_256=1(packed_ops.py+fast_ds_step.py, bitwise N0): zero-pads Layer-31N_sufandN_validrows to multiples of 256 (exact 0 fwd/bwd on padded rows) + lean 13-size startup cuBLAS prewarm (+0.3sstartup, eliminates mid-run heuristic stalls). -LLAVA_OPT_NO_DS_TIMERS=1(fast_ds_step.py): disablesengine.tput_timercudaDeviceSynchronize()calls so steps pipeline back-to-back on GPU. -LLAVA_OPT_FAST_LOGGING=1(llava_trainer.py, bitwise N0): setslogging_nan_inf_filter=False(eliminates 2 DtoH syncs) and replaces scalar_nested_gatherwith preallocatedall_gather_into_tensor. - In-placeFusedAddRMSNormFn.backward(dh = h.detach()underINPLACE_BWD=1, saves 7.2 GB/step allocs) +BLOCK_I=2048inFusedSwiGLUPackedFn. - Ablation & Verification: -r15c_n0(CLIP_FIRST + FAST_LOGGING + NO_DS_TIMERS+ kernels):909.8 ms/step(3.0564×). -r15d_pad(+ lean PAD_L31_256):909.5 ms/step(3.0575×, Window 1 =899.7 ms). -r15i_dma(+ DMA_GRAD_PUSH + nan_filter=False):902.4 ms/step(3.0817×, Window 1 =893.5 ms). - Full 4-gatecheck(/tmp/r15/check_r15i_dma/check.json):STATUS: PASS,903.0 ms/step,3.0795×speedup (window_seconds: [9.124, 8.936],window_spread: 0.0023,peak_alloc: 121.27 GiB,peak_reserved: 121.65 GiB,avg_power: 1385.2 W), Gate 0 PASS, Gate 2TIER: N1(exact_failures: []), Gate 3verdict: equivalent(+1.054σ/+0.150σ, 91.9s wall). - Promoted/tmp/r15/sw_r15i_dma.jsonto/submission/switches.json(commit4eb13ac). ---
5.1 hRound 16 — L2/L4 Steady-State 700W Hardware-Aware 2-GPU Load Balancing + Overlapped IPC-Signaled DMA Avg Study (`3.0900×`, Sub-900 ms/step!)
- Profile of Round 15 (/tmp/r16/prof_r15&/tmp/r16/prof_r16a): - ConfirmedLLAVA_OPT_DMA_GRAD_PUSH=1+CLIP_FIRST=1+PAD_L31_256=1+NO_DS_TIMERS=1eliminated Layer-31 idle stalls and cut inter-step overhead (5.70 → 1.63 ms), leaving 97.6% of step time in GEMMs (85.2%), Triton 4.2 TB/s kernels (4.9%), FA3 (4.6%), and AdamW_NVLink (2.9%,4,172 GB/s— microbench confirmed baselineB=1024, nw=4is optimal). - Exposed a persistent10.53 ms(1.0143×) 700W GEMM speed asymmetry between GPU 0 (748.75 ms) and GPU 1 (738.22 ms), causing Rank 1 to wait7.16–10.61 msat epilogue. - Changes (commit12b08d2): -LLAVA_OPT_AUTO_RANK_SPEED=1+LLAVA_OPT_RANK_SPEED_DAMP=0.72(llava_trainer.py): runs a 1.0s steady-state 700W BF16 GEMM calibration (100warmup +180timed iters using a localtorch.Generator, zero global RNG side effect) inon_train_begin, exchanges per-GPU throughput viaall_gather_object, and damps by the 700W compute-bound fraction (0.72) inside_balance_megabatches_2rank(preserving exact per-step sample multiset). - Implemented optionalLLAVA_OPT_DMA_OVLP_AVG=1(fast_ds_step.py,cuStreamWriteValue32_v2/cuStreamWaitValue32_v2per-param overlapped averaging onavg_s), which cut epilogue from5.43 → 0.50 ms(902.0 ms), though epilogue-batched averaging (DMA_OVLP_AVG=0) +damp=0.72achieved slightly tighter spread (0.0014vs0.0042) and899.4 msby keeping backward GEMM clocks higher. - Sweep & Verification: -damp=0.00(r15i_dma):903.0 ms(3.0795×);damp=0.55(r15j):901.7 ms(3.0838×);damp=0.72(r16c):899.4 ms(3.0919×, Window 1 =888.2 ms=3.131×);damp=0.95(r16e):902.0 ms(3.0830×). - Full 4-gatecheck(/tmp/r16/check_r16c/check.json):STATUS: PASS,899.9 ms/step,3.0900×speedup (window_seconds: [9.109, 8.889],window_spread: 0.0014,peak_alloc: 121.65 GiB,peak_reserved: 121.93 GiB,avg_power: 1386.3 W), Gate 0 PASS, Gate 2TIER: N1(exact_failures: []), Gate 3verdict: equivalent(+1.276σ/+0.273σ, 92.7s wall). - Promoted/tmp/r16/sw_r16c_noovlp_auto72.jsonto/submission/switches.json(commit12b08d2). ---
6.0 hRound 17 — L4/L2 Zero Inter-Step Gap (`ASYNC_LOSS_LOG` + `ev_adam_start` Throttle), Persistent 6.75 GiB Grad Buffer + 86 GiB Prewarm, High-Prio Epilogue, Patch-Linear CLIP, Fused Triton BF16 Cross-Entropy (`897.4 ms/step`, `3.0986×` time / `3.0918×` full check PASS!)
- Diagnosis & Profiling (/tmp/r17/prof_r17b): -tr_loss.item()forced a~254 msCPU stall behindAdamW_NVLinkcausing a~2.5 msGPU idle gap at every step boundary. - Profilingr17buncovered a massive68.0 ms(Rank 0) +17.8 ms(Rank 1)aten::empty([3379560448], bf16)(cuMemCreate+cuMemMap) allocator stall atlm_headbackward caused by freeing & reallocating the6.759 GiB_direct_grad_bufevery step (plusPREWARM_MEM_GIB=76leaving lazy Adamm/v+ dynamic peaks partially unprewarmed). - Also identified a0.55 msserialized epilogue gap wherereduce_ipg_gradsonpriority=0reduction_streamwaited behind_avg_inplace_bf16_kernel, and an unfused0.15 msbias add onmm_projector[0]due to non-contiguoushidden_states[:, 1:]from CLIP. - Changes (commitbf7e4b8): -LLAVA_OPT_ASYNC_LOSS_LOG=1(llava_trainer.py,fast_ds_step.py,packed_ops.py): copies scalar loss immediately aftercompute_losson a side stream to pinned CPU memory + gathers via 2-rank Gloo CPU group, throttled by a singleev_adam_startevent recorded right beforeAdamW_NVLinkand synced afterCLIP + build_packed_plan(cuts inter-step GPU gap to0.000 mswhile preventing peak memory bloat). -LLAVA_OPT_PERSISTENT_GRAD_BUF=1+LLAVA_OPT_PREWARM_MEM_GIB=86(fast_ds_step.py): statically allocates persistent 6.759 GiB_direct_grad_buf[0]once beforeexpandable_segments:True(0 extra peak memory, eliminates18–68 mscuMemCreatestalls and reduces reserved overhead to0.13 GiB:124.40 / 124.53 GiB). -LLAVA_OPT_FAST_EPILOGUE_V2=1(fast_ds_step.py): includesmm_projector.0/2in DMA push, elevatesreduction_streamtopriority=-1soreduce_ipg_grads()overlaps 100% behind_avg_inplace_bf16_kernel, and skips the redundant pre-AdamW barrier. -LLAVA_OPT_FAST_CLIP_PATCH=1+ contiguous final CLIP patch residual (fast_clip.py): replaces cuDNNConv2d(3,1024,14,14)+ NCHW↔NHWC with non-overlapping patchF.linear(0.403 → 0.106 ms) and outputs contiguousresidual[:, 1:] + h[:, 1:]somm_projector[0]uses fused-biasaddmm(0.216 → 0.113 ms). -LLAVA_OPT_FUSED_CE=1(fused_llama_kernels.py,packed_ops.py): custom online-softmax TritonFusedBF16CrossEntropyFn(BLOCK_V=8192, nw=8,do_not_specialize=("N",)), exactfp32loss (loss_diff=0.00e+00, 100% deterministic), writes bf16d_logitsin-place including padded zero rows (0.868 → 0.123 msimage /2.662 → 0.363 mstext,7×faster), with early-exits==1.0backward scale (BLOCK_SIZE=8192). - Verification: -time_r17d:897.4 ms/step(3.0986×),window_seconds: [9.075, 8.874](Window 1 =887.4 ms = 3.134×),window_spread: 0.0007,peak_alloc: 124.40 GiB,peak_reserved: 124.53 GiB. - Full 4-gatecheck(/tmp/r17/check_r17d/check.json):STATUS: PASS,899.4 ms/step,3.0918×speedup (window_seconds: [9.117, 8.872],window_spread: 0.0042,peak_alloc: 124.40 GiB,peak_reserved: 124.53 GiB,avg_power: 1384.7 W), Gate 0 PASS, Gate 2TIER: N1(exact_failures: [],errors: 0), Gate 3verdict: equivalent(+0.990σ/+0.181σ, 93.0s wall). - Promoted/tmp/r17/sw_r17d.jsonto/submission/switches.json(commitbf7e4b8). ---
6.3 hRound 18 — L4/L3 Hopper TMA & cuBLASLt 12.8 Exact Packed-Token Modulo Alignment (`mod16_8`) + Triton Warp/Block Tuning (`893.6 ms/step`, `3.1118×` Full 4-Gate PASS!)
- Hardware / cuBLASLt 12.8 Root-Cause Discovery: - Profilingr17b+ running 6-round interleaved steady-state 700W GEMM sweeps across all 31 Llama-7B decoder layers exposed two simultaneous Hopper cuBLASLt 12.8 laws onN = total_tokens: 1. WheneverN % 8 != 0(7/8 of natural packed batches), backwarddW = dy.T @ xloses 16-byte Hopper TMA alignment and suffers a+5 to +18 mspenalty. 2. WheneverN % 64 == 0(and someN % 16 == 0shapes), cuBLASLt 12.8 switches forward/dx projections tonvjet_tst_256x160_..., suffering a+10 to +16 msheuristic cliff at 700W TDP. - ChoosingN_pad = N + ((8 - N % 16) % 16)(N_pad % 16 == 8, adding only0..15zero tokens =+7.5avg =+0.05%FLOPs) satisfiesN_pad % 8 == 0(full 16-byte TMA alignment fordW) while avoiding 100% ofN % 16 == 0andN % 64 == 0cliffs. - Changes (commitb0d87d1): -LLAVA_OPT_PAD_TOK_MODE="mod16_8"(packed_ops.py): appends a dummy zero-embedded sequence of lengthpad_extra in [0..15](out[real_total_tokens:].zero_()in_PackMultimodalFn,_PadRowsZeroFnon text-only steps, extracu_seqlenstail[real_total_tokens, total_tokens]withpos=0). Unit-tested bitwise0.0diff on loss,dx, and all param grads (exact N0 equivalence, zero NaNs). - Tuned Hopper Triton launch configs (fused_llama_kernels.py,fast_clip.py, bitwise identical,−0.35 ms/stepcombined):FusedSwiGLUPackedFnBLOCK_I=4096(nw=16fwd /nw=8bwd),FusedAddRMSNormFnfwdnw=16,_clip_add_layernorm_fwd_kernelnw=8. - Increased_calibrate_2gpu_speed_ratio()steady-state warmup from100to150iters (llava_trainer.py) for tighter cold-GPU ratio stability. - Ablation & Verification: -r17d(none):897.4 ms(3.0986×);r18a(mod8_no64):896.1 ms(3.1033×);r18b(mod16_8):895.5 ms(3.1053×,spread: 0.0018);r18c(mod64_32):900.5 ms(3.0882×). - Full 4-gatecheck(/tmp/r18/check_r18_mod16_8/check.json):STATUS: PASS,893.6 ms/step,3.1118×speedup (window_seconds: [9.034, 8.839]— Window 1 =883.9 ms/step = 3.146×!,window_spread: 0.0012,samples_per_s: 35.81,peak_alloc: 124.40 GiB,peak_reserved: 124.53 GiB,avg_power: 1385.6 W), Gate 0 PASS, Gate 2TIER: N1(exact_failures: [],errors: 0), Gate 3verdict: equivalent(+1.198σ/+0.201σ, 94.0s wall). - Promoted/tmp/r18/sw_r18_mod16_8.jsonto/submission/switches.json(commitb0d87d1). ---
6.8 hRound 19 — L4/L2 Fused DMA Gradient Averaging + NVLink AdamW (`FUSE_AVG_ADAM`) + Calibrated `damp=0.30` (`890.9 ms/step`, `3.1214×` Full 4-Gate PASS!)
- Profile of Round 18 (/tmp/r18/prof_r18): - Confirmed Round 17+18 eliminated ALLaten::empty(68 ms + 20 ms → 0.00 ms), ALL inter-step gaps (0.000 ms), ALL epilogue gaps (0.003 ms), leaving 99.6% of step time in GEMMs (86.9%), FA3 (4.9%), Triton 4.2 TB/s kernels (4.8%), AdamW_NVLink (2.6%), and AvgInplace (0.5%). - Identified two remaining clean wins: 1._avg_inplace_bf16_kernel(4.88 ms,20.28 GiBHBM3e) wrote6.759 GiBof averagedbufthat_fused_bf16_adamw_nvlink_kernelimmediately re-read3 uslater — fusing(ga + gb) * 0.5directly into NVLink AdamW eliminates13.52 GiBof HBM3e traffic =−3.14 ms/step(microbench verified bitwise0.0diff,28.945 → 25.804 ms). 2. Undermod16_8+ 150-iter calibration,damp=0.72slightly overshot GPU 1 (2.7–4.1 msRank 0 wait on Steps 6–7); recalibrating on13576(mod16_8) with clamp[0.985, 1.015]and sweepingdampfound a clean U-shaped optimum atdamp=0.30. - Changes (commitbe57919): -LLAVA_OPT_FUSE_AVG_ADAM=1(fast_ds_step.py): wrapsaveraged_gradientsin_LazyAvgGradList(list)(lazily materializes(local+peer)*0.5if any external reader likesafe_get_full_gradororig_stepinspects gradients), whilefast_step()fuses(ga + gb) * 0.5directly inside_fused_bf16_adamw_nvlink_avg_kernelover_dma_owned_ranges[0](overlappingreduce_ipg_grads100% behind the26.0 msAdamW kernel onpriority=-1reduction_stream), then updates the tiny complement_dma_other_ranges[0](0.07 ms). - Updated_calibrate_2gpu_speed_ratio()(llava_trainer.py) to calibrate on(13576, 4096)(mod16_8) with clamp[0.985, 1.015], and setLLAVA_OPT_RANK_SPEED_DAMP="0.30". - Sweep & Verification: -auto=0:894.4 ms(3.1091×);auto=1, damp=0.30:891.3 ms(3.1200×, Window 1 =882.5 ms = 3.151×);damp=0.50:891.9 ms(3.1177×);damp=0.72:893.7 ms(3.1116×). - Full 4-gatecheck(/tmp/r19/check_r19d/check.json):STATUS: PASS,890.9 ms/step,3.1214×speedup (window_seconds: [9.004, 8.814]— Window 1 =881.4 ms/step = 3.155×!,window_spread: 0.0016,samples_per_s: 35.92,peak_alloc: 124.40 GiB,peak_reserved: 124.53 GiB,avg_power: 1386.3 W), Gate 0 PASS, Gate 2TIER: N1(exact_failures: [],errors: 0), Gate 3verdict: equivalent(+0.896σ/+0.079σ, 93.0s wall). - Promoted/tmp/r19/sw_r19d_fuseavg_d30.jsonto/submission/switches.json(commitbe57919). ---
9.2 hRound 20 Details (`e42ac26`, Verified FULL 4-GATE PASS) · continuation
- Root cause from R19 profile: PyTorch'scublasLt12.8 default#0heuristic picked 3-stage suboptimal tiles ongu_dw(320x128_64x3,114.1 ms/step) anddn_dw(192x192_64x3,59.7 ms/step), andco=4onqkv_dw/o_dw(86.6 ms/step). - Fix: Built precompiled C++ extensionllava_cublaslt_tuned(cublaslt_tuned.cpp) caching descriptors & verifiedsplitk=1Hopperalgo_id=66(tile, custom_option)plans (gu_dw=24:7,dn_dw=504:5,qkv_dw=23:5,o_dw=23:5), verified0.0e+00bitwise diff undertorch.use_deterministic_algorithms(True). Reduced_rmsnorm_bwd_kernelnum_progsfrom8xSM(1056) to3xSM(396) to shrinkpartial_dwinto L2 (-0.67 ms/step). Replaced binary0 -> 32GC cliff at>16500tokens with exact proportional adaptive GC keeping Layer 31 pruning enabled. - Rejected ablations: GlobalCUBLASLT_FDX=502:7(895.1 ms) & 5-tile wave selector (892.6 ms) regressed vs cuBLASLt's dynamicN_tokmulti-cluster heuristic (192x208wins onqkv_fwdwhere12288=64*192);dn_dw=252:6(892.8 ms),dn_dw=24:7(888.2 ms),mod8(893.7 ms),damp=0.15(888.8 ms), frozen CLIP CUDA Graph (887.8 msvs886.8 ms). - Judge result (/tmp/r20/check_r20h/check.json):PASS,888.8 ms/step,3.1296×,window_seconds: [8.975, 8.801],window_spread: 0.0036,peak_alloc: 124.40 GiB,avg_power: 1386.5 W, Gate 2N1(0exact failures), Gate 3equivalent(+1.291σ,+0.181σ).