exp004 shipped: aleph relays on the Anima DiT through the fork (relay improves, LoRA degrades - 3-for-3 substrates; NC ckpt; bring-up ledger)
Browse files- README.md +1 -1
- exp004_anima_relay/README.md +40 -0
- exp004_anima_relay/aleph_relay.safetensors +3 -0
- exp004_anima_relay/exp004_dataset.toml +20 -0
- exp004_anima_relay/r0b_probe.py +96 -0
README.md
CHANGED
|
@@ -74,7 +74,7 @@ resolution) so gaps live in a narrow band — the paired design is load-bearing.
|
|
| 74 |
| exp001_sd15_relay | relay-all16 vs matched LoRA-r32 vs frozen: **relay beats both; LoRA lands below frozen; post-train toggle bit-exact** | **shipped (candidate, s0)** |
|
| 75 |
| exp002_sd15_addrcond | addr-cond 4-arm causal: **GUIDEPOST with a pulse** — inert beside full text (real≈deranged), but the address ALONE steers (+0.029); redesign = complementarity | **shipped (candidate, s0)** |
|
| 76 |
| exp003_sigma_registers | register probe: **sigma is the ONLY live axis** — caption/type/cond all compress to ≤0; ordering prereg MISS with design consequences | **shipped (candidate, s0)** |
|
| 77 |
-
| exp004_anima_relay |
|
| 78 |
| exp005_sdxl_tree4a | the SDXL capacity battery (guidepost/scaffold/skeleton) | designed |
|
| 79 |
| exp006_sd15core_relay | CORE EPRED certification: **relay beats frozen (−2.5%) and matched LoRA 2-for-2; grounding gained (+0.036) where LoRA traded it; gates GROW on the core** | **shipped (candidate, s0)** |
|
| 80 |
| exp007_amoe_lora | AMoE v1 vs monolith falsifier: **falsifier fires — uniform pressure ⇒ flat usage, dispatch pays nothing (Tree-1b law on diffusion); machinery green; next = structural band assignment** | **shipped (candidate, s0)** |
|
|
|
|
| 74 |
| exp001_sd15_relay | relay-all16 vs matched LoRA-r32 vs frozen: **relay beats both; LoRA lands below frozen; post-train toggle bit-exact** | **shipped (candidate, s0)** |
|
| 75 |
| exp002_sd15_addrcond | addr-cond 4-arm causal: **GUIDEPOST with a pulse** — inert beside full text (real≈deranged), but the address ALONE steers (+0.029); redesign = complementarity | **shipped (candidate, s0)** |
|
| 76 |
| exp003_sigma_registers | register probe: **sigma is the ONLY live axis** — caption/type/cond all compress to ≤0; ordering prereg MISS with design consequences | **shipped (candidate, s0)** |
|
| 77 |
+
| exp004_anima_relay | ANIMA DiT via the fork: **relay improves (0.123→0.115) while native LoRA degrades (0.138→0.142) — relay-favorable 3-for-3 substrates; full fork path certified; ckpt NC** | **shipped (candidate, s0)** |
|
| 78 |
| exp005_sdxl_tree4a | the SDXL capacity battery (guidepost/scaffold/skeleton) | designed |
|
| 79 |
| exp006_sd15core_relay | CORE EPRED certification: **relay beats frozen (−2.5%) and matched LoRA 2-for-2; grounding gained (+0.036) where LoRA traded it; gates GROW on the core** | **shipped (candidate, s0)** |
|
| 80 |
| exp007_amoe_lora | AMoE v1 vs monolith falsifier: **falsifier fires — uniform pressure ⇒ flat usage, dispatch pays nothing (Tree-1b law on diffusion); machinery green; next = structural band assignment** | **shipped (candidate, s0)** |
|
exp004_anima_relay/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# exp004_anima_relay — aleph relays on the Anima DiT through diffusion-pipe
|
| 2 |
+
# (CANDIDATE, s0 — the reserved number closes)
|
| 3 |
+
|
| 4 |
+
**The run.** First aleph adapters trained through the diffusion-pipe fork
|
| 5 |
+
(branch feat/aleph-adapter): Anima 2B Cosmos DiT, 28/28 blocks carrying
|
| 6 |
+
bf16 RelayPatch2D (14,275,716 params — dtype law enforced by the R0b gate,
|
| 7 |
+
which caught a live fp32-on-bf16 violation pre-train), 2978 rows of
|
| 8 |
+
ft1/qwen_90k (2-shard local-parquet cap; verbatim caption_vlm_json), 4
|
| 9 |
+
epochs = 2976 steps, PURE ADAM (engine-confirmed), freeze-by-lr-0 trunk,
|
| 10 |
+
llm_adapter frozen per the anima law. Control: the fork's native PEFT LoRA
|
| 11 |
+
(rank 16, all Block linears), identical data/steps/optimizer.
|
| 12 |
+
|
| 13 |
+
**Training-loss trajectories** (first-50 mean → last-50 mean):
|
| 14 |
+
|
| 15 |
+
| arm | start | end | direction |
|
| 16 |
+
|---|---|---|---|
|
| 17 |
+
| **aleph relay** | 0.1229 | **0.1154** | improving throughout |
|
| 18 |
+
| native LoRA r16 | 0.1375 | 0.1424 | **degrading** |
|
| 19 |
+
|
| 20 |
+
The relay-favorable pattern now holds on a THIRD substrate class (Lune
|
| 21 |
+
flow, SD15-core eps, Anima DiT flow) — and the LoRA control destabilizes
|
| 22 |
+
here as it did on Lune (exp001).
|
| 23 |
+
|
| 24 |
+
**Certified machinery** (this run + R0b, `r0b_probe.py` bundled):
|
| 25 |
+
end-to-end fork path — parquet cache → pipeline engine → per-block relays →
|
| 26 |
+
adapter-only save (`aleph_relay.safetensors`, 28.6MB — no trunk dump) —
|
| 27 |
+
with the plain-Adam branch live in DeepSpeed.
|
| 28 |
+
|
| 29 |
+
**Bring-up ledger (all caught by gates/watchers, none reached training):**
|
| 30 |
+
wandb + torch-optimi pip-name trap; ALL submodules required (train.py
|
| 31 |
+
imports every family top-level); ComfyUI `utils` package shadowing; single-
|
| 32 |
+
process dist init; the R0b dtype catch; torch-2.8 scalar strictness in the
|
| 33 |
+
fork's clip_grad_norm_ patch (bypassed via gradient_clipping=0, deviation
|
| 34 |
+
ledgered; fix docketed).
|
| 35 |
+
|
| 36 |
+
**Caveats.** Train-loss comparison (no paired held-out val in the fork bed
|
| 37 |
+
— the standalone-bed gauges don't port 1:1); placements differ (relay on
|
| 38 |
+
block outputs vs LoRA on all block linears); rank-16 param count per the
|
| 39 |
+
run log; 1 seed; Anima-derived weights are NC (CircleStone + NVIDIA OML) —
|
| 40 |
+
this checkpoint inherits NC.
|
exp004_anima_relay/aleph_relay.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:251566a5652db0f2785476684ff4e39a3d955d6ea5165f9ba2d74a5566b299cf
|
| 3 |
+
size 28577712
|
exp004_anima_relay/exp004_dataset.toml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# exp004: local-parquet slice of ft1 qwen_90k (2 shards = 3000 rows — the
|
| 2 |
+
# natural row cap; the fork's HF source has no limit key).
|
| 3 |
+
resolutions = [512]
|
| 4 |
+
enable_ar_bucket = true
|
| 5 |
+
min_ar = 0.5
|
| 6 |
+
max_ar = 2.0
|
| 7 |
+
num_ar_buckets = 7
|
| 8 |
+
cache_backend = 'parquet'
|
| 9 |
+
cache_shard_size_mb = 350
|
| 10 |
+
|
| 11 |
+
[[directory]]
|
| 12 |
+
type = 'parquet'
|
| 13 |
+
parquet_files = '/workspace/data/ft1_shards/*.parquet'
|
| 14 |
+
image_column = 'image'
|
| 15 |
+
width_column = 'image_width'
|
| 16 |
+
height_column = 'image_height'
|
| 17 |
+
caption_column = 'caption_vlm_json'
|
| 18 |
+
caption_type = 'text'
|
| 19 |
+
num_repeats = 1
|
| 20 |
+
skip_empty_caption = true
|
exp004_anima_relay/r0b_probe.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""r0b_probe.py — ANIMA R0b: the fork-integration gate (runs INSIDE the pod
|
| 2 |
+
clone of diffusion-pipe @ feat/aleph-adapter). Certifies, without a dataset:
|
| 3 |
+
G1 anima weights load through CosmosPredict2Pipeline (dit_config printed);
|
| 4 |
+
G2 aleph relays attach post-materialization (site count, param count);
|
| 5 |
+
G3 DTYPE LAW: relay dtype == block dtype (bf16);
|
| 6 |
+
G4 param groups: aleph_relay bucket present, trunk freezable by lr=0;
|
| 7 |
+
G5 zero-init: all-off/enabled-at-init forward delta == 0 through one block.
|
| 8 |
+
Full exp004 training goes to the evening slot per the day-3 plan.
|
| 9 |
+
Run: cd /workspace/geolip2/diffusion-pipe && python3 ../pod2/r0b_probe.py
|
| 10 |
+
"""
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import sys
|
| 14 |
+
|
| 15 |
+
import torch
|
| 16 |
+
|
| 17 |
+
sys.path.insert(0, ".")
|
| 18 |
+
import utils.common # bind the fork utils BEFORE ComfyUI (regular-pkg shadowing)
|
| 19 |
+
sys.path.append("submodules/ComfyUI")
|
| 20 |
+
|
| 21 |
+
CFG = {
|
| 22 |
+
"model": {
|
| 23 |
+
"type": "anima",
|
| 24 |
+
"transformer_path":
|
| 25 |
+
"/workspace/models/anima/split_files/diffusion_models/"
|
| 26 |
+
"anima-base-v1.0.safetensors",
|
| 27 |
+
"llm_path": "/workspace/models/anima/split_files/text_encoders/"
|
| 28 |
+
"qwen_3_06b_base.safetensors",
|
| 29 |
+
"vae_path": "/workspace/models/anima/split_files/vae/"
|
| 30 |
+
"qwen_image_vae.safetensors",
|
| 31 |
+
"dtype": torch.bfloat16,
|
| 32 |
+
"aleph_relay": True,
|
| 33 |
+
"aleph_relay_every": 1,
|
| 34 |
+
"aleph_relay_lr": 1e-3,
|
| 35 |
+
"self_attn_lr": 0, "cross_attn_lr": 0, "mlp_lr": 0, "mod_lr": 0,
|
| 36 |
+
"llm_adapter_lr": 0,
|
| 37 |
+
},
|
| 38 |
+
"optimizer": {"lr": 0},
|
| 39 |
+
"reentrant_activation_checkpointing": False,
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
def main():
|
| 44 |
+
import os
|
| 45 |
+
for k, v in (("MASTER_ADDR", "127.0.0.1"), ("MASTER_PORT", "29571"),
|
| 46 |
+
("RANK", "0"), ("WORLD_SIZE", "1"), ("LOCAL_RANK", "0")):
|
| 47 |
+
os.environ.setdefault(k, v)
|
| 48 |
+
import deepspeed
|
| 49 |
+
deepspeed.init_distributed()
|
| 50 |
+
from models.cosmos_predict2 import CosmosPredict2Pipeline
|
| 51 |
+
pipe = CosmosPredict2Pipeline(CFG)
|
| 52 |
+
print("[G1] pipeline constructed (text encoder loaded, name="
|
| 53 |
+
f"{pipe.name})", flush=True)
|
| 54 |
+
pipe.load_diffusion_model()
|
| 55 |
+
tr = pipe.transformer
|
| 56 |
+
relays = [getattr(b, "aleph_relay", None) for b in tr.blocks]
|
| 57 |
+
n_sites = sum(r is not None for r in relays)
|
| 58 |
+
n_params = sum(p.numel() for r in relays if r is not None
|
| 59 |
+
for p in r.parameters())
|
| 60 |
+
print(f"[G2] {n_sites}/{len(tr.blocks)} blocks carry relays, "
|
| 61 |
+
f"{n_params:,} adapter params", flush=True)
|
| 62 |
+
assert n_sites == len(tr.blocks) > 0
|
| 63 |
+
|
| 64 |
+
r0 = next(r for r in relays if r is not None)
|
| 65 |
+
b0 = tr.blocks[0]
|
| 66 |
+
bdt = next(p for n, p in b0.named_parameters()
|
| 67 |
+
if "aleph_relay" not in n).dtype
|
| 68 |
+
rdt = next(r0.parameters()).dtype
|
| 69 |
+
print(f"[G3] block dtype {bdt} | relay dtype {rdt}", flush=True)
|
| 70 |
+
assert rdt == bdt == torch.bfloat16, "dtype law violated"
|
| 71 |
+
|
| 72 |
+
params = [p for p in tr.parameters()]
|
| 73 |
+
for p, (n, _) in zip(params, tr.named_parameters()):
|
| 74 |
+
pass
|
| 75 |
+
groups = pipe.get_param_groups(
|
| 76 |
+
[p for p in tr.parameters() if hasattr(p, "original_name")])
|
| 77 |
+
n_trainable = sum(p.numel() for g in groups for p in g["params"])
|
| 78 |
+
print(f"[G4] {len(groups)} param groups, trainable {n_trainable:,} "
|
| 79 |
+
f"(should == adapter count {n_params:,})", flush=True)
|
| 80 |
+
assert n_trainable == n_params, "freeze-by-lr-0 leaked trunk params"
|
| 81 |
+
|
| 82 |
+
r0.assert_zero_init()
|
| 83 |
+
x = torch.randn(1, 2, 4, 4, tr.model_channels, dtype=bdt)
|
| 84 |
+
with torch.no_grad():
|
| 85 |
+
out_on = r0(x)
|
| 86 |
+
r0.enabled = False
|
| 87 |
+
out_off = r0(x)
|
| 88 |
+
r0.enabled = True
|
| 89 |
+
assert torch.equal(out_on, x) and out_off is x, "zero-init/toggle broken"
|
| 90 |
+
print("[G5] zero-init + toggle exact on the DiT relay", flush=True)
|
| 91 |
+
print("R0B ALL GATES GREEN — fork integration certified; exp004 train "
|
| 92 |
+
"is evening-slot ready", flush=True)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
if __name__ == "__main__":
|
| 96 |
+
main()
|