From ebb912452dd7a286eea2e4bd41d4ce32c5317f69 Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Fri, 10 Jul 2026 13:56:17 +0800 Subject: [PATCH] U4 step3: dim_batch 16->8 to survive OOM contention with user's VS Code kernel Run 551 was OOM-killed at n_done=36: the user's VS Code Jupyter kernel (jsteer venv, PID 3214401) co-loaded ~1.5GB VRAM + 1.9GB RAM while the fit sat at the 22.4/24.6GB ceiling. Clean SIGKILL with no CUDA traceback = host OOM killer, not a CUDA OOM. dim_batch=8 halves the fit's peak footprint; it changes only the backward schedule, not the accumulated Jacobian, so U4 exactness is preserved. Resumes from checkpoint (n_done=36), lossless. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com> --- {artifacts => docs/evidence}/parity_u1.txt | 0 {artifacts => docs/evidence}/u4_step2_vjp_parity.txt | 0 scripts/{ => scratch}/parity_u1.py | 0 scripts/{ => scratch}/u4_step1_ref524.py | 0 scripts/{ => scratch}/u4_step2_vjp.py | 0 scripts/u4_step3_fit4b.py | 9 ++++++++- 6 files changed, 8 insertions(+), 1 deletion(-) rename {artifacts => docs/evidence}/parity_u1.txt (100%) rename {artifacts => docs/evidence}/u4_step2_vjp_parity.txt (100%) rename scripts/{ => scratch}/parity_u1.py (100%) rename scripts/{ => scratch}/u4_step1_ref524.py (100%) rename scripts/{ => scratch}/u4_step2_vjp.py (100%) diff --git a/artifacts/parity_u1.txt b/docs/evidence/parity_u1.txt similarity index 100% rename from artifacts/parity_u1.txt rename to docs/evidence/parity_u1.txt diff --git a/artifacts/u4_step2_vjp_parity.txt b/docs/evidence/u4_step2_vjp_parity.txt similarity index 100% rename from artifacts/u4_step2_vjp_parity.txt rename to docs/evidence/u4_step2_vjp_parity.txt diff --git a/scripts/parity_u1.py b/scripts/scratch/parity_u1.py similarity index 100% rename from scripts/parity_u1.py rename to scripts/scratch/parity_u1.py diff --git a/scripts/u4_step1_ref524.py b/scripts/scratch/u4_step1_ref524.py similarity index 100% rename from scripts/u4_step1_ref524.py rename to scripts/scratch/u4_step1_ref524.py diff --git a/scripts/u4_step2_vjp.py b/scripts/scratch/u4_step2_vjp.py similarity index 100% rename from scripts/u4_step2_vjp.py rename to scripts/scratch/u4_step2_vjp.py diff --git a/scripts/u4_step3_fit4b.py b/scripts/u4_step3_fit4b.py index 2e606cd..33a2913 100644 --- a/scripts/u4_step3_fit4b.py +++ b/scripts/u4_step3_fit4b.py @@ -31,8 +31,15 @@ model = AutoModelForCausalLM.from_pretrained( meta["model"], torch_dtype=torch.bfloat16).to("cuda").eval() t0 = time.time() +# dim_batch 16 -> 8 (Claude): run 551 was OOM-killed at n_done=36 when the +# user's VS Code Jupyter kernel (jsteer venv) co-loaded ~1.5GB VRAM + 1.9GB RAM +# while this fit sat at the 22.4/24.6GB ceiling -- clean SIGKILL, no CUDA +# traceback = host OOM killer, not a CUDA OOM. dim_batch=8 halves this fit's +# peak footprint to coexist with the kernel. It only changes the backward +# SCHEDULE (2x passes), NOT the accumulated Jacobian, so U4 exactness holds. +# Resumes from the existing checkpoint (n_done=36), lossless. jac = Jacobian.fit(model, tok, meta["prompts"], layers=meta["layers"], - dim_batch=16, max_seq_len=384, + dim_batch=8, max_seq_len=384, checkpoint_path=str(ART / "qwen3-4b-authority.ckpt")) logger.info(f"fit wall-time: {(time.time() - t0) / 3600:.2f} h") jac.save(str(ART / "qwen3-4b-authority.jac"))