ackermannj commited on
Commit
120a4ab
·
verified ·
1 Parent(s): 5c7c36d

Document corrected adapter training and loading

Browse files
corrected_image_adapter_step500/TRAINING_FINDINGS.md ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Realistic-image tuning findings
2
+
3
+ ## Data audit
4
+
5
+ The 721 Parquet shards contain 46,119 rows, but only 44,440 have
6
+ `status=completed`; 1,679 are failed generations. After intersecting completed
7
+ rows with the released particle splits there are 39,430 training samples and
8
+ 343 held-out samples. Rows without released particle targets cannot be used for
9
+ supervised PGF training.
10
+
11
+ ## Why the previous run did not work
12
+
13
+ Evaluation uses the exact same particle target, diffusion time, and noise for
14
+ the aligned-image, batch-permuted-image, and zero-image conditions. A useful
15
+ image-conditioned model must have both a low aligned loss and positive control
16
+ penalties.
17
+
18
+ | checkpoint (EMA) | aligned loss | permuted - aligned | zero - aligned |
19
+ |---|---:|---:|---:|
20
+ | released image PGF | 0.9996 | -0.0048 | +0.0167 |
21
+ | previous 5k | 1.1676 | +0.0223 | -0.0015 |
22
+ | previous 10k | 1.3878 | -0.0179 | +0.0142 |
23
+ | previous 15k | 1.6136 | +0.0156 | +0.0003 |
24
+ | previous 20k | 1.9356 | -0.0799 | -0.0361 |
25
+ | previous 25k | 2.4031 | -0.0580 | -0.0038 |
26
+ | previous 30k | 2.7410 | +0.0977 | +0.2163 |
27
+ | previous 35k | 3.3768 | +0.1124 | +0.0307 |
28
+
29
+ The previous run therefore caused catastrophic forgetting and did not learn a
30
+ reliable image signal. Its DCP metadata contains all 911 non-encoder model
31
+ tensors, including the particle backbone. Updating that whole 1.4B-parameter
32
+ model was unnecessarily destructive for a 39k-example domain adaptation.
33
+
34
+ Padding every target to 8,192 points does not explain the result: under that
35
+ distribution the base scores 1.0181 and the old 35k checkpoint scores 3.2950.
36
+
37
+ There is also an architecture-name mismatch: the old checkpoints store 28
38
+ `blocks.*.norm4.weight` tensors, while the released/current model calls these
39
+ `blocks.*.additional_norm.weight`. A normal `strict=False` load silently drops
40
+ the learned tensors. The evaluator explicitly maps these names.
41
+
42
+ Finally, Hydra's `${now:...}` run directory is evaluated independently in each
43
+ `torchrun` worker. Ranks that cross a one-second boundary write shards into
44
+ different checkpoint directories. `train_realistic_image.sh` now resolves one
45
+ absolute run directory in the parent process and passes it to every worker.
46
+
47
+ ## Corrected recipe
48
+
49
+ The launcher starts from the released image PGF, trains only the image
50
+ projection/cross-attention adapters (about 150M of 1.4B parameters), uses
51
+ variable-length targets, front images only, 10% image dropout for classifier-
52
+ free guidance, unconditional text, and a `2e-5` learning rate. Checkpoints are
53
+ adapter-only and must be overlaid on the released image PGF.
54
+
55
+ The 1,000-step pilot produced three verified checkpoints (the old trainer's
56
+ final-save race made step 1,000 incomplete; that race is now fixed). Full
57
+ held-out results are:
58
+
59
+ | checkpoint/state | aligned loss | permuted - aligned | zero - aligned |
60
+ |---|---:|---:|---:|
61
+ | 250 EMA | 0.9964 | +0.0056 | -0.0056 |
62
+ | 250 raw | 1.0139 | +0.0035 | -0.0116 |
63
+ | **500 EMA** | **0.9947** | **+0.0204** | -0.0032 |
64
+ | 500 raw | 1.0018 | +0.0052 | -0.0124 |
65
+ | 750 EMA | 1.0026 | +0.0126 | -0.0152 |
66
+ | 750 raw | 1.0063 | +0.0179 | -0.0089 |
67
+
68
+ Step 500 EMA is the pilot winner: it slightly improves aligned loss while
69
+ giving the largest mismatched-image penalty. The negative zero penalty is not
70
+ the primary conditioning diagnostic because blank images were intentionally
71
+ used during classifier-free training; batch permutation is the clean control.
72
+
73
+ Evaluate one with:
74
+
75
+ ```bash
76
+ CUDA_VISIBLE_DEVICES=0,1,2,4,5,6,7 uv run torchrun --standalone \
77
+ --nproc_per_node=7 tools/evaluate_realistic_checkpoints.py \
78
+ --base-checkpoint checkpoints/pgf_image \
79
+ --checkpoint /path/to/adapter/checkpoints/0000250 \
80
+ --checkpoint-state both \
81
+ --particle-dir ../garment_data/extracted \
82
+ --image-dir ../realistic_gcdv2 \
83
+ --assets-dir ../realistic_assets \
84
+ --split ../realistic_assets/garment_particle_realistic_val.txt \
85
+ --output-dir outputs/adapter_eval
86
+ ```