diff --git a/gmnet/code/journal_exp/configs/base/cifar100_paper.yaml b/gmnet/code/journal_exp/configs/base/cifar100_paper.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ca142c72e8862a1e3b5cab2e00aa1d0ef234cba8 --- /dev/null +++ b/gmnet/code/journal_exp/configs/base/cifar100_paper.yaml @@ -0,0 +1,51 @@ +# CIFAR recipe from the paper supplementary training-setting table. +recipe_id: paper-supplementary-cifar100-v1 +model: + variant: s1 + num_classes: 100 + gate_type: relu6_self + stem_activation: relu6 + kernel_size: 7 + layer_scale: 1.0e-6 + drop_path_rate: 0.0 +data: + dataset: cifar100 + num_classes: 100 + input_size: 32 + batch_size: 128 + eval_batch_size: 256 + workers: 4 + pin_memory: true + persistent_workers: true + prefetch_factor: 2 + mean: [0.5071, 0.4867, 0.4408] + std: [0.2675, 0.2565, 0.2761] +optimizer: + name: sgd + lr: 0.1 + weight_decay: 0.0005 + momentum: 0.9 + nesterov: false + # Prevent the learned smooth threshold from being an AdamW/SGD decay artifact. + no_weight_decay_patterns: [raw_clip] +scheduler: + name: cosine + warmup_epochs: 0 + warmup_lr: 0.0 + min_lr: 0.0 +mixup: + mixup_alpha: 0.0 + cutmix_alpha: 0.0 +train: + epochs: 100 + label_smoothing: 0.0 + channels_last: false + deterministic: false + compile: false + clip_grad: 0.0 + log_interval: 100 +amp: + enabled: false + dtype: bfloat16 +wandb: + enabled: false diff --git a/gmnet/code/journal_exp/configs/base/imagenet_paper.yaml b/gmnet/code/journal_exp/configs/base/imagenet_paper.yaml new file mode 100644 index 0000000000000000000000000000000000000000..91b1f48a3fcb367f982d12bee904027b1e8355b1 --- /dev/null +++ b/gmnet/code/journal_exp/configs/base/imagenet_paper.yaml @@ -0,0 +1,86 @@ +# Canonical recipe from arXiv 2503.22841 supplementary Table 8. +# The released README disagrees (WD 0.05, CutMix 0.2, DropPath 0); those +# values are retained only as an audited legacy recipe, not used here. +recipe_id: paper-supplementary-table8-v1 +protocol_id: imagenet-long-v2-audited +model: + variant: s3 + num_classes: 1000 + gate_type: relu6_self + stem_activation: relu6 + kernel_size: 7 + layer_scale: 1.0e-6 + drop_path_rate: 0.02 + f12_bn: false + projection_bn: true + second_dw_bn: false +data: + dataset: imagenet + num_classes: 1000 + train_split: train + val_split: val + input_size: 224 + batch_size: 256 + eval_batch_size: 256 + workers: 8 + pin_memory: true + persistent_workers: false + prefetch_factor: 4 + interpolation: bicubic + train_interpolation: random + crop_pct: 0.875 + mean: [0.485, 0.456, 0.406] + std: [0.229, 0.224, 0.225] + expected_train_samples: 1281167 + expected_val_samples: 50000 + expected_manifest_sha256: bb70bc9f530db6bb24f70e648624b35281bfbc76a57775d589a2e0209dd98661 + auto_augment: rand-m1-mstd0.5-inc1 + color_jitter: 0.0 + hflip: 0.5 + vflip: 0.0 + random_erasing: 0.25 + random_erasing_mode: pixel + random_erasing_count: 1 +optimizer: + name: adamw + lr: 0.003 + weight_decay: 0.03 + betas: [0.9, 0.999] + eps: 1.0e-8 + # Learned clipping thresholds are scalar controller parameters, not weights. + no_weight_decay_patterns: [raw_clip] +scheduler: + name: cosine + step_unit: epoch + cooldown_epochs: 0 + warmup_epochs: 5 + warmup_lr: 1.0e-6 + min_lr: 1.0e-5 +mixup: + # The public command does not override the runner's Mixup default (0.8). + mixup_alpha: 0.8 + cutmix_alpha: 0.4 + prob: 1.0 + switch_prob: 0.5 + mode: batch +train: + epochs: 300 + label_smoothing: 0.1 + channels_last: false + dist_bn: reduce + deterministic: false + compile: false + clip_grad: 0.0 + log_interval: 50 + eval_interval: 300 + fail_on_nonfinite: true + strict_resume: true + official_validation_policy: final_epoch_only + save_best_checkpoint: false +amp: + # Precision is not reported in the paper and the public command has AMP off. + enabled: false + dtype: bfloat16 +wandb: + enabled: true + project: gmnet-journal diff --git a/gmnet/code/journal_exp/configs/base/imagenet_release_readme_legacy.yaml b/gmnet/code/journal_exp/configs/base/imagenet_release_readme_legacy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7cb7912133de2012c2ec77dd5cb967892e2edf76 --- /dev/null +++ b/gmnet/code/journal_exp/configs/base/imagenet_release_readme_legacy.yaml @@ -0,0 +1,20 @@ +# Audit-only approximation of the released README recipe bundle. It uses this +# repository's runner and is not an exact replay of timm's augmentation order or +# scheduler call timing. Do not use it for primary tables or call it release-exact. +base: imagenet_paper.yaml +recipe_id: release-readme-legacy-audit-only +# Approximate the public timm command's 300-epoch cosine span plus 10 cooldown +# epochs; the conditional audit reports the whole bundle, not scheduler causality. +train: + epochs: 310 + eval_interval: 310 + official_validation_policy: final_epoch_only +scheduler: + step_unit: epoch + cooldown_epochs: 10 +optimizer: + weight_decay: 0.05 +mixup: + cutmix_alpha: 0.2 +model: + drop_path_rate: 0.0 diff --git a/gmnet/code/journal_exp/configs/code_manifests/e4_alignment_20260716.json b/gmnet/code/journal_exp/configs/code_manifests/e4_alignment_20260716.json new file mode 100644 index 0000000000000000000000000000000000000000..5141042f126fae80da660aac203fba24cfdde226 --- /dev/null +++ b/gmnet/code/journal_exp/configs/code_manifests/e4_alignment_20260716.json @@ -0,0 +1,572 @@ +{ + "code_sha256": "4a62bc48370247d882196cd9afc1a0f1629a5bbfd522c3f599ffaf0c1187641f", + "files": [ + { + "path": "configs/base/cifar100_paper.yaml", + "sha256": "9310b7e4144b79ad14379990d956419d83de88b0cf36f8e121f16a90fe2da930", + "size": 1049 + }, + { + "path": "configs/base/imagenet_paper.yaml", + "sha256": "e3662558aeba0eb18556e809172d5d2ba9836a64064c34cb6d0efde6bf0f2829", + "size": 2147 + }, + { + "path": "configs/base/imagenet_release_readme_legacy.yaml", + "sha256": "0560c79581e099c0eb6a7e7d05cff14f3eabd8081f09a26fcda830b317ad1703", + "size": 704 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s2.yaml", + "sha256": "f27e3145d1119f57ca4a36de8ee571913bb3635d3c455803fa4e8dd032d42876", + "size": 98 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s3.yaml", + "sha256": "0460961aa6de4c1127d03abafbe30b24178d90e6ca5d8b84d4201d1ccbab6a64", + "size": 99 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s3_release_historical_full_bn.yaml", + "sha256": "607f72892354888e79b40ee7b6807deb03f632b41eb44f507d9637974115b883", + "size": 260 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s3_release_paper_bn.yaml", + "sha256": "1807c3a0801aeb4f4e13b87b52c5953d86141b017ba1a39b783945cf424899f5", + "size": 255 + }, + { + "path": "configs/e1_spectral/gate_block_audit.yaml", + "sha256": "4d46c338d08e28e153600bd11be4b6dae34f9b25baee57d444aa8f762f9e3af1", + "size": 1030 + }, + { + "path": "configs/e2_synthetic/full.yaml", + "sha256": "85f6f358a11651730daa5a006103895d9d541ddefba0f7f48dcdfeeb8131a19b", + "size": 1165 + }, + { + "path": "configs/e2_synthetic/test.yaml", + "sha256": "65fd23a1398ef45256be3064747058a48d377c3e937878d8bdef6299accdd774", + "size": 744 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_gelu.yaml", + "sha256": "7192ada71a891a2317f443f219e155060496a47c1e7b0a6bd015356c77c97f3a", + "size": 95 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_identity.yaml", + "sha256": "99e9cd089d0ff135df689ebfb010a4f027d201adab3b5f5126bd3a33a576366c", + "size": 98 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_no_gate.yaml", + "sha256": "978ce753a0fe2c8a18efb3bafa5291410f86d94c215a3b737b2e7610281ba6a4", + "size": 96 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_relu.yaml", + "sha256": "5888ef757590e12526729b4c7766ad952a07f616a0c9bb1a0eaa7d29104e3d85", + "size": 95 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_relu6.yaml", + "sha256": "9c499ac11c7fef57985ca5234be1457c9bf7be5bbf7d856659c43cd36866ba9c", + "size": 97 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_relu6_only.yaml", + "sha256": "29cb57bbc44ab29d0ca748840571571ea9f5b95929ce35e8255318c9554f0d6e", + "size": 102 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_smooth_corrected.yaml", + "sha256": "eb7466417237cb33890d68699d1fd7528970d1aad505531be43e4511fecda60a", + "size": 239 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_smooth_fixed_c6.yaml", + "sha256": "f869fb498eb2ed24924dec0538184d1398b29fd88ecc16ea39c3d5ccd055b765", + "size": 229 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_smooth_static.yaml", + "sha256": "2f65db2447252ef105526a32febda26189a1d1707e3eb425149d0f3d46a6a5ef", + "size": 226 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_gelu.yaml", + "sha256": "4bde6c0fc35b212b4636e65d83d4fcafffbb1c0f22e0b6129f8d554344d4e638", + "size": 106 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_no_gate.yaml", + "sha256": "80502dcf220b8076eb393d97f85753b135951b0ab900a12ae91a5fb22129e408", + "size": 107 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_relu.yaml", + "sha256": "f30fb342e5f7908f097e6ac6c4d99773b6e9634e3c796f3b36993938e56ae5ca", + "size": 106 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_relu6.yaml", + "sha256": "32476bd99f9e6d8dd804d6384ed4d10deebd3aee5acb741b094aa300122fc491", + "size": 108 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_relu6_only.yaml", + "sha256": "b698877cd5e946ca34fd589f4ed06007f2e436536215a41a1ed158d593071999", + "size": 113 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_smooth_clipped_static.yaml", + "sha256": "b67e3c7ad1920065f497662bd43de9b253dd99b817eec3729949574a3fdcee01", + "size": 245 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_smooth_corrected.yaml", + "sha256": "18e921bb0976988240e81e6d8db9a1a2d44066236c6d0c5f92c8bba3d6ad3f73", + "size": 360 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_smooth_fixed_c6.yaml", + "sha256": "a4da9aa68b8bf3bf9ce824f7454d3e53836c64f49e6724349c1b03517374a165", + "size": 311 + }, + { + "path": "configs/e4_alignment/imagenet_gmnet_s3_channel_derangement.yaml", + "sha256": "65f7b7429ed529bd30ec9e69837a4996d62a803a44b3b77b1ba3fd9e76ad845b", + "size": 293 + }, + { + "path": "configs/e4_alignment/imagenet_gmnet_s3_stop_gradient.yaml", + "sha256": "bbd70c5304808e192f62ae4778047362f10a42ba8b7cdf430a5e0dd8cb650a10", + "size": 292 + }, + { + "path": "configs/e4_alignment_protocol.yaml", + "sha256": "e3133bffd81cb950c91bad469e8e19f0305e9cdee1f09d97298d726740dc51ca", + "size": 4993 + }, + { + "path": "configs/e5_scaling/imagenet_gmnet_s1.yaml", + "sha256": "3a889d094b28ffd92c0277d8c30766799dc90cb48243ebd2ae1285f383aefa64", + "size": 98 + }, + { + "path": "configs/e5_scaling/imagenet_gmnet_s4.yaml", + "sha256": "5624d1746253a6eac4073c42f3ff849321299844192a7ad1f8a54d14eb45b596", + "size": 99 + }, + { + "path": "configs/e6_e10_availability.yaml", + "sha256": "0ff98c1cdc7ea72ddf93cdb4048bd13a2d92ed47d2ac2c4679a8be57c28b212f", + "size": 3192 + }, + { + "path": "configs/e6_e8/imagenet_partial.yaml", + "sha256": "85015afa1d7fc4e603c97eec883aed564f1c23da058be9efe8b4eb9dab048331", + "size": 1098 + }, + { + "path": "configs/experiment_registry.yaml", + "sha256": "0a1c2a83f54ff8b44e718161e306333e5fa8ac3ca26620bc4a8e7bf3f2579fc8", + "size": 2134 + }, + { + "path": "configs/imagenet_v2_protocol.yaml", + "sha256": "791c1d7d242e357c09e70719283dd8ee12fd8b0990117cb794f400b6f6b37ab4", + "size": 19489 + }, + { + "path": "configs/single_seed_followup_protocol.yaml", + "sha256": "2c1b35bcba8eb14d813c63800d0a12714a4616bcba0e47bd0a8c96886330948d", + "size": 8007 + }, + { + "path": "configs/smoke/cifar10_gmnet_s1.yaml", + "sha256": "31570bbaa0779eb4445edcbb7dab240f434db9932f7930def29d9f40212181ec", + "size": 788 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1.yaml", + "sha256": "e3561fe50933b69e49056637f13d40b84d186c20518f357deb9ad7c337b5a92b", + "size": 779 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1_e4_channel_derangement.yaml", + "sha256": "b58c9d149d4fefa60af3e168361b8a1820ebe1151afd2a91c4762a7a2d0de3ec", + "size": 344 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1_e4_stop_gradient.yaml", + "sha256": "bc5c9ffa5208f63e153d3e10ae049b097b196684f9166718679154698803c96d", + "size": 332 + }, + { + "path": "gmnet/__init__.py", + "sha256": "b7a6498713d41d380b4011cc9c8eb4023357441d46990a1d2121228523d0385d", + "size": 502 + }, + { + "path": "gmnet/analysis/__init__.py", + "sha256": "e622fc5f26a70d02120d20d0c7f52d29b5bce9d1426fac1882a6656510614717", + "size": 712 + }, + { + "path": "gmnet/analysis/aggregation.py", + "sha256": "e7c9799a95ef81ce8c58ba4e9765d5e6439d26fde1f260d1ac5814d68233c00c", + "size": 7755 + }, + { + "path": "gmnet/analysis/checkpoint.py", + "sha256": "ac4b69102f62f7e895976efae85d4d1c117f21bc0c3c3640eea140dcc3d7c27e", + "size": 6952 + }, + { + "path": "gmnet/analysis/interventions.py", + "sha256": "f384e2fc6916e6fd19b1194aa100a154b6b77d96c0b64db98488e644c8a2a806", + "size": 6735 + }, + { + "path": "gmnet/analysis/profiling.py", + "sha256": "67058cd0abaa61a7839c6c6f92729d767e93342c7bfed7101c14d2a780619364", + "size": 4607 + }, + { + "path": "gmnet/config.py", + "sha256": "d6cf4bfae347d5e6985d05e436ee66284e5d7b94ae83da4c7bcf6a10a0c79472", + "size": 3206 + }, + { + "path": "gmnet/data/__init__.py", + "sha256": "b7db0b5c96e1a3f4714704d67d7da886e066e41f28ddcb8ddb2b8e2296a41753", + "size": 232 + }, + { + "path": "gmnet/data/build.py", + "sha256": "3f2b5b0e6ffdea0f062ec7ec1c0ade51ca3d172dcbdfa87f219de05809f5d747", + "size": 12922 + }, + { + "path": "gmnet/data/manifest.py", + "sha256": "322f3179e5e7f1017e74a7538c3fdc4e7c60d6ac0d3bbaf0cfc7f9a816a4a984", + "size": 2566 + }, + { + "path": "gmnet/data/validate.py", + "sha256": "f59065d09c27aff25a59ca12ca7bb91bece270ad327e8dd80e3e66f329c47403", + "size": 7838 + }, + { + "path": "gmnet/engine/__init__.py", + "sha256": "4842f4d62face113ab43684ca3a21873c64f1bdf56fcf3581617f8ee8b55651d", + "size": 254 + }, + { + "path": "gmnet/engine/checkpoint.py", + "sha256": "d3586d3449f274780697c6a4d11143694c6c7e108fe4790450db228ff88dcad0", + "size": 1666 + }, + { + "path": "gmnet/engine/metrics.py", + "sha256": "2c70965ec96ed7b57e0d7ccaf6f209f9a74cb365807e6fefa5919dc2a5a4b74a", + "size": 1825 + }, + { + "path": "gmnet/evaluation/__init__.py", + "sha256": "35bd93e9d915205580472a4618938e5a6e21f75e95a496ff34edaef85ac3035f", + "size": 318 + }, + { + "path": "gmnet/evaluation/corruptions.py", + "sha256": "1856c77c0d175a7e4186b789689e942a21cb6faf42e4bb536116aef4b5f70624", + "size": 2642 + }, + { + "path": "gmnet/evaluation/metrics.py", + "sha256": "f7049befa61577f91f7296c6c9f76f8d0231c44ac8cae74cfe4a95dd76a51177", + "size": 5750 + }, + { + "path": "gmnet/models/__init__.py", + "sha256": "9227138f9cd0e0110f57bad21b9302d8b5daa51cd63246e37c8ff2878eb2715e", + "size": 722 + }, + { + "path": "gmnet/models/gmnet.py", + "sha256": "5291156084aaf72936d1f8896057e7e606f74ef05aed856df4940e4838dbe3ac", + "size": 28103 + }, + { + "path": "gmnet/robustness/__init__.py", + "sha256": "13ca553eda7910b543857921e7d2296a4f6b600788cdfe0ef376a1f5ad198683", + "size": 435 + }, + { + "path": "gmnet/robustness/attacks.py", + "sha256": "fe40737fdccb2a5ea71de691a1c31bc3312fc6958ef3b3921ead1ff8a9ce4282", + "size": 5501 + }, + { + "path": "gmnet/robustness/corruptions.py", + "sha256": "dc8bd22643c3efb7f21679d72d89909e6971e0b8b3c28334224cb78dbfcf2109", + "size": 2501 + }, + { + "path": "gmnet/robustness/data.py", + "sha256": "8b16b4e32dfc46b1c7ff70969d8c5e91b440dc1f504c594b086cb767911e0089", + "size": 2536 + }, + { + "path": "gmnet/spectral/__init__.py", + "sha256": "461bc17c2792d6be03b623b4a36e4c03f1b6e0cab093ce56405caa1f5ed1b312", + "size": 689 + }, + { + "path": "gmnet/spectral/experiment.py", + "sha256": "aa8b44c0d47887ae069b75c84a1fa83349fda679b5834ffc0efa02eab1a54d06", + "size": 26519 + }, + { + "path": "gmnet/spectral/inputs.py", + "sha256": "b50a1c6ddd0a51fe70d61584ac78e027848968dc0d3598309249eed38ffc2914", + "size": 2711 + }, + { + "path": "gmnet/spectral/metrics.py", + "sha256": "2b4d97514e1a4db05ee28be7afadac600c3dd71e75452b6a8f5284e9403ac648", + "size": 3745 + }, + { + "path": "gmnet/spectral/streaming.py", + "sha256": "21bd2b9f3f856c3ae1d96e4e35301f3fd854e585383fa40230081dde2c75b54c", + "size": 6355 + }, + { + "path": "gmnet/spectral/transforms.py", + "sha256": "507c434b5db8d6a05a45b443362e206a359994198500b731453202b59e643ed2", + "size": 8016 + }, + { + "path": "gmnet/synthetic/__init__.py", + "sha256": "e07e37e484352c816dba89c5585991bdf4dfa230a964986bb28e3fcfcc030214", + "size": 198 + }, + { + "path": "gmnet/synthetic/metrics.py", + "sha256": "8f3d2d226b8b69a34e7f1c82c223032eb988a8956a3bfcf941dde2808c7f4b37", + "size": 4389 + }, + { + "path": "gmnet/synthetic/protocols.py", + "sha256": "a83a6b4a623c874132cd4e367966b63ca389325bebd004fbb22577ace71baa73", + "size": 14667 + }, + { + "path": "gmnet/train.py", + "sha256": "972f4c8caeb541b3625cf5dda616a7f55b6d7cbf52224ca54d93f05bd1d4b17b", + "size": 34797 + }, + { + "path": "pyproject.toml", + "sha256": "464e3151a4fcbc2c83ef53eebf11a42e22a57426a9281b12682b80ea5c487a5a", + "size": 308 + }, + { + "path": "requirements-dev.txt", + "sha256": "1f8016c37cfbc5dfd6dc5854006d89b7ba0c4ab076d728f8deff1003ef54f327", + "size": 44 + }, + { + "path": "requirements-runtime.txt", + "sha256": "06268a208dbfb489050a9152ca021d6b5abf52becc396c7acdaa80b4967e5646", + "size": 240 + }, + { + "path": "scripts/__init__.py", + "sha256": "76cf3b2bf66662378cb5993e2cd3373831baeeee33b3a79663364d8fbaa02bcb", + "size": 65 + }, + { + "path": "scripts/aggregate_local_results.py", + "sha256": "a3ee86576f6a732f6ae4a15c21e852a1645c7218a890f804b7b109226a328675", + "size": 1322 + }, + { + "path": "scripts/audit_e4_alignment_smoke.py", + "sha256": "e4fa57ee26430f5e5363b3f6b0d9f243eaefa7a4645a7b024b9082c27e034f96", + "size": 17560 + }, + { + "path": "scripts/check_env.py", + "sha256": "920efc6af8fa29c5f7f7bb3fed2c728ade58d8708cbba472d9b22fa98f744d04", + "size": 7948 + }, + { + "path": "scripts/code_fingerprint.py", + "sha256": "2bbac3fc5e0d6fb32502a3015aaf82dcc8adef8fdadb95c467ed819d8a3887ec", + "size": 3062 + }, + { + "path": "scripts/evaluate_e3_cifar100.py", + "sha256": "6193424c5d84fcb9084719e4d384dd3ff79fc2727bc3df97b2933f29c34b0165", + "size": 15382 + }, + { + "path": "scripts/evaluate_imagenet_long.py", + "sha256": "58cf18320e6d393b85f4d0635d8a4dd9bca9e905ada0982c4278a369cde19c22", + "size": 60246 + }, + { + "path": "scripts/freeze_imagenet_manifest.py", + "sha256": "6702096cf7f174db244228a8272686557c11075714221f16a149374316b9b318", + "size": 2170 + }, + { + "path": "scripts/generate_deploy.py", + "sha256": "51b25d03ac218ac4c4902da30cf860cc18c7f6f16013c9dda31432708969469d", + "size": 23152 + }, + { + "path": "scripts/generate_e4_alignment_deploy.py", + "sha256": "2de3a1ee4117b98e032afd2617c6bf2c28d722f678a5bc8a73ad85022a45e847", + "size": 33762 + }, + { + "path": "scripts/generate_single_seed_followup.py", + "sha256": "ac8e5d7101630565ec5b7ef5dc74ec0b21c004eb003a1a85491aee28776b35f3", + "size": 29326 + }, + { + "path": "scripts/init_run.sh", + "sha256": "7f4d0ba92723ffcf9a809f3dff142b1ced858082a2b932f3f8f44b122af05844", + "size": 5944 + }, + { + "path": "scripts/merge_e1_trained_features.py", + "sha256": "c970b3521f4669e8208186358d7823a05d3efc513ac6205910a5f04a8374d714", + "size": 16433 + }, + { + "path": "scripts/nccl_smoke.py", + "sha256": "91bb5ff137ef21b57faaf532d090df53fac6423d1ab391ee34a73b3d84beaeb6", + "size": 2825 + }, + { + "path": "scripts/run_cifar100_imagenet_pregate_v2.sh", + "sha256": "6ccba35b04dbd6a8fbfe47223bf6bc979244e11d26ab427071293aff0b5164a0", + "size": 4147 + }, + { + "path": "scripts/run_e12_profile.py", + "sha256": "b05574d6f10eb7dd5a5227fbe275168baf5f2f47e1d939446bb4cb12265a01a1", + "size": 12381 + }, + { + "path": "scripts/run_e1_spectral.py", + "sha256": "665c5f2689f979fcfada6215d25a646435ce31afdc93f8690fc00ef6ccf9d8ca", + "size": 1331 + }, + { + "path": "scripts/run_e1_trained_features.py", + "sha256": "8999d4e7017e6abd6014d71d7e6509521d7bd5b55268feb4c190502637cb2e3f", + "size": 30227 + }, + { + "path": "scripts/run_e1_trained_features_full.sh", + "sha256": "569b0a6765413d695054f37442daceea15c046ad133501cd9fa4717ff5e17d06", + "size": 10750 + }, + { + "path": "scripts/run_e2_synthetic.py", + "sha256": "01c0f0d95f31f4f685922d9e9031b756ebdbb32afda407485ef4bdb440338336", + "size": 16193 + }, + { + "path": "scripts/run_e3_cifar100.sh", + "sha256": "16d3e17ee415096390dd6deed91751171e5a2606138dcbac69b0b17e8cdedd60", + "size": 2731 + }, + { + "path": "scripts/run_e3_cifar100_evaluation.sh", + "sha256": "e636cd7d2782c08ae92b54f1dec02a303e881b61cc8a1e60b2e5f4a3c25ade64", + "size": 16387 + }, + { + "path": "scripts/run_e4_alignment.sh", + "sha256": "ba71d8e67e30b7c699732df29a79677d8ced3827ad8282e9eed3705282efb2a2", + "size": 820 + }, + { + "path": "scripts/run_e4_e12_official.sh", + "sha256": "cabe569202795861c988ca0040453c18edb1f4a6146bbb7e3a0a3fa52c266fdf", + "size": 7196 + }, + { + "path": "scripts/run_e4_interventions.py", + "sha256": "2b0a4d648bfb5c84cbfc7024436cd5ce6d93215d8e0757b6d31f16bb4fd025b8", + "size": 16257 + }, + { + "path": "scripts/run_e6_e8_imagenet_partial.sh", + "sha256": "bbfd11d67807b717b984db4a040c6c453e34c92ce9bf7bf72f71a10967e349ad", + "size": 5448 + }, + { + "path": "scripts/run_e6_e8_imagenet_robustness.py", + "sha256": "c94f562643d935ca8333376f668600aff07d7e1eda118acf310e3e650fa55693", + "size": 25603 + }, + { + "path": "scripts/run_local_smoke.sh", + "sha256": "09495dda8a3daeb5fc1d0d6a75f71f0ee2a304a678f9eaef911ef4ef025b6f96", + "size": 3782 + }, + { + "path": "scripts/run_single_seed_followup.sh", + "sha256": "e2c5cf2def13c6c534653910b4b5e1b2ccfaa85cec8809990c1d26807eec3f54", + "size": 832 + }, + { + "path": "scripts/setup_env.sh", + "sha256": "748e5fdc0e46e508bf77796e284ba36e5e6afec7309329339268ebaf4d1cfc06", + "size": 1414 + }, + { + "path": "scripts/stage_cifar100.sh", + "sha256": "6cd30b9177214fe6673a2615d671e5104b53cec9d1ead393f7b2e9a50ddc66c9", + "size": 2094 + }, + { + "path": "scripts/stage_dataset.sh", + "sha256": "d2a1c70d93723574772b868526fa072bb5d3386e28de8867cacdcfe704abf846", + "size": 4131 + }, + { + "path": "scripts/stage_imagenet.sh", + "sha256": "b11b47cc4f707c14cb9d329b772c9dd29232cf4ce32150500ba0ec9074200bec", + "size": 9182 + }, + { + "path": "scripts/summarize_cifar100_pregate_v2.py", + "sha256": "3e15ec8e4ed88931e36454a182051dc5be998e663cf5d52e2206acf3e38d0fad", + "size": 8664 + }, + { + "path": "scripts/summarize_e3_cifar100.py", + "sha256": "d18b11e184d3952a1a61e08bfec11a59832216250a6b6a7e9e4c7eabeeb89a02", + "size": 21381 + }, + { + "path": "scripts/summarize_imagenet_v2.py", + "sha256": "b3bb7ab6b85574076cb9772c244edf0dd8569338d91bba0b0feaf617ff218dc4", + "size": 16886 + } + ], + "fingerprint_scope": "training_source_configs_and_environment_specs", + "schema_version": 1 +} diff --git a/gmnet/code/journal_exp/configs/code_manifests/e4_mechanism_followup_20260717.json b/gmnet/code/journal_exp/configs/code_manifests/e4_mechanism_followup_20260717.json new file mode 100644 index 0000000000000000000000000000000000000000..8ab24f75993fe04c40847b4d4eee85d6ceb9c6e4 --- /dev/null +++ b/gmnet/code/journal_exp/configs/code_manifests/e4_mechanism_followup_20260717.json @@ -0,0 +1,627 @@ +{ + "code_sha256": "f6bd434a2ac86c772f2e23683431f3bb7ccb06f539558682a3bea6464bacebf9", + "files": [ + { + "path": "configs/base/cifar100_paper.yaml", + "sha256": "9310b7e4144b79ad14379990d956419d83de88b0cf36f8e121f16a90fe2da930", + "size": 1049 + }, + { + "path": "configs/base/imagenet_paper.yaml", + "sha256": "e3662558aeba0eb18556e809172d5d2ba9836a64064c34cb6d0efde6bf0f2829", + "size": 2147 + }, + { + "path": "configs/base/imagenet_release_readme_legacy.yaml", + "sha256": "0560c79581e099c0eb6a7e7d05cff14f3eabd8081f09a26fcda830b317ad1703", + "size": 704 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s2.yaml", + "sha256": "f27e3145d1119f57ca4a36de8ee571913bb3635d3c455803fa4e8dd032d42876", + "size": 98 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s3.yaml", + "sha256": "0460961aa6de4c1127d03abafbe30b24178d90e6ca5d8b84d4201d1ccbab6a64", + "size": 99 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s3_release_historical_full_bn.yaml", + "sha256": "607f72892354888e79b40ee7b6807deb03f632b41eb44f507d9637974115b883", + "size": 260 + }, + { + "path": "configs/e0_baseline/imagenet_gmnet_s3_release_paper_bn.yaml", + "sha256": "1807c3a0801aeb4f4e13b87b52c5953d86141b017ba1a39b783945cf424899f5", + "size": 255 + }, + { + "path": "configs/e1_spectral/gate_block_audit.yaml", + "sha256": "4d46c338d08e28e153600bd11be4b6dae34f9b25baee57d444aa8f762f9e3af1", + "size": 1030 + }, + { + "path": "configs/e2_synthetic/full.yaml", + "sha256": "85f6f358a11651730daa5a006103895d9d541ddefba0f7f48dcdfeeb8131a19b", + "size": 1165 + }, + { + "path": "configs/e2_synthetic/test.yaml", + "sha256": "65fd23a1398ef45256be3064747058a48d377c3e937878d8bdef6299accdd774", + "size": 744 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_gelu.yaml", + "sha256": "7192ada71a891a2317f443f219e155060496a47c1e7b0a6bd015356c77c97f3a", + "size": 95 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_identity.yaml", + "sha256": "99e9cd089d0ff135df689ebfb010a4f027d201adab3b5f5126bd3a33a576366c", + "size": 98 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_no_gate.yaml", + "sha256": "978ce753a0fe2c8a18efb3bafa5291410f86d94c215a3b737b2e7610281ba6a4", + "size": 96 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_relu.yaml", + "sha256": "5888ef757590e12526729b4c7766ad952a07f616a0c9bb1a0eaa7d29104e3d85", + "size": 95 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_relu6.yaml", + "sha256": "9c499ac11c7fef57985ca5234be1457c9bf7be5bbf7d856659c43cd36866ba9c", + "size": 97 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_relu6_only.yaml", + "sha256": "29cb57bbc44ab29d0ca748840571571ea9f5b95929ce35e8255318c9554f0d6e", + "size": 102 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_smooth_corrected.yaml", + "sha256": "eb7466417237cb33890d68699d1fd7528970d1aad505531be43e4511fecda60a", + "size": 239 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_smooth_fixed_c6.yaml", + "sha256": "f869fb498eb2ed24924dec0538184d1398b29fd88ecc16ea39c3d5ccd055b765", + "size": 229 + }, + { + "path": "configs/e3_gate/cifar100_gmnet_s1_smooth_static.yaml", + "sha256": "2f65db2447252ef105526a32febda26189a1d1707e3eb425149d0f3d46a6a5ef", + "size": 226 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_gelu.yaml", + "sha256": "4bde6c0fc35b212b4636e65d83d4fcafffbb1c0f22e0b6129f8d554344d4e638", + "size": 106 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_no_gate.yaml", + "sha256": "80502dcf220b8076eb393d97f85753b135951b0ab900a12ae91a5fb22129e408", + "size": 107 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_relu.yaml", + "sha256": "f30fb342e5f7908f097e6ac6c4d99773b6e9634e3c796f3b36993938e56ae5ca", + "size": 106 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_relu6.yaml", + "sha256": "32476bd99f9e6d8dd804d6384ed4d10deebd3aee5acb741b094aa300122fc491", + "size": 108 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_relu6_only.yaml", + "sha256": "b698877cd5e946ca34fd589f4ed06007f2e436536215a41a1ed158d593071999", + "size": 113 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_smooth_clipped_static.yaml", + "sha256": "b67e3c7ad1920065f497662bd43de9b253dd99b817eec3729949574a3fdcee01", + "size": 245 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_smooth_corrected.yaml", + "sha256": "18e921bb0976988240e81e6d8db9a1a2d44066236c6d0c5f92c8bba3d6ad3f73", + "size": 360 + }, + { + "path": "configs/e3_gate/imagenet_gmnet_s3_smooth_fixed_c6.yaml", + "sha256": "a4da9aa68b8bf3bf9ce824f7454d3e53836c64f49e6724349c1b03517374a165", + "size": 311 + }, + { + "path": "configs/e4_alignment/imagenet_gmnet_s3_channel_derangement.yaml", + "sha256": "65f7b7429ed529bd30ec9e69837a4996d62a803a44b3b77b1ba3fd9e76ad845b", + "size": 293 + }, + { + "path": "configs/e4_alignment/imagenet_gmnet_s3_stop_gradient.yaml", + "sha256": "bbd70c5304808e192f62ae4778047362f10a42ba8b7cdf430a5e0dd8cb650a10", + "size": 292 + }, + { + "path": "configs/e4_alignment_protocol.yaml", + "sha256": "e3133bffd81cb950c91bad469e8e19f0305e9cdee1f09d97298d726740dc51ca", + "size": 4993 + }, + { + "path": "configs/e4_mechanism_followup/imagenet_gmnet_s3_batch_derangement.yaml", + "sha256": "cded9dc356656ba449968dde2f15a12b01090a6f8b982418bfa7ed79670f178e", + "size": 277 + }, + { + "path": "configs/e4_mechanism_followup/imagenet_gmnet_s3_current_baseline.yaml", + "sha256": "bd9bf41321c332a5d4b997eae909d31e97f56a2d9f1e68a22abb454cdbd4038a", + "size": 279 + }, + { + "path": "configs/e4_mechanism_followup/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml", + "sha256": "bba389430f64af8c28c7bab402a3506a8a4b16aed65bd025934e0a7f4936836a", + "size": 320 + }, + { + "path": "configs/e4_mechanism_followup_protocol.yaml", + "sha256": "2723bd29cd0205715f6d31888355ffe7ee312bee36c645bdb937d6e8c7146fb6", + "size": 6986 + }, + { + "path": "configs/e5_scaling/imagenet_gmnet_s1.yaml", + "sha256": "3a889d094b28ffd92c0277d8c30766799dc90cb48243ebd2ae1285f383aefa64", + "size": 98 + }, + { + "path": "configs/e5_scaling/imagenet_gmnet_s4.yaml", + "sha256": "5624d1746253a6eac4073c42f3ff849321299844192a7ad1f8a54d14eb45b596", + "size": 99 + }, + { + "path": "configs/e6_e10_availability.yaml", + "sha256": "0ff98c1cdc7ea72ddf93cdb4048bd13a2d92ed47d2ac2c4679a8be57c28b212f", + "size": 3192 + }, + { + "path": "configs/e6_e8/imagenet_partial.yaml", + "sha256": "85015afa1d7fc4e603c97eec883aed564f1c23da058be9efe8b4eb9dab048331", + "size": 1098 + }, + { + "path": "configs/experiment_registry.yaml", + "sha256": "0a1c2a83f54ff8b44e718161e306333e5fa8ac3ca26620bc4a8e7bf3f2579fc8", + "size": 2134 + }, + { + "path": "configs/imagenet_v2_protocol.yaml", + "sha256": "791c1d7d242e357c09e70719283dd8ee12fd8b0990117cb794f400b6f6b37ab4", + "size": 19489 + }, + { + "path": "configs/single_seed_followup_protocol.yaml", + "sha256": "2c1b35bcba8eb14d813c63800d0a12714a4616bcba0e47bd0a8c96886330948d", + "size": 8007 + }, + { + "path": "configs/smoke/cifar10_gmnet_s1.yaml", + "sha256": "31570bbaa0779eb4445edcbb7dab240f434db9932f7930def29d9f40212181ec", + "size": 788 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1.yaml", + "sha256": "e3561fe50933b69e49056637f13d40b84d186c20518f357deb9ad7c337b5a92b", + "size": 779 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1_e4_channel_derangement.yaml", + "sha256": "b58c9d149d4fefa60af3e168361b8a1820ebe1151afd2a91c4762a7a2d0de3ec", + "size": 344 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1_e4_stop_gradient.yaml", + "sha256": "bc5c9ffa5208f63e153d3e10ae049b097b196684f9166718679154698803c96d", + "size": 332 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1_e4f_batch_derangement.yaml", + "sha256": "3fb58a5f69ff75047cf240f5b47019cfe341ddc53035cddc8f85319b995fbcee", + "size": 512 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1_e4f_current_baseline.yaml", + "sha256": "faebdc1c430d1316793ef5c94ff0f80bea582caf5c6306a5e95c1b58811fe65e", + "size": 502 + }, + { + "path": "configs/smoke/imagenet5_gmnet_s1_e4f_stopgrad_channel_derangement.yaml", + "sha256": "24869f8cf6a1745524c452f8ce206e0baaf842d37f4ca85f8d1e112f77dc2c88", + "size": 539 + }, + { + "path": "gmnet/__init__.py", + "sha256": "b7a6498713d41d380b4011cc9c8eb4023357441d46990a1d2121228523d0385d", + "size": 502 + }, + { + "path": "gmnet/analysis/__init__.py", + "sha256": "e622fc5f26a70d02120d20d0c7f52d29b5bce9d1426fac1882a6656510614717", + "size": 712 + }, + { + "path": "gmnet/analysis/aggregation.py", + "sha256": "e7c9799a95ef81ce8c58ba4e9765d5e6439d26fde1f260d1ac5814d68233c00c", + "size": 7755 + }, + { + "path": "gmnet/analysis/checkpoint.py", + "sha256": "ac4b69102f62f7e895976efae85d4d1c117f21bc0c3c3640eea140dcc3d7c27e", + "size": 6952 + }, + { + "path": "gmnet/analysis/interventions.py", + "sha256": "f384e2fc6916e6fd19b1194aa100a154b6b77d96c0b64db98488e644c8a2a806", + "size": 6735 + }, + { + "path": "gmnet/analysis/profiling.py", + "sha256": "67058cd0abaa61a7839c6c6f92729d767e93342c7bfed7101c14d2a780619364", + "size": 4607 + }, + { + "path": "gmnet/config.py", + "sha256": "d6cf4bfae347d5e6985d05e436ee66284e5d7b94ae83da4c7bcf6a10a0c79472", + "size": 3206 + }, + { + "path": "gmnet/data/__init__.py", + "sha256": "b7db0b5c96e1a3f4714704d67d7da886e066e41f28ddcb8ddb2b8e2296a41753", + "size": 232 + }, + { + "path": "gmnet/data/build.py", + "sha256": "3f2b5b0e6ffdea0f062ec7ec1c0ade51ca3d172dcbdfa87f219de05809f5d747", + "size": 12922 + }, + { + "path": "gmnet/data/manifest.py", + "sha256": "322f3179e5e7f1017e74a7538c3fdc4e7c60d6ac0d3bbaf0cfc7f9a816a4a984", + "size": 2566 + }, + { + "path": "gmnet/data/validate.py", + "sha256": "f59065d09c27aff25a59ca12ca7bb91bece270ad327e8dd80e3e66f329c47403", + "size": 7838 + }, + { + "path": "gmnet/engine/__init__.py", + "sha256": "4842f4d62face113ab43684ca3a21873c64f1bdf56fcf3581617f8ee8b55651d", + "size": 254 + }, + { + "path": "gmnet/engine/checkpoint.py", + "sha256": "d3586d3449f274780697c6a4d11143694c6c7e108fe4790450db228ff88dcad0", + "size": 1666 + }, + { + "path": "gmnet/engine/metrics.py", + "sha256": "2c70965ec96ed7b57e0d7ccaf6f209f9a74cb365807e6fefa5919dc2a5a4b74a", + "size": 1825 + }, + { + "path": "gmnet/evaluation/__init__.py", + "sha256": "35bd93e9d915205580472a4618938e5a6e21f75e95a496ff34edaef85ac3035f", + "size": 318 + }, + { + "path": "gmnet/evaluation/corruptions.py", + "sha256": "1856c77c0d175a7e4186b789689e942a21cb6faf42e4bb536116aef4b5f70624", + "size": 2642 + }, + { + "path": "gmnet/evaluation/metrics.py", + "sha256": "f7049befa61577f91f7296c6c9f76f8d0231c44ac8cae74cfe4a95dd76a51177", + "size": 5750 + }, + { + "path": "gmnet/models/__init__.py", + "sha256": "68a705c94c1223305f2d5ab18cc41faf36c35d90748fde5a32f4474222e4ef29", + "size": 870 + }, + { + "path": "gmnet/models/gmnet.py", + "sha256": "8446a0ed7d6863f81e88929f3277d363c961372210279de7d0e770f636852f3c", + "size": 30254 + }, + { + "path": "gmnet/robustness/__init__.py", + "sha256": "13ca553eda7910b543857921e7d2296a4f6b600788cdfe0ef376a1f5ad198683", + "size": 435 + }, + { + "path": "gmnet/robustness/attacks.py", + "sha256": "fe40737fdccb2a5ea71de691a1c31bc3312fc6958ef3b3921ead1ff8a9ce4282", + "size": 5501 + }, + { + "path": "gmnet/robustness/corruptions.py", + "sha256": "dc8bd22643c3efb7f21679d72d89909e6971e0b8b3c28334224cb78dbfcf2109", + "size": 2501 + }, + { + "path": "gmnet/robustness/data.py", + "sha256": "8b16b4e32dfc46b1c7ff70969d8c5e91b440dc1f504c594b086cb767911e0089", + "size": 2536 + }, + { + "path": "gmnet/spectral/__init__.py", + "sha256": "461bc17c2792d6be03b623b4a36e4c03f1b6e0cab093ce56405caa1f5ed1b312", + "size": 689 + }, + { + "path": "gmnet/spectral/experiment.py", + "sha256": "aa8b44c0d47887ae069b75c84a1fa83349fda679b5834ffc0efa02eab1a54d06", + "size": 26519 + }, + { + "path": "gmnet/spectral/inputs.py", + "sha256": "b50a1c6ddd0a51fe70d61584ac78e027848968dc0d3598309249eed38ffc2914", + "size": 2711 + }, + { + "path": "gmnet/spectral/metrics.py", + "sha256": "2b4d97514e1a4db05ee28be7afadac600c3dd71e75452b6a8f5284e9403ac648", + "size": 3745 + }, + { + "path": "gmnet/spectral/streaming.py", + "sha256": "21bd2b9f3f856c3ae1d96e4e35301f3fd854e585383fa40230081dde2c75b54c", + "size": 6355 + }, + { + "path": "gmnet/spectral/transforms.py", + "sha256": "507c434b5db8d6a05a45b443362e206a359994198500b731453202b59e643ed2", + "size": 8016 + }, + { + "path": "gmnet/synthetic/__init__.py", + "sha256": "e07e37e484352c816dba89c5585991bdf4dfa230a964986bb28e3fcfcc030214", + "size": 198 + }, + { + "path": "gmnet/synthetic/metrics.py", + "sha256": "8f3d2d226b8b69a34e7f1c82c223032eb988a8956a3bfcf941dde2808c7f4b37", + "size": 4389 + }, + { + "path": "gmnet/synthetic/protocols.py", + "sha256": "a83a6b4a623c874132cd4e367966b63ca389325bebd004fbb22577ace71baa73", + "size": 14667 + }, + { + "path": "gmnet/train.py", + "sha256": "972f4c8caeb541b3625cf5dda616a7f55b6d7cbf52224ca54d93f05bd1d4b17b", + "size": 34797 + }, + { + "path": "pyproject.toml", + "sha256": "464e3151a4fcbc2c83ef53eebf11a42e22a57426a9281b12682b80ea5c487a5a", + "size": 308 + }, + { + "path": "requirements-dev.txt", + "sha256": "1f8016c37cfbc5dfd6dc5854006d89b7ba0c4ab076d728f8deff1003ef54f327", + "size": 44 + }, + { + "path": "requirements-runtime.txt", + "sha256": "06268a208dbfb489050a9152ca021d6b5abf52becc396c7acdaa80b4967e5646", + "size": 240 + }, + { + "path": "scripts/__init__.py", + "sha256": "76cf3b2bf66662378cb5993e2cd3373831baeeee33b3a79663364d8fbaa02bcb", + "size": 65 + }, + { + "path": "scripts/aggregate_local_results.py", + "sha256": "a3ee86576f6a732f6ae4a15c21e852a1645c7218a890f804b7b109226a328675", + "size": 1322 + }, + { + "path": "scripts/audit_e4_alignment_smoke.py", + "sha256": "e4fa57ee26430f5e5363b3f6b0d9f243eaefa7a4645a7b024b9082c27e034f96", + "size": 17560 + }, + { + "path": "scripts/audit_e4_mechanism_followup_smoke.py", + "sha256": "650494d54c253d8b467cf4c597ed1e58f73b31fb7427022da7cbeda5c3d7f81e", + "size": 23205 + }, + { + "path": "scripts/check_env.py", + "sha256": "920efc6af8fa29c5f7f7bb3fed2c728ade58d8708cbba472d9b22fa98f744d04", + "size": 7948 + }, + { + "path": "scripts/code_fingerprint.py", + "sha256": "2bbac3fc5e0d6fb32502a3015aaf82dcc8adef8fdadb95c467ed819d8a3887ec", + "size": 3062 + }, + { + "path": "scripts/evaluate_e3_cifar100.py", + "sha256": "6193424c5d84fcb9084719e4d384dd3ff79fc2727bc3df97b2933f29c34b0165", + "size": 15382 + }, + { + "path": "scripts/evaluate_imagenet_long.py", + "sha256": "62c0c30b8d70a3b83796f455d8bbb69a205c2295f717b86c9a310dbc6d7f0786", + "size": 72188 + }, + { + "path": "scripts/freeze_imagenet_manifest.py", + "sha256": "6702096cf7f174db244228a8272686557c11075714221f16a149374316b9b318", + "size": 2170 + }, + { + "path": "scripts/generate_deploy.py", + "sha256": "51b25d03ac218ac4c4902da30cf860cc18c7f6f16013c9dda31432708969469d", + "size": 23152 + }, + { + "path": "scripts/generate_e4_alignment_deploy.py", + "sha256": "2de3a1ee4117b98e032afd2617c6bf2c28d722f678a5bc8a73ad85022a45e847", + "size": 33762 + }, + { + "path": "scripts/generate_e4_mechanism_followup_deploy.py", + "sha256": "3ed54036216a846dca32717c2b1e8c69f1bbe03d0778a0456c75234d3ce76361", + "size": 42745 + }, + { + "path": "scripts/generate_single_seed_followup.py", + "sha256": "ac8e5d7101630565ec5b7ef5dc74ec0b21c004eb003a1a85491aee28776b35f3", + "size": 29326 + }, + { + "path": "scripts/init_run.sh", + "sha256": "7f4d0ba92723ffcf9a809f3dff142b1ced858082a2b932f3f8f44b122af05844", + "size": 5944 + }, + { + "path": "scripts/merge_e1_trained_features.py", + "sha256": "c970b3521f4669e8208186358d7823a05d3efc513ac6205910a5f04a8374d714", + "size": 16433 + }, + { + "path": "scripts/nccl_smoke.py", + "sha256": "91bb5ff137ef21b57faaf532d090df53fac6423d1ab391ee34a73b3d84beaeb6", + "size": 2825 + }, + { + "path": "scripts/run_cifar100_imagenet_pregate_v2.sh", + "sha256": "6ccba35b04dbd6a8fbfe47223bf6bc979244e11d26ab427071293aff0b5164a0", + "size": 4147 + }, + { + "path": "scripts/run_e12_profile.py", + "sha256": "b05574d6f10eb7dd5a5227fbe275168baf5f2f47e1d939446bb4cb12265a01a1", + "size": 12381 + }, + { + "path": "scripts/run_e1_spectral.py", + "sha256": "665c5f2689f979fcfada6215d25a646435ce31afdc93f8690fc00ef6ccf9d8ca", + "size": 1331 + }, + { + "path": "scripts/run_e1_trained_features.py", + "sha256": "8999d4e7017e6abd6014d71d7e6509521d7bd5b55268feb4c190502637cb2e3f", + "size": 30227 + }, + { + "path": "scripts/run_e1_trained_features_full.sh", + "sha256": "569b0a6765413d695054f37442daceea15c046ad133501cd9fa4717ff5e17d06", + "size": 10750 + }, + { + "path": "scripts/run_e2_synthetic.py", + "sha256": "01c0f0d95f31f4f685922d9e9031b756ebdbb32afda407485ef4bdb440338336", + "size": 16193 + }, + { + "path": "scripts/run_e3_cifar100.sh", + "sha256": "16d3e17ee415096390dd6deed91751171e5a2606138dcbac69b0b17e8cdedd60", + "size": 2731 + }, + { + "path": "scripts/run_e3_cifar100_evaluation.sh", + "sha256": "e636cd7d2782c08ae92b54f1dec02a303e881b61cc8a1e60b2e5f4a3c25ade64", + "size": 16387 + }, + { + "path": "scripts/run_e4_alignment.sh", + "sha256": "ba71d8e67e30b7c699732df29a79677d8ced3827ad8282e9eed3705282efb2a2", + "size": 820 + }, + { + "path": "scripts/run_e4_e12_official.sh", + "sha256": "cabe569202795861c988ca0040453c18edb1f4a6146bbb7e3a0a3fa52c266fdf", + "size": 7196 + }, + { + "path": "scripts/run_e4_interventions.py", + "sha256": "2b0a4d648bfb5c84cbfc7024436cd5ce6d93215d8e0757b6d31f16bb4fd025b8", + "size": 16257 + }, + { + "path": "scripts/run_e4_mechanism_followup.sh", + "sha256": "e5825a4855f5c9a37962de4a7cc5f0e9a82fb8240338d5e2683c3ce96f55b5d4", + "size": 858 + }, + { + "path": "scripts/run_e6_e8_imagenet_partial.sh", + "sha256": "bbfd11d67807b717b984db4a040c6c453e34c92ce9bf7bf72f71a10967e349ad", + "size": 5448 + }, + { + "path": "scripts/run_e6_e8_imagenet_robustness.py", + "sha256": "c94f562643d935ca8333376f668600aff07d7e1eda118acf310e3e650fa55693", + "size": 25603 + }, + { + "path": "scripts/run_local_smoke.sh", + "sha256": "09495dda8a3daeb5fc1d0d6a75f71f0ee2a304a678f9eaef911ef4ef025b6f96", + "size": 3782 + }, + { + "path": "scripts/run_single_seed_followup.sh", + "sha256": "e2c5cf2def13c6c534653910b4b5e1b2ccfaa85cec8809990c1d26807eec3f54", + "size": 832 + }, + { + "path": "scripts/setup_env.sh", + "sha256": "748e5fdc0e46e508bf77796e284ba36e5e6afec7309329339268ebaf4d1cfc06", + "size": 1414 + }, + { + "path": "scripts/stage_cifar100.sh", + "sha256": "6cd30b9177214fe6673a2615d671e5104b53cec9d1ead393f7b2e9a50ddc66c9", + "size": 2094 + }, + { + "path": "scripts/stage_dataset.sh", + "sha256": "d2a1c70d93723574772b868526fa072bb5d3386e28de8867cacdcfe704abf846", + "size": 4131 + }, + { + "path": "scripts/stage_imagenet.sh", + "sha256": "b11b47cc4f707c14cb9d329b772c9dd29232cf4ce32150500ba0ec9074200bec", + "size": 9182 + }, + { + "path": "scripts/stage_imagenet_batch2_smoke.sh", + "sha256": "fb45f879b169233a4c85a7f571cfab3bd57d78c3a2118e19f9ba745ca5c78a78", + "size": 2828 + }, + { + "path": "scripts/summarize_cifar100_pregate_v2.py", + "sha256": "3e15ec8e4ed88931e36454a182051dc5be998e663cf5d52e2206acf3e38d0fad", + "size": 8664 + }, + { + "path": "scripts/summarize_e3_cifar100.py", + "sha256": "d18b11e184d3952a1a61e08bfec11a59832216250a6b6a7e9e4c7eabeeb89a02", + "size": 21381 + }, + { + "path": "scripts/summarize_imagenet_v2.py", + "sha256": "b3bb7ab6b85574076cb9772c244edf0dd8569338d91bba0b0feaf617ff218dc4", + "size": 16886 + } + ], + "fingerprint_scope": "training_source_configs_and_environment_specs", + "schema_version": 1 +} diff --git a/gmnet/code/journal_exp/configs/e1_spectral/gate_block_audit.yaml b/gmnet/code/journal_exp/configs/e1_spectral/gate_block_audit.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3646eb373022c362127c7e57dac97947ce0e8098 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e1_spectral/gate_block_audit.yaml @@ -0,0 +1,48 @@ +experiment_id: E1-spectral-gate-block-audit +description: Orthogonal FFT, DCT-II, and Haar audit on controlled spatial fields. +seeds: [0, 1, 2, 3, 4] +device: cuda:0 +shape: + batch_size: 4 + channels: 8 + resolution: 64 +gates: + - relu6_self + - relu_self + - gelu_self + - identity + - no_gate + - smooth_clipped_static +inputs: + - name: smooth_random_std1 + kind: random_field + target_std: 1.0 + spectral_alpha: 3.0 + knee: 0.15 + - name: smooth_random_std4 + kind: random_field + target_std: 4.0 + spectral_alpha: 3.0 + knee: 0.15 + - name: white_random_std1 + kind: random_field + target_std: 1.0 + spectral_alpha: 0.0 + knee: 0.15 + - name: tone_mix_std2 + kind: tone_mix + target_std: 2.0 +spectral: + high_low_split: 0.5 + haar_levels: 3 + lowpass_cutoffs: [0.125, 0.25, 0.5] + lowpass_modes: [hard, butterworth] + butterworth_order: 4 + band_edges: [0.0, 0.125, 0.25, 0.5, 1.0] +block: + mlp_ratio: 2 + kernel_size: 7 + layer_scale: 0.0 + f12_bn: false + projection_bn: true + second_dw_bn: false diff --git a/gmnet/code/journal_exp/configs/e2_synthetic/full.yaml b/gmnet/code/journal_exp/configs/e2_synthetic/full.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d2d626fb7a6fd9b206b1201c9e2b8ebe06bf0c7d --- /dev/null +++ b/gmnet/code/journal_exp/configs/e2_synthetic/full.yaml @@ -0,0 +1,45 @@ +experiment: e2_controlled_spectral_mechanism +device: auto +grid_size: 128 +seeds: [0, 1, 2, 3, 4] +gates: + - relu6_self + - relu_self + - gelu_self + - identity + - no_gate + - smooth_clipped_self +smooth_gate: + clip: 6.0 + beta: 10.0 +protocols: + - single_tone + - dual_tone + - random_field + - phase_amplitude + - cue_conflict +single_tone: + frequencies: [[4, 0], [8, 0], [16, 0], [24, 0], [40, 0], [52, 0]] + amplitudes: [0.5, 1.0, 3.0, 6.0, 9.0] + phases: [0.0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345] + max_harmonic_order: 8 +dual_tone: + frequency_pairs: [[4, 12], [8, 28], [12, 44]] + amplitudes: [1.0, 1.0] +random_field: + bands: [[2, 8], [12, 24], [32, 52]] +phase_amplitude: + frequency: [12, 0] + amplitudes: [0.25, 0.5, 1.0, 3.0, 6.0, 9.0] + phases: [0.0, 0.39269908169872414, 0.7853981633974483, 1.1780972450961724, + 1.5707963267948966, 1.9634954084936207, 2.356194490192345, + 2.748893571891069] +cue_conflict: + low_frequency: [4, 0] + high_frequency: [36, 0] + high_amplitude: 1.0 + low_to_high_ratios: [0.25, 0.5, 1.0, 2.0, 4.0] +statistics: + bootstrap_samples: 2000 + confidence: 0.95 + bootstrap_seed: 250322841 diff --git a/gmnet/code/journal_exp/configs/e2_synthetic/test.yaml b/gmnet/code/journal_exp/configs/e2_synthetic/test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..de2eac53eefafb9480b5e3ccac0e189a7ae3408d --- /dev/null +++ b/gmnet/code/journal_exp/configs/e2_synthetic/test.yaml @@ -0,0 +1,27 @@ +experiment: e2_controlled_spectral_mechanism_test +device: cpu +grid_size: 32 +seeds: [0] +gates: [relu6_self, no_gate] +smooth_gate: {clip: 6.0, beta: 10.0} +protocols: [single_tone, dual_tone, random_field, phase_amplitude, cue_conflict] +single_tone: + frequencies: [[3, 0], [12, 0]] + amplitudes: [1.0] + phases: [0.0] + max_harmonic_order: 4 +dual_tone: + frequency_pairs: [[2, 7]] + amplitudes: [1.0, 1.0] +random_field: + bands: [[1, 4], [5, 8], [9, 13]] +phase_amplitude: + frequency: [3, 0] + amplitudes: [1.0] + phases: [0.0, 1.5707963267948966] +cue_conflict: + low_frequency: [2, 0] + high_frequency: [11, 0] + high_amplitude: 1.0 + low_to_high_ratios: [0.5, 1.0, 2.0] +statistics: {bootstrap_samples: 100, confidence: 0.95, bootstrap_seed: 1} diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_gelu.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_gelu.yaml new file mode 100644 index 0000000000000000000000000000000000000000..010e8d39be8b04806f1e9b8a7fbb60cbfa4f6db2 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_gelu.yaml @@ -0,0 +1,4 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-gelu-S1 +model: + gate_type: gelu_self diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_identity.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_identity.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d37bc2a40b27ce2ef61954d6f231d14271fa1767 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_identity.yaml @@ -0,0 +1,4 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-identity-S1 +model: + gate_type: identity diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_no_gate.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_no_gate.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9abaec713b631e765b69306fa5f3c4b6bdb73a59 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_no_gate.yaml @@ -0,0 +1,4 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-no-gate-S1 +model: + gate_type: no_gate diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu.yaml new file mode 100644 index 0000000000000000000000000000000000000000..32dc6b4def77c59212bf49810060f6306e41f744 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu.yaml @@ -0,0 +1,4 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-relu-S1 +model: + gate_type: relu_self diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu6.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu6.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3a82d848cc3ec251b0e0786b17c50c2db8fee97d --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu6.yaml @@ -0,0 +1,4 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-relu6-S1 +model: + gate_type: relu6_self diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu6_only.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu6_only.yaml new file mode 100644 index 0000000000000000000000000000000000000000..254a726a4f1fdfbdd8f087e14eaa692d0440f610 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_relu6_only.yaml @@ -0,0 +1,4 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-relu6-only-S1 +model: + gate_type: relu6_only diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_corrected.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_corrected.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cc7c6ab41022b5d2694294c28d4efb9781304131 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_corrected.yaml @@ -0,0 +1,8 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-smooth-trainable-corrected-S1 +model: + gate_type: smooth_clipped_self + smooth_clip_init: 6.0 + smooth_clip_beta: 10.0 + smooth_clip_per_channel: false + smooth_clip_trainable: true diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_fixed_c6.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_fixed_c6.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3935e8f02616483b3cbddcbfebae8260bd2623af --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_fixed_c6.yaml @@ -0,0 +1,8 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-smooth-fixed-c6-S1 +model: + gate_type: smooth_clipped_self + smooth_clip_init: 6.0 + smooth_clip_beta: 10.0 + smooth_clip_per_channel: false + smooth_clip_trainable: false diff --git a/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_static.yaml b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_static.yaml new file mode 100644 index 0000000000000000000000000000000000000000..88d01f2f7322cfb2a6f61198e71b4fa6ffa49c68 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/cifar100_gmnet_s1_smooth_static.yaml @@ -0,0 +1,8 @@ +base: ../base/cifar100_paper.yaml +experiment_id: E3-C100-smooth-static-S1 +model: + gate_type: smooth_clipped_self + smooth_clip_init: 6.0 + smooth_clip_beta: 10.0 + smooth_clip_per_channel: false + smooth_clip_trainable: true diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_gelu.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_gelu.yaml new file mode 100644 index 0000000000000000000000000000000000000000..58d531ebd4cbaf8908e500147a020daea3468977 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_gelu.yaml @@ -0,0 +1,5 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-gelu-S3 +model: + variant: s3 + gate_type: gelu_self diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_no_gate.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_no_gate.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eded87e046aec0e2fb5d1fad67069cad7f724dd0 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_no_gate.yaml @@ -0,0 +1,5 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-no-gate-S3 +model: + variant: s3 + gate_type: no_gate diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu.yaml new file mode 100644 index 0000000000000000000000000000000000000000..061ac9e4265bc3504c18afbad8a0a7f28a0fe866 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu.yaml @@ -0,0 +1,5 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-relu-S3 +model: + variant: s3 + gate_type: relu_self diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu6.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu6.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8599f8632c8c41d7945b55d153a1099b042cc693 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu6.yaml @@ -0,0 +1,5 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-relu6-S3 +model: + variant: s3 + gate_type: relu6_self diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu6_only.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu6_only.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4f75444f2ef1bb50b02d1b6b2b1c560da9456e15 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_relu6_only.yaml @@ -0,0 +1,5 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-relu6-only-S3 +model: + variant: s3 + gate_type: relu6_only diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_clipped_static.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_clipped_static.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c8c29b313ea29828be903f2ea52de00469f4883c --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_clipped_static.yaml @@ -0,0 +1,9 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-smooth-clipped-static-S3 +model: + variant: s3 + gate_type: smooth_clipped_self + smooth_clip_init: 6.0 + smooth_clip_beta: 10.0 + smooth_clip_per_channel: false + smooth_clip_trainable: true diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_corrected.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_corrected.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1280916cf9f6c89e77fac0cd350cc66cf46dc823 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_corrected.yaml @@ -0,0 +1,11 @@ +# Corrected learned-smooth gate. The threshold is initialized at 6 and learned; +# this is not the fixed/static control. +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-smooth-corrected-S3 +model: + variant: s3 + gate_type: smooth_clipped_self + smooth_clip_init: 6.0 + smooth_clip_beta: 10.0 + smooth_clip_per_channel: false + smooth_clip_trainable: true diff --git a/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_fixed_c6.yaml b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_fixed_c6.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e9e32291f5e9ff8daf4f19347f8171bf7cad8564 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e3_gate/imagenet_gmnet_s3_smooth_fixed_c6.yaml @@ -0,0 +1,10 @@ +# Fixed-c=6 diagnostic matched to the learned-smooth parameterization. +base: ../base/imagenet_paper.yaml +experiment_id: E3-G-smooth-fixed-c6-S3 +model: + variant: s3 + gate_type: smooth_clipped_self + smooth_clip_init: 6.0 + smooth_clip_beta: 10.0 + smooth_clip_per_channel: false + smooth_clip_trainable: false diff --git a/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_batch_derangement.yaml b/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_batch_derangement.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c4708a921bd72fc607d64b5d6f772893426f37d5 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_batch_derangement.yaml @@ -0,0 +1,7 @@ +# Use another sample in the local batch as the gate input. +base: ../e0_baseline/imagenet_gmnet_s3.yaml +experiment_id: E4F-ImageNet-S3-batch-derangement +protocol_id: e4-imagenet-mechanism-followup-v1 +model: + gate_intervention: batch_derangement + gate_intervention_seed: 41041 diff --git a/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_current_baseline.yaml b/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_current_baseline.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7dc74bbcd98515f2cadebd902b55ba6dae0266cc --- /dev/null +++ b/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_current_baseline.yaml @@ -0,0 +1,7 @@ +# Exact-current-code control for all E4 mechanism follow-up contrasts. +base: ../e0_baseline/imagenet_gmnet_s3.yaml +experiment_id: E4F-ImageNet-S3-current-baseline +protocol_id: e4-imagenet-mechanism-followup-v1 +model: + gate_intervention: baseline + gate_intervention_seed: 41041 diff --git a/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml b/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b47ab2466c5657b5afd1f953c62ca42c8d0db4cc --- /dev/null +++ b/gmnet/code/journal_exp/configs/e4_mechanism_followup/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml @@ -0,0 +1,7 @@ +# Combine channel misalignment with removal of the gate-branch derivative. +base: ../e0_baseline/imagenet_gmnet_s3.yaml +experiment_id: E4F-ImageNet-S3-stopgrad-channel-derangement +protocol_id: e4-imagenet-mechanism-followup-v1 +model: + gate_intervention: stop_gradient_channel_derangement + gate_intervention_seed: 41041 diff --git a/gmnet/code/journal_exp/configs/e5_scaling/imagenet_gmnet_s1.yaml b/gmnet/code/journal_exp/configs/e5_scaling/imagenet_gmnet_s1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..edf6bc740425198420dc8ee39565ef6240273c7f --- /dev/null +++ b/gmnet/code/journal_exp/configs/e5_scaling/imagenet_gmnet_s1.yaml @@ -0,0 +1,5 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E5-S1 +model: + variant: s1 + drop_path_rate: 0.0 diff --git a/gmnet/code/journal_exp/configs/e5_scaling/imagenet_gmnet_s4.yaml b/gmnet/code/journal_exp/configs/e5_scaling/imagenet_gmnet_s4.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6b2b3178dde336f230d0b01979c709a1253e07ca --- /dev/null +++ b/gmnet/code/journal_exp/configs/e5_scaling/imagenet_gmnet_s4.yaml @@ -0,0 +1,5 @@ +base: ../base/imagenet_paper.yaml +experiment_id: E5-S4 +model: + variant: s4 + drop_path_rate: 0.02 diff --git a/gmnet/code/journal_exp/configs/e6_e8/imagenet_partial.yaml b/gmnet/code/journal_exp/configs/e6_e8/imagenet_partial.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f752089af6d33e38bba72e9f72d1795025956906 --- /dev/null +++ b/gmnet/code/journal_exp/configs/e6_e8/imagenet_partial.yaml @@ -0,0 +1,37 @@ +protocol_version: e6-e8-imagenet-partial-v1 +checkpoint: /nfs/ywang29/GmNet/gmnet_s3.npy +data_root: /s3-code/ywang29/datasets/imagenet-1k/val +output_root: /tmp/gmnet_runs +input: + size: 224 + crop_pct: 0.875 + mean: [0.485, 0.456, 0.406] + std: [0.229, 0.224, 0.225] +subset: + selection: per-class-sha256 + seed: 250322841 + e6_per_class: 5 + e8_per_class: 1 +e6: + conditions: [clean, gaussian_noise, gaussian_blur, jpeg, contrast, shift_2px] + ece_bins: 15 +e8: + ece_bins: 15 + random_seed: 22841 + pgd_linf: + epsilon: 0.01568627450980392 + step_size: 0.00392156862745098 + steps: 10 + pgd_l2_frequency: + equal_energy_definition: epsilon_linf_times_sqrt_num_pixels + step_fraction: 0.25 + steps: 10 + projection_iterations: 8 + bands: + low: [0.0, 0.15] + mid: [0.15, 0.4] + high: [0.4, 1.0] +claim_boundary: + - This is a fixed-subset partial protocol, not full ImageNet validation. + - PGD-10 is not AutoAttack and is not claimed to be attack-complete. + - The checkpoint uses the strictly matching historical full-BN topology, not the frozen paper-default topology. diff --git a/gmnet/code/journal_exp/gmnet/analysis/__init__.py b/gmnet/code/journal_exp/gmnet/analysis/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c8651c08a72a0dd02ff437f1129b938233fd259b --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/analysis/__init__.py @@ -0,0 +1,27 @@ +"""Checkpoint, intervention, and deployment analysis helpers.""" + +from .checkpoint import ( + audit_gmnet_s3_checkpoint, + load_gmnet_s3_checkpoint, + load_model_checkpoint, + load_training_checkpoint, +) +from .interventions import ( + INTERVENTION_MODES, + TRAINING_ONLY_INTERVENTION_MODES, + install_gate_interventions, + set_intervention_mode, + summarize_intervention_coherence, +) + +__all__ = [ + "INTERVENTION_MODES", + "TRAINING_ONLY_INTERVENTION_MODES", + "audit_gmnet_s3_checkpoint", + "install_gate_interventions", + "load_gmnet_s3_checkpoint", + "load_model_checkpoint", + "load_training_checkpoint", + "set_intervention_mode", + "summarize_intervention_coherence", +] diff --git a/gmnet/code/journal_exp/gmnet/analysis/aggregation.py b/gmnet/code/journal_exp/gmnet/analysis/aggregation.py new file mode 100644 index 0000000000000000000000000000000000000000..d7db8af92142c4c3ca5b1b45dc474be862b47298 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/analysis/aggregation.py @@ -0,0 +1,213 @@ +"""Aggregate process- or seed-level local experiment results.""" + +from __future__ import annotations + +import json +import statistics +from pathlib import Path +from typing import Any + + +def _summary(values: list[float]) -> dict[str, float | int]: + if not values: + raise ValueError("cannot summarize an empty value list") + return { + "count": len(values), + "mean": statistics.fmean(values), + "sample_std": statistics.stdev(values) if len(values) > 1 else 0.0, + "min": min(values), + "max": max(values), + "median": statistics.median(values), + } + + +def _load_results(paths: list[Path]) -> list[dict[str, Any]]: + results = [] + for path in paths: + if not path.is_file(): + raise FileNotFoundError(f"result file does not exist: {path}") + value = json.loads(path.read_text(encoding="utf-8")) + if not isinstance(value, dict): + raise TypeError(f"result is not a mapping: {path}") + value["_source_result"] = str(path.resolve()) + results.append(value) + return results + + +def aggregate_e4(paths: list[Path]) -> dict[str, Any]: + results = _load_results(paths) + if len(results) < 2: + raise ValueError("E4 aggregation requires at least two seed results") + modes = list(results[0]["interventions"]) + for result in results: + data = result["data"] + if data["evaluated_samples"] != data["full_validation_samples"]: + raise ValueError("official E4 aggregation requires full validation sets") + if list(result["interventions"]) != modes: + raise ValueError("E4 intervention modes differ across seeds") + + metric_names = ( + "top1_percent", + "top5_percent", + "nll", + "ece_percent", + "prediction_agreement_with_baseline_percent", + "mean_kl_from_baseline", + "logit_rmse_from_baseline", + ) + aggregated_modes = {} + for mode in modes: + aggregated_modes[mode] = { + metric: _summary( + [float(result["interventions"][mode][metric]) for result in results] + ) + for metric in metric_names + } + return { + "schema_version": 1, + "experiment": "E4", + "status": "aggregated_full_validation_seed_results", + "seed_count": len(results), + "seeds": [result["checkpoint"].get("seed") for result in results], + "checkpoint_sha256": [ + result["checkpoint"]["sha256"] for result in results + ], + "source_results": [result["_source_result"] for result in results], + "data": results[0]["data"], + "interventions": aggregated_modes, + "claim_scope": results[0]["claim_scope"], + } + + +def aggregate_e12(paths: list[Path]) -> dict[str, Any]: + results = _load_results(paths) + if len(results) != 5: + raise ValueError("official E12 aggregation requires five process results") + if any(result["status"] != "completed" for result in results): + raise ValueError("E12 contains an incomplete or smoke-only result") + + grouped: dict[tuple[str, str, int], list[dict[str, Any]]] = {} + for result in results: + for measurement in result["measurements"]: + key = ( + str(measurement["device"]), + str(measurement["precision"]), + int(measurement["batch_size"]), + ) + grouped.setdefault(key, []).append(measurement) + expected = len(results) + metrics = ( + "latency_mean_ms", + "latency_p50_ms", + "latency_p95_ms", + "throughput_mean_images_per_second", + "throughput_at_p50_images_per_second", + ) + configurations = [] + for key, measurements in sorted(grouped.items()): + if len(measurements) != expected: + raise ValueError(f"missing E12 process measurement for {key}") + summary = { + metric: _summary([float(item[metric]) for item in measurements]) + for metric in metrics + } + memory = [ + float(item["peak_cuda_memory_mb"]) + for item in measurements + if item["peak_cuda_memory_mb"] is not None + ] + summary["peak_cuda_memory_mb"] = _summary(memory) if memory else None + configurations.append( + { + "device": key[0], + "precision": key[1], + "batch_size": key[2], + "process_count": len(measurements), + "metrics": summary, + } + ) + return { + "schema_version": 1, + "experiment": "E12", + "status": "aggregated_five_independent_processes", + "process_count": len(results), + "source_results": [result["_source_result"] for result in results], + "checkpoint_sha256": results[0]["checkpoint"]["sha256"], + "configurations": configurations, + "int8": results[0]["int8"], + } + + +def render_e4_markdown(result: dict[str, Any]) -> str: + rows = [] + for mode, metrics in result["interventions"].items(): + top1 = metrics["top1_percent"] + top5 = metrics["top5_percent"] + nll = metrics["nll"] + ece = metrics["ece_percent"] + rows.append( + f"| {mode} | {top1['mean']:.3f} +/- {top1['sample_std']:.3f} | " + f"{top5['mean']:.3f} +/- {top5['sample_std']:.3f} | " + f"{nll['mean']:.4f} +/- {nll['sample_std']:.4f} | " + f"{ece['mean']:.3f} +/- {ece['sample_std']:.3f} |" + ) + return "\n".join( + [ + "# E4 Three-Seed Aggregate", + "", + "Frozen-weight interventions on the full CIFAR-100 test set. Values " + "are mean +/- sample standard deviation across seed checkpoints.", + "", + "| Mode | Top-1 (%) | Top-5 (%) | NLL | ECE (%) |", + "|---|---:|---:|---:|---:|", + *rows, + "", + "This is a frozen-checkpoint diagnostic, not matched retraining.", + "", + ] + ) + + +def render_e12_markdown(result: dict[str, Any]) -> str: + rows = [] + for configuration in result["configurations"]: + metrics = configuration["metrics"] + latency = metrics["latency_p50_ms"] + p95 = metrics["latency_p95_ms"] + throughput = metrics["throughput_mean_images_per_second"] + memory = metrics["peak_cuda_memory_mb"] + memory_text = f"{memory['mean']:.1f}" if memory else "n/a" + rows.append( + f"| {configuration['device']} | {configuration['precision']} | " + f"{configuration['batch_size']} | {latency['mean']:.3f} +/- " + f"{latency['sample_std']:.3f} | {p95['mean']:.3f} +/- " + f"{p95['sample_std']:.3f} | {throughput['mean']:.2f} +/- " + f"{throughput['sample_std']:.2f} | {memory_text} |" + ) + return "\n".join( + [ + "# E12 Five-Process Aggregate", + "", + "Each table entry is mean +/- sample standard deviation across five " + "independent processes on an otherwise idle host.", + "", + "| Device | Precision | Batch | Process p50 (ms) | Process p95 (ms) | " + "Throughput (image/s) | Peak CUDA MiB |", + "|---|---|---:|---:|---:|---:|---:|", + *rows, + "", + ] + ) + + +def write_aggregate( + result: dict[str, Any], output_dir: Path, markdown: str +) -> tuple[Path, Path]: + output_dir.mkdir(parents=True, exist_ok=True) + json_path = output_dir / "aggregate.json" + markdown_path = output_dir / "AGGREGATE.md" + json_path.write_text( + json.dumps(result, indent=2, sort_keys=True) + "\n", encoding="utf-8" + ) + markdown_path.write_text(markdown, encoding="utf-8") + return json_path, markdown_path diff --git a/gmnet/code/journal_exp/gmnet/analysis/checkpoint.py b/gmnet/code/journal_exp/gmnet/analysis/checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..9b557a17bcfd16978bf856839827e5771053ba2e --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/analysis/checkpoint.py @@ -0,0 +1,189 @@ +"""Compatibility loader for the historical GmNet-S3 NumPy checkpoint.""" + +from __future__ import annotations + +import hashlib +from pathlib import Path +from typing import Any + +import numpy as np +import torch +from torch import Tensor, nn + +from gmnet.models import create_gmnet, gmnet_s3 + + +COMPAT_MODEL_KWARGS: dict[str, object] = { + "f12_bn": True, + "projection_bn": True, + "second_dw_bn": True, +} + + +def sha256_file(path: str | Path, chunk_size: int = 8 * 1024 * 1024) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as handle: + for chunk in iter(lambda: handle.read(chunk_size), b""): + digest.update(chunk) + return digest.hexdigest() + + +def load_numpy_state_dict(path: str | Path) -> dict[str, Tensor]: + """Load the trusted historical object-array checkpoint as CPU tensors.""" + + checkpoint_path = Path(path).expanduser().resolve() + if not checkpoint_path.is_file(): + raise FileNotFoundError(f"checkpoint does not exist: {checkpoint_path}") + payload = np.load(checkpoint_path, allow_pickle=True).item() + if not isinstance(payload, dict) or not payload: + raise ValueError( + f"checkpoint is not a non-empty state dictionary: {checkpoint_path}" + ) + + state: dict[str, Tensor] = {} + for key, value in payload.items(): + if not isinstance(key, str) or not isinstance(value, np.ndarray): + raise TypeError(f"unsupported checkpoint entry: {key!r} ({type(value)!r})") + state[key] = torch.from_numpy(value) + return state + + +def _state_compatibility( + model: nn.Module, state: dict[str, Tensor] +) -> dict[str, Any]: + model_state = model.state_dict() + model_keys = set(model_state) + checkpoint_keys = set(state) + shared = model_keys & checkpoint_keys + shape_mismatches = sorted( + key + for key in shared + if tuple(model_state[key].shape) != tuple(state[key].shape) + ) + missing = sorted(model_keys - checkpoint_keys) + unexpected = sorted(checkpoint_keys - model_keys) + return { + "model_key_count": len(model_state), + "checkpoint_key_count": len(state), + "missing_key_count": len(missing), + "unexpected_key_count": len(unexpected), + "shape_mismatch_count": len(shape_mismatches), + "missing_key_sample": missing[:10], + "unexpected_key_sample": unexpected[:10], + "shape_mismatch_sample": shape_mismatches[:10], + "strict_compatible": not missing and not unexpected and not shape_mismatches, + } + + +def audit_gmnet_s3_checkpoint(path: str | Path) -> dict[str, Any]: + checkpoint_path = Path(path).expanduser().resolve() + state = load_numpy_state_dict(checkpoint_path) + paper_model = gmnet_s3() + compat_model = gmnet_s3(**COMPAT_MODEL_KWARGS) + paper = _state_compatibility(paper_model, state) + compat = _state_compatibility(compat_model, state) + return { + "path": str(checkpoint_path), + "format": "numpy_object_state_dict", + "sha256": sha256_file(checkpoint_path), + "paper_default_topology": paper, + "historical_full_bn_topology": compat, + "compat_model_kwargs": dict(COMPAT_MODEL_KWARGS), + "selected_topology": ( + "historical_full_bn_topology" if compat["strict_compatible"] else None + ), + "claim_boundary": ( + "The checkpoint is not compatible with the frozen paper-default " + "topology. It is used only with the exactly matching historical " + "full-BN topology." + ), + } + + +def load_gmnet_s3_checkpoint( + path: str | Path, + *, + device: str | torch.device = "cpu", +) -> tuple[nn.Module, dict[str, Any]]: + checkpoint_path = Path(path).expanduser().resolve() + state = load_numpy_state_dict(checkpoint_path) + audit = audit_gmnet_s3_checkpoint(checkpoint_path) + compatibility = audit["historical_full_bn_topology"] + if not compatibility["strict_compatible"]: + raise ValueError( + "historical checkpoint does not strictly map to the full-BN " + f"compatibility model: {compatibility}" + ) + model = gmnet_s3(**COMPAT_MODEL_KWARGS) + model.load_state_dict(state, strict=True) + model.eval().to(device) + audit["parameter_count"] = sum( + parameter.numel() for parameter in model.parameters() + ) + return model, audit + + +def load_training_checkpoint( + path: str | Path, + *, + device: str | torch.device = "cpu", +) -> tuple[nn.Module, dict[str, Any]]: + """Strictly reconstruct a model from a checkpoint produced by gmnet.train.""" + + checkpoint_path = Path(path).expanduser().resolve() + if not checkpoint_path.is_file(): + raise FileNotFoundError(f"checkpoint does not exist: {checkpoint_path}") + checkpoint = torch.load( + checkpoint_path, + map_location="cpu", + weights_only=False, + ) + if not isinstance(checkpoint, dict): + raise TypeError(f"training checkpoint is not a mapping: {checkpoint_path}") + state = checkpoint.get("model") + config = checkpoint.get("config") + if not isinstance(state, dict) or not isinstance(config, dict): + raise ValueError("training checkpoint must contain model and config mappings") + model_config = dict(config.get("model", {})) + variant = str(model_config.pop("variant")) + num_classes = int(model_config.pop("num_classes")) + model = create_gmnet(variant, num_classes=num_classes, **model_config) + compatibility = _state_compatibility(model, state) + if not compatibility["strict_compatible"]: + raise ValueError( + f"training checkpoint is not strictly compatible: {compatibility}" + ) + model.load_state_dict(state, strict=True) + model.eval().to(device) + audit = { + "path": str(checkpoint_path), + "format": "gmnet_train_torch_checkpoint", + "sha256": sha256_file(checkpoint_path), + "strict_compatibility": compatibility, + "model_config": config["model"], + "data_config": config.get("data", {}), + "run_name": checkpoint.get("run_name"), + "seed": checkpoint.get("seed"), + "epoch": checkpoint.get("epoch"), + "best_top1_recorded": checkpoint.get("best_top1"), + "parameter_count": sum( + parameter.numel() for parameter in model.parameters() + ), + "selected_topology": "checkpoint_resolved_config", + "claim_boundary": ( + "This model is reconstructed only from the resolved configuration " + "stored in the training checkpoint." + ), + } + return model, audit + + +def load_model_checkpoint( + path: str | Path, + *, + device: str | torch.device = "cpu", +) -> tuple[nn.Module, dict[str, Any]]: + checkpoint_path = Path(path).expanduser().resolve() + if checkpoint_path.suffix.lower() == ".npy": + return load_gmnet_s3_checkpoint(checkpoint_path, device=device) + return load_training_checkpoint(checkpoint_path, device=device) diff --git a/gmnet/code/journal_exp/gmnet/analysis/interventions.py b/gmnet/code/journal_exp/gmnet/analysis/interventions.py new file mode 100644 index 0000000000000000000000000000000000000000..4e89bb37a1e7b4d0b1b51ac5e407a51e4e2bc586 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/analysis/interventions.py @@ -0,0 +1,193 @@ +"""Frozen-weight gate interventions for GmNet diagnostic evaluation.""" + +from __future__ import annotations + +import math +from dataclasses import dataclass +from typing import Final + +import torch +from torch import Tensor, nn + +from gmnet.models.gmnet import GmNet, SelfGate + + +INTERVENTION_MODES: Final[tuple[str, ...]] = ( + "baseline", + "batch_shuffle", + "spatial_shuffle", + "channel_shuffle", + "mean_gate", +) +TRAINING_ONLY_INTERVENTION_MODES: Final[tuple[str, ...]] = ("stop_gradient",) + + +@dataclass +class MomentStats: + count: int + sum_x: float + sum_y: float + sum_x2: float + sum_y2: float + sum_xy: float + + @classmethod + def from_tensors(cls, x: Tensor, y: Tensor, max_values: int) -> "MomentStats": + x_flat = x.detach().float().reshape(-1) + y_flat = y.detach().float().reshape(-1) + if x_flat.numel() > max_values: + step = math.ceil(x_flat.numel() / max_values) + x_flat = x_flat[::step][:max_values] + y_flat = y_flat[::step][:max_values] + return cls( + count=x_flat.numel(), + sum_x=float(x_flat.sum().item()), + sum_y=float(y_flat.sum().item()), + sum_x2=float(x_flat.square().sum().item()), + sum_y2=float(y_flat.square().sum().item()), + sum_xy=float((x_flat * y_flat).sum().item()), + ) + + def pearson(self) -> float: + if self.count == 0: + return float("nan") + numerator = self.count * self.sum_xy - self.sum_x * self.sum_y + variance_x = self.count * self.sum_x2 - self.sum_x**2 + variance_y = self.count * self.sum_y2 - self.sum_y**2 + denominator = math.sqrt(max(variance_x * variance_y, 0.0)) + return numerator / denominator if denominator > 0 else float("nan") + + +class InterventionSelfGate(nn.Module): + """Use a permuted or detached gate input while preserving the feature path.""" + + def __init__( + self, + activation: nn.Module, + *, + seed: int, + max_stat_values: int = 65_536, + ) -> None: + super().__init__() + self.activation = activation + self.seed = int(seed) + self.max_stat_values = int(max_stat_values) + self.mode = "baseline" + self._permutations: dict[tuple[str, int, str], Tensor] = {} + self._stats: dict[str, MomentStats] = {} + + def set_mode(self, mode: str) -> None: + supported = (*INTERVENTION_MODES, *TRAINING_ONLY_INTERVENTION_MODES) + if mode not in supported: + choices = ", ".join(supported) + raise ValueError( + f"unsupported intervention {mode!r}; choose from {choices}" + ) + self.mode = mode + + def _permutation(self, mode: str, size: int, device: torch.device) -> Tensor: + key = (mode, size, str(device)) + if key not in self._permutations: + generator = torch.Generator(device="cpu") + mode_offset = { + "batch_shuffle": 11, + "spatial_shuffle": 23, + "channel_shuffle": 37, + }[mode] + generator.manual_seed(self.seed + mode_offset + size * 1_000_003) + permutation = torch.randperm(size, generator=generator) + if size > 1 and torch.equal(permutation, torch.arange(size)): + permutation = permutation.roll(1) + self._permutations[key] = permutation.to(device=device) + return self._permutations[key] + + def _gate_input(self, x: Tensor) -> Tensor: + if self.mode == "baseline": + return x + if self.mode == "stop_gradient": + return x.detach() + if self.mode == "batch_shuffle": + return x.index_select(0, self._permutation(self.mode, x.shape[0], x.device)) + if self.mode == "channel_shuffle": + return x.index_select(1, self._permutation(self.mode, x.shape[1], x.device)) + if self.mode == "spatial_shuffle": + flattened = x.flatten(2) + permutation = self._permutation(self.mode, flattened.shape[2], x.device) + return flattened.index_select(2, permutation).view_as(x) + raise AssertionError(f"unreachable intervention mode: {self.mode}") + + def forward(self, x: Tensor) -> Tensor: + if self.mode == "mean_gate": + gate_signal = self.activation(x).mean( + dim=(0, 2, 3), keepdim=True + ).expand_as(x) + if self.mode not in self._stats: + self._stats[self.mode] = MomentStats.from_tensors( + x, gate_signal, self.max_stat_values + ) + return x * gate_signal + gate_input = self._gate_input(x) + if self.mode not in self._stats: + self._stats[self.mode] = MomentStats.from_tensors( + x, gate_input, self.max_stat_values + ) + return x * self.activation(gate_input) + + def coherence(self, mode: str) -> dict[str, float | int] | None: + stats = self._stats.get(mode) + if stats is None: + return None + return {"sampled_values": stats.count, "pearson": stats.pearson()} + + +def install_gate_interventions(model: GmNet, seed: int = 0) -> int: + installed = 0 + for module in model.modules(): + gate = getattr(module, "gate", None) + if isinstance(gate, SelfGate): + module.gate = InterventionSelfGate( + gate.activation, + seed=seed + installed * 10_007, + ) + installed += 1 + if installed == 0: + raise ValueError("model contains no supported SelfGate modules") + return installed + + +def _intervention_modules(model: nn.Module) -> list[InterventionSelfGate]: + return [ + module + for module in model.modules() + if isinstance(module, InterventionSelfGate) + ] + + +def set_intervention_mode(model: nn.Module, mode: str) -> None: + modules = _intervention_modules(model) + if not modules: + raise ValueError("gate interventions have not been installed") + for module in modules: + module.set_mode(mode) + + +def summarize_intervention_coherence( + model: nn.Module, mode: str +) -> dict[str, object]: + per_gate = [] + for index, module in enumerate(_intervention_modules(model)): + value = module.coherence(mode) + if value is not None: + per_gate.append({"gate_index": index, **value}) + correlations = [ + float(item["pearson"]) + for item in per_gate + if math.isfinite(float(item["pearson"])) + ] + return { + "measured_gate_count": len(per_gate), + "mean_gate_input_pearson": ( + sum(correlations) / len(correlations) if correlations else None + ), + "per_gate": per_gate, + } diff --git a/gmnet/code/journal_exp/gmnet/analysis/profiling.py b/gmnet/code/journal_exp/gmnet/analysis/profiling.py new file mode 100644 index 0000000000000000000000000000000000000000..58c379f3fe093f5c846e3c0f2f5f2adb5ce4f28d --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/analysis/profiling.py @@ -0,0 +1,134 @@ +"""Reproducible eager-mode inference profiling utilities.""" + +from __future__ import annotations + +import contextlib +import math +import time +from collections.abc import Iterator + +import torch +from torch import nn + + +def percentile(values: list[float], quantile: float) -> float: + if not values: + raise ValueError("cannot compute a percentile of an empty sequence") + if not 0.0 <= quantile <= 1.0: + raise ValueError(f"quantile must be in [0, 1], got {quantile}") + ordered = sorted(values) + position = quantile * (len(ordered) - 1) + lower = math.floor(position) + upper = math.ceil(position) + if lower == upper: + return ordered[lower] + fraction = position - lower + return ordered[lower] * (1.0 - fraction) + ordered[upper] * fraction + + +def _autocast( + device: torch.device, precision: str +) -> contextlib.AbstractContextManager: + if precision == "fp32": + return contextlib.nullcontext() + if precision == "bf16": + return torch.autocast(device_type=device.type, dtype=torch.bfloat16) + raise ValueError(f"unsupported precision: {precision}") + + +def _cuda_timings( + model: nn.Module, + inputs: torch.Tensor, + precision: str, + iterations: int, +) -> list[float]: + starts = [torch.cuda.Event(enable_timing=True) for _ in range(iterations)] + ends = [torch.cuda.Event(enable_timing=True) for _ in range(iterations)] + with torch.inference_mode(), _autocast(inputs.device, precision): + for start, end in zip(starts, ends, strict=True): + start.record() + output = model(inputs) + end.record() + torch.cuda.synchronize(inputs.device) + if not torch.isfinite(output).all(): + raise ValueError("model produced non-finite output during profiling") + return [start.elapsed_time(end) for start, end in zip(starts, ends, strict=True)] + + +def _cpu_timings( + model: nn.Module, + inputs: torch.Tensor, + precision: str, + iterations: int, +) -> list[float]: + timings = [] + with torch.inference_mode(), _autocast(inputs.device, precision): + for _ in range(iterations): + started = time.perf_counter() + output = model(inputs) + timings.append((time.perf_counter() - started) * 1_000.0) + if not torch.isfinite(output).all(): + raise ValueError("model produced non-finite output during profiling") + return timings + + +def _warm_up( + model: nn.Module, + inputs: torch.Tensor, + precision: str, + iterations: int, +) -> None: + with torch.inference_mode(), _autocast(inputs.device, precision): + for _ in range(iterations): + model(inputs) + if inputs.device.type == "cuda": + torch.cuda.synchronize(inputs.device) + + +def benchmark_model( + model: nn.Module, + *, + device: str | torch.device, + batch_size: int, + input_size: int, + precision: str, + warmup_iterations: int, + measured_iterations: int, +) -> dict[str, float | int | str | None]: + if batch_size <= 0 or input_size <= 0: + raise ValueError("batch_size and input_size must be positive") + if warmup_iterations < 0 or measured_iterations <= 0: + raise ValueError("invalid profiling iteration counts") + target = torch.device(device) + model.eval().to(target) + inputs = torch.randn(batch_size, 3, input_size, input_size, device=target) + _warm_up(model, inputs, precision, warmup_iterations) + + peak_memory_mb: float | None = None + current_memory_mb: float | None = None + if target.type == "cuda": + torch.cuda.reset_peak_memory_stats(target) + timings = _cuda_timings(model, inputs, precision, measured_iterations) + peak_memory_mb = torch.cuda.max_memory_allocated(target) / 2**20 + current_memory_mb = torch.cuda.memory_allocated(target) / 2**20 + else: + timings = _cpu_timings(model, inputs, precision, measured_iterations) + + mean_ms = sum(timings) / len(timings) + p50_ms = percentile(timings, 0.50) + p95_ms = percentile(timings, 0.95) + return { + "device": str(target), + "precision": precision, + "batch_size": batch_size, + "input_size": input_size, + "warmup_iterations": warmup_iterations, + "measured_iterations": measured_iterations, + "latency_mean_ms": mean_ms, + "latency_p50_ms": p50_ms, + "latency_p95_ms": p95_ms, + "throughput_mean_images_per_second": batch_size * 1_000.0 / mean_ms, + "throughput_at_p50_images_per_second": batch_size * 1_000.0 / p50_ms, + "peak_cuda_memory_mb": peak_memory_mb, + "current_cuda_memory_mb": current_memory_mb, + } diff --git a/gmnet/code/journal_exp/gmnet/data/__init__.py b/gmnet/code/journal_exp/gmnet/data/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2cbd3537201c25f3165afd27c31f528b71fad508 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/data/__init__.py @@ -0,0 +1,6 @@ +"""Dataset construction for GmNet experiments.""" + +from .build import DataBundle, build_dataloaders +from .manifest import imagefolder_split_fingerprint + +__all__ = ["DataBundle", "build_dataloaders", "imagefolder_split_fingerprint"] diff --git a/gmnet/code/journal_exp/gmnet/data/build.py b/gmnet/code/journal_exp/gmnet/data/build.py new file mode 100644 index 0000000000000000000000000000000000000000..9d3f3c81c2016d7d65ed2d408ad3e9bb4d3df517 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/data/build.py @@ -0,0 +1,352 @@ +"""Build data loaders and an auditable, root-independent data manifest.""" + +from __future__ import annotations + +import hashlib +import json +import random +from dataclasses import dataclass +from pathlib import Path +from typing import Any + +import numpy as np +import torch +import torch.distributed as dist +from timm.data import create_transform +from torch.utils.data import DataLoader, DistributedSampler, RandomSampler, SequentialSampler +from torchvision import datasets, transforms +from torchvision.transforms import InterpolationMode + +from .manifest import imagefolder_split_fingerprint + + +@dataclass +class DataBundle: + train_loader: DataLoader + val_loader: DataLoader + train_sampler: DistributedSampler | None + num_classes: int + class_to_idx: dict[str, int] + manifest: dict[str, Any] + generator: torch.Generator + + +def _stable_sha256(value: Any) -> str: + encoded = json.dumps( + value, sort_keys=True, separators=(",", ":"), ensure_ascii=True + ).encode("utf-8") + return hashlib.sha256(encoded).hexdigest() + + +def _cifar_content_sha256(dataset: datasets.CIFAR10 | datasets.CIFAR100) -> str: + digest = hashlib.sha256() + digest.update(memoryview(np.ascontiguousarray(dataset.data))) + targets = np.asarray(dataset.targets, dtype=np.int64) + digest.update(memoryview(targets)) + return digest.hexdigest() + + +def _validate_expected_samples( + config: dict[str, Any], *, train_samples: int, val_samples: int +) -> None: + expected = config.get("expected_samples", {}) + if expected is None: + expected = {} + if not isinstance(expected, dict): + raise TypeError("data.expected_samples must be a mapping") + expected_train = config.get("expected_train_samples", expected.get("train")) + expected_val = config.get("expected_val_samples", expected.get("val")) + for split, actual, configured in ( + ("train", train_samples, expected_train), + ("val", val_samples, expected_val), + ): + if configured is not None and int(configured) != actual: + raise ValueError( + f"{split} dataset has {actual} samples but config expects {configured}" + ) + + +def _build_manifest( + *, + dataset_name: str, + train_split: str, + val_split: str, + train_dataset: object, + val_dataset: object, + train_root: Path | None, + val_root: Path | None, + class_to_idx: dict[str, int], +) -> dict[str, Any]: + if isinstance(train_dataset, datasets.ImageFolder): + assert train_root is not None and val_root is not None + train_fingerprint = imagefolder_split_fingerprint(train_dataset, train_root) + val_fingerprint = imagefolder_split_fingerprint(val_dataset, val_root) + train_sha256 = train_fingerprint["sample_index_sha256"] + val_sha256 = val_fingerprint["sample_index_sha256"] + fingerprint_kind = "relative_path_and_target_plus_sampled_raw_file_bytes" + elif isinstance(train_dataset, (datasets.CIFAR10, datasets.CIFAR100)): + train_sha256 = _cifar_content_sha256(train_dataset) + val_sha256 = _cifar_content_sha256(val_dataset) + fingerprint_kind = "image_bytes_and_target" + train_fingerprint = None + val_fingerprint = None + else: # pragma: no cover - guarded by the supported dataset branches + raise TypeError(f"unsupported dataset type: {type(train_dataset).__name__}") + + payload: dict[str, Any] = { + "schema_version": 2, + "dataset": dataset_name, + "splits": {"train": train_split, "val": val_split}, + "samples": {"train": len(train_dataset), "val": len(val_dataset)}, + "num_classes": len(class_to_idx), + "class_to_idx_sha256": _stable_sha256(class_to_idx), + "sample_fingerprint_kind": fingerprint_kind, + "sample_index_sha256": {"train": train_sha256, "val": val_sha256}, + } + if train_fingerprint is not None and val_fingerprint is not None: + payload.update( + { + "sampled_content_policy": train_fingerprint[ + "sampled_content_policy" + ], + "sampled_content_samples": { + "train": train_fingerprint["sampled_content_samples"], + "val": val_fingerprint["sampled_content_samples"], + }, + "sampled_content_sha256": { + "train": train_fingerprint["sampled_content_sha256"], + "val": val_fingerprint["sampled_content_sha256"], + }, + } + ) + payload["manifest_sha256"] = _stable_sha256(payload) + return payload + + +def _interpolation(name: str) -> InterpolationMode: + normalized = name.lower() + choices = { + "bicubic": InterpolationMode.BICUBIC, + "bilinear": InterpolationMode.BILINEAR, + "nearest": InterpolationMode.NEAREST, + } + if normalized not in choices: + raise ValueError(f"unsupported interpolation: {name}") + return choices[normalized] + + +def _imagenet_transforms(config: dict[str, Any]) -> tuple[object, object]: + input_size = int(config.get("input_size", 224)) + mean = tuple(config.get("mean", (0.485, 0.456, 0.406))) + std = tuple(config.get("std", (0.229, 0.224, 0.225))) + interpolation = str(config.get("interpolation", "bicubic")) + train_interpolation = str(config.get("train_interpolation", interpolation)) + color_jitter = float(config.get("color_jitter", 0.0)) + auto_augment = config.get("auto_augment", "rand-m1-mstd0.5-inc1") + train_transform = create_transform( + input_size=input_size, + is_training=True, + color_jitter=color_jitter if color_jitter > 0 else None, + auto_augment=auto_augment or None, + interpolation=train_interpolation, + mean=mean, + std=std, + re_prob=float(config.get("random_erasing", 0.0)), + re_mode=str(config.get("random_erasing_mode", "pixel")), + re_count=int(config.get("random_erasing_count", 1)), + hflip=float(config.get("hflip", 0.5)), + vflip=float(config.get("vflip", 0.0)), + ) + crop_pct = float(config.get("crop_pct", 0.875)) + resize_size = int(input_size / crop_pct) + val_transform = transforms.Compose( + [ + transforms.Resize(resize_size, interpolation=_interpolation(interpolation)), + transforms.CenterCrop(input_size), + transforms.ToTensor(), + transforms.Normalize(mean, std), + ] + ) + return train_transform, val_transform + + +def _cifar_transforms(config: dict[str, Any]) -> tuple[object, object]: + input_size = int(config.get("input_size", 32)) + mean = tuple(config.get("mean", (0.4914, 0.4822, 0.4465))) + std = tuple(config.get("std", (0.2470, 0.2435, 0.2616))) + train_ops: list[object] = [] + if input_size == 32: + train_ops.extend([transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip()]) + else: + train_ops.extend( + [ + transforms.RandomResizedCrop(input_size), + transforms.RandomHorizontalFlip(), + ] + ) + train_ops.extend([transforms.ToTensor(), transforms.Normalize(mean, std)]) + val_ops: list[object] = [] + if input_size != 32: + val_ops.append(transforms.Resize((input_size, input_size))) + val_ops.extend([transforms.ToTensor(), transforms.Normalize(mean, std)]) + return transforms.Compose(train_ops), transforms.Compose(val_ops) + + +def _seed_worker(worker_id: int) -> None: + del worker_id + worker_seed = torch.initial_seed() % (2**32) + np.random.seed(worker_seed) + random.seed(worker_seed) + + +def _imagefolder_root(root: Path, split: str) -> Path: + candidate = root / split + if not candidate.is_dir(): + raise FileNotFoundError(f"missing ImageFolder split: {candidate}") + return candidate + + +def build_dataloaders( + config: dict[str, Any], + *, + data_root: str | Path, + distributed: bool, + rank: int, + world_size: int, + seed: int, +) -> DataBundle: + data_root = Path(data_root).expanduser() + dataset_name = str(config.get("dataset", "imagenet")).lower() + + if dataset_name in {"imagenet", "imagefolder"}: + train_transform, val_transform = _imagenet_transforms(config) + train_split = str(config.get("train_split", "train")) + val_split = str(config.get("val_split", "val")) + train_root = _imagefolder_root(data_root, train_split) + val_root = _imagefolder_root(data_root, val_split) + train_dataset = datasets.ImageFolder( + train_root, + transform=train_transform, + ) + val_dataset = datasets.ImageFolder( + val_root, + transform=val_transform, + ) + if train_dataset.class_to_idx != val_dataset.class_to_idx: + raise ValueError("train and validation class mappings differ") + class_to_idx = train_dataset.class_to_idx + num_classes = len(class_to_idx) + elif dataset_name in {"cifar10", "cifar-10", "cifar100", "cifar-100"}: + train_split = "train" + val_split = "test" + train_root = None + val_root = None + train_transform, val_transform = _cifar_transforms(config) + dataset_class = ( + datasets.CIFAR100 + if dataset_name in {"cifar100", "cifar-100"} + else datasets.CIFAR10 + ) + train_dataset = dataset_class( + data_root, train=True, transform=train_transform, download=False + ) + val_dataset = dataset_class( + data_root, train=False, transform=val_transform, download=False + ) + class_to_idx = {name: index for index, name in enumerate(train_dataset.classes)} + num_classes = len(class_to_idx) + else: + raise ValueError(f"unsupported dataset: {dataset_name}") + + expected_classes = config.get("num_classes") + if expected_classes is not None and int(expected_classes) != num_classes: + raise ValueError( + f"dataset has {num_classes} classes but config expects {expected_classes}" + ) + _validate_expected_samples( + config, train_samples=len(train_dataset), val_samples=len(val_dataset) + ) + manifest: dict[str, Any] | None = None + if not distributed or rank == 0: + manifest = _build_manifest( + dataset_name=dataset_name, + train_split=train_split, + val_split=val_split, + train_dataset=train_dataset, + val_dataset=val_dataset, + train_root=train_root, + val_root=val_root, + class_to_idx=class_to_idx, + ) + if distributed: + manifest_objects = [manifest] + dist.broadcast_object_list(manifest_objects, src=0) + manifest = manifest_objects[0] + if not isinstance(manifest, dict): # pragma: no cover - collective contract + raise RuntimeError("rank 0 did not broadcast a valid data manifest") + expected_manifest = config.get("expected_manifest_sha256") + if ( + expected_manifest is not None + and str(expected_manifest) != manifest["manifest_sha256"] + ): + raise ValueError( + "dataset manifest mismatch: " + f"computed {manifest['manifest_sha256']} but config expects {expected_manifest}" + ) + + if distributed: + train_sampler: DistributedSampler | None = DistributedSampler( + train_dataset, + num_replicas=world_size, + rank=rank, + shuffle=True, + seed=seed, + drop_last=True, + ) + val_sampler = DistributedSampler( + val_dataset, + num_replicas=world_size, + rank=rank, + shuffle=False, + drop_last=False, + ) + else: + train_sampler = None + val_sampler = SequentialSampler(val_dataset) + + generator = torch.Generator() + generator.manual_seed(seed + rank) + workers = int(config.get("workers", 8)) + common = { + "num_workers": workers, + "pin_memory": bool(config.get("pin_memory", True)), + "worker_init_fn": _seed_worker, + "generator": generator, + "persistent_workers": bool(config.get("persistent_workers", True)) and workers > 0, + } + if workers > 0: + common["prefetch_factor"] = int(config.get("prefetch_factor", 2)) + + train_loader = DataLoader( + train_dataset, + batch_size=int(config.get("batch_size", 256)), + sampler=train_sampler if train_sampler is not None else RandomSampler(train_dataset, generator=generator), + drop_last=True, + **common, + ) + val_loader = DataLoader( + val_dataset, + batch_size=int(config.get("eval_batch_size", config.get("batch_size", 256))), + sampler=val_sampler, + drop_last=False, + **common, + ) + return DataBundle( + train_loader, + val_loader, + train_sampler, + num_classes, + class_to_idx, + manifest, + generator, + ) diff --git a/gmnet/code/journal_exp/gmnet/data/manifest.py b/gmnet/code/journal_exp/gmnet/data/manifest.py new file mode 100644 index 0000000000000000000000000000000000000000..9205e57a57af7bcc9329e89bdcaa4310af3cbe13 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/data/manifest.py @@ -0,0 +1,71 @@ +"""Root-independent dataset fingerprints shared by training and evaluation.""" + +from __future__ import annotations + +import hashlib +from pathlib import Path +from typing import Any + +from torchvision import datasets + + +SAMPLED_CONTENT_LIMIT = 1_000 +SAMPLED_CONTENT_POLICY = "first_sample_per_class_up_to_1000" + + +def _relative_path(path: str, root: Path) -> str: + return Path(path).relative_to(root).as_posix() + + +def _update_file_digest(digest: Any, path: Path) -> None: + with path.open("rb") as handle: + for chunk in iter(lambda: handle.read(1024 * 1024), b""): + digest.update(chunk) + + +def imagefolder_split_fingerprint( + dataset: datasets.ImageFolder, + root: str | Path, +) -> dict[str, Any]: + """Hash the full index and raw bytes of one deterministic sample per class.""" + + root = Path(root) + index_digest = hashlib.sha256() + relative_paths: list[str] = [] + sampled_indices: list[int] = [] + seen_targets: set[int] = set() + for index, (path, target) in enumerate(dataset.samples): + relative = _relative_path(path, root) + relative_paths.append(relative) + index_digest.update(relative.encode("utf-8")) + index_digest.update(b"\0") + index_digest.update(str(int(target)).encode("ascii")) + index_digest.update(b"\n") + target = int(target) + if target not in seen_targets and len(sampled_indices) < SAMPLED_CONTENT_LIMIT: + seen_targets.add(target) + sampled_indices.append(index) + + content_digest = hashlib.sha256() + content_digest.update(b"gmnet-imagefolder-sampled-content-v1\n") + for index in sampled_indices: + path, target = dataset.samples[index] + relative = relative_paths[index] + file_path = Path(path) + content_digest.update(relative.encode("utf-8")) + content_digest.update(b"\0") + content_digest.update(str(int(target)).encode("ascii")) + content_digest.update(b"\0") + content_digest.update(str(file_path.stat().st_size).encode("ascii")) + content_digest.update(b"\0") + _update_file_digest(content_digest, file_path) + content_digest.update(b"\n") + + return { + "sample_index_sha256": index_digest.hexdigest(), + "sampled_content_sha256": content_digest.hexdigest(), + "sampled_content_samples": len(sampled_indices), + "sampled_content_policy": SAMPLED_CONTENT_POLICY, + "first_relative_path": relative_paths[0] if relative_paths else None, + "last_relative_path": relative_paths[-1] if relative_paths else None, + } diff --git a/gmnet/code/journal_exp/gmnet/data/validate.py b/gmnet/code/journal_exp/gmnet/data/validate.py new file mode 100644 index 0000000000000000000000000000000000000000..d706900b5ac737fe2964e12a014c2d50f2221399 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/data/validate.py @@ -0,0 +1,212 @@ +"""Dataset integrity checks used by the local staging scripts.""" + +from __future__ import annotations + +import argparse +import hashlib +import json +import pickle +import sys +from pathlib import Path +from typing import Any, Iterable + + +IMAGE_SUFFIXES = {".jpeg", ".jpg", ".png", ".webp"} +CIFAR_TRAIN_BATCHES = tuple(f"data_batch_{index}" for index in range(1, 6)) + + +def sha256_file(path: Path, chunk_size: int = 8 * 1024 * 1024) -> str: + digest = hashlib.sha256() + with path.open("rb") as handle: + for chunk in iter(lambda: handle.read(chunk_size), b""): + digest.update(chunk) + return digest.hexdigest() + + +def _load_pickle(path: Path) -> dict[Any, Any]: + with path.open("rb") as handle: + value = pickle.load(handle, encoding="bytes") # noqa: S301 - trusted archive + if not isinstance(value, dict): + raise ValueError(f"{path} does not contain a dictionary") + return value + + +def _dict_value(value: dict[Any, Any], key: str) -> Any: + if key in value: + return value[key] + byte_key = key.encode("ascii") + if byte_key in value: + return value[byte_key] + raise ValueError(f"missing key {key!r}") + + +def _shape(value: Any) -> tuple[int, ...]: + shape = getattr(value, "shape", None) + if shape is None: + raise ValueError("CIFAR data payload has no shape") + return tuple(int(dimension) for dimension in shape) + + +def validate_cifar10(root: Path, archive: Path | None, expected_sha256: str | None) -> dict[str, Any]: + root = root.resolve() + batch_root = root / "cifar-10-batches-py" + if not batch_root.is_dir(): + raise ValueError(f"missing CIFAR-10 directory: {batch_root}") + + train_examples = 0 + for filename in CIFAR_TRAIN_BATCHES: + payload = _load_pickle(batch_root / filename) + data = _dict_value(payload, "data") + labels = _dict_value(payload, "labels") + if _shape(data) != (10_000, 3_072) or len(labels) != 10_000: + raise ValueError(f"unexpected data shape or labels in {filename}") + train_examples += len(labels) + + test_payload = _load_pickle(batch_root / "test_batch") + test_data = _dict_value(test_payload, "data") + test_labels = _dict_value(test_payload, "labels") + if _shape(test_data) != (10_000, 3_072) or len(test_labels) != 10_000: + raise ValueError("unexpected data shape or labels in test_batch") + + meta = _load_pickle(batch_root / "batches.meta") + label_names = _dict_value(meta, "label_names") + if len(label_names) != 10: + raise ValueError(f"expected 10 CIFAR-10 labels, found {len(label_names)}") + + result: dict[str, Any] = { + "dataset": "cifar-10", + "root": str(root), + "train_images": train_examples, + "test_images": len(test_labels), + "classes": len(label_names), + } + if archive is not None: + archive = archive.resolve() + if not archive.is_file(): + raise ValueError(f"missing archive: {archive}") + digest = sha256_file(archive) + result["archive"] = str(archive) + result["sha256"] = digest + if expected_sha256 is not None and digest.lower() != expected_sha256.lower(): + raise ValueError( + f"SHA256 mismatch for {archive}: expected {expected_sha256}, got {digest}" + ) + return result + + +def _class_directories(split_root: Path) -> list[Path]: + if not split_root.is_dir(): + raise ValueError(f"missing ImageNet split: {split_root}") + return sorted(path for path in split_root.iterdir() if path.is_dir()) + + +def _image_paths(class_directories: Iterable[Path]) -> Iterable[Path]: + for class_directory in class_directories: + for path in class_directory.rglob("*"): + if path.is_file() and path.suffix.lower() in IMAGE_SUFFIXES: + yield path + + +def _verify_image(path: Path) -> None: + try: + from PIL import Image + except ImportError as error: # pragma: no cover - torchvision normally supplies Pillow + raise ValueError("Pillow is required for --decode-samples") from error + with Image.open(path) as image: + image.verify() + + +def validate_imagenet( + root: Path, + expected_classes: int, + expected_train_images: int, + expected_val_images: int, + decode_samples: bool, +) -> dict[str, Any]: + root = root.resolve() + train_classes = _class_directories(root / "train") + val_classes = _class_directories(root / "val") + if len(train_classes) != expected_classes: + raise ValueError( + f"expected {expected_classes} train classes, found {len(train_classes)}" + ) + if len(val_classes) != expected_classes: + raise ValueError(f"expected {expected_classes} val classes, found {len(val_classes)}") + + train_names = [path.name for path in train_classes] + val_names = [path.name for path in val_classes] + if train_names != val_names: + missing_train = sorted(set(val_names) - set(train_names))[:10] + missing_val = sorted(set(train_names) - set(val_names))[:10] + raise ValueError( + "train/val class sets differ; " + f"missing from train={missing_train}, missing from val={missing_val}" + ) + + train_images = list(_image_paths(train_classes)) + val_images = list(_image_paths(val_classes)) + if len(train_images) != expected_train_images: + raise ValueError( + f"expected {expected_train_images} train images, found {len(train_images)}" + ) + if len(val_images) != expected_val_images: + raise ValueError(f"expected {expected_val_images} val images, found {len(val_images)}") + + if decode_samples: + if not train_images or not val_images: + raise ValueError("cannot decode samples from an empty split") + _verify_image(train_images[0]) + _verify_image(val_images[0]) + + return { + "dataset": "imagenet-1k", + "root": str(root), + "classes": len(train_classes), + "train_images": len(train_images), + "val_images": len(val_images), + "first_class": train_names[0], + "last_class": train_names[-1], + "decoded_samples": decode_samples, + } + + +def parse_args(argv: list[str] | None = None) -> argparse.Namespace: + parser = argparse.ArgumentParser(description=__doc__) + subparsers = parser.add_subparsers(dest="dataset", required=True) + + cifar = subparsers.add_parser("cifar10", help="validate an extracted CIFAR-10 archive") + cifar.add_argument("--root", type=Path, required=True) + cifar.add_argument("--archive", type=Path) + cifar.add_argument("--expected-sha256") + + imagenet = subparsers.add_parser("imagenet", help="validate an ImageFolder-style ImageNet tree") + imagenet.add_argument("--root", type=Path, required=True) + imagenet.add_argument("--expected-classes", type=int, default=1_000) + imagenet.add_argument("--expected-train-images", type=int, default=1_281_167) + imagenet.add_argument("--expected-val-images", type=int, default=50_000) + imagenet.add_argument("--decode-samples", action="store_true") + return parser.parse_args(argv) + + +def main(argv: list[str] | None = None) -> int: + args = parse_args(argv) + try: + if args.dataset == "cifar10": + result = validate_cifar10(args.root, args.archive, args.expected_sha256) + else: + result = validate_imagenet( + args.root, + args.expected_classes, + args.expected_train_images, + args.expected_val_images, + args.decode_samples, + ) + except (OSError, pickle.UnpicklingError, ValueError) as error: + print(f"dataset validation failed: {error}", file=sys.stderr) + return 1 + print(json.dumps(result, indent=2, sort_keys=True)) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/gmnet/code/journal_exp/gmnet/engine/__init__.py b/gmnet/code/journal_exp/gmnet/engine/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..eadbe5db24dfd9cc46542525d256bd33a0736484 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/engine/__init__.py @@ -0,0 +1,11 @@ +"""Training engine helpers.""" + +from .checkpoint import load_checkpoint, save_checkpoint, state_dict_schema_sha256 +from .metrics import evaluate + +__all__ = [ + "evaluate", + "load_checkpoint", + "save_checkpoint", + "state_dict_schema_sha256", +] diff --git a/gmnet/code/journal_exp/gmnet/engine/checkpoint.py b/gmnet/code/journal_exp/gmnet/engine/checkpoint.py new file mode 100644 index 0000000000000000000000000000000000000000..ab124b0a5dad14726a701c2078bc00cf535c756a --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/engine/checkpoint.py @@ -0,0 +1,52 @@ +"""Atomic checkpoint persistence.""" + +from __future__ import annotations + +import hashlib +import json +import os +from collections.abc import Mapping +from pathlib import Path +from typing import Any + +import torch + + +def state_dict_schema_sha256(state_dict: Mapping[str, Any]) -> str: + """Hash state names, tensor shapes, and dtypes without hashing weights.""" + + schema = [] + for name, value in state_dict.items(): + if not isinstance(name, str) or not isinstance(value, torch.Tensor): + raise TypeError("model state_dict schema only supports named tensors") + schema.append( + { + "name": name, + "shape": list(value.shape), + "dtype": str(value.dtype), + "layout": str(value.layout), + } + ) + encoded = json.dumps( + schema, + sort_keys=True, + separators=(",", ":"), + ensure_ascii=True, + allow_nan=False, + ).encode("utf-8") + return hashlib.sha256(encoded).hexdigest() + + +def save_checkpoint(state: dict[str, Any], path: str | Path) -> None: + destination = Path(path) + destination.parent.mkdir(parents=True, exist_ok=True) + temporary = destination.with_name(f".{destination.name}.{os.getpid()}.tmp") + torch.save(state, temporary) + os.replace(temporary, destination) + + +def load_checkpoint(path: str | Path, map_location: str | torch.device = "cpu") -> dict[str, Any]: + checkpoint = torch.load(Path(path), map_location=map_location, weights_only=False) + if not isinstance(checkpoint, dict) or "model" not in checkpoint: + raise ValueError(f"invalid checkpoint: {path}") + return checkpoint diff --git a/gmnet/code/journal_exp/gmnet/engine/metrics.py b/gmnet/code/journal_exp/gmnet/engine/metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..5a6509922390fee0517fb0bad3b9cf4462890ab0 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/engine/metrics.py @@ -0,0 +1,58 @@ +"""Distributed validation metrics.""" + +from __future__ import annotations + +from contextlib import nullcontext +from typing import Callable + +import torch +import torch.distributed as dist +from torch import nn +from torch.utils.data import DataLoader + + +def _reduce_totals(totals: torch.Tensor) -> torch.Tensor: + if dist.is_available() and dist.is_initialized(): + dist.all_reduce(totals, op=dist.ReduceOp.SUM) + return totals + + +@torch.inference_mode() +def evaluate( + model: nn.Module, + loader: DataLoader, + device: torch.device, + *, + autocast_factory: Callable[[], object] | None = None, + max_steps: int | None = None, +) -> dict[str, float]: + model.eval() + criterion = nn.CrossEntropyLoss(reduction="sum") + totals = torch.zeros(4, dtype=torch.float64, device=device) + context_factory = autocast_factory or nullcontext + + for step, (images, targets) in enumerate(loader): + if max_steps is not None and step >= max_steps: + break + images = images.to(device, non_blocking=True) + targets = targets.to(device, non_blocking=True) + with context_factory(): + logits = model(images) + loss = criterion(logits.float(), targets) + + top_k = min(5, logits.shape[1]) + predictions = logits.topk(top_k, dim=1).indices + correct = predictions.eq(targets.view(-1, 1)) + totals[0] += loss + totals[1] += correct[:, :1].sum() + totals[2] += correct.any(dim=1).sum() + totals[3] += targets.numel() + + totals = _reduce_totals(totals) + count = max(float(totals[3].item()), 1.0) + return { + "loss": float(totals[0].item()) / count, + "top1": 100.0 * float(totals[1].item()) / count, + "top5": 100.0 * float(totals[2].item()) / count, + "samples": float(totals[3].item()), + } diff --git a/gmnet/code/journal_exp/gmnet/evaluation/__init__.py b/gmnet/code/journal_exp/gmnet/evaluation/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..adbe2b106f86ce2f2e78d88df55d7e5cdeaf3ec3 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/evaluation/__init__.py @@ -0,0 +1,11 @@ +"""Evaluation utilities for journal experiments.""" + +from .corruptions import CORRUPTION_SPECS, apply_corruption +from .metrics import classification_metrics, paired_hierarchical_bootstrap + +__all__ = [ + "CORRUPTION_SPECS", + "apply_corruption", + "classification_metrics", + "paired_hierarchical_bootstrap", +] diff --git a/gmnet/code/journal_exp/gmnet/evaluation/corruptions.py b/gmnet/code/journal_exp/gmnet/evaluation/corruptions.py new file mode 100644 index 0000000000000000000000000000000000000000..74cd2a57e54703d8b45c4cd98c7f581853d9cb14 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/evaluation/corruptions.py @@ -0,0 +1,65 @@ +"""Fixed, deterministic CIFAR-100 corruption protocol for E3 screening.""" + +from __future__ import annotations + +from typing import Final + +import torch +from torch import Tensor +from torch.nn import functional as F +from torchvision.transforms import functional as TF + + +CORRUPTION_SPECS: Final[dict[str, dict[str, object]]] = { + "clean": {}, + "gaussian_noise": {"sigma": 0.1, "seed": 250322841}, + "gaussian_blur": {"kernel_size": 5, "sigma": 1.0}, + "contrast": {"factor": 0.5}, + "pixelate": {"downsample_size": 16, "mode": "nearest"}, + "shift_2px": {"shift_x": 2, "shift_y": 2, "fill": 0.0}, +} + + +def _index_seed(base_seed: int, index: int) -> int: + # Large odd multipliers give a stable per-index seed without depending on + # DataLoader worker count or evaluation batch size. + return (base_seed + 1_000_003 * int(index)) % (2**63 - 1) + + +def apply_corruption(image: Tensor, condition: str, sample_index: int) -> Tensor: + """Apply one protocol corruption to an unnormalized CHW image in [0, 1].""" + + if image.ndim != 3: + raise ValueError(f"expected CHW image, got shape {tuple(image.shape)}") + if condition not in CORRUPTION_SPECS: + raise ValueError(f"unknown corruption {condition!r}") + spec = CORRUPTION_SPECS[condition] + if condition == "clean": + return image + if condition == "gaussian_noise": + generator = torch.Generator(device="cpu").manual_seed( + _index_seed(int(spec["seed"]), sample_index) + ) + noise = torch.randn(image.shape, generator=generator, dtype=image.dtype) + return (image + float(spec["sigma"]) * noise).clamp(0.0, 1.0) + if condition == "gaussian_blur": + kernel_size = int(spec["kernel_size"]) + sigma = float(spec["sigma"]) + return TF.gaussian_blur(image, [kernel_size, kernel_size], [sigma, sigma]) + if condition == "contrast": + return TF.adjust_contrast(image, float(spec["factor"])).clamp(0.0, 1.0) + if condition == "pixelate": + size = int(spec["downsample_size"]) + low_resolution = F.interpolate(image[None], size=(size, size), mode="nearest") + return F.interpolate( + low_resolution, size=image.shape[-2:], mode="nearest" + )[0] + if condition == "shift_2px": + shift_x, shift_y = int(spec["shift_x"]), int(spec["shift_y"]) + shifted = torch.full_like(image, float(spec["fill"])) + height, width = image.shape[-2:] + shifted[:, shift_y:height, shift_x:width] = image[ + :, : height - shift_y, : width - shift_x + ] + return shifted + raise AssertionError(f"unhandled corruption: {condition}") diff --git a/gmnet/code/journal_exp/gmnet/evaluation/metrics.py b/gmnet/code/journal_exp/gmnet/evaluation/metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..215b8b481e93951030b2d8bc69107befbdd707d3 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/evaluation/metrics.py @@ -0,0 +1,153 @@ +"""Classification metrics and paired uncertainty for E3 evaluation.""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any + +import numpy as np + + +def expected_calibration_error( + confidence: np.ndarray, + correctness: np.ndarray, + *, + bins: int = 15, +) -> float: + """Equal-width ECE in percentage points.""" + + confidence = np.asarray(confidence, dtype=np.float64) + correctness = np.asarray(correctness, dtype=np.float64) + if confidence.shape != correctness.shape or confidence.ndim != 1: + raise ValueError("confidence and correctness must be aligned 1-D arrays") + if not len(confidence): + return float("nan") + edges = np.linspace(0.0, 1.0, bins + 1) + assignments = np.minimum(np.searchsorted(edges, confidence, side="right") - 1, bins - 1) + assignments = np.maximum(assignments, 0) + ece = 0.0 + for index in range(bins): + selected = assignments == index + if selected.any(): + ece += selected.mean() * abs( + correctness[selected].mean() - confidence[selected].mean() + ) + return 100.0 * float(ece) + + +def classification_metrics( + correctness: np.ndarray, + top5_correctness: np.ndarray, + nll: np.ndarray, + confidence: np.ndarray, + *, + ece_bins: int = 15, +) -> dict[str, float]: + arrays = [ + np.asarray(value) + for value in (correctness, top5_correctness, nll, confidence) + ] + if not arrays[0].ndim == 1 or any(value.shape != arrays[0].shape for value in arrays): + raise ValueError("per-sample metric arrays must be aligned and one-dimensional") + return { + "samples": int(len(arrays[0])), + "top1": 100.0 * float(arrays[0].mean()), + "top5": 100.0 * float(arrays[1].mean()), + "nll": float(arrays[2].mean()), + "ece": expected_calibration_error(arrays[3], arrays[0], bins=ece_bins), + } + + +def _bootstrap_statistic_from_samples( + candidate_sample: np.ndarray, + reference_sample: np.ndarray, + statistic: str, +) -> float: + if statistic == "clean_top1": + return 100.0 * float( + candidate_sample[:, 0].mean() - reference_sample[:, 0].mean() + ) + if statistic == "mean_corruption_top1": + return 100.0 * float( + candidate_sample[:, 1:].mean() - reference_sample[:, 1:].mean() + ) + if statistic == "retention": + candidate_retention = 100.0 * candidate_sample[:, 1:].mean() / max( + candidate_sample[:, 0].mean(), 1e-12 + ) + reference_retention = 100.0 * reference_sample[:, 1:].mean() / max( + reference_sample[:, 0].mean(), 1e-12 + ) + return float(candidate_retention - reference_retention) + if statistic.startswith("condition:"): + condition_index = int(statistic.split(":", 1)[1]) + return 100.0 * float( + candidate_sample[:, condition_index].mean() + - reference_sample[:, condition_index].mean() + ) + if statistic == "clean_raw_mean": + return float(candidate_sample[:, 0].mean() - reference_sample[:, 0].mean()) + if statistic == "mean_corruption_raw_mean": + return float(candidate_sample[:, 1:].mean() - reference_sample[:, 1:].mean()) + if statistic.startswith("condition_raw:"): + condition_index = int(statistic.split(":", 1)[1]) + return float( + candidate_sample[:, condition_index].mean() + - reference_sample[:, condition_index].mean() + ) + raise ValueError(f"unknown bootstrap statistic: {statistic}") + + +def paired_hierarchical_bootstrap( + candidate: np.ndarray, + reference: np.ndarray, + *, + statistics: Mapping[str, str], + samples: int = 2000, + confidence: float = 0.95, + seed: int = 250322841, +) -> list[dict[str, Any]]: + """Paired bootstrap over matched training seeds and test sample indices. + + Inputs have shape [training_seed, condition, sample]. Conditions and sample + indices remain paired between the candidate and ReLU6 reference. Both the + training seeds and test samples are resampled with replacement. + """ + + candidate = np.asarray(candidate, dtype=np.float64) + reference = np.asarray(reference, dtype=np.float64) + if candidate.shape != reference.shape or candidate.ndim != 3: + raise ValueError("candidate/reference must have equal [seed, condition, sample] shapes") + seed_count, _, sample_count = candidate.shape + rng = np.random.default_rng(seed) + draws: dict[str, np.ndarray] = { + name: np.empty(samples, dtype=np.float64) for name in statistics + } + for draw in range(samples): + seed_indices = rng.integers(0, seed_count, size=seed_count) + sample_indices = rng.integers(0, sample_count, size=sample_count) + candidate_sample = candidate[seed_indices][:, :, sample_indices] + reference_sample = reference[seed_indices][:, :, sample_indices] + for name, statistic in statistics.items(): + draws[name][draw] = _bootstrap_statistic_from_samples( + candidate_sample, reference_sample, statistic + ) + alpha = (1.0 - confidence) / 2.0 + result = [] + for name, statistic in statistics.items(): + observed = _bootstrap_statistic_from_samples( + candidate, reference, statistic + ) + low, high = np.quantile(draws[name], [alpha, 1.0 - alpha]) + result.append( + { + "metric": name, + "difference": observed, + "ci_low": float(low), + "ci_high": float(high), + "bootstrap_samples": samples, + "training_seeds": seed_count, + "test_samples": sample_count, + } + ) + return result diff --git a/gmnet/code/journal_exp/gmnet/models/__init__.py b/gmnet/code/journal_exp/gmnet/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f4b089355ea3148a7b76d480959b28768a9d2ee0 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/models/__init__.py @@ -0,0 +1,41 @@ +"""Model constructors exposed by the GmNet package.""" + +from .gmnet import ( + CHANNEL_DERANGEMENT_INTERVENTIONS, + GATE_INTERVENTION_SEED_STRIDE, + GMNET_CONFIGS, + SUPPORTED_GATE_INTERVENTIONS, + SUPPORTED_GATE_TYPES, + ActivationOnlyGate, + GmNet, + GmNetBlock, + GmNetConfig, + SmoothClippedSelfGate, + STOP_GRADIENT_INTERVENTIONS, + build_gate, + create_gmnet, + gmnet_s1, + gmnet_s2, + gmnet_s3, + gmnet_s4, +) + +__all__ = [ + "CHANNEL_DERANGEMENT_INTERVENTIONS", + "GATE_INTERVENTION_SEED_STRIDE", + "GMNET_CONFIGS", + "SUPPORTED_GATE_INTERVENTIONS", + "SUPPORTED_GATE_TYPES", + "ActivationOnlyGate", + "GmNet", + "GmNetBlock", + "GmNetConfig", + "SmoothClippedSelfGate", + "STOP_GRADIENT_INTERVENTIONS", + "build_gate", + "create_gmnet", + "gmnet_s1", + "gmnet_s2", + "gmnet_s3", + "gmnet_s4", +] diff --git a/gmnet/code/journal_exp/gmnet/models/gmnet.py b/gmnet/code/journal_exp/gmnet/models/gmnet.py new file mode 100644 index 0000000000000000000000000000000000000000..7119b15a731d2e0ed9673528842cc01a64e64d2a --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/models/gmnet.py @@ -0,0 +1,846 @@ +"""GmNet model definitions. + +This module keeps the published GmNet topology while avoiding the legacy timm +model registry. The default ``relu6_self`` gate implements the paper's +``ReLU6(x) * x`` operation. Alternative gates are intentionally parameterized +independently from the stem activation so activation/gating ablations do not +silently change the rest of the network. +""" + +from __future__ import annotations + +import hashlib +import math +import struct +from collections.abc import Sequence +from dataclasses import dataclass +from typing import Final + +import torch +from torch import Tensor, nn +from torch.nn import functional as F + +SUPPORTED_GATE_TYPES: Final[tuple[str, ...]] = ( + "relu6_self", + "relu6_only", + "relu_self", + "gelu_self", + "identity", + "no_gate", + "smooth_clipped_self", +) +SUPPORTED_GATE_INTERVENTIONS: Final[tuple[str, ...]] = ( + "baseline", + "stop_gradient", + "channel_derangement", + "batch_derangement", + "stop_gradient_channel_derangement", +) +CHANNEL_DERANGEMENT_INTERVENTIONS: Final[frozenset[str]] = frozenset( + {"channel_derangement", "stop_gradient_channel_derangement"} +) +STOP_GRADIENT_INTERVENTIONS: Final[frozenset[str]] = frozenset( + {"stop_gradient", "stop_gradient_channel_derangement"} +) +GATE_INTERVENTION_SEED_STRIDE: Final[int] = 10_007 +_MAX_GATE_INTERVENTION_SEED: Final[int] = (1 << 63) - 1 + + +@dataclass(frozen=True) +class GmNetConfig: + """Architecture settings reported in the GmNet paper.""" + + base_dim: int + depths: tuple[int, int, int, int] + mlp_ratios: tuple[int, int, int, int] + + @property + def embed_dims(self) -> tuple[int, int, int, int]: + return tuple(self.base_dim * (2**index) for index in range(4)) + + +GMNET_CONFIGS: Final[dict[str, GmNetConfig]] = { + "s1": GmNetConfig(40, (2, 2, 10, 2), (3, 3, 3, 2)), + # The appendix prints (3, 3, 3, 2) for S2, which constructs a 5.27M + # model. The released experiment source uses (4, 4, 3, 3), matching the + # reported 6.2M parameter count, so that reproducible setting is used here. + "s2": GmNetConfig(48, (2, 2, 8, 3), (4, 4, 3, 3)), + "s3": GmNetConfig(48, (3, 3, 8, 3), (4, 4, 4, 4)), + "s4": GmNetConfig(68, (3, 3, 11, 3), (4, 4, 4, 4)), +} + + +class ConvBN(nn.Sequential): + """Convolution followed by optional batch normalization. + + Biases are retained to match the released GmNet implementation and its + reported parameter counts, including for convolutions followed by BN. + """ + + def __init__( + self, + in_channels: int, + out_channels: int, + kernel_size: int = 1, + stride: int = 1, + padding: int = 0, + dilation: int = 1, + groups: int = 1, + with_bn: bool = True, + ) -> None: + super().__init__() + self.kernel_size = kernel_size + self.in_channels = in_channels + self.out_channels = out_channels + # Compatibility attributes used by the original CoreML conversion tool. + self.in_planes = in_channels + self.out_planes = out_channels + self.add_module( + "conv", + nn.Conv2d( + in_channels, + out_channels, + kernel_size, + stride, + padding, + dilation, + groups, + bias=True, + ), + ) + if with_bn: + self.add_module("bn", nn.BatchNorm2d(out_channels)) + + +class DropPath(nn.Module): + """Per-sample stochastic depth without a timm dependency.""" + + def __init__(self, drop_prob: float = 0.0) -> None: + super().__init__() + if not 0.0 <= drop_prob < 1.0: + raise ValueError(f"drop_prob must be in [0, 1), got {drop_prob}") + self.drop_prob = float(drop_prob) + + def forward(self, x: Tensor) -> Tensor: + if self.drop_prob == 0.0 or not self.training: + return x + keep_prob = 1.0 - self.drop_prob + mask_shape = (x.shape[0],) + (1,) * (x.ndim - 1) + mask = x.new_empty(mask_shape).bernoulli_(keep_prob) + return x * mask / keep_prob + + def extra_repr(self) -> str: + return f"drop_prob={self.drop_prob:g}" + + +class NoGate(nn.Module): + """Pass features through without activation or multiplication.""" + + def forward(self, x: Tensor) -> Tensor: + return x + + +def _normalize_gate_intervention(gate_intervention: str) -> str: + if not isinstance(gate_intervention, str): + raise TypeError("gate_intervention must be a string") + normalized = gate_intervention.lower().replace("-", "_") + if normalized not in SUPPORTED_GATE_INTERVENTIONS: + choices = ", ".join(SUPPORTED_GATE_INTERVENTIONS) + raise ValueError( + f"unknown gate_intervention {gate_intervention!r}; expected one of: " + f"{choices}" + ) + return normalized + + +def _validate_gate_intervention_seed(seed: int) -> int: + if isinstance(seed, bool) or not isinstance(seed, int): + raise TypeError("gate_intervention_seed must be an integer") + if not 0 <= seed <= _MAX_GATE_INTERVENTION_SEED: + raise ValueError( + "gate_intervention_seed must be in " + f"[0, {_MAX_GATE_INTERVENTION_SEED}], got {seed}" + ) + return seed + + +def _channel_derangement(channels: int, seed: int) -> Tensor: + if channels < 2: + raise ValueError( + "channel_derangement requires at least two expanded channels, " + f"got {channels}" + ) + generator = torch.Generator(device="cpu") + generator.manual_seed(seed) + cycle = torch.randperm(channels, generator=generator) + permutation = torch.empty_like(cycle) + permutation[cycle] = cycle.roll(-1) + return permutation + + +class _GateInterventionMixin: + """Select the tensor used by a multiplicative gate branch.""" + + gate_intervention: str + gate_intervention_seed: int + gate_permutation: Tensor | None + + def _configure_gate_intervention( + self, + channels: int, + gate_intervention: str, + gate_intervention_seed: int, + ) -> None: + intervention = _normalize_gate_intervention(gate_intervention) + seed = _validate_gate_intervention_seed(gate_intervention_seed) + permutation = ( + _channel_derangement(channels, seed) + if intervention in CHANNEL_DERANGEMENT_INTERVENTIONS + else None + ) + self.gate_intervention = intervention + self.gate_intervention_seed = seed + self._gate_channels = channels + self.register_buffer("gate_permutation", permutation, persistent=False) + + def gate_input(self, x: Tensor) -> Tensor: + """Return the input seen by the gate branch.""" + + value = x + if self.gate_intervention == "batch_derangement": + if x.ndim < 1 or x.shape[0] < 2: + raise ValueError( + "batch_derangement requires at least two samples per local " + f"batch, got shape {tuple(x.shape)}" + ) + shift = self.batch_derangement_shift(int(x.shape[0])) + value = x.roll(shifts=-shift, dims=0) + elif self.gate_intervention in CHANNEL_DERANGEMENT_INTERVENTIONS: + if x.ndim < 2 or x.shape[1] != self._gate_channels: + raise ValueError( + "channel derangement expected channel dimension " + f"{self._gate_channels}, got shape {tuple(x.shape)}" + ) + assert self.gate_permutation is not None + value = x.index_select(1, self.gate_permutation) + if self.gate_intervention in STOP_GRADIENT_INTERVENTIONS: + value = value.detach() + return value + + def batch_derangement_shift(self, batch_size: int) -> int: + """Return the seeded cyclic shift used for a local batch derangement.""" + + if isinstance(batch_size, bool) or not isinstance(batch_size, int): + raise TypeError("batch_size must be an integer") + if batch_size < 2: + raise ValueError("batch derangement requires batch_size >= 2") + return 1 + self.gate_intervention_seed % (batch_size - 1) + + +class SelfGate(_GateInterventionMixin, nn.Module): + """Apply ``activation(x) * x`` using a shared gate/feature tensor.""" + + def __init__( + self, + activation: nn.Module, + name: str, + *, + channels: int, + gate_intervention: str = "baseline", + gate_intervention_seed: int = 0, + ) -> None: + super().__init__() + self.activation = activation + self.name = name + self._configure_gate_intervention( + channels, gate_intervention, gate_intervention_seed + ) + + def forward(self, x: Tensor) -> Tensor: + return self.activation(self.gate_input(x)) * x + + def extra_repr(self) -> str: + return f"name={self.name}, gate_intervention={self.gate_intervention}" + + +class ActivationOnlyGate(nn.Module): + """Apply an activation without multiplicative self-gating.""" + + def __init__(self, activation: nn.Module, name: str) -> None: + super().__init__() + self.activation = activation + self.name = name + + def forward(self, x: Tensor) -> Tensor: + return self.activation(x) + + def extra_repr(self) -> str: + return f"name={self.name}" + + +class SmoothClippedSelfGate(_GateInterventionMixin, nn.Module): + r"""A static differentiable approximation to ReLU6 self-gating. + + For each expanded feature channel, the gate is + + .. math:: + + g(x; \tau) = \operatorname{softplus}(\beta x) / \beta + - \operatorname{softplus}(\beta(x-\tau)) / \beta, + + followed by ``x * g(x; tau)``. The positive threshold ``tau`` is either + trainable or held fixed, and is always fixed across samples and spatial + locations. This is therefore a static gate, not an input-conditioned + controller. + """ + + def __init__( + self, + channels: int, + init_clip: float = 6.0, + beta: float = 10.0, + per_channel: bool = True, + trainable: bool = True, + min_clip: float = 1e-4, + gate_intervention: str = "baseline", + gate_intervention_seed: int = 0, + ) -> None: + super().__init__() + if channels <= 0: + raise ValueError(f"channels must be positive, got {channels}") + if init_clip <= min_clip: + raise ValueError( + f"init_clip must be greater than min_clip ({min_clip}), got {init_clip}" + ) + if beta <= 0: + raise ValueError(f"beta must be positive, got {beta}") + + parameter_channels = channels if per_channel else 1 + raw_init = math.log(math.expm1(init_clip - min_clip)) + clip_shape = (1, parameter_channels, 1, 1) + if trainable: + self.raw_clip = nn.Parameter(torch.full(clip_shape, raw_init)) + self.register_buffer("fixed_clip", None) + else: + self.register_parameter("raw_clip", None) + self.register_buffer("fixed_clip", torch.full(clip_shape, init_clip)) + self.channels = channels + self.beta = float(beta) + self.per_channel = per_channel + self.trainable = trainable + self.min_clip = float(min_clip) + self._configure_gate_intervention( + channels, gate_intervention, gate_intervention_seed + ) + + @property + def clip_value(self) -> Tensor: + if self.raw_clip is None: + assert self.fixed_clip is not None + return self.fixed_clip + return F.softplus(self.raw_clip) + self.min_clip + + def gate_value(self, x: Tensor) -> Tensor: + if x.ndim != 4: + raise ValueError(f"expected a BCHW tensor, got shape {tuple(x.shape)}") + if x.shape[1] != self.channels: + raise ValueError(f"expected {self.channels} channels, got {x.shape[1]}") + clip = self.clip_value + lower = F.softplus(x, beta=self.beta) + upper = F.softplus(x - clip, beta=self.beta) + return lower - upper + + def forward(self, x: Tensor) -> Tensor: + return x * self.gate_value(self.gate_input(x)) + + def extra_repr(self) -> str: + return ( + f"channels={self.channels}, beta={self.beta:g}, " + f"per_channel={self.per_channel}, trainable={self.trainable}, " + f"gate_intervention={self.gate_intervention}" + ) + + +def build_gate( + gate_type: str, + channels: int, + *, + smooth_clip_init: float = 6.0, + smooth_clip_beta: float = 10.0, + smooth_clip_per_channel: bool = True, + smooth_clip_trainable: bool = True, + gate_intervention: str = "baseline", + gate_intervention_seed: int = 0, +) -> nn.Module: + """Construct a GmNet gate. + + ``identity`` means an identity activation inside the self-gate and thus + computes ``x * x``. ``no_gate`` is the distinct pass-through ablation. + """ + + normalized = gate_type.lower().replace("-", "_") + normalized = { + "relu6": "relu6_self", + "activation_only": "relu6_only", + "relu6_activation_only": "relu6_only", + "relu": "relu_self", + "gelu": "gelu_self", + "smooth_clipped_static": "smooth_clipped_self", + }.get(normalized, normalized) + intervention = _normalize_gate_intervention(gate_intervention) + if normalized == "relu6_self": + return SelfGate( + nn.ReLU6(inplace=False), + normalized, + channels=channels, + gate_intervention=intervention, + gate_intervention_seed=gate_intervention_seed, + ) + if normalized == "relu6_only": + if intervention != "baseline": + raise ValueError( + "gate_intervention requires a multiplicative self-gate; " + "relu6_only is activation-only" + ) + return ActivationOnlyGate(nn.ReLU6(inplace=False), normalized) + if normalized == "relu_self": + return SelfGate( + nn.ReLU(inplace=False), + normalized, + channels=channels, + gate_intervention=intervention, + gate_intervention_seed=gate_intervention_seed, + ) + if normalized == "gelu_self": + return SelfGate( + nn.GELU(), + normalized, + channels=channels, + gate_intervention=intervention, + gate_intervention_seed=gate_intervention_seed, + ) + if normalized == "identity": + return SelfGate( + nn.Identity(), + normalized, + channels=channels, + gate_intervention=intervention, + gate_intervention_seed=gate_intervention_seed, + ) + if normalized == "no_gate": + if intervention != "baseline": + raise ValueError( + "gate_intervention requires a multiplicative self-gate; " + "no_gate has no gate branch" + ) + return NoGate() + if normalized in {"smooth_clipped", "smooth_clipped_self"}: + return SmoothClippedSelfGate( + channels, + init_clip=smooth_clip_init, + beta=smooth_clip_beta, + per_channel=smooth_clip_per_channel, + trainable=smooth_clip_trainable, + gate_intervention=intervention, + gate_intervention_seed=gate_intervention_seed, + ) + choices = ", ".join(SUPPORTED_GATE_TYPES) + raise ValueError(f"unknown gate_type {gate_type!r}; expected one of: {choices}") + + +class GmNetBlock(nn.Module): + """The residual block used by all four published GmNet variants.""" + + def __init__( + self, + dim: int, + mlp_ratio: int = 3, + kernel_size: int = 7, + gate_type: str = "relu6_self", + f12_bn: bool = False, + projection_bn: bool = True, + second_dw_bn: bool = False, + drop_path: float = 0.0, + layer_scale: float = 1e-6, + smooth_clip_init: float = 6.0, + smooth_clip_beta: float = 10.0, + smooth_clip_per_channel: bool = True, + smooth_clip_trainable: bool = True, + gate_intervention: str = "baseline", + gate_intervention_seed: int = 0, + ) -> None: + super().__init__() + if dim <= 0 or mlp_ratio <= 0: + raise ValueError("dim and mlp_ratio must be positive") + if kernel_size <= 0 or kernel_size % 2 == 0: + raise ValueError("kernel_size must be a positive odd integer") + + hidden_dim = dim * mlp_ratio + padding = (kernel_size - 1) // 2 + self.dwconv = ConvBN( + dim, + dim, + kernel_size, + padding=padding, + groups=dim, + with_bn=True, + ) + self.f1 = ConvBN(dim, hidden_dim, 1, with_bn=f12_bn) + self.gate = build_gate( + gate_type, + hidden_dim, + smooth_clip_init=smooth_clip_init, + smooth_clip_beta=smooth_clip_beta, + smooth_clip_per_channel=smooth_clip_per_channel, + smooth_clip_trainable=smooth_clip_trainable, + gate_intervention=gate_intervention, + gate_intervention_seed=gate_intervention_seed, + ) + self.g = ConvBN(hidden_dim, dim, 1, with_bn=projection_bn) + self.dwconv2 = ConvBN( + dim, + dim, + kernel_size, + padding=padding, + groups=dim, + with_bn=second_dw_bn, + ) + if layer_scale > 0: + self.gamma = nn.Parameter(layer_scale * torch.ones(dim)) + else: + self.register_parameter("gamma", None) + self.drop_path = DropPath(drop_path) + self.gate_type = gate_type + self.gate_intervention = _normalize_gate_intervention(gate_intervention) + self.gate_intervention_seed = _validate_gate_intervention_seed( + gate_intervention_seed + ) + self.gate_channels = hidden_dim + + @property + def gate_permutation(self) -> Tensor | None: + value = getattr(self.gate, "gate_permutation", None) + return value if isinstance(value, Tensor) else None + + def forward(self, x: Tensor) -> Tensor: + residual = x + x = self.dwconv(x) + x = self.f1(x) + x = self.gate(x) + x = self.g(x) + x = self.dwconv2(x) + if self.gamma is not None: + x = x * self.gamma.view(1, -1, 1, 1) + return residual + self.drop_path(x) + + +def _stage_gate_types(gate_type: str | Sequence[str], stages: int) -> tuple[str, ...]: + if isinstance(gate_type, str): + return (gate_type,) * stages + values = tuple(gate_type) + if len(values) != stages: + raise ValueError(f"gate_type must contain {stages} values, got {len(values)}") + return values + + +def _block_gate_intervention_seed(base_seed: int, block_index: int) -> int: + seed = base_seed + block_index * GATE_INTERVENTION_SEED_STRIDE + if seed > _MAX_GATE_INTERVENTION_SEED: + raise ValueError( + "derived gate intervention seed exceeds the supported maximum: " + f"base={base_seed}, block_index={block_index}, derived={seed}" + ) + return seed + + +def _stem_activation(name: str) -> nn.Module: + normalized = name.lower().replace("-", "_") + if normalized == "relu6": + return nn.ReLU6(inplace=False) + if normalized == "relu": + return nn.ReLU(inplace=False) + if normalized == "gelu": + return nn.GELU() + if normalized in {"identity", "none"}: + return nn.Identity() + raise ValueError(f"unsupported stem_activation: {name!r}") + + +class GmNet(nn.Module): + """Hierarchical GmNet image classifier.""" + + def __init__( + self, + embed_dims: Sequence[int] = (48, 96, 192, 384), + depths: Sequence[int] = (3, 3, 8, 3), + mlp_ratios: Sequence[int] = (4, 4, 4, 4), + *, + num_classes: int = 1000, + in_channels: int = 3, + stem_dim: int = 32, + stem_activation: str = "relu6", + gate_type: str | Sequence[str] = "relu6_self", + kernel_size: int = 7, + drop_path_rate: float = 0.0, + layer_scale: float = 1e-6, + f12_bn: bool = False, + projection_bn: bool = True, + second_dw_bn: bool = False, + smooth_clip_init: float = 6.0, + smooth_clip_beta: float = 10.0, + smooth_clip_per_channel: bool = True, + smooth_clip_trainable: bool = True, + gate_intervention: str = "baseline", + gate_intervention_seed: int = 0, + ) -> None: + super().__init__() + embed_dims = tuple(int(value) for value in embed_dims) + depths = tuple(int(value) for value in depths) + mlp_ratios = tuple(int(value) for value in mlp_ratios) + stage_count = len(embed_dims) + if ( + stage_count == 0 + or len(depths) != stage_count + or len(mlp_ratios) != stage_count + ): + raise ValueError( + "embed_dims, depths, and mlp_ratios must have equal non-zero length" + ) + if any(value <= 0 for value in (*embed_dims, *depths, *mlp_ratios)): + raise ValueError("embed_dims, depths, and mlp_ratios must be positive") + if num_classes < 0: + raise ValueError("num_classes cannot be negative") + if not 0.0 <= drop_path_rate < 1.0: + raise ValueError("drop_path_rate must be in [0, 1)") + + self.num_classes = num_classes + self.num_features = embed_dims[-1] + self.embed_dims = embed_dims + self.depths = depths + self.mlp_ratios = mlp_ratios + self.gate_types = _stage_gate_types(gate_type, stage_count) + self.gate_intervention = _normalize_gate_intervention(gate_intervention) + self.gate_intervention_seed = _validate_gate_intervention_seed( + gate_intervention_seed + ) + if depths: + _block_gate_intervention_seed(self.gate_intervention_seed, sum(depths) - 1) + + self.stem = nn.Sequential( + ConvBN(in_channels, stem_dim, kernel_size=3, stride=2, padding=1), + _stem_activation(stem_activation), + ) + + drop_rates = torch.linspace(0, drop_path_rate, sum(depths)).tolist() + self.stages = nn.ModuleList() + block_index = 0 + current_dim = stem_dim + for stage_index, (dim, depth, ratio) in enumerate( + zip(embed_dims, depths, mlp_ratios, strict=True) + ): + downsample = nn.Sequential( + ConvBN(current_dim, dim, kernel_size=3, stride=2, padding=1), + nn.Identity(), + ) + blocks = [ + GmNetBlock( + dim, + mlp_ratio=ratio, + kernel_size=kernel_size, + gate_type=self.gate_types[stage_index], + f12_bn=f12_bn, + projection_bn=projection_bn, + second_dw_bn=second_dw_bn, + drop_path=drop_rates[block_index + offset], + layer_scale=layer_scale, + smooth_clip_init=smooth_clip_init, + smooth_clip_beta=smooth_clip_beta, + smooth_clip_per_channel=smooth_clip_per_channel, + smooth_clip_trainable=smooth_clip_trainable, + gate_intervention=self.gate_intervention, + gate_intervention_seed=_block_gate_intervention_seed( + self.gate_intervention_seed, block_index + offset + ), + ) + for offset in range(depth) + ] + self.stages.append(nn.Sequential(downsample, *blocks)) + block_index += depth + current_dim = dim + + self.norm = nn.BatchNorm2d(self.num_features) + self.avgpool = nn.AdaptiveAvgPool2d(1) + self.head = ( + nn.Linear(self.num_features, num_classes) + if num_classes > 0 + else nn.Identity() + ) + self.apply(self._init_weights) + + @staticmethod + def _init_weights(module: nn.Module) -> None: + # The released implementation leaves Conv2d at its PyTorch default + # initialization and applies truncated normal initialization to the head. + if isinstance(module, nn.Linear): + nn.init.trunc_normal_(module.weight, std=0.02) + if module.bias is not None: + nn.init.zeros_(module.bias) + elif isinstance(module, nn.BatchNorm2d): + nn.init.ones_(module.weight) + nn.init.zeros_(module.bias) + + def forward_features(self, x: Tensor) -> Tensor: + if x.ndim != 4: + raise ValueError(f"expected a BCHW tensor, got shape {tuple(x.shape)}") + x = self.stem(x) + for stage in self.stages: + x = stage(x) + return self.norm(x) + + def forward_head(self, x: Tensor) -> Tensor: + x = self.avgpool(x).flatten(1) + return self.head(x) + + def forward(self, x: Tensor) -> Tensor: + return self.forward_head(self.forward_features(x)) + + def reset_classifier(self, num_classes: int) -> None: + if num_classes < 0: + raise ValueError("num_classes cannot be negative") + self.num_classes = num_classes + self.head = ( + nn.Linear(self.num_features, num_classes) + if num_classes > 0 + else nn.Identity() + ) + if isinstance(self.head, nn.Linear): + self._init_weights(self.head) + + def gate_intervention_metadata(self) -> list[dict[str, object]]: + """Return canonical per-block metadata for checkpoint/eval audits. + + Permutation hashes use contiguous little-endian signed int64 values. + This representation is independent of the tensor's source dtype and + host byte order. + """ + + metadata: list[dict[str, object]] = [] + global_block_index = 0 + for stage_index, stage in enumerate(self.stages): + for stage_block_index, module in enumerate(stage[1:]): + if not isinstance(module, GmNetBlock): + continue + permutation = module.gate_permutation + if permutation is None: + permutation_sha256 = None + fixed_points = None + is_bijection = None + else: + values = [int(value) for value in permutation.detach().cpu()] + payload = struct.pack(f"<{len(values)}q", *values) + permutation_sha256 = hashlib.sha256(payload).hexdigest() + fixed_points = sum( + value == index for index, value in enumerate(values) + ) + is_bijection = sorted(values) == list(range(len(values))) + metadata.append( + { + "global_block_index": global_block_index, + "stage_index": stage_index, + "stage_block_index": stage_block_index, + "mode": module.gate_intervention, + "seed": module.gate_intervention_seed, + "channels": module.gate_channels, + "permutation_sha256": permutation_sha256, + "permutation_hash_encoding": ( + "little_endian_int64_c_order" + if permutation is not None + else None + ), + "fixed_points": fixed_points, + "is_bijection": is_bijection, + "stops_gate_gradient": ( + module.gate_intervention + in STOP_GRADIENT_INTERVENTIONS + ), + "channel_derangement": ( + module.gate_intervention + in CHANNEL_DERANGEMENT_INTERVENTIONS + ), + "batch_derangement": ( + module.gate_intervention == "batch_derangement" + ), + "batch_shift_rule": ( + "1 + seed % (local_batch_size - 1)" + if module.gate_intervention == "batch_derangement" + else None + ), + } + ) + global_block_index += 1 + return metadata + + +def create_gmnet( + variant: str, + *, + pretrained: bool = False, + **kwargs: object, +) -> GmNet: + """Create a paper GmNet variant without a framework-specific registry.""" + + normalized = variant.lower().replace("gmnet_", "").replace("-", "") + if normalized not in GMNET_CONFIGS: + choices = ", ".join(f"gmnet_{name}" for name in GMNET_CONFIGS) + raise ValueError(f"unknown variant {variant!r}; expected one of: {choices}") + if pretrained: + raise ValueError( + "pretrained=True is not supported because no versioned checkpoint " + "URL is bundled; instantiate the model and load a state_dict explicitly" + ) + config = GMNET_CONFIGS[normalized] + return GmNet( + embed_dims=config.embed_dims, + depths=config.depths, + mlp_ratios=config.mlp_ratios, + **kwargs, + ) + + +def gmnet_s1(*, pretrained: bool = False, **kwargs: object) -> GmNet: + return create_gmnet("s1", pretrained=pretrained, **kwargs) + + +def gmnet_s2(*, pretrained: bool = False, **kwargs: object) -> GmNet: + return create_gmnet("s2", pretrained=pretrained, **kwargs) + + +def gmnet_s3(*, pretrained: bool = False, **kwargs: object) -> GmNet: + return create_gmnet("s3", pretrained=pretrained, **kwargs) + + +def gmnet_s4(*, pretrained: bool = False, **kwargs: object) -> GmNet: + return create_gmnet("s4", pretrained=pretrained, **kwargs) + + +__all__ = [ + "CHANNEL_DERANGEMENT_INTERVENTIONS", + "GATE_INTERVENTION_SEED_STRIDE", + "GMNET_CONFIGS", + "SUPPORTED_GATE_INTERVENTIONS", + "SUPPORTED_GATE_TYPES", + "ActivationOnlyGate", + "ConvBN", + "DropPath", + "GmNet", + "GmNetBlock", + "GmNetConfig", + "SmoothClippedSelfGate", + "STOP_GRADIENT_INTERVENTIONS", + "build_gate", + "create_gmnet", + "gmnet_s1", + "gmnet_s2", + "gmnet_s3", + "gmnet_s4", +] diff --git a/gmnet/code/journal_exp/gmnet/robustness/__init__.py b/gmnet/code/journal_exp/gmnet/robustness/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2a96e3039db4c17b8c7287c4f8c4f72efea6f31f --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/robustness/__init__.py @@ -0,0 +1,14 @@ +"""Partial ImageNet robustness protocols for historical GmNet checkpoints.""" + +from .attacks import pgd_l2_frequency, pgd_linf +from .corruptions import IMAGENET_CORRUPTION_SPECS, apply_imagenet_corruption +from .data import ImageNetPixels, balanced_hashed_subset + +__all__ = [ + "IMAGENET_CORRUPTION_SPECS", + "ImageNetPixels", + "apply_imagenet_corruption", + "balanced_hashed_subset", + "pgd_l2_frequency", + "pgd_linf", +] diff --git a/gmnet/code/journal_exp/gmnet/robustness/attacks.py b/gmnet/code/journal_exp/gmnet/robustness/attacks.py new file mode 100644 index 0000000000000000000000000000000000000000..46386b4030868bf259058c897d1e2966fd4ce2b6 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/robustness/attacks.py @@ -0,0 +1,160 @@ +"""Pixel-space PGD and frequency-subspace L2 PGD attacks.""" + +from __future__ import annotations + +from collections.abc import Callable + +import torch +from torch import Tensor, nn +from torch.nn import functional as F + + +def _batch_l2(x: Tensor) -> Tensor: + return x.flatten(1).norm(p=2, dim=1) + + +def _project_l2(delta: Tensor, epsilon: float) -> Tensor: + norm = _batch_l2(delta).clamp_min(1e-12) + scale = torch.minimum(torch.ones_like(norm), torch.full_like(norm, epsilon) / norm) + return delta * scale[:, None, None, None] + + +def radial_frequency_mask( + height: int, + width: int, + band: tuple[float, float], + device: torch.device, +) -> Tensor: + """Radial full-FFT mask with radius normalized to the corner Nyquist radius.""" + + fy = torch.fft.fftshift(torch.fft.fftfreq(height, device=device)) + fx = torch.fft.fftshift(torch.fft.fftfreq(width, device=device)) + yy, xx = torch.meshgrid(fy, fx, indexing="ij") + radius = torch.sqrt(xx.square() + yy.square()) / (2.0**-0.5) + low, high = band + if low < 0 or high > 1.0 or low >= high: + raise ValueError(f"invalid normalized frequency band: {band}") + if high == 1.0: + selected = (radius >= low) & (radius <= high + 1e-7) + else: + selected = (radius >= low) & (radius < high) + return selected[None, None] + + +def project_frequency(delta: Tensor, mask: Tensor) -> Tensor: + spectrum = torch.fft.fftshift( + torch.fft.fft2(delta.float(), dim=(-2, -1), norm="ortho"), dim=(-2, -1) + ) + projected = torch.fft.ifft2( + torch.fft.ifftshift(spectrum * mask, dim=(-2, -1)), + dim=(-2, -1), + norm="ortho", + ).real + return projected.to(delta.dtype) + + +def project_band_box_l2( + delta: Tensor, + clean: Tensor, + mask: Tensor, + epsilon: float, + *, + iterations: int = 8, +) -> Tensor: + """Alternating projection onto band subspace, L2 ball, and pixel box.""" + + for _ in range(iterations): + delta = project_frequency(delta, mask) + delta = _project_l2(delta, epsilon) + delta = (clean + delta).clamp(0.0, 1.0) - clean + return delta + + +def perturbation_band_fraction(delta: Tensor, mask: Tensor) -> Tensor: + spectrum = torch.fft.fftshift( + torch.fft.fft2(delta.float(), dim=(-2, -1), norm="ortho"), dim=(-2, -1) + ) + power = spectrum.abs().square() + return (power * mask).flatten(1).sum(1) / power.flatten(1).sum(1).clamp_min(1e-20) + + +def pgd_linf( + model: nn.Module, + clean: Tensor, + targets: Tensor, + normalize: Callable[[Tensor], Tensor], + *, + epsilon: float, + step_size: float, + steps: int, + generator: torch.Generator, +) -> tuple[Tensor, dict[str, Tensor]]: + """Untargeted random-start PGD in the pixel-space L-infinity ball.""" + + delta = torch.empty(clean.shape, device=clean.device, dtype=clean.dtype).uniform_( + -epsilon, epsilon, generator=generator + ) + adversarial = (clean + delta).clamp(0.0, 1.0) + for _ in range(steps): + adversarial.requires_grad_(True) + loss = F.cross_entropy(model(normalize(adversarial)), targets) + gradient = torch.autograd.grad(loss, adversarial, only_inputs=True)[0] + with torch.no_grad(): + adversarial = adversarial + step_size * gradient.sign() + delta = (adversarial - clean).clamp(-epsilon, epsilon) + adversarial = (clean + delta).clamp(0.0, 1.0) + delta = adversarial.detach() - clean + return adversarial.detach(), { + "linf": delta.flatten(1).abs().max(1).values, + "l2": _batch_l2(delta), + } + + +def pgd_l2_frequency( + model: nn.Module, + clean: Tensor, + targets: Tensor, + normalize: Callable[[Tensor], Tensor], + *, + band: tuple[float, float], + epsilon: float, + step_size: float, + steps: int, + generator: torch.Generator, + projection_iterations: int = 8, +) -> tuple[Tensor, dict[str, Tensor]]: + """Untargeted PGD constrained to a radial Fourier band and an L2 ball.""" + + mask = radial_frequency_mask(clean.shape[-2], clean.shape[-1], band, clean.device) + delta = torch.randn( + clean.shape, device=clean.device, dtype=clean.dtype, generator=generator + ) + delta = project_frequency(delta, mask) + random_radius = torch.rand( + (clean.shape[0],), device=clean.device, generator=generator + ) + delta = _project_l2(delta, epsilon) + delta = delta * random_radius[:, None, None, None] + delta = project_band_box_l2( + delta, clean, mask, epsilon, iterations=projection_iterations + ) + adversarial = (clean + delta).clamp(0.0, 1.0) + for _ in range(steps): + adversarial.requires_grad_(True) + loss = F.cross_entropy(model(normalize(adversarial)), targets) + gradient = torch.autograd.grad(loss, adversarial, only_inputs=True)[0] + with torch.no_grad(): + gradient = project_frequency(gradient, mask) + gradient_norm = _batch_l2(gradient).clamp_min(1e-12) + delta = adversarial.detach() - clean + delta = delta + step_size * gradient / gradient_norm[:, None, None, None] + delta = project_band_box_l2( + delta, clean, mask, epsilon, iterations=projection_iterations + ) + adversarial = (clean + delta).clamp(0.0, 1.0) + delta = adversarial.detach() - clean + return adversarial.detach(), { + "linf": delta.flatten(1).abs().max(1).values, + "l2": _batch_l2(delta), + "band_fraction": perturbation_band_fraction(delta, mask), + } diff --git a/gmnet/code/journal_exp/gmnet/robustness/corruptions.py b/gmnet/code/journal_exp/gmnet/robustness/corruptions.py new file mode 100644 index 0000000000000000000000000000000000000000..6091a64709724c087b67898966c531d6ca2786ac --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/robustness/corruptions.py @@ -0,0 +1,65 @@ +"""Fixed pre-normalization ImageNet corruptions used by the partial E6 run.""" + +from __future__ import annotations + +from io import BytesIO +from typing import Final + +import torch +from PIL import Image +from torch import Tensor +from torchvision.transforms import functional as TF + + +IMAGENET_CORRUPTION_SPECS: Final[dict[str, dict[str, object]]] = { + "clean": {}, + "gaussian_noise": {"sigma": 0.1, "seed": 250322841}, + "gaussian_blur": {"kernel_size": 5, "sigma": 1.0}, + "jpeg": {"quality": 50, "subsampling": 0}, + "contrast": {"factor": 0.5}, + "shift_2px": {"shift_x": 2, "shift_y": 2, "fill": 0.0}, +} + + +def _sample_seed(base_seed: int, index: int) -> int: + return (base_seed + 1_000_003 * int(index)) % (2**63 - 1) + + +def apply_imagenet_corruption(image: Tensor, condition: str, sample_index: int) -> Tensor: + if image.ndim != 3: + raise ValueError(f"expected CHW image, got {tuple(image.shape)}") + if condition not in IMAGENET_CORRUPTION_SPECS: + raise ValueError(f"unknown corruption: {condition}") + spec = IMAGENET_CORRUPTION_SPECS[condition] + if condition == "clean": + return image + if condition == "gaussian_noise": + generator = torch.Generator(device="cpu").manual_seed( + _sample_seed(int(spec["seed"]), sample_index) + ) + noise = torch.randn(image.shape, generator=generator, dtype=image.dtype) + return (image + float(spec["sigma"]) * noise).clamp(0.0, 1.0) + if condition == "gaussian_blur": + kernel = int(spec["kernel_size"]) + sigma = float(spec["sigma"]) + return TF.gaussian_blur(image, [kernel, kernel], [sigma, sigma]) + if condition == "jpeg": + buffer = BytesIO() + TF.to_pil_image(image).save( + buffer, + format="JPEG", + quality=int(spec["quality"]), + subsampling=int(spec["subsampling"]), + ) + buffer.seek(0) + with Image.open(buffer) as decoded: + return TF.to_tensor(decoded.convert("RGB")) + if condition == "contrast": + return TF.adjust_contrast(image, float(spec["factor"])).clamp(0.0, 1.0) + if condition == "shift_2px": + shift_x, shift_y = int(spec["shift_x"]), int(spec["shift_y"]) + shifted = torch.full_like(image, float(spec["fill"])) + height, width = image.shape[-2:] + shifted[:, shift_y:, shift_x:] = image[:, : height - shift_y, : width - shift_x] + return shifted + raise AssertionError(f"unhandled corruption: {condition}") diff --git a/gmnet/code/journal_exp/gmnet/robustness/data.py b/gmnet/code/journal_exp/gmnet/robustness/data.py new file mode 100644 index 0000000000000000000000000000000000000000..a28745ed9878b8b1e3051b8fdf635165862c9e39 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/robustness/data.py @@ -0,0 +1,66 @@ +"""Deterministic ImageNet validation subsets in unnormalized pixel space.""" + +from __future__ import annotations + +import hashlib +from collections import defaultdict +from pathlib import Path + +from torch import Tensor +from torch.utils.data import Dataset +from torchvision import datasets, transforms +from torchvision.transforms import InterpolationMode + + +class ImageNetPixels(Dataset): + """ImageNet center-crop tensors in [0, 1], with stable base indices.""" + + def __init__(self, root: str | Path, *, input_size: int = 224, crop_pct: float = 0.875) -> None: + self.root = Path(root).expanduser().resolve() + resize_size = int(input_size / crop_pct) + transform = transforms.Compose( + [ + transforms.Resize(resize_size, interpolation=InterpolationMode.BICUBIC), + transforms.CenterCrop(input_size), + transforms.ToTensor(), + ] + ) + self.dataset = datasets.ImageFolder(self.root, transform=transform) + if len(self.dataset.classes) != 1_000: + raise ValueError(f"expected 1000 ImageNet classes, got {len(self.dataset.classes)}") + + def __len__(self) -> int: + return len(self.dataset) + + def __getitem__(self, index: int) -> tuple[Tensor, int, int, str]: + image, target = self.dataset[index] + path = Path(self.dataset.samples[index][0]).relative_to(self.root).as_posix() + return image, int(target), int(index), path + + @property + def samples(self) -> list[tuple[str, int]]: + return self.dataset.samples + + +def balanced_hashed_subset( + dataset: ImageNetPixels, + *, + per_class: int, + seed: int, +) -> list[int]: + """Select a path-hashed, class-balanced subset independent of directory order.""" + + grouped: dict[int, list[tuple[str, int]]] = defaultdict(list) + for index, (path, target) in enumerate(dataset.samples): + relative = Path(path).relative_to(dataset.root).as_posix() + digest = hashlib.sha256(f"{seed}:{relative}".encode()).hexdigest() + grouped[int(target)].append((digest, index)) + if set(grouped) != set(range(1_000)): + raise ValueError("ImageNet target indices are not the expected contiguous 0..999") + selected: list[int] = [] + for target in range(1_000): + candidates = sorted(grouped[target]) + if len(candidates) < per_class: + raise ValueError(f"class {target} has only {len(candidates)} images") + selected.extend(index for _, index in candidates[:per_class]) + return selected diff --git a/gmnet/code/journal_exp/gmnet/spectral/__init__.py b/gmnet/code/journal_exp/gmnet/spectral/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..78c365b79867fd746348d12b941dfd4aba83de3f --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/spectral/__init__.py @@ -0,0 +1,28 @@ +"""Reproducible spatial-frequency measurements for GmNet experiments.""" + +from .metrics import SpectrumMetrics, measure_spectrum +from .streaming import RadialPSDAccumulator, RadialPSDResult, torch_fft_lowpass +from .transforms import ( + HaarCoefficients, + dct_lowpass, + fft_lowpass, + hard_band_reconstruction, + haar_decompose2d, + haar_lowpass, + haar_reconstruct2d, +) + +__all__ = [ + "HaarCoefficients", + "RadialPSDAccumulator", + "RadialPSDResult", + "SpectrumMetrics", + "dct_lowpass", + "fft_lowpass", + "hard_band_reconstruction", + "haar_decompose2d", + "haar_lowpass", + "haar_reconstruct2d", + "measure_spectrum", + "torch_fft_lowpass", +] diff --git a/gmnet/code/journal_exp/gmnet/spectral/experiment.py b/gmnet/code/journal_exp/gmnet/spectral/experiment.py new file mode 100644 index 0000000000000000000000000000000000000000..1246943290c1444b3732e9513ad185e409aec82e --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/spectral/experiment.py @@ -0,0 +1,630 @@ +"""Execution and reporting for the E1 spectral measurement audit.""" + +from __future__ import annotations + +import csv +import json +import math +import platform +import sys +from collections import defaultdict +from datetime import UTC, datetime +from pathlib import Path +from typing import Any + +import numpy as np +import scipy +import torch +import yaml +from scipy.stats import spearmanr + +from gmnet.models.gmnet import GmNetBlock, build_gate + +from .inputs import make_controlled_input +from .metrics import center_spatial, measure_spectrum +from .transforms import ( + HaarCoefficients, + dct_coefficients, + dct_lowpass, + dct_reconstruct, + fft_coefficients, + fft_lowpass, + fft_reconstruct, + haar_decompose2d, + haar_lowpass, + haar_reconstruct2d, + hard_band_reconstruction, + relative_l2_error, +) + + +Row = dict[str, Any] +METHODS = ("fft", "dct", "haar") +SUBJECTS = ("gate_output", "block_output", "block_delta") + + +def _write_csv(path: Path, rows: list[Row]) -> None: + if not rows: + raise ValueError(f"refusing to write empty table {path}") + fields: list[str] = [] + for row in rows: + for field in row: + if field not in fields: + fields.append(field) + with path.open("w", newline="", encoding="utf-8") as handle: + writer = csv.DictWriter(handle, fieldnames=fields) + writer.writeheader() + writer.writerows(rows) + + +def _mean_std(values: list[float]) -> tuple[float, float]: + array = np.asarray(values, dtype=np.float64) + return float(array.mean()), float(array.std(ddof=1)) if len(array) > 1 else 0.0 + + +def _aggregate(rows: list[Row], keys: tuple[str, ...], metrics: tuple[str, ...]) -> list[Row]: + groups: dict[tuple[Any, ...], list[Row]] = defaultdict(list) + for row in rows: + groups[tuple(row[key] for key in keys)].append(row) + result: list[Row] = [] + for group_key, group in sorted(groups.items()): + summary: Row = dict(zip(keys, group_key, strict=True)) + summary["count"] = len(group) + for metric in metrics: + mean, std = _mean_std([float(row[metric]) for row in group]) + summary[f"{metric}_mean"] = mean + summary[f"{metric}_std"] = std + result.append(summary) + return result + + +def _reconstruction_audit( + value: np.ndarray, band_edges: tuple[float, ...], haar_levels: int +) -> list[Row]: + centered = center_spatial(value) + output: list[Row] = [] + fft_full = fft_reconstruct(fft_coefficients(centered)) + dct_full = dct_reconstruct(dct_coefficients(centered)) + haar_coefficients = haar_decompose2d(centered, levels=haar_levels) + haar_full = haar_reconstruct2d(haar_coefficients) + for method, reconstructed in ( + ("fft", fft_full), + ("dct", dct_full), + ("haar", haar_full), + ): + output.append( + { + "method": method, + "reconstruction": "full_inverse", + "relative_l2_error": relative_l2_error(centered, reconstructed), + "max_abs_error": float(np.max(np.abs(centered - reconstructed))), + } + ) + for method in ("fft", "dct"): + reconstructed = hard_band_reconstruction(centered, method, band_edges) + output.append( + { + "method": method, + "reconstruction": "sum_disjoint_radial_bands", + "relative_l2_error": relative_l2_error(centered, reconstructed), + "max_abs_error": float(np.max(np.abs(centered - reconstructed))), + } + ) + # Reconstruct each Haar subband independently, then verify their sum. + components: list[np.ndarray] = [] + zeros_approximation = np.zeros_like(haar_coefficients.approximation) + zero_details = tuple( + tuple(np.zeros_like(detail) for detail in level) + for level in haar_coefficients.details + ) + components.append( + haar_reconstruct2d( + HaarCoefficients( + haar_coefficients.approximation, + zero_details, + haar_coefficients.original_shape, + ) + ) + ) + for level_index, details in enumerate(haar_coefficients.details): + for orientation_index, detail in enumerate(details): + selected = [[np.zeros_like(item) for item in level] for level in haar_coefficients.details] + selected[level_index][orientation_index] = detail + components.append( + haar_reconstruct2d( + HaarCoefficients( + zeros_approximation, + tuple(tuple(level) for level in selected), + haar_coefficients.original_shape, + ) + ) + ) + reconstructed = np.sum(components, axis=0) + output.append( + { + "method": "haar", + "reconstruction": "sum_all_subbands", + "relative_l2_error": relative_l2_error(centered, reconstructed), + "max_abs_error": float(np.max(np.abs(centered - reconstructed))), + } + ) + return output + + +def _lowpass_audit( + value: np.ndarray, + cutoffs: tuple[float, ...], + modes: tuple[str, ...], + butterworth_order: int, +) -> list[Row]: + centered = center_spatial(value) + reference_energy = max(float(np.square(centered).sum()), np.finfo(float).eps) + rows: list[Row] = [] + for method in ("fft", "dct"): + lowpass = fft_lowpass if method == "fft" else dct_lowpass + for mode in modes: + for cutoff in cutoffs: + reconstructed = lowpass( + centered, cutoff, mode=mode, order=butterworth_order + ) + relative_mse = float(np.square(centered - reconstructed).sum()) / reference_energy + rows.append( + { + "method": method, + "mode": mode, + "cutoff": cutoff, + "retained_energy_fraction": float(np.square(reconstructed).sum()) + / reference_energy, + "relative_mse": relative_mse, + "reconstruction_fidelity": max(0.0, 1.0 - relative_mse), + } + ) + for cutoff in cutoffs: + levels_float = -math.log2(cutoff) + levels = int(round(levels_float)) + if not math.isclose(levels_float, levels, abs_tol=1e-9): + raise ValueError(f"Haar cutoff must be a power of two, got {cutoff}") + reconstructed = haar_lowpass(centered, levels) + relative_mse = float(np.square(centered - reconstructed).sum()) / reference_energy + rows.append( + { + "method": "haar", + "mode": "hard", + "cutoff": cutoff, + "retained_energy_fraction": float(np.square(reconstructed).sum()) + / reference_energy, + "relative_mse": relative_mse, + "reconstruction_fidelity": max(0.0, 1.0 - relative_mse), + } + ) + return rows + + +def _curve_auc(rows: list[Row]) -> list[Row]: + keys = ("seed", "input", "gate", "subject", "method", "mode") + groups: dict[tuple[Any, ...], list[Row]] = defaultdict(list) + for row in rows: + groups[tuple(row[key] for key in keys)].append(row) + result: list[Row] = [] + for key, group in sorted(groups.items()): + points = [(0.0, 0.0)] + sorted( + (float(row["cutoff"]), float(row["reconstruction_fidelity"])) + for row in group + ) + [(1.0, 1.0)] + x = np.asarray([point[0] for point in points]) + y = np.asarray([point[1] for point in points]) + result.append( + { + **dict(zip(keys, key, strict=True)), + "lowpass_reconstruction_auc": float(np.trapezoid(y, x)), + } + ) + return result + + +def _consistency(rows: list[Row]) -> list[Row]: + result: list[Row] = [] + index_keys = ("seed", "input", "gate") + for subject in SUBJECTS: + subject_rows = [row for row in rows if row["subject"] == subject] + by_method = { + method: {tuple(row[key] for key in index_keys): row for row in subject_rows if row["method"] == method} + for method in METHODS + } + for metric in ("frequency_auc", "high_low_ratio", "frequency_auc_delta"): + for left, right in (("fft", "dct"), ("fft", "haar"), ("dct", "haar")): + common = sorted(set(by_method[left]) & set(by_method[right])) + left_values = [float(by_method[left][key][metric]) for key in common] + right_values = [float(by_method[right][key][metric]) for key in common] + correlation = spearmanr(left_values, right_values) + result.append( + { + "subject": subject, + "metric": metric, + "method_a": left, + "method_b": right, + "count": len(common), + "spearman_rho": float(correlation.statistic), + "p_value": float(correlation.pvalue), + } + ) + return result + + +def _gate_rows( + input_tensor: torch.Tensor, + block: GmNetBlock, + gate_name: str, +) -> tuple[dict[str, torch.Tensor], torch.Tensor]: + direct_gate = build_gate(gate_name, input_tensor.shape[1]).to(input_tensor.device).eval() + gate_output = direct_gate(input_tensor) + pre_gate = block.f1(block.dwconv(input_tensor)) + block_output = block(input_tensor) + return { + "gate_output": gate_output, + "block_output": block_output, + "block_delta": block_output - input_tensor, + }, pre_gate + + +def _format(value: float) -> str: + return f"{value:.6g}" + + +def _report( + config: dict[str, Any], + consistency: list[Row], + validation: dict[str, float], + paired_gate_summary: list[Row], + distribution_summary: list[Row], +) -> str: + gate_primary = [ + row + for row in paired_gate_summary + if row["subject"] == "gate_output" and row["input"] in { + "smooth_random_std1", + "smooth_random_std4", + } + ] + paired_index = { + (row["input"], row["gate"], row["subject"]): row + for row in paired_gate_summary + } + distribution_index = { + (row["input"], row["gate"]): row for row in distribution_summary + } + relu6_high = paired_index[("smooth_random_std4", "relu6_self", "gate_output")] + relu_high = paired_index[("smooth_random_std4", "relu_self", "gate_output")] + smooth_high = paired_index[ + ("smooth_random_std4", "smooth_clipped_static", "gate_output") + ] + block_relu6_high = paired_index[ + ("smooth_random_std4", "relu6_self", "block_delta") + ] + block_relu_high = paired_index[ + ("smooth_random_std4", "relu_self", "block_delta") + ] + distribution_high = distribution_index[("smooth_random_std4", "relu6_self")] + clipping_reduction = ( + relu_high["frequency_auc_delta_mean"] + - relu6_high["frequency_auc_delta_mean"] + ) + clipping_reduction_relative = clipping_reduction / max( + abs(relu_high["frequency_auc_delta_mean"]), np.finfo(float).eps + ) + smooth_gap = abs( + smooth_high["frequency_auc_delta_mean"] + - relu6_high["frequency_auc_delta_mean"] + ) + block_gap = abs( + block_relu_high["frequency_auc_delta_mean"] + - block_relu6_high["frequency_auc_delta_mean"] + ) + lines = [ + "# E1 Spectral Measurement Audit", + "", + "## Protocol", + "", + f"- Seeds: {config['seeds']}", + f"- Gates: {', '.join(config['gates'])}", + "- Subjects: gate output, complete random-initialized block output, and residual branch delta.", + "- Bases: orthonormal FFT, orthonormal DCT-II, and a manual orthonormal 2-D Haar transform.", + "- All energy metrics remove each map's spatial mean before measuring spectrum.", + "- frequency_auc is the integral of surviving spectral energy over normalized radius; it equals energy-weighted mean radius. It is not classification accuracy AUC.", + "", + "## Numerical Validation", + "", + "| Check | Maximum error |", + "|---|---:|", + ] + lines.extend(f"| {key} | {_format(value)} |" for key, value in validation.items()) + lines.extend( + [ + "", + "## Gate-Only Frequency Shift", + "", + "Each seed first averages its paired change across the three bases. The table reports mean and sample standard deviation across five seeds.", + "", + "| Input | Gate | Frequency AUC delta | High/low log-gain |", + "|---|---|---:|---:|", + ] + ) + for row in gate_primary: + lines.append( + f"| {row['input']} | {row['gate']} | " + f"{_format(row['frequency_auc_delta_mean'])} +/- {_format(row['frequency_auc_delta_std'])} | " + f"{_format(row['high_low_log_gain_mean'])} +/- {_format(row['high_low_log_gain_std'])} |" + ) + lines.extend( + [ + "", + "## Cross-Basis Consistency", + "", + "Spearman correlations use all seed/input/gate combinations within each subject.", + "", + "| Subject | Metric | Pair | rho | p |", + "|---|---|---|---:|---:|", + ] + ) + for row in consistency: + if row["metric"] == "frequency_auc_delta": + lines.append( + f"| {row['subject']} | {row['metric']} | {row['method_a']}/{row['method_b']} | " + f"{_format(row['spearman_rho'])} | {_format(row['p_value'])} |" + ) + minimum_rho = min( + row["spearman_rho"] for row in consistency if row["metric"] == "frequency_auc_delta" + ) + maximum_error = max(validation.values()) + lines.extend( + [ + "", + "## Conclusions", + "", + f"1. The transform and disjoint-band reconstruction audit passes numerically; the worst recorded error is {_format(maximum_error)}.", + f"2. Directional agreement is quantified rather than assumed. The minimum cross-basis Spearman rho for paired frequency shift is {_format(minimum_rho)}; method-specific values remain in consistency.csv.", + f"3. In the std=4 direct-gate condition, {_format(distribution_high['direct_input_clipped_fraction_mean'] * 100.0)}% of values cross 6. ReLU6 reduces the frequency-AUC increase by {_format(clipping_reduction)} ({_format(clipping_reduction_relative * 100.0)}%) relative to ReLU.", + f"4. The static smooth-clipped approximation tracks hard ReLU6 closely: its absolute frequency-AUC delta gap is {_format(smooth_gap)} in that condition.", + f"5. The random block's pre-gate clip-crossing rate is only {_format(distribution_high['block_gate_input_clipped_fraction_mean'] * 100.0)}%, and the ReLU/ReLU6 residual-branch gap contracts to {_format(block_gap)}. Gate behavior therefore depends on the learned activation distribution.", + "6. Identity self-gating (x squared) produces the largest gate-only frequency shift, while no_gate is the zero-change control. Smoothness alone does not order the results; the composite mapping and clipping both matter.", + "7. Gate-output energy expansion is a spatial-feature statistic, not evidence of label relevance or model function frequency.", + "", + "## Limitations", + "", + "- Blocks are random-initialized and are used only to audit measurement behavior. No statement about ImageNet accuracy follows from these rows.", + "- Haar octave bands are not geometrically identical to radial FFT/DCT bands; rank agreement is the defensible cross-basis comparison.", + "- Frequency-Accuracy AUC requires a trained checkpoint and labeled evaluation set. This run reports spectral energy AUC and low-pass reconstruction AUC only.", + "", + "The machine-readable source tables are metrics.csv, summary.csv, paired_seed_summary.csv, paired_gate_summary.csv, distributions.csv, distribution_summary.csv, lowpass.csv, lowpass_auc.csv, reconstruction.csv, consistency.csv, and results.json.", + "", + ] + ) + return "\n".join(lines) + + +def run_experiment(config_path: Path, output_dir: Path) -> dict[str, Any]: + with config_path.open(encoding="utf-8") as handle: + config = yaml.safe_load(handle) + output_dir.mkdir(parents=True, exist_ok=False) + (output_dir / "config.yaml").write_text( + yaml.safe_dump(config, sort_keys=False), encoding="utf-8" + ) + + requested_device = str(config.get("device", "cuda:0")) + if requested_device.startswith("cuda") and not torch.cuda.is_available(): + device = torch.device("cpu") + else: + device = torch.device(requested_device) + shape_config = config["shape"] + shape = ( + int(shape_config["batch_size"]), + int(shape_config["channels"]), + int(shape_config["resolution"]), + int(shape_config["resolution"]), + ) + spectral = config["spectral"] + split = float(spectral["high_low_split"]) + levels = int(spectral["haar_levels"]) + cutoffs = tuple(float(value) for value in spectral["lowpass_cutoffs"]) + modes = tuple(str(value) for value in spectral["lowpass_modes"]) + order = int(spectral["butterworth_order"]) + band_edges = tuple(float(value) for value in spectral["band_edges"]) + + metrics_rows: list[Row] = [] + reconstruction_rows: list[Row] = [] + lowpass_rows: list[Row] = [] + distribution_rows: list[Row] = [] + + for seed in config["seeds"]: + seed = int(seed) + blocks: dict[str, GmNetBlock] = {} + for gate in config["gates"]: + torch.manual_seed(seed + 100_000) + block_config = config["block"] + blocks[gate] = GmNetBlock( + shape[1], + mlp_ratio=int(block_config["mlp_ratio"]), + kernel_size=int(block_config["kernel_size"]), + gate_type=gate, + f12_bn=bool(block_config["f12_bn"]), + projection_bn=bool(block_config["projection_bn"]), + second_dw_bn=bool(block_config["second_dw_bn"]), + layer_scale=float(block_config["layer_scale"]), + ).to(device).eval() + + for input_index, input_spec in enumerate(config["inputs"]): + input_array = make_controlled_input( + input_spec["kind"], + seed * 10_000 + input_index, + shape, + target_std=float(input_spec["target_std"]), + spectral_alpha=float(input_spec.get("spectral_alpha", 0.0)), + knee=float(input_spec.get("knee", 0.15)), + ) + input_tensor = torch.from_numpy(input_array).to(device=device, dtype=torch.float32) + input_metrics = { + method: measure_spectrum(input_array, method, split=split, haar_levels=levels) + for method in METHODS + } + with torch.inference_mode(): + for gate in config["gates"]: + subjects, pre_gate = _gate_rows(input_tensor, blocks[gate], gate) + pre_gate_np = pre_gate.float().cpu().numpy() + distribution_rows.append( + { + "seed": seed, + "input": input_spec["name"], + "gate": gate, + "direct_input_negative_fraction": float((input_array < 0).mean()), + "direct_input_mid_fraction": float( + ((input_array >= 0) & (input_array < 6)).mean() + ), + "direct_input_clipped_fraction": float((input_array >= 6).mean()), + "block_gate_input_negative_fraction": float((pre_gate_np < 0).mean()), + "block_gate_input_mid_fraction": float( + ((pre_gate_np >= 0) & (pre_gate_np < 6)).mean() + ), + "block_gate_input_clipped_fraction": float((pre_gate_np >= 6).mean()), + } + ) + for subject, tensor in subjects.items(): + value = tensor.float().cpu().numpy() + metadata = { + "seed": seed, + "input": input_spec["name"], + "gate": gate, + "subject": subject, + } + for method in METHODS: + measured = measure_spectrum( + value, method, split=split, haar_levels=levels + ) + baseline = input_metrics[method] + epsilon = np.finfo(float).eps + metrics_rows.append( + { + **metadata, + **measured.to_dict(), + "input_frequency_auc": baseline.frequency_auc, + "frequency_auc_delta": measured.frequency_auc + - baseline.frequency_auc, + "input_high_low_ratio": baseline.high_low_ratio, + "high_low_log_gain": math.log( + (measured.high_low_ratio + epsilon) + / (baseline.high_low_ratio + epsilon) + ), + "output_mean": float(value.mean()), + "output_std": float(value.std()), + } + ) + for row in _reconstruction_audit(value, band_edges, levels): + reconstruction_rows.append({**metadata, **row}) + for row in _lowpass_audit(value, cutoffs, modes, order): + lowpass_rows.append({**metadata, **row}) + + summary_rows = _aggregate( + metrics_rows, + ("input", "gate", "subject", "method"), + ( + "frequency_auc", + "frequency_auc_delta", + "high_low_ratio", + "high_low_log_gain", + "output_mean", + "output_std", + ), + ) + paired_seed_raw = _aggregate( + metrics_rows, + ("seed", "input", "gate", "subject"), + ("frequency_auc_delta", "high_low_log_gain"), + ) + paired_seed_summary = [ + { + "seed": row["seed"], + "input": row["input"], + "gate": row["gate"], + "subject": row["subject"], + "basis_count": row["count"], + "frequency_auc_delta": row["frequency_auc_delta_mean"], + "high_low_log_gain": row["high_low_log_gain_mean"], + } + for row in paired_seed_raw + ] + paired_gate_summary = _aggregate( + paired_seed_summary, + ("input", "gate", "subject"), + ("frequency_auc_delta", "high_low_log_gain"), + ) + distribution_metrics = ( + "direct_input_negative_fraction", + "direct_input_mid_fraction", + "direct_input_clipped_fraction", + "block_gate_input_negative_fraction", + "block_gate_input_mid_fraction", + "block_gate_input_clipped_fraction", + ) + distribution_summary = _aggregate( + distribution_rows, ("input", "gate"), distribution_metrics + ) + lowpass_auc_rows = _curve_auc(lowpass_rows) + consistency_rows = _consistency(metrics_rows) + validation = { + f"{row['method']}:{row['reconstruction']}": max( + float(candidate["max_abs_error"]) + for candidate in reconstruction_rows + if candidate["method"] == row["method"] + and candidate["reconstruction"] == row["reconstruction"] + ) + for row in reconstruction_rows + } + + _write_csv(output_dir / "metrics.csv", metrics_rows) + _write_csv(output_dir / "summary.csv", summary_rows) + _write_csv(output_dir / "paired_seed_summary.csv", paired_seed_summary) + _write_csv(output_dir / "paired_gate_summary.csv", paired_gate_summary) + _write_csv(output_dir / "distributions.csv", distribution_rows) + _write_csv(output_dir / "distribution_summary.csv", distribution_summary) + _write_csv(output_dir / "reconstruction.csv", reconstruction_rows) + _write_csv(output_dir / "lowpass.csv", lowpass_rows) + _write_csv(output_dir / "lowpass_auc.csv", lowpass_auc_rows) + _write_csv(output_dir / "consistency.csv", consistency_rows) + + results = { + "schema_version": 1, + "experiment_id": config["experiment_id"], + "timestamp_utc": datetime.now(UTC).isoformat(), + "config_path": str(config_path.resolve()), + "output_dir": str(output_dir.resolve()), + "environment": { + "python": sys.version, + "platform": platform.platform(), + "torch": torch.__version__, + "numpy": np.__version__, + "scipy": scipy.__version__, + "requested_device": requested_device, + "actual_device": str(device), + "gpu": torch.cuda.get_device_name(device) if device.type == "cuda" else None, + }, + "definitions": { + "frequency_auc": "Integral of surviving centered spatial energy over normalized radius; equivalent to energy-weighted mean normalized frequency.", + "lowpass_reconstruction_auc": "Trapezoidal AUC of 1-relative-MSE for low-pass reconstructions; not classification accuracy.", + "high_low_split": split, + }, + "validation_max_abs_error": validation, + "paired_gate_summary": paired_gate_summary, + "distribution_summary": distribution_summary, + "consistency": consistency_rows, + } + (output_dir / "results.json").write_text( + json.dumps(results, indent=2, allow_nan=False) + "\n", encoding="utf-8" + ) + report = _report( + config, + consistency_rows, + validation, + paired_gate_summary, + distribution_summary, + ) + (output_dir / "REPORT.md").write_text(report, encoding="utf-8") + return results diff --git a/gmnet/code/journal_exp/gmnet/spectral/inputs.py b/gmnet/code/journal_exp/gmnet/spectral/inputs.py new file mode 100644 index 0000000000000000000000000000000000000000..bd2167500cd817f380fe089f735e1d79a223a24e --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/spectral/inputs.py @@ -0,0 +1,82 @@ +"""Controlled spatial fields used by the E1 measurement audit.""" + +from __future__ import annotations + +import math + +import numpy as np + + +def _standardize(x: np.ndarray, target_std: float) -> np.ndarray: + x = x - x.mean(axis=(-2, -1), keepdims=True) + scale = x.std(axis=(-2, -1), keepdims=True) + return x / np.maximum(scale, 1e-12) * target_std + + +def random_field( + rng: np.random.Generator, + shape: tuple[int, int, int, int], + *, + spectral_alpha: float, + target_std: float, + knee: float = 0.15, +) -> np.ndarray: + """Generate real random fields with an isotropic power-law envelope.""" + + noise = rng.standard_normal(shape) + height, width = shape[-2:] + fy = np.fft.fftfreq(height) + fx = np.fft.fftfreq(width) + yy, xx = np.meshgrid(fy, fx, indexing="ij") + radius = np.sqrt(xx * xx + yy * yy) / np.sqrt(0.5) + amplitude = (1.0 + (radius / knee) ** 2) ** (-spectral_alpha / 4.0) + coeff = np.fft.fft2(noise, axes=(-2, -1), norm="ortho") * amplitude + field = np.fft.ifft2(coeff, axes=(-2, -1), norm="ortho").real + return _standardize(field, target_std) + + +def tone_mix( + rng: np.random.Generator, + shape: tuple[int, int, int, int], + *, + target_std: float, + frequencies: tuple[float, float] = (0.12, 0.31), +) -> np.ndarray: + """Generate two oriented tones; frequencies use cycles/pixel.""" + + batch, channels, height, width = shape + yy, xx = np.meshgrid(np.arange(height), np.arange(width), indexing="ij") + result = np.empty(shape, dtype=np.float64) + angles = (math.radians(30.0), math.radians(67.0)) + for sample in range(batch): + for channel in range(channels): + phases = rng.uniform(0.0, 2.0 * math.pi, size=2) + signal = np.zeros((height, width), dtype=np.float64) + for frequency, angle, phase in zip(frequencies, angles, phases, strict=True): + coordinate = math.cos(angle) * xx + math.sin(angle) * yy + signal += np.sin(2.0 * math.pi * frequency * coordinate + phase) + result[sample, channel] = signal + return _standardize(result, target_std) + + +def make_controlled_input( + kind: str, + seed: int, + shape: tuple[int, int, int, int], + *, + target_std: float, + spectral_alpha: float = 0.0, + knee: float = 0.15, +) -> np.ndarray: + rng = np.random.default_rng(seed) + if kind == "random_field": + return random_field( + rng, + shape, + spectral_alpha=spectral_alpha, + target_std=target_std, + knee=knee, + ) + if kind == "tone_mix": + return tone_mix(rng, shape, target_std=target_std) + raise ValueError(f"unsupported controlled input kind {kind!r}") diff --git a/gmnet/code/journal_exp/gmnet/spectral/metrics.py b/gmnet/code/journal_exp/gmnet/spectral/metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..f95ec9584534d1b24ce590a9250e2227a1f5be67 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/spectral/metrics.py @@ -0,0 +1,101 @@ +"""Common spectral energy metrics across FFT, DCT, and Haar bases.""" + +from __future__ import annotations + +from dataclasses import asdict, dataclass + +import numpy as np + +from .transforms import ( + dct_coefficients, + dct_radius, + fft_coefficients, + fft_radius, + haar_decompose2d, +) + + +Array = np.ndarray + + +@dataclass(frozen=True) +class SpectrumMetrics: + method: str + total_energy: float + low_energy_fraction: float + high_energy_fraction: float + high_low_ratio: float + frequency_auc: float + + def to_dict(self) -> dict[str, float | str]: + return asdict(self) + + +def center_spatial(x: Array) -> Array: + """Remove each sample/channel spatial mean so DC cannot dominate ratios.""" + + value = np.asarray(x, dtype=np.float64) + return value - value.mean(axis=(-2, -1), keepdims=True) + + +def _coefficient_metrics( + coefficients: Array, radius: Array, method: str, split: float +) -> SpectrumMetrics: + energy_map = np.abs(coefficients) ** 2 + # Sum leading sample/channel dimensions before applying the shared grid. + if energy_map.ndim > 2: + energy_map = energy_map.sum(axis=tuple(range(energy_map.ndim - 2))) + total = float(energy_map.sum()) + if total <= np.finfo(float).eps: + return SpectrumMetrics(method, total, 0.0, 0.0, 0.0, 0.0) + low = float(energy_map[radius < split].sum()) / total + high = float(energy_map[radius >= split].sum()) / total + ratio = high / max(low, np.finfo(float).eps) + # Integral of the surviving-energy curve equals the energy-weighted mean + # normalized frequency. This gives a bounded, grid-independent AUC. + auc = float((energy_map * radius).sum()) / total + return SpectrumMetrics(method, total, low, high, ratio, auc) + + +def _haar_metrics(x: Array, levels: int, split: float) -> SpectrumMetrics: + coefficients = haar_decompose2d(x, levels) + approximation_energy = float(np.square(coefficients.approximation).sum()) + # Level 1 details cover the highest octave. Level l is assigned the center + # of [2^-l, 2^-(l-1)], yielding a consistent normalized scale proxy. + bands: list[tuple[float, float]] = [] + for level, details in enumerate(coefficients.details, start=1): + energy = float(sum(np.square(detail).sum() for detail in details)) + center = 0.75 / (2 ** (level - 1)) + bands.append((center, energy)) + approximation_center = 0.25 / (2 ** (levels - 1)) + bands.append((approximation_center, approximation_energy)) + total = sum(energy for _, energy in bands) + if total <= np.finfo(float).eps: + return SpectrumMetrics("haar", total, 0.0, 0.0, 0.0, 0.0) + low_energy = sum(energy for radius, energy in bands if radius < split) + high_energy = total - low_energy + auc = sum(radius * energy for radius, energy in bands) / total + low = low_energy / total + high = high_energy / total + return SpectrumMetrics( + "haar", total, low, high, high / max(low, np.finfo(float).eps), auc + ) + + +def measure_spectrum( + x: Array, method: str, *, split: float = 0.5, haar_levels: int = 3 +) -> SpectrumMetrics: + """Measure centered spatial energy; ``frequency_auc`` is not accuracy AUC.""" + + if not 0.0 < split < 1.0: + raise ValueError(f"split must be in (0, 1), got {split}") + value = center_spatial(x) + if method == "fft": + coeff = fft_coefficients(value) + return _coefficient_metrics(coeff, fft_radius(value.shape[-2:]), method, split) + if method == "dct": + coeff = dct_coefficients(value) + return _coefficient_metrics(coeff, dct_radius(value.shape[-2:]), method, split) + if method == "haar": + return _haar_metrics(value, haar_levels, split) + raise ValueError(f"unknown spectral method {method!r}") diff --git a/gmnet/code/journal_exp/gmnet/spectral/streaming.py b/gmnet/code/journal_exp/gmnet/spectral/streaming.py new file mode 100644 index 0000000000000000000000000000000000000000..bebcafa1a055c2e09808e8716ba427565cd86cb9 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/spectral/streaming.py @@ -0,0 +1,178 @@ +"""Streaming feature-spectrum statistics used by trained-model audits.""" + +from __future__ import annotations + +from dataclasses import asdict, dataclass + +import numpy as np +import torch +from torch import Tensor + +from .transforms import fft_radius + + +@dataclass(frozen=True) +class RadialPSDResult: + valid: bool + high_low_valid: bool + height: int + width: int + map_count: int + total_energy: float | None + mean_energy_per_map: float | None + spectral_centroid: float | None + low_energy_fraction: float | None + high_energy_fraction: float | None + high_low_ratio: float | None + spectral_entropy: float | None + spectral_entropy_raw: float | None + + def to_dict(self) -> dict[str, bool | int | float | None]: + return asdict(self) + + +class RadialPSDAccumulator: + """Accumulate centered spatial PSD over batches and feature channels.""" + + def __init__(self, *, high_low_split: float = 0.5, radial_bins: int = 16) -> None: + if not 0.0 < high_low_split < 1.0: + raise ValueError("high_low_split must be in (0, 1)") + if radial_bins < 2: + raise ValueError("radial_bins must be at least 2") + self.high_low_split = float(high_low_split) + self.radial_bins = int(radial_bins) + self._energy: np.ndarray | None = None + self._map_count = 0 + + def update(self, features: Tensor) -> None: + if features.ndim != 4: + raise ValueError(f"expected BCHW features, got {tuple(features.shape)}") + batch, channels, height, width = features.shape + if self._energy is not None and self._energy.shape != (height, width): + raise ValueError( + f"feature shape changed from {self._energy.shape} to {(height, width)}" + ) + value = features.detach().to(dtype=torch.float32) + value = value - value.mean(dim=(-2, -1), keepdim=True) + coefficients = torch.fft.fftshift( + torch.fft.fft2(value, dim=(-2, -1), norm="ortho"), dim=(-2, -1) + ) + energy = coefficients.abs().square().sum(dim=(0, 1)).double().cpu().numpy() + if self._energy is None: + self._energy = energy + else: + self._energy += energy + self._map_count += int(batch * channels) + + def compute(self) -> RadialPSDResult: + if self._energy is None or self._map_count == 0: + raise RuntimeError("no features were accumulated") + height, width = self._energy.shape + total = float(self._energy.sum()) + if min(height, width) < 2 or total <= np.finfo(float).eps: + return RadialPSDResult( + False, + False, + height, + width, + self._map_count, + None, + None, + None, + None, + None, + None, + None, + None, + ) + radius = fft_radius((height, width)) + mean_energy = total / self._map_count + roundoff_floor = ( + 10.0 * np.finfo(np.float32).eps**2 * height * width + ) + if mean_energy <= roundoff_floor: + return RadialPSDResult( + False, + False, + height, + width, + self._map_count, + None, + None, + None, + None, + None, + None, + None, + None, + ) + low_energy = float(self._energy[radius < self.high_low_split].sum()) + high_energy = total - low_energy + high_low_valid = bool( + np.any((radius > 0) & (radius < self.high_low_split)) + and np.any(radius >= self.high_low_split) + ) + centroid = float((self._energy * radius).sum() / total) + edges = np.linspace(0.0, 1.0 + 1e-12, self.radial_bins + 1) + band_energy, _ = np.histogram(radius, bins=edges, weights=self._energy) + grid_count, _ = np.histogram(radius, bins=edges) + probabilities = band_energy[grid_count > 0] / total + probabilities = probabilities[probabilities > 0] + raw_entropy = float(-(probabilities * np.log(probabilities)).sum()) + possible_bands = int((grid_count > 0).sum()) + normalized_entropy = ( + raw_entropy / np.log(possible_bands) if possible_bands > 1 else 0.0 + ) + low_fraction = low_energy / total + high_fraction = high_energy / total + return RadialPSDResult( + True, + high_low_valid, + height, + width, + self._map_count, + total, + mean_energy, + centroid, + low_fraction, + high_fraction, + ( + high_fraction / max(low_fraction, np.finfo(float).eps) + if high_low_valid + else None + ), + normalized_entropy, + raw_entropy, + ) + + +def torch_fft_lowpass( + images: Tensor, cutoff: float, *, order: int = 4 +) -> Tensor: + """Apply a differentiable Butterworth low-pass to a BCHW tensor. + + A cutoff of zero retains only each channel's DC value. A cutoff of one is + defined as the exact identity endpoint for frequency-accuracy curves. + """ + + if images.ndim != 4: + raise ValueError(f"expected BCHW images, got {tuple(images.shape)}") + if not 0.0 <= cutoff <= 1.0: + raise ValueError(f"cutoff must be in [0, 1], got {cutoff}") + if order <= 0: + raise ValueError(f"order must be positive, got {order}") + if cutoff == 0.0: + return images.mean(dim=(-2, -1), keepdim=True).expand_as(images) + if cutoff == 1.0: + return images + height, width = images.shape[-2:] + fy = torch.fft.fftfreq(height, device=images.device, dtype=torch.float32) + fx = torch.fft.fftfreq(width, device=images.device, dtype=torch.float32) + yy, xx = torch.meshgrid(fy, fx, indexing="ij") + radius = torch.sqrt(xx.square() + yy.square()) / np.sqrt(0.5) + weight = torch.rsqrt(1.0 + (radius / cutoff).pow(2 * order)) + coefficients = torch.fft.fft2(images.float(), dim=(-2, -1), norm="ortho") + filtered = torch.fft.ifft2( + coefficients * weight, dim=(-2, -1), norm="ortho" + ).real + return filtered.to(dtype=images.dtype) diff --git a/gmnet/code/journal_exp/gmnet/spectral/transforms.py b/gmnet/code/journal_exp/gmnet/spectral/transforms.py new file mode 100644 index 0000000000000000000000000000000000000000..072ec4e9a1f15700e3e35e216926e4813adcc507 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/spectral/transforms.py @@ -0,0 +1,219 @@ +"""Orthogonal 2-D spectral transforms and low-pass reconstructions. + +The implementation operates on NumPy arrays with arbitrary leading dimensions +and spatial dimensions in the last two axes. FFT and DCT use orthonormal +normalization. The Haar implementation is an explicit orthonormal transform, +which keeps this audit independent of an optional wavelet package. +""" + +from __future__ import annotations + +from dataclasses import dataclass + +import numpy as np +from scipy.fft import dctn, idctn + + +Array = np.ndarray + + +def _validate_spatial(x: Array) -> Array: + value = np.asarray(x) + if value.ndim < 2: + raise ValueError(f"expected at least two dimensions, got {value.shape}") + if min(value.shape[-2:]) < 2: + raise ValueError(f"spatial dimensions must be at least 2, got {value.shape[-2:]}") + if not np.issubdtype(value.dtype, np.number): + raise TypeError(f"expected a numeric array, got {value.dtype}") + return value.astype(np.float64, copy=False) + + +def fft_radius(shape: tuple[int, int]) -> Array: + """Return shifted FFT radius normalized to one at the corner Nyquist.""" + + height, width = shape + fy = np.fft.fftshift(np.fft.fftfreq(height)) + fx = np.fft.fftshift(np.fft.fftfreq(width)) + yy, xx = np.meshgrid(fy, fx, indexing="ij") + return np.sqrt(xx * xx + yy * yy) / np.sqrt(0.5) + + +def dct_radius(shape: tuple[int, int]) -> Array: + """Return DCT-II basis radius normalized to one at the highest corner.""" + + height, width = shape + fy = np.arange(height, dtype=np.float64) / max(height - 1, 1) + fx = np.arange(width, dtype=np.float64) / max(width - 1, 1) + yy, xx = np.meshgrid(fy, fx, indexing="ij") + return np.sqrt(xx * xx + yy * yy) / np.sqrt(2.0) + + +def _lowpass_weight(radius: Array, cutoff: float, mode: str, order: int) -> Array: + if not 0.0 < cutoff <= 1.0: + raise ValueError(f"cutoff must be in (0, 1], got {cutoff}") + if mode == "hard": + return (radius <= cutoff).astype(np.float64) + if mode == "butterworth": + if order <= 0: + raise ValueError(f"Butterworth order must be positive, got {order}") + return 1.0 / np.sqrt(1.0 + (radius / cutoff) ** (2 * order)) + raise ValueError(f"unknown low-pass mode {mode!r}") + + +def fft_coefficients(x: Array) -> Array: + value = _validate_spatial(x) + return np.fft.fftshift( + np.fft.fft2(value, axes=(-2, -1), norm="ortho"), axes=(-2, -1) + ) + + +def fft_reconstruct(coefficients: Array) -> Array: + coeff = np.asarray(coefficients) + restored = np.fft.ifft2( + np.fft.ifftshift(coeff, axes=(-2, -1)), axes=(-2, -1), norm="ortho" + ) + return restored.real + + +def fft_lowpass( + x: Array, cutoff: float, *, mode: str = "hard", order: int = 4 +) -> Array: + coeff = fft_coefficients(x) + weight = _lowpass_weight(fft_radius(coeff.shape[-2:]), cutoff, mode, order) + return fft_reconstruct(coeff * weight) + + +def dct_coefficients(x: Array) -> Array: + value = _validate_spatial(x) + return dctn(value, axes=(-2, -1), norm="ortho") + + +def dct_reconstruct(coefficients: Array) -> Array: + return idctn(np.asarray(coefficients), axes=(-2, -1), norm="ortho") + + +def dct_lowpass( + x: Array, cutoff: float, *, mode: str = "hard", order: int = 4 +) -> Array: + coeff = dct_coefficients(x) + weight = _lowpass_weight(dct_radius(coeff.shape[-2:]), cutoff, mode, order) + return dct_reconstruct(coeff * weight) + + +def hard_band_reconstruction(x: Array, method: str, edges: tuple[float, ...]) -> Array: + """Reconstruct the sum of disjoint radial bands for an audit of masks.""" + + if len(edges) < 2 or edges[0] != 0.0 or edges[-1] < 1.0: + raise ValueError("edges must start at 0 and cover normalized radius 1") + if any(right <= left for left, right in zip(edges[:-1], edges[1:], strict=True)): + raise ValueError("edges must be strictly increasing") + if method == "fft": + coefficients = fft_coefficients(x) + radius = fft_radius(coefficients.shape[-2:]) + inverse = fft_reconstruct + elif method == "dct": + coefficients = dct_coefficients(x) + radius = dct_radius(coefficients.shape[-2:]) + inverse = dct_reconstruct + else: + raise ValueError(f"hard radial bands are unavailable for {method!r}") + result = np.zeros_like(_validate_spatial(x)) + for index, (lower, upper) in enumerate(zip(edges[:-1], edges[1:], strict=True)): + if index == len(edges) - 2: + mask = (radius >= lower) & (radius <= upper) + else: + mask = (radius >= lower) & (radius < upper) + result += inverse(coefficients * mask) + return result + + +@dataclass(frozen=True) +class HaarCoefficients: + """A multilevel orthonormal Haar decomposition. + + ``details`` are ordered from fine to coarse. Each entry stores horizontal, + vertical, and diagonal detail coefficients at that level. + """ + + approximation: Array + details: tuple[tuple[Array, Array, Array], ...] + original_shape: tuple[int, ...] + + +def _haar_step(x: Array) -> tuple[Array, tuple[Array, Array, Array]]: + a = x[..., 0::2, 0::2] + b = x[..., 0::2, 1::2] + c = x[..., 1::2, 0::2] + d = x[..., 1::2, 1::2] + approximation = (a + b + c + d) / 2.0 + horizontal = (a - b + c - d) / 2.0 + vertical = (a + b - c - d) / 2.0 + diagonal = (a - b - c + d) / 2.0 + return approximation, (horizontal, vertical, diagonal) + + +def _inverse_haar_step( + approximation: Array, details: tuple[Array, Array, Array] +) -> Array: + horizontal, vertical, diagonal = details + a = (approximation + horizontal + vertical + diagonal) / 2.0 + b = (approximation - horizontal + vertical - diagonal) / 2.0 + c = (approximation + horizontal - vertical - diagonal) / 2.0 + d = (approximation - horizontal - vertical + diagonal) / 2.0 + output = np.empty( + (*approximation.shape[:-2], approximation.shape[-2] * 2, approximation.shape[-1] * 2), + dtype=np.result_type(approximation, *details), + ) + output[..., 0::2, 0::2] = a + output[..., 0::2, 1::2] = b + output[..., 1::2, 0::2] = c + output[..., 1::2, 1::2] = d + return output + + +def haar_decompose2d(x: Array, levels: int) -> HaarCoefficients: + value = _validate_spatial(x) + if levels <= 0: + raise ValueError(f"levels must be positive, got {levels}") + divisor = 2**levels + if value.shape[-2] % divisor or value.shape[-1] % divisor: + raise ValueError( + f"shape {value.shape[-2:]} must be divisible by 2**levels ({divisor})" + ) + approximation = value + details: list[tuple[Array, Array, Array]] = [] + for _ in range(levels): + approximation, level_details = _haar_step(approximation) + details.append(level_details) + return HaarCoefficients(approximation, tuple(details), value.shape) + + +def haar_reconstruct2d(coefficients: HaarCoefficients) -> Array: + approximation = coefficients.approximation + for details in reversed(coefficients.details): + approximation = _inverse_haar_step(approximation, details) + if approximation.shape != coefficients.original_shape: + raise RuntimeError( + f"reconstructed shape {approximation.shape} != {coefficients.original_shape}" + ) + return approximation + + +def haar_lowpass(x: Array, levels: int) -> Array: + """Reconstruct only the Haar approximation after ``levels`` stages.""" + + coefficients = haar_decompose2d(x, levels) + zero_details = tuple( + tuple(np.zeros_like(detail) for detail in level) + for level in coefficients.details + ) + return haar_reconstruct2d( + HaarCoefficients(coefficients.approximation, zero_details, coefficients.original_shape) + ) + + +def relative_l2_error(reference: Array, estimate: Array) -> float: + reference = np.asarray(reference, dtype=np.float64) + estimate = np.asarray(estimate, dtype=np.float64) + denominator = max(float(np.linalg.norm(reference.ravel())), np.finfo(float).eps) + return float(np.linalg.norm((reference - estimate).ravel()) / denominator) diff --git a/gmnet/code/journal_exp/gmnet/synthetic/__init__.py b/gmnet/code/journal_exp/gmnet/synthetic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0dae28181b2c7b3c1773232b39e26809dc91a368 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/synthetic/__init__.py @@ -0,0 +1,5 @@ +"""Controlled synthetic protocols for measuring GmNet gate spectra.""" + +from .protocols import SyntheticExperiment, load_synthetic_config + +__all__ = ["SyntheticExperiment", "load_synthetic_config"] diff --git a/gmnet/code/journal_exp/gmnet/synthetic/metrics.py b/gmnet/code/journal_exp/gmnet/synthetic/metrics.py new file mode 100644 index 0000000000000000000000000000000000000000..258e9f7edbd35eea69aa32a2426c45df699ddebd --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/synthetic/metrics.py @@ -0,0 +1,124 @@ +"""FFT utilities and uncertainty estimates for controlled spectral tests.""" + +from __future__ import annotations + +import math +from collections.abc import Iterable + +import numpy as np +import torch +from torch import Tensor + + +def fft_power(x: Tensor) -> Tensor: + """Return centered two-dimensional power with an orthonormal FFT.""" + + if x.ndim != 2: + raise ValueError(f"expected a 2-D signal, got {tuple(x.shape)}") + return torch.fft.fftshift(torch.fft.fft2(x, norm="ortho")).abs().square() + + +def frequency_grid(size: int, device: torch.device) -> tuple[Tensor, Tensor, Tensor]: + """Return centered integer x/y frequencies and their radial magnitude.""" + + values = torch.arange(-size // 2, size // 2, device=device) + fy, fx = torch.meshgrid(values, values, indexing="ij") + radius = torch.sqrt(fx.float().square() + fy.float().square()) + return fx, fy, radius + + +def tone_mask(size: int, frequencies: Iterable[tuple[int, int]], device: torch.device) -> Tensor: + """Construct the exact DFT-bin support of real-valued sinusoidal tones.""" + + fx, fy, _ = frequency_grid(size, device) + mask = torch.zeros((size, size), dtype=torch.bool, device=device) + for kx, ky in frequencies: + mask |= ((fx == kx) & (fy == ky)) | ((fx == -kx) & (fy == -ky)) + return mask + + +def radial_band_mask(size: int, low: float, high: float, device: torch.device) -> Tensor: + """Select a half-open radial frequency annulus.""" + + _, _, radius = frequency_grid(size, device) + return (radius >= low) & (radius < high) + + +def energy_fraction(power: Tensor, mask: Tensor) -> float: + total = power.sum().clamp_min(torch.finfo(power.dtype).eps) + return float((power[mask].sum() / total).item()) + + +def band_gain(input_power: Tensor, output_power: Tensor, mask: Tensor) -> float: + denominator = input_power[mask].sum().clamp_min(torch.finfo(input_power.dtype).eps) + return float((output_power[mask].sum() / denominator).item()) + + +def wrap_frequency(value: int, size: int) -> int: + """Wrap an integer frequency into [-N/2, N/2).""" + + return (value + size // 2) % size - size // 2 + + +def alias_mask( + size: int, + frequency: tuple[int, int], + max_order: int, + device: torch.device, +) -> Tensor: + """Bins occupied by harmonics whose unwrapped frequency exceeds Nyquist. + + This is an attribution mask rather than an anti-aliasing reconstruction: + it asks how much observed output power lies at locations reached only after + wrapping higher harmonics onto the sampled grid. + """ + + kx, ky = frequency + aliased: list[tuple[int, int]] = [] + unaliased: list[tuple[int, int]] = [(0, 0), frequency] + for order in range(2, max_order + 1): + raw_x, raw_y = order * kx, order * ky + if abs(raw_x) >= size / 2 or abs(raw_y) >= size / 2: + aliased.append((wrap_frequency(raw_x, size), wrap_frequency(raw_y, size))) + else: + unaliased.append((raw_x, raw_y)) + mask = tone_mask(size, aliased, device) + # A wrapped order can collide with DC, the fundamental, or an ordinary + # sub-Nyquist harmonic. Those bins do not admit unique alias attribution. + mask &= ~tone_mask(size, unaliased, device) + return mask + + +def normalized_trapezoid_auc(x: Iterable[float], y: Iterable[float]) -> float: + x_array = np.asarray(list(x), dtype=np.float64) + y_array = np.asarray(list(y), dtype=np.float64) + order = np.argsort(x_array) + x_array, y_array = x_array[order], y_array[order] + span = x_array[-1] - x_array[0] + if span <= 0: + return math.nan + return float(np.trapezoid(y_array, x_array) / span) + + +def bootstrap_mean_ci( + values: Iterable[float], + *, + samples: int, + confidence: float, + seed: int, +) -> tuple[float, float, float, int]: + """Percentile bootstrap CI for a finite-valued sample mean.""" + + array = np.asarray(list(values), dtype=np.float64) + array = array[np.isfinite(array)] + if not len(array): + return math.nan, math.nan, math.nan, 0 + mean = float(array.mean()) + if len(array) == 1: + return mean, mean, mean, 1 + rng = np.random.default_rng(seed) + indices = rng.integers(0, len(array), size=(samples, len(array))) + means = array[indices].mean(axis=1) + alpha = (1.0 - confidence) / 2.0 + low, high = np.quantile(means, [alpha, 1.0 - alpha]) + return mean, float(low), float(high), len(array) diff --git a/gmnet/code/journal_exp/gmnet/synthetic/protocols.py b/gmnet/code/journal_exp/gmnet/synthetic/protocols.py new file mode 100644 index 0000000000000000000000000000000000000000..cb0cafc921b3eb1fae403dba6e2a9b36c854c564 --- /dev/null +++ b/gmnet/code/journal_exp/gmnet/synthetic/protocols.py @@ -0,0 +1,331 @@ +"""Numerical causal protocols for pointwise GmNet gates. + +These experiments deliberately do not train a classifier. They isolate the +gate as an operator on exactly controlled inputs, making newly generated +frequencies and cue interactions directly attributable to that operator. +""" + +from __future__ import annotations + +import math +from collections.abc import Callable +from pathlib import Path +from typing import Any + +import numpy as np +import torch +import yaml +from torch import Tensor + +from gmnet.models.gmnet import build_gate + +from .metrics import ( + alias_mask, + band_gain, + energy_fraction, + fft_power, + normalized_trapezoid_auc, + radial_band_mask, + tone_mask, +) + + +def load_synthetic_config(path: str | Path) -> dict[str, Any]: + with Path(path).open(encoding="utf-8") as handle: + config = yaml.safe_load(handle) + if not isinstance(config, dict): + raise ValueError("synthetic config must contain a mapping") + return config + + +def _tone( + size: int, + frequency: tuple[int, int], + amplitude: float, + phase: float, + device: torch.device, +) -> Tensor: + coordinates = torch.arange(size, device=device, dtype=torch.float64) + yy, xx = torch.meshgrid(coordinates, coordinates, indexing="ij") + kx, ky = frequency + angle = 2.0 * math.pi * (kx * xx + ky * yy) / size + phase + return amplitude * torch.cos(angle) + + +def _complex_coefficient(x: Tensor, frequency: tuple[int, int]) -> complex: + spectrum = torch.fft.fft2(x, norm="ortho") + kx, ky = frequency + value = spectrum[ky % x.shape[0], kx % x.shape[1]] + return complex(value.item()) + + +def _random_field( + size: int, + band: tuple[float, float], + generator: torch.Generator, + device: torch.device, +) -> Tensor: + noise = torch.randn((size, size), generator=generator, device=device, dtype=torch.float64) + spectrum = torch.fft.fftshift(torch.fft.fft2(noise, norm="ortho")) + mask = radial_band_mask(size, band[0], band[1], device) + field = torch.fft.ifft2(torch.fft.ifftshift(spectrum * mask), norm="ortho").real + return (field - field.mean()) / field.square().mean().sqrt().clamp_min(1e-12) + + +class SyntheticExperiment: + """Run the configured protocols for all gates and random seeds.""" + + def __init__(self, config: dict[str, Any]) -> None: + self.config = config + self.size = int(config["grid_size"]) + requested = str(config.get("device", "auto")) + if requested == "auto": + requested = "cuda" if torch.cuda.is_available() else "cpu" + self.device = torch.device(requested) + self.dtype = torch.float64 + self.seeds = [int(seed) for seed in config["seeds"]] + self.gate_names = [str(name) for name in config["gates"]] + self.gates = { + name: build_gate( + name, + channels=1, + smooth_clip_init=float(config["smooth_gate"]["clip"]), + smooth_clip_beta=float(config["smooth_gate"]["beta"]), + smooth_clip_per_channel=False, + ).to(device=self.device, dtype=self.dtype).eval() + for name in self.gate_names + } + self.rows: list[dict[str, Any]] = [] + + def _apply(self, gate_name: str, signal: Tensor) -> Tensor: + with torch.inference_mode(): + return self.gates[gate_name](signal[None, None])[0, 0] + + def _add( + self, + protocol: str, + gate: str, + seed: int, + condition: str, + **metrics: float, + ) -> None: + base: dict[str, Any] = { + "protocol": protocol, + "gate": gate, + "seed": seed, + "condition": condition, + } + base.update({name: float(value) for name, value in metrics.items()}) + self.rows.append(base) + + def run_single_tone(self) -> None: + section = self.config["single_tone"] + phases = [float(value) for value in section["phases"]] + amplitudes = [float(value) for value in section["amplitudes"]] + frequencies = [tuple(map(int, value)) for value in section["frequencies"]] + max_order = int(section["max_harmonic_order"]) + for seed in self.seeds: + phase_offset = 2.0 * math.pi * np.random.default_rng(seed).random() + for frequency in frequencies: + support = tone_mask(self.size, [frequency], self.device) + aliases = alias_mask(self.size, frequency, max_order, self.device) + for amplitude in amplitudes: + for phase_index, phase in enumerate(phases): + x = _tone( + self.size, + frequency, + amplitude, + phase + phase_offset, + self.device, + ) + input_power = fft_power(x) + for gate in self.gate_names: + y = self._apply(gate, x) + output_power = fft_power(y) + retained = energy_fraction(output_power, support) + self._add( + "single_tone", + gate, + seed, + f"f={frequency[0]}x{frequency[1]}_a={amplitude:g}_p={phase_index}", + harmonic_generation=1.0 - retained, + band_transfer=1.0 - retained, + fundamental_gain=band_gain(input_power, output_power, support), + alias_fraction=energy_fraction(output_power, aliases), + dc_fraction=energy_fraction( + output_power, + tone_mask(self.size, [(0, 0)], self.device), + ), + ) + + def run_dual_tone(self) -> None: + section = self.config["dual_tone"] + pairs = [tuple(map(int, pair)) for pair in section["frequency_pairs"]] + amplitudes = tuple(map(float, section["amplitudes"])) + for seed in self.seeds: + rng = np.random.default_rng(seed + 101) + for low, high in pairs: + low_frequency, high_frequency = (low, 0), (high, 0) + support = tone_mask(self.size, [low_frequency, high_frequency], self.device) + x = _tone(self.size, low_frequency, amplitudes[0], 2 * math.pi * rng.random(), self.device) + x += _tone(self.size, high_frequency, amplitudes[1], 2 * math.pi * rng.random(), self.device) + input_power = fft_power(x) + for gate in self.gate_names: + output_power = fft_power(self._apply(gate, x)) + retained = energy_fraction(output_power, support) + self._add( + "dual_tone", + gate, + seed, + f"f={low}+{high}", + harmonic_generation=1.0 - retained, + band_transfer=1.0 - retained, + fundamental_gain=band_gain(input_power, output_power, support), + ) + + def run_random_field(self) -> None: + bands = [tuple(map(float, value)) for value in self.config["random_field"]["bands"]] + gains: dict[tuple[str, int], list[tuple[float, float]]] = {} + for seed in self.seeds: + generator = torch.Generator(device=self.device).manual_seed(seed + 202) + for low, high in bands: + x = _random_field(self.size, (low, high), generator, self.device) + mask = radial_band_mask(self.size, low, high, self.device) + input_power = fft_power(x) + center = (low + high) / 2.0 + for gate in self.gate_names: + output_power = fft_power(self._apply(gate, x)) + gain = band_gain(input_power, output_power, mask) + gains.setdefault((gate, seed), []).append((center, gain)) + self._add( + "random_field", + gate, + seed, + f"band={low:g}-{high:g}", + band_transfer=1.0 - energy_fraction(output_power, mask), + frequency_response=gain, + ) + for (gate, seed), curve in gains.items(): + curve.sort() + base = max(curve[0][1], 1e-12) + auc = normalized_trapezoid_auc( + [point[0] for point in curve], + [point[1] / base for point in curve], + ) + self._add("frequency_auc", gate, seed, "random_field_relative", frequency_auc=auc) + + def run_phase_amplitude(self) -> None: + section = self.config["phase_amplitude"] + frequency = tuple(map(int, section["frequency"])) + phases = [float(value) for value in section["phases"]] + amplitudes = [float(value) for value in section["amplitudes"]] + support = tone_mask(self.size, [frequency], self.device) + for seed in self.seeds: + phase_offset = 2.0 * math.pi * np.random.default_rng(seed + 303).random() + for amplitude in amplitudes: + gate_values: dict[str, list[float]] = {name: [] for name in self.gate_names} + for phase_index, phase in enumerate(phases): + x = _tone(self.size, frequency, amplitude, phase + phase_offset, self.device) + for gate in self.gate_names: + value = energy_fraction(fft_power(self._apply(gate, x)), support) + gate_values[gate].append(value) + self._add( + "phase_amplitude", + gate, + seed, + f"a={amplitude:g}_p={phase_index}", + fundamental_fraction=value, + ) + for gate, values in gate_values.items(): + mean = float(np.mean(values)) + sensitivity = float(np.std(values) / max(mean, 1e-12)) + self._add( + "phase_sensitivity", + gate, + seed, + f"a={amplitude:g}", + phase_sensitivity=sensitivity, + ) + + def run_cue_conflict(self) -> None: + section = self.config["cue_conflict"] + low_frequency = tuple(map(int, section["low_frequency"])) + high_frequency = tuple(map(int, section["high_frequency"])) + ratios = [float(value) for value in section["low_to_high_ratios"]] + high_amplitude = float(section["high_amplitude"]) + low_mask = tone_mask(self.size, [low_frequency], self.device) + high_mask = tone_mask(self.size, [high_frequency], self.device) + preference_curves: dict[tuple[str, int], list[tuple[float, float]]] = {} + for seed in self.seeds: + rng = np.random.default_rng(seed + 404) + phase_low, phase_high = 2 * math.pi * rng.random(2) + high = _tone(self.size, high_frequency, high_amplitude, phase_high, self.device) + for ratio in ratios: + low = _tone( + self.size, + low_frequency, + ratio * high_amplitude, + phase_low, + self.device, + ) + for gate in self.gate_names: + output = self._apply(gate, low + high) + flipped = self._apply(gate, -low + high) + power, flipped_power = fft_power(output), fft_power(flipped) + low_energy = float(power[low_mask].sum().item()) + high_energy = float(power[high_mask].sum().item()) + cue_energy = low_energy + high_energy + output_energy = float(power.sum().item()) + high_flip = float(flipped_power[high_mask].sum().item()) + if cue_energy <= 1e-10 * max(output_energy, 1e-12): + # Some even gates (notably x^2) remove both original + # cue frequencies. A preference between two numerical + # zeros is not an identifiable quantity. + preference = math.nan + modulation = math.nan + phase_shift = math.nan + else: + preference = high_energy / cue_energy + modulation = abs(high_flip - high_energy) / max( + 0.5 * (high_flip + high_energy), 1e-12 + ) + coefficient = _complex_coefficient(output, high_frequency) + flipped_coefficient = _complex_coefficient(flipped, high_frequency) + phase_shift = abs(np.angle(coefficient / (flipped_coefficient + 1e-30))) + preference_curves.setdefault((gate, seed), []).append( + (math.log2(ratio), preference) + ) + self._add( + "cue_conflict", + gate, + seed, + f"low_high={ratio:g}", + high_frequency_preference=preference, + phase_cross_modulation=modulation, + high_readout_phase_shift=phase_shift, + ) + for (gate, seed), curve in preference_curves.items(): + curve.sort() + self._add( + "cue_conflict_auc", + gate, + seed, + "log2_amplitude_ratio", + cue_preference_auc=normalized_trapezoid_auc( + [point[0] for point in curve], [point[1] for point in curve] + ), + ) + + def run(self) -> list[dict[str, Any]]: + protocols: dict[str, Callable[[], None]] = { + "single_tone": self.run_single_tone, + "dual_tone": self.run_dual_tone, + "random_field": self.run_random_field, + "phase_amplitude": self.run_phase_amplitude, + "cue_conflict": self.run_cue_conflict, + } + for name in self.config["protocols"]: + if name not in protocols: + raise ValueError(f"unknown protocol: {name}") + protocols[name]() + return self.rows diff --git a/gmnet/deploy/e4_alignment_20260716/batch_manifest.json b/gmnet/deploy/e4_alignment_20260716/batch_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..a0fc7b80d3fac9ee2898bff6204d8b42e3174570 --- /dev/null +++ b/gmnet/deploy/e4_alignment_20260716/batch_manifest.json @@ -0,0 +1,135 @@ +{ + "claim_restrictions": [ + "Report fixed final checkpoints even when the direction is unfavorable.", + "The historical baseline has retrospective-unverified source provenance.", + "Effects at or below 0.3 percentage points are descriptive near-baseline results.", + "Effects above 1.0 percentage point are material single-seed signals, not significance claims.", + "High post-training channel coherence indicates adaptation, not maintained misalignment." + ], + "code_manifest_path": "configs/code_manifests/e4_alignment_20260716.json", + "code_manifest_sha256": "fa1a6ba00c82619dbd51b9af61489a34326b635978d83ef948584e45f93cddbc", + "code_sha256": "4a62bc48370247d882196cd9afc1a0f1629a5bbfd522c3f599ffaf0c1187641f", + "data": { + "canonical_manifest_sha256": "bb70bc9f530db6bb24f70e648624b35281bfbc76a57775d589a2e0209dd98661", + "expected_archive_bytes": 161381969920, + "expected_train_samples": 1281167, + "expected_val_samples": 50000, + "runtime_root": "/tmp/gmnet_data/imagenet-1k", + "source_archive_uri": "s3://snap-research-cv-code/ywang29/datasets/imagenet-1k/imagenet-1k.tar", + "train_sample_index_sha256": "e74104e28ef79fff114e729e81d050a7b4f0c294c4d82345bad13c320d7255b2", + "train_sampled_content_sha256": "dea27b5dbcb5f110ed47c075d473ebd0f6aefc446b45ab1e62d8246f2a153798", + "val_sample_index_sha256": "5ed16b5cd3ebd64e90cd7a8380b4e19d4c0d82eedcca3489dfa29313ce88d6f6", + "val_sampled_content_sha256": "d80a57419bc9396df7c01e29a2b17698c02c3a9a68dc4006a1fe87ef129ed166" + }, + "generated_by": "/nfs/ywang29/GmNet/journal_exp/scripts/generate_e4_alignment_deploy.py", + "historical_baseline": { + "acceptance": "accepted_historical_seed0_alias", + "code_provenance": "retrospective_unverified", + "evidence_id": "legacy_relu6_s3_seed0", + "expected": { + "checkpoint_last.pt": "e03401ab71852656b7e62d82376eb628efdcc158d310088afd39e0e6b98d1930", + "config_resolved.yaml": "d669c6c6f57815b9e3ead42a99c160ba399ef15df40fdd845f899c3b97d396d5", + "config_source.yaml": "0460961aa6de4c1127d03abafbe30b24178d90e6ca5d8b84d4201d1ccbab6a64", + "data_manifest.json": "e130879b003a8b4f6630afc9e2cf606789cb722802df742e046ac538e183ce40", + "official_eval/checks.json": "7b1010999d913ab5e4ae267279cfab2d6172b60b9d4b29402a2b374a40145f84", + "official_eval/per_sample.npz": "3f719366080c2d510efff6bf318201dc5ebd20fa37f5bc16947efabff26e0f31", + "official_eval/results.json": "614bf87d7fd9f63ef2512c121e8a452ab85ea6b06f4a9237e7258db7dbd6129c" + }, + "official": { + "artifacts_sha256": "33a79b915eedbbf45c2e31ccf69595a23685b757fcb66ab080281132e729e6be", + "checkpoint_config_sha256": "a914c8e570ffb0cc953afff81c49dd76bd5b606beca95fdbd2c9445119c647c5", + "gate_type": "relu6_self", + "model_state_schema_sha256": "352cb771eaf4123fb9364dfd25d0151f9c2e6fa5493b989759091819f8981c99", + "parameter_count": 7791544, + "run_name": "e0_s3_seed0", + "state_tensor_count": 365, + "top1": 78.746 + }, + "run_dir": "/nfs/ywang29/GmNet/runs/e0_s3_seed0", + "semantic_projection_sha256": "63c040674fd48ef97272392a4fb52e46534f291a43a979c1077a1ac0904deddd", + "target_config": "configs/e0_baseline/imagenet_gmnet_s3.yaml" + }, + "known_before_registration": { + "fixed_c6_top1": 78.798, + "frozen_interventions_are_distribution_shifted": true, + "learned_smooth_top1": 78.67, + "no_gate_top1": 14.376, + "paper_recipe_relu6_top1": 78.746, + "release_recipe_paper_bn_top1": 79.158, + "relu6_only_top1": 78.122 + }, + "policy": { + "approval_marker_required_for_every_task": true, + "approval_requires_8gpu_strict_resume_smoke": true, + "baseline_recipe": "paper-supplementary-table8-v1", + "baseline_top1": 78.746, + "block_seed_stride": 10007, + "checkpoint_policy": "fixed_last", + "epochs": 300, + "eta_class": "greater_than_12h", + "gpus_per_job": 8, + "intervention_seed": 41041, + "launchjob_submitted_by_generator": false, + "model_variant": "s3", + "output_lock": "nonblocking_flock", + "post_eval": "strict_official", + "resume": "auto", + "seed": 0, + "seed_replication_in_scope": false + }, + "protocol_id": "imagenet-e4-alignment-single-seed-20260716", + "protocol_sha256": "e3133bffd81cb950c91bad469e8e19f0305e9cdee1f09d97298d726740dc51ca", + "protocol_source": "/nfs/ywang29/GmNet/journal_exp/configs/e4_alignment_protocol.yaml", + "relationship_to_prior_work": "Post-hoc, single-seed exploratory mechanism follow-up. These tasks do not enter the ImageNet-v2 Holm family and do not provide seed-level inference.", + "run_root": "/nfs/ywang29/GmNet/runs/e4_alignment", + "schema_version": 1, + "smoke_evidence_path": "/nfs/ywang29/GmNet/depoly/e4_alignment_20260716/smoke_evidence.json", + "smoke_evidence_sha256": "ea4b807ee0fdf78a7c4e92523d698e8ba64386e86c418997f170761d34888ab6", + "source_template": "/nfs/ywang29/LongLive/deploy/jul11_vgp/j11_vgp01_base.yaml", + "source_template_sha256": "1c84a6a1219bbd6a68c73aa673912d8154065f020083581089b5b615fd1459a9", + "summary": { + "approved_count": 2, + "seed_count": 1, + "task_count": 2 + }, + "tasks": [ + { + "approval_path": "/nfs/ywang29/GmNet/depoly/e4_alignment_20260716/approvals/e4a_s3_stop_gradient_seed0.json", + "config_path": "configs/e4_alignment/imagenet_gmnet_s3_stop_gradient.yaml", + "contrast": "stop-gradient minus historical aligned ReLU6 self-gate", + "deploy_path": "/nfs/ywang29/GmNet/depoly/e4_alignment_20260716/e4a_s3_stop_gradient_seed0.yaml", + "eta_class": ">12h", + "experiment": "E4", + "gate": "relu6_self", + "gate_intervention": "stop_gradient", + "gate_intervention_seed": 41041, + "job_name": "gmnet-e4a-s3-stop-gradient-seed0", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/e4_alignment/e4a_s3_stop_gradient_seed0", + "question": "Does the derivative through the gate branch materially aid optimization?", + "role": "matched_alignment_retraining", + "seed": 0, + "status": "ready_after_smoke", + "task_id": "e4a_s3_stop_gradient_seed0" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/e4_alignment_20260716/approvals/e4a_s3_channel_derangement_seed0.json", + "config_path": "configs/e4_alignment/imagenet_gmnet_s3_channel_derangement.yaml", + "contrast": "channel-deranged minus historical aligned ReLU6 self-gate", + "deploy_path": "/nfs/ywang29/GmNet/depoly/e4_alignment_20260716/e4a_s3_channel_derangement_seed0.yaml", + "eta_class": ">12h", + "experiment": "E4", + "gate": "relu6_self", + "gate_intervention": "channel_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-e4a-s3-channel-derangement-seed0", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/e4_alignment/e4a_s3_channel_derangement_seed0", + "question": "Can the network retain accuracy when feature and gate channels are persistently mismatched?", + "role": "matched_alignment_retraining", + "seed": 0, + "status": "ready_after_smoke", + "task_id": "e4a_s3_channel_derangement_seed0" + } + ] +} diff --git a/gmnet/deploy/e4_alignment_20260716/e4a_s3_channel_derangement_seed0.yaml b/gmnet/deploy/e4_alignment_20260716/e4a_s3_channel_derangement_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..79f8f46e2915e48003020a2af595554629253a0a --- /dev/null +++ b/gmnet/deploy/e4_alignment_20260716/e4a_s3_channel_derangement_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by journal_exp/scripts/generate_e4_alignment_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/journal_exp && chmod +x ./scripts/*.sh && INSTALL_DEV=0 bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_e4_alignment_deploy.py --verify-task e4a_s3_channel_derangement_seed0 --require-approval && KEEP_ARCHIVE=0 bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_e4_alignment_deploy.py --verify-task e4a_s3_channel_derangement_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/journal_exp && /tmp/gmnet_venv/bin/python scripts/generate_e4_alignment_deploy.py --verify-task e4a_s3_channel_derangement_seed0 --require-approval && RUN_NAME=e4a_s3_channel_derangement_seed0 CONFIG_PATH=configs/e4_alignment/imagenet_gmnet_s3_channel_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/e4_alignment/e4a_s3_channel_derangement_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 CODE_MANIFEST_PATH=configs/code_manifests/e4_alignment_20260716.json bash scripts/run_e4_alignment.sh + jobs: + - name: gmnet-e4a-s3-channel-derangement-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/e4_alignment_20260716/e4a_s3_stop_gradient_seed0.yaml b/gmnet/deploy/e4_alignment_20260716/e4a_s3_stop_gradient_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d81cc81fb5495d7b230b126defc2c8c79c092d0e --- /dev/null +++ b/gmnet/deploy/e4_alignment_20260716/e4a_s3_stop_gradient_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by journal_exp/scripts/generate_e4_alignment_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/journal_exp && chmod +x ./scripts/*.sh && INSTALL_DEV=0 bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_e4_alignment_deploy.py --verify-task e4a_s3_stop_gradient_seed0 --require-approval && KEEP_ARCHIVE=0 bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_e4_alignment_deploy.py --verify-task e4a_s3_stop_gradient_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/journal_exp && /tmp/gmnet_venv/bin/python scripts/generate_e4_alignment_deploy.py --verify-task e4a_s3_stop_gradient_seed0 --require-approval && RUN_NAME=e4a_s3_stop_gradient_seed0 CONFIG_PATH=configs/e4_alignment/imagenet_gmnet_s3_stop_gradient.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/e4_alignment/e4a_s3_stop_gradient_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 CODE_MANIFEST_PATH=configs/code_manifests/e4_alignment_20260716.json bash scripts/run_e4_alignment.sh + jobs: + - name: gmnet-e4a-s3-stop-gradient-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/e4_alignment_20260716/smoke_evidence.json b/gmnet/deploy/e4_alignment_20260716/smoke_evidence.json new file mode 100644 index 0000000000000000000000000000000000000000..147c0d1bab69ffe477058322828b92972e9d6fdb --- /dev/null +++ b/gmnet/deploy/e4_alignment_20260716/smoke_evidence.json @@ -0,0 +1,488 @@ +{ + "audited_at_utc": "2026-07-16T19:19:52.492809+00:00", + "code_manifest_path": "configs/code_manifests/e4_alignment_20260716.json", + "code_manifest_sha256": "fa1a6ba00c82619dbd51b9af61489a34326b635978d83ef948584e45f93cddbc", + "code_sha256": "4a62bc48370247d882196cd9afc1a0f1629a5bbfd522c3f599ffaf0c1187641f", + "protocol_id": "imagenet-e4-alignment-single-seed-20260716", + "schema_version": 1, + "shared_topology": { + "block_count": 16, + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "smoke_root": "/tmp/gmnet_runs/e4_alignment_smoke", + "status": "passed", + "strict_resume": true, + "tasks": { + "e4a_s3_channel_derangement_seed0": { + "artifacts_sha256": { + "checkpoint_epoch0.pt": "835e9a7d862c9c5a6ed6cfca705e3b86ad1107144b5cfcab4598f6c29c1a614d", + "checkpoint_last.pt": "c1af3664926c9197b795457719a023505bfb3d8e529632ed67b9ea18c71518f9", + "config_resolved.yaml": "47813a156dc164fc95732bd23864183a0a2c1fc40a8764f266999a710b0ffe89", + "config_source.yaml": "b58c9d149d4fefa60af3e168361b8a1820ebe1151afd2a91c4762a7a2d0de3ec", + "data_manifest.json": "4564bd087419effa1b4942a540823d45bf8f7aa6c60d6815196ef01c374022a7", + "metrics.jsonl": "070dbd446b9b55c74e8b6b1b39503d72921773a171342ef6c8995aa4380821f9" + }, + "checkpoint_epoch0_sha256": "835e9a7d862c9c5a6ed6cfca705e3b86ad1107144b5cfcab4598f6c29c1a614d", + "checkpoint_last_sha256": "c1af3664926c9197b795457719a023505bfb3d8e529632ed67b9ea18c71518f9", + "config_fingerprint": "f8eba40bc5c6d94f73a09c457445df8afed6e70710eee295c6c81014660069c8", + "data_manifest_sha256": "27f53b86f5f7b6e46342213d815981b77596de103a95e291a6a3b7d939ee9632", + "epoch0": { + "epoch": 0, + "global_step": 1, + "training_complete": false + }, + "final": { + "epoch": 1, + "global_step": 2, + "training_complete": true + }, + "gate_intervention": "channel_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "block_count": 16, + "block_seed_stride": 10007, + "blocks": [ + { + "channels": 120, + "fixed_points": 0, + "global_block_index": 0, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "119f2202e3052dd65635c59c8693b9e10787820620c3df5d55a66ad36bda5aac", + "seed": 41041, + "stage_block_index": 0, + "stage_index": 0 + }, + { + "channels": 120, + "fixed_points": 0, + "global_block_index": 1, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "65aa7c0d25e252cc1ae98236b1864dd7c39bd2243bb777e6bd03cf81b706d8c6", + "seed": 51048, + "stage_block_index": 1, + "stage_index": 0 + }, + { + "channels": 240, + "fixed_points": 0, + "global_block_index": 2, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "d83766a3a126dd8d1e6d4ec11cea5f4bacea6049f15cd44a4167005d68e4f338", + "seed": 61055, + "stage_block_index": 0, + "stage_index": 1 + }, + { + "channels": 240, + "fixed_points": 0, + "global_block_index": 3, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "b4065e708c8dbb0d1e29aefa0b238780c0fabb7de8f66315ac7207d2b9b7020b", + "seed": 71062, + "stage_block_index": 1, + "stage_index": 1 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 4, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "c1add1325f039397e1b126e0d807b2ab83ea91605cfeeec884f284a110203a24", + "seed": 81069, + "stage_block_index": 0, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 5, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "e549c10b225546dcd5c60c60dac154ca3d599a20ee6e6f3d76e617e6cc26de3c", + "seed": 91076, + "stage_block_index": 1, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 6, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "63c3dfebe9204eefc9d0adfd1e432270bfb0c6a30b8a230f623ef92e8b0013cb", + "seed": 101083, + "stage_block_index": 2, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 7, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "29bbd34cd1b7403e2f3bbaf03f1e73ceab88b6d672b88044d318fc844f07e039", + "seed": 111090, + "stage_block_index": 3, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 8, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "38d10e3ce9e2e97701db148154ef6904c63ca8572bc254e908e46bee15c3d1d5", + "seed": 121097, + "stage_block_index": 4, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 9, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "7c7dfdc76eea57e490e9f58097bd5a33c8dab1ed57e305c40800dce7b0c7a1fc", + "seed": 131104, + "stage_block_index": 5, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 10, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "fe99e4578cbcdf167c185d1e32f23efc5a4dcbe501e03198cde79fd8454da2d3", + "seed": 141111, + "stage_block_index": 6, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 11, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "6f4374ecd86e121c30725a201b0dee38b90e62b11872ad50d21b14e899ec68bc", + "seed": 151118, + "stage_block_index": 7, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 12, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "fdbecf663d6296b14dff04e75ebc0bfc8011569971b1c142ac18b372831c0256", + "seed": 161125, + "stage_block_index": 8, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": 0, + "global_block_index": 13, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "b7b74a17450be3d8046109291f41613ee0fa1486ef4949fc784ce75a756b074a", + "seed": 171132, + "stage_block_index": 9, + "stage_index": 2 + }, + { + "channels": 640, + "fixed_points": 0, + "global_block_index": 14, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "ea96ebcfdfadb28872f3945d593813dda28b0b07554dc0496b9e2aa0429b374b", + "seed": 181139, + "stage_block_index": 0, + "stage_index": 3 + }, + { + "channels": 640, + "fixed_points": 0, + "global_block_index": 15, + "is_bijection": true, + "mode": "channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "a52b7dcc5f7f9f2309b5381a846e2205d79c70ff3052f8c4c49e44d3fa552fe7", + "seed": 191146, + "stage_block_index": 1, + "stage_index": 3 + } + ], + "intervention_manifest_sha256": "8a8693e49d73139decd721fc357693e839d1f5fe4667fdc484420888989f3fe8", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "resume_verified": true, + "run_name": "e4a_s3_channel_derangement_seed0", + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4_channel_derangement.yaml", + "smoke_run_dir": "/tmp/gmnet_runs/e4_alignment_smoke/channel_derangement", + "training_complete": true + }, + "e4a_s3_stop_gradient_seed0": { + "artifacts_sha256": { + "checkpoint_epoch0.pt": "1d5c4db7be326dfa9b75e06729d7f1bf0697f0dd124eaec4f054be157c6f9293", + "checkpoint_last.pt": "ed72fce65e85814604816ebaa218dc05426a6eddfe039a7d27073678598bf0d9", + "config_resolved.yaml": "38e468f8e8b9ba8ba020738fe46071c8e9ab073a08f72a2e49254cecd473fd4b", + "config_source.yaml": "bc5c9ffa5208f63e153d3e10ae049b097b196684f9166718679154698803c96d", + "data_manifest.json": "4564bd087419effa1b4942a540823d45bf8f7aa6c60d6815196ef01c374022a7", + "metrics.jsonl": "3777443c13d253410714f4ed151383e919a794348cbb804689e2c64c4b37a588" + }, + "checkpoint_epoch0_sha256": "1d5c4db7be326dfa9b75e06729d7f1bf0697f0dd124eaec4f054be157c6f9293", + "checkpoint_last_sha256": "ed72fce65e85814604816ebaa218dc05426a6eddfe039a7d27073678598bf0d9", + "config_fingerprint": "938d32fe9f48365e3de9fe238328271adb5d6bd9635682f3ee7a5bf11f8c136b", + "data_manifest_sha256": "27f53b86f5f7b6e46342213d815981b77596de103a95e291a6a3b7d939ee9632", + "epoch0": { + "epoch": 0, + "global_step": 1, + "training_complete": false + }, + "final": { + "epoch": 1, + "global_step": 2, + "training_complete": true + }, + "gate_intervention": "stop_gradient", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "block_count": 16, + "block_seed_stride": 10007, + "blocks": [ + { + "channels": 120, + "fixed_points": null, + "global_block_index": 0, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 41041, + "stage_block_index": 0, + "stage_index": 0 + }, + { + "channels": 120, + "fixed_points": null, + "global_block_index": 1, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 51048, + "stage_block_index": 1, + "stage_index": 0 + }, + { + "channels": 240, + "fixed_points": null, + "global_block_index": 2, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 61055, + "stage_block_index": 0, + "stage_index": 1 + }, + { + "channels": 240, + "fixed_points": null, + "global_block_index": 3, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 71062, + "stage_block_index": 1, + "stage_index": 1 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 4, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 81069, + "stage_block_index": 0, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 5, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 91076, + "stage_block_index": 1, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 6, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 101083, + "stage_block_index": 2, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 7, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 111090, + "stage_block_index": 3, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 8, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 121097, + "stage_block_index": 4, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 9, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 131104, + "stage_block_index": 5, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 10, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 141111, + "stage_block_index": 6, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 11, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 151118, + "stage_block_index": 7, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 12, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 161125, + "stage_block_index": 8, + "stage_index": 2 + }, + { + "channels": 480, + "fixed_points": null, + "global_block_index": 13, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 171132, + "stage_block_index": 9, + "stage_index": 2 + }, + { + "channels": 640, + "fixed_points": null, + "global_block_index": 14, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 181139, + "stage_block_index": 0, + "stage_index": 3 + }, + { + "channels": 640, + "fixed_points": null, + "global_block_index": 15, + "is_bijection": null, + "mode": "stop_gradient", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 191146, + "stage_block_index": 1, + "stage_index": 3 + } + ], + "intervention_manifest_sha256": "94f191df18e773310c6d7f3e11ad4118d620f051229f34d88b0cc77bf26666ed", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "resume_verified": true, + "run_name": "e4a_s3_stop_gradient_seed0", + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4_stop_gradient.yaml", + "smoke_run_dir": "/tmp/gmnet_runs/e4_alignment_smoke/stop_gradient", + "training_complete": true + } + }, + "world_size": 8 +} diff --git a/gmnet/deploy/e4_imagenet_spectral_20260718/deploy_manifest.json b/gmnet/deploy/e4_imagenet_spectral_20260718/deploy_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..b7285f7b102e9a647f4f8b0c5c2c759d6f585e72 --- /dev/null +++ b/gmnet/deploy/e4_imagenet_spectral_20260718/deploy_manifest.json @@ -0,0 +1,69 @@ +{ + "aggregator": "/nfs/ywang29/GmNet/e4_spectral_audit/scripts/aggregate_and_validate.py", + "aggregator_sha256": "9027155739ccbeba1150d5bdaa6d94930d8169ed4d4edb5c5fe2af2bd655b5e5", + "artifacts_sha256": { + "alignment_snapshot_gmnet": "5291156084aaf72936d1f8896057e7e606f74ef05aed856df4940e4838dbe3ac", + "alignment_snapshot_init": "9227138f9cd0e0110f57bad21b9302d8b5daa51cd63246e37c8ff2878eb2715e", + "alignment_snapshot_manifest": "f590f522f8e9181eaa26b1688ed5d59a0598b9d4188fcd10f14516d24b070b19", + "alignment_snapshot_reconstructor": "c8b93a0f96689f09167f6897a77d7ad0331894d87272fb3cf5d0150350e2a6aa", + "cross_task_aggregator": "9027155739ccbeba1150d5bdaa6d94930d8169ed4d4edb5c5fe2af2bd655b5e5", + "frozen_subset": "52a3e937d8862b19d6352e60833a864aa5bea376436acd2290415cac58232adb", + "generator": "72c185b2aa2a4bb8c3bf8ef843404916d2026e7d99ac047bec8746d6004cddd5", + "input_manifest": "8b32da7c33f6b578dd2b5359d727afe313462be0c0040212a2640755ad2fadf7", + "input_verifier": "7b0bfa6ce5a8b2ef43766b68f36d21e027800b175d9f0b0f4dd3f09129325ef5", + "longlive_init_run": "037181feb9984bbd7618df116d25324286137427441f9995d7d0dfb8556e6c90", + "parallel_wrapper": "88bcfe42f5ffd1876061f6e17756b6a76ce57e38648d7d785870446d3384af61", + "protocol": "b66f0aa2f620135584483fb0057fe6fec9a55b4b501b08fd26065034a892b4a2", + "runner": "2b56465319e651716170fbaa58d43f14924d70f694b0a273ab63255c2697edfe", + "setup_env": "748e5fdc0e46e508bf77796e284ba36e5e6afec7309329339268ebaf4d1cfc06", + "source_equivalence_test": "3b695ed53e11ae4a1de0e9c60e8991c1e260d8de7394b4a8a8bd3141a3cdb45d", + "stage_imagenet": "b11b47cc4f707c14cb9d329b772c9dd29232cf4ce32150500ba0ec9074200bec", + "static_checker": "9f71d5ec8ced0be27ddfefd5891f650aadea77322d028697bb9bf4dd124366b9" + }, + "audit_contract": { + "batch_size": 256, + "lowpass_cutoffs": [ + 0.125, + 0.25, + 0.5, + 0.75 + ], + "max_eval_samples": 50000, + "precision": "float32", + "spectral_samples": 4096, + "workers_per_arm": 8 + }, + "deploy_yaml": "/nfs/ywang29/GmNet/depoly/e4_imagenet_spectral_20260718/e4_matched_spectral_5arms_seed0.yaml", + "docker_image": "763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2", + "job_name": "gmnet-e4-spectral-5arm-seed0", + "launchjob_submitted_by_generator": false, + "output_root": "/nfs/ywang29/GmNet/e4_spectral_audit/results/matched_5arm_seed0_20260718", + "protocol_id": "gmnet-e4-imagenet-matched-spectral-v1", + "protocol_path": "/nfs/ywang29/GmNet/e4_spectral_audit/protocol/IMAGENET_MATCHED_SPECTRAL_AUDIT_PROTOCOL.md", + "protocol_sha256": "b66f0aa2f620135584483fb0057fe6fec9a55b4b501b08fd26065034a892b4a2", + "resource_contract": { + "canonical_arms": 5, + "cpu_num": "88", + "gpu_assignment": { + "B": 0, + "B_order1": 7, + "C": 3, + "D": 1, + "D_order1": 5, + "D_order2": 6, + "S": 2, + "SC": 4 + }, + "gpu_memory": "80", + "gpu_num": "8", + "gpu_type": "nvidia-tesla-a100", + "memory": "880.0", + "parallel_tasks": 8 + }, + "runner": "/nfs/ywang29/GmNet/e4_spectral_audit/code/run_e4_imagenet_spectral_audit.py", + "runner_sha256": "2b56465319e651716170fbaa58d43f14924d70f694b0a273ab63255c2697edfe", + "schema_version": 1, + "source_template": "/nfs/ywang29/LongLive/deploy/jul11_vgp/j11_vgp01_base.yaml", + "source_template_sha256": "1c84a6a1219bbd6a68c73aa673912d8154065f020083581089b5b615fd1459a9", + "status": "ready_not_submitted" +} diff --git a/gmnet/deploy/e4_imagenet_spectral_20260718/e4_matched_spectral_5arms_seed0.yaml b/gmnet/deploy/e4_imagenet_spectral_20260718/e4_matched_spectral_5arms_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1bbb48461421e187a49252bea4523c09b4f78a80 --- /dev/null +++ b/gmnet/deploy/e4_imagenet_spectral_20260718/e4_matched_spectral_5arms_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by e4_spectral_audit/scripts/generate_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/journal_exp && chmod +x ./scripts/setup_env.sh ./scripts/stage_imagenet.sh /nfs/ywang29/GmNet/e4_spectral_audit/scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python ./scripts/generate_e4_mechanism_followup_deploy.py --check && /tmp/gmnet_venv/bin/python /nfs/ywang29/GmNet/e4_spectral_audit/scripts/generate_deploy.py --check && /tmp/gmnet_venv/bin/python /nfs/ywang29/GmNet/e4_spectral_audit/scripts/static_check.py --require-generated && /tmp/gmnet_venv/bin/python /nfs/ywang29/GmNet/e4_spectral_audit/scripts/aggregate_and_validate.py --self-test && /tmp/gmnet_venv/bin/python /nfs/ywang29/GmNet/e4_spectral_audit/scripts/reconstruct_alignment_snapshot.py --check && /tmp/gmnet_venv/bin/python /nfs/ywang29/GmNet/e4_spectral_audit/scripts/test_alignment_source_equivalence.py --output /tmp/gmnet_alignment_equivalence_torch29.json && /tmp/gmnet_venv/bin/python /nfs/ywang29/GmNet/e4_spectral_audit/scripts/verify_inputs.py --manifest /nfs/ywang29/GmNet/e4_spectral_audit/input_manifest.json --runner /nfs/ywang29/GmNet/e4_spectral_audit/code/run_e4_imagenet_spectral_audit.py --runner-sha256 2b56465319e651716170fbaa58d43f14924d70f694b0a273ab63255c2697edfe --runtime --equivalence /tmp/gmnet_alignment_equivalence_torch29.json && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python /nfs/ywang29/GmNet/e4_spectral_audit/scripts/verify_inputs.py --manifest /nfs/ywang29/GmNet/e4_spectral_audit/input_manifest.json --runner /nfs/ywang29/GmNet/e4_spectral_audit/code/run_e4_imagenet_spectral_audit.py --runner-sha256 2b56465319e651716170fbaa58d43f14924d70f694b0a273ab63255c2697edfe --runtime --data-root /tmp/gmnet_data/imagenet-1k --equivalence /tmp/gmnet_alignment_equivalence_torch29.json + command: cd /nfs/ywang29/GmNet/e4_spectral_audit && AUDIT_ROOT=/nfs/ywang29/GmNet/e4_spectral_audit MANIFEST_PATH=/nfs/ywang29/GmNet/e4_spectral_audit/input_manifest.json SPECTRAL_RUNNER=/nfs/ywang29/GmNet/e4_spectral_audit/code/run_e4_imagenet_spectral_audit.py EXPECTED_RUNNER_SHA256=2b56465319e651716170fbaa58d43f14924d70f694b0a273ab63255c2697edfe EXPECTED_AGGREGATOR_SHA256=9027155739ccbeba1150d5bdaa6d94930d8169ed4d4edb5c5fe2af2bd655b5e5 DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_ROOT=/nfs/ywang29/GmNet/e4_spectral_audit/results/matched_5arm_seed0_20260718 VENV_DIR=/tmp/gmnet_venv bash /nfs/ywang29/GmNet/e4_spectral_audit/scripts/run_parallel_5arms.sh + jobs: + - name: gmnet-e4-spectral-5arm-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/e4_mechanism_followup_20260717/batch_manifest.json b/gmnet/deploy/e4_mechanism_followup_20260717/batch_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..5f3d143d03c77b1abf2260907af33520eb501f26 --- /dev/null +++ b/gmnet/deploy/e4_mechanism_followup_20260717/batch_manifest.json @@ -0,0 +1,544 @@ +{ + "claim_restrictions": [ + "Report fixed final checkpoints even when the direction is unfavorable.", + "Use the current-code baseline in this batch as the primary numerical reference.", + "The batch-derangement arm tests local-batch sample dependence, not global cross-rank pairing.", + "The combined arm estimates interaction descriptively; one seed does not identify population-level additivity.", + "Effects at or below 0.3 percentage points are descriptive near-baseline results.", + "Effects above 1.0 percentage point are material single-seed signals, not significance claims." + ], + "code_manifest_path": "configs/code_manifests/e4_mechanism_followup_20260717.json", + "code_manifest_sha256": "e354339142ffc72e669234a9f297113a64e5294ce8ff37dd658e62f723f0b239", + "code_sha256": "f6bd434a2ac86c772f2e23683431f3bb7ccb06f539558682a3bea6464bacebf9", + "data": { + "canonical_manifest_sha256": "bb70bc9f530db6bb24f70e648624b35281bfbc76a57775d589a2e0209dd98661", + "expected_archive_bytes": 161381969920, + "expected_train_samples": 1281167, + "expected_val_samples": 50000, + "runtime_root": "/tmp/gmnet_data/imagenet-1k", + "source_archive_uri": "s3://snap-research-cv-code/ywang29/datasets/imagenet-1k/imagenet-1k.tar", + "train_sample_index_sha256": "e74104e28ef79fff114e729e81d050a7b4f0c294c4d82345bad13c320d7255b2", + "train_sampled_content_sha256": "dea27b5dbcb5f110ed47c075d473ebd0f6aefc446b45ab1e62d8246f2a153798", + "val_sample_index_sha256": "5ed16b5cd3ebd64e90cd7a8380b4e19d4c0d82eedcca3489dfa29313ce88d6f6", + "val_sampled_content_sha256": "d80a57419bc9396df7c01e29a2b17698c02c3a9a68dc4006a1fe87ef129ed166" + }, + "formal_channel_reference": { + "block_count": 17, + "block_identities": [ + { + "global_block_index": 0, + "permutation_sha256": "81c39f5e5d80eb8ecee0defe76443012e14e1ff393ed1b75803e7f4076f3cd2c", + "seed": 41041 + }, + { + "global_block_index": 1, + "permutation_sha256": "5afa5a19520c8a590c6040934a902279da0c89035b78139d84e9be8a9d4fc506", + "seed": 51048 + }, + { + "global_block_index": 2, + "permutation_sha256": "5d85daea4b5427bec16fca0b3f25347d245ff530efc5edfb574bdef5e8ce39f8", + "seed": 61055 + }, + { + "global_block_index": 3, + "permutation_sha256": "cc6c8357bbee74c2248dcc63e412ca77d0697c57151105682a6f2096c6feae24", + "seed": 71062 + }, + { + "global_block_index": 4, + "permutation_sha256": "09180ef61cbaa6bb46ca2c94c69e52164d11ea37f5ebbf247c2da8d79acac300", + "seed": 81069 + }, + { + "global_block_index": 5, + "permutation_sha256": "3e1893ed17aef0fe295951867d2bd952afde8bb62f9ce8db80f50580f3de6699", + "seed": 91076 + }, + { + "global_block_index": 6, + "permutation_sha256": "f2df260887846e17c4fcd53e4afcdbab8d9d6cb37012f4e613c4c10303da42de", + "seed": 101083 + }, + { + "global_block_index": 7, + "permutation_sha256": "6d278618dee2daf52ceff0c9f27e40d55ea940e5b44a91217593f676935c797d", + "seed": 111090 + }, + { + "global_block_index": 8, + "permutation_sha256": "007992cc0fb1c4e5d57d2c8ec07017dc67a5605be4be9aee664ee17efd217e84", + "seed": 121097 + }, + { + "global_block_index": 9, + "permutation_sha256": "6d9035619249ba965704732037f696359eaf8c9aca96005acdafb7acb16928aa", + "seed": 131104 + }, + { + "global_block_index": 10, + "permutation_sha256": "46026d5db68992fdc6d1795b6f21ab4e624607b80c5d74a94d100a97c14901a9", + "seed": 141111 + }, + { + "global_block_index": 11, + "permutation_sha256": "d1fc5ebffee98ea376518355ed960e9732074b7d93144756e5ad4552a7a93334", + "seed": 151118 + }, + { + "global_block_index": 12, + "permutation_sha256": "5d827b1b3884b67cea799768b01f6bbad09a2b19cf470a41e3ecc85efaa5631a", + "seed": 161125 + }, + { + "global_block_index": 13, + "permutation_sha256": "9b43e24d6c96f03f20a7c7797efb1d8ee3e3dc96ddef00084f7873fec012263a", + "seed": 171132 + }, + { + "global_block_index": 14, + "permutation_sha256": "3e1f04e3fe8302ee2faafa6244192dc4d752dcbce91b937aa78b2abf57b67a1c", + "seed": 181139 + }, + { + "global_block_index": 15, + "permutation_sha256": "8593429cc7b72edb9bb0590733ca58481664d313cbe0bf9fa5f563b5d15e7f66", + "seed": 191146 + }, + { + "global_block_index": 16, + "permutation_sha256": "64e7c26b4a26a4e865cd7adcc635cbf780655d4aa933cdf4b7b8cacf3d90810b", + "seed": 201153 + } + ], + "block_seed_stride": 10007, + "combined_mode": "stop_gradient_channel_derangement", + "intervention_seed": 41041, + "matches_completed_e4_channel_algorithm": true, + "permutation_manifest_sha256": "0219d0a289ae2e3c2bde90568af4b05d23ca629522f1b19b6a1d09473d87fb8b", + "reference_mode": "channel_derangement" + }, + "generated_by": "/nfs/ywang29/GmNet/journal_exp/scripts/generate_e4_mechanism_followup_deploy.py", + "known_before_registration": { + "e4_channel_derangement_delta_pp_vs_historical": -0.952, + "e4_channel_derangement_top1": 77.794, + "e4_stop_gradient_delta_pp_vs_historical": -1.972, + "e4_stop_gradient_top1": 76.774, + "historical_baseline_code_provenance": "retrospective_unverified", + "historical_paper_recipe_relu6_top1": 78.746 + }, + "policy": { + "approval_marker_required_for_every_task": true, + "approval_requires_8gpu_strict_resume_smoke": true, + "baseline_recipe": "paper-supplementary-table8-v1", + "block_seed_stride": 10007, + "checkpoint_policy": "fixed_last", + "epochs": 300, + "eta_class": "greater_than_12h", + "gpus_per_job": 8, + "intervention_seed": 41041, + "launchjob_submitted_by_generator": false, + "model_variant": "s3", + "output_lock": "nonblocking_flock", + "post_eval": "strict_official", + "resume": "auto", + "seed": 0, + "seed_replication_in_scope": false + }, + "prior_evidence": { + "e4_channel_derangement": { + "artifacts_sha256": { + "checkpoint_last.pt": "e21cddc22c53f880a8357b009652beadfacec8723ef0aad2a93bb5a8caf346b7", + "official_eval/checks.json": "48f295fd10cc9f16b4695750f442d4570cd600cecdb4e9962fc6975fcc188305", + "official_eval/gate_diagnostics.json": "01f70d53f267f1667832ec72bf52b8057b91156d01b1f4d62a74b364c1e8ecd9", + "official_eval/results.json": "dd81aec890b9ba79b8a8d3cf2427f81d583615e61f839407093083c96dec5a8a" + }, + "block_identities": [ + { + "block": 1, + "global_block_index": 0, + "module": "stages.0.1.gate", + "permutation_sha256": "81c39f5e5d80eb8ecee0defe76443012e14e1ff393ed1b75803e7f4076f3cd2c", + "seed": 41041, + "stage": 1 + }, + { + "block": 2, + "global_block_index": 1, + "module": "stages.0.2.gate", + "permutation_sha256": "5afa5a19520c8a590c6040934a902279da0c89035b78139d84e9be8a9d4fc506", + "seed": 51048, + "stage": 1 + }, + { + "block": 3, + "global_block_index": 2, + "module": "stages.0.3.gate", + "permutation_sha256": "5d85daea4b5427bec16fca0b3f25347d245ff530efc5edfb574bdef5e8ce39f8", + "seed": 61055, + "stage": 1 + }, + { + "block": 1, + "global_block_index": 3, + "module": "stages.1.1.gate", + "permutation_sha256": "cc6c8357bbee74c2248dcc63e412ca77d0697c57151105682a6f2096c6feae24", + "seed": 71062, + "stage": 2 + }, + { + "block": 2, + "global_block_index": 4, + "module": "stages.1.2.gate", + "permutation_sha256": "09180ef61cbaa6bb46ca2c94c69e52164d11ea37f5ebbf247c2da8d79acac300", + "seed": 81069, + "stage": 2 + }, + { + "block": 3, + "global_block_index": 5, + "module": "stages.1.3.gate", + "permutation_sha256": "3e1893ed17aef0fe295951867d2bd952afde8bb62f9ce8db80f50580f3de6699", + "seed": 91076, + "stage": 2 + }, + { + "block": 1, + "global_block_index": 6, + "module": "stages.2.1.gate", + "permutation_sha256": "f2df260887846e17c4fcd53e4afcdbab8d9d6cb37012f4e613c4c10303da42de", + "seed": 101083, + "stage": 3 + }, + { + "block": 2, + "global_block_index": 7, + "module": "stages.2.2.gate", + "permutation_sha256": "6d278618dee2daf52ceff0c9f27e40d55ea940e5b44a91217593f676935c797d", + "seed": 111090, + "stage": 3 + }, + { + "block": 3, + "global_block_index": 8, + "module": "stages.2.3.gate", + "permutation_sha256": "007992cc0fb1c4e5d57d2c8ec07017dc67a5605be4be9aee664ee17efd217e84", + "seed": 121097, + "stage": 3 + }, + { + "block": 4, + "global_block_index": 9, + "module": "stages.2.4.gate", + "permutation_sha256": "6d9035619249ba965704732037f696359eaf8c9aca96005acdafb7acb16928aa", + "seed": 131104, + "stage": 3 + }, + { + "block": 5, + "global_block_index": 10, + "module": "stages.2.5.gate", + "permutation_sha256": "46026d5db68992fdc6d1795b6f21ab4e624607b80c5d74a94d100a97c14901a9", + "seed": 141111, + "stage": 3 + }, + { + "block": 6, + "global_block_index": 11, + "module": "stages.2.6.gate", + "permutation_sha256": "d1fc5ebffee98ea376518355ed960e9732074b7d93144756e5ad4552a7a93334", + "seed": 151118, + "stage": 3 + }, + { + "block": 7, + "global_block_index": 12, + "module": "stages.2.7.gate", + "permutation_sha256": "5d827b1b3884b67cea799768b01f6bbad09a2b19cf470a41e3ecc85efaa5631a", + "seed": 161125, + "stage": 3 + }, + { + "block": 8, + "global_block_index": 13, + "module": "stages.2.8.gate", + "permutation_sha256": "9b43e24d6c96f03f20a7c7797efb1d8ee3e3dc96ddef00084f7873fec012263a", + "seed": 171132, + "stage": 3 + }, + { + "block": 1, + "global_block_index": 14, + "module": "stages.3.1.gate", + "permutation_sha256": "3e1f04e3fe8302ee2faafa6244192dc4d752dcbce91b937aa78b2abf57b67a1c", + "seed": 181139, + "stage": 4 + }, + { + "block": 2, + "global_block_index": 15, + "module": "stages.3.2.gate", + "permutation_sha256": "8593429cc7b72edb9bb0590733ca58481664d313cbe0bf9fa5f563b5d15e7f66", + "seed": 191146, + "stage": 4 + }, + { + "block": 3, + "global_block_index": 16, + "module": "stages.3.3.gate", + "permutation_sha256": "64e7c26b4a26a4e865cd7adcc635cbf780655d4aa933cdf4b7b8cacf3d90810b", + "seed": 201153, + "stage": 4 + } + ], + "gate_intervention": "channel_derangement", + "permutation_manifest_sha256": "0219d0a289ae2e3c2bde90568af4b05d23ca629522f1b19b6a1d09473d87fb8b", + "run_dir": "/nfs/ywang29/GmNet/runs/e4_alignment/e4a_s3_channel_derangement_seed0", + "run_name": "e4a_s3_channel_derangement_seed0", + "top1": 77.794 + }, + "e4_stop_gradient": { + "artifacts_sha256": { + "checkpoint_last.pt": "786526f3f4d55cac7656b2cce770c4192177f28a06e9362c8473248f32a81326", + "official_eval/checks.json": "98ff97ac63929e80f0a61d9e9b1f72bb88e0190fcc21afa50eb7e8b14f777669", + "official_eval/gate_diagnostics.json": "bbdbd3e40d652ba65c07fc583db700d35b115452c9658b12e1d7de7f1116a5dc", + "official_eval/results.json": "bc89d402149c7238b56aa188d24001902e1e891061b08cf6d7a3eb11f4098031" + }, + "block_identities": [ + { + "block": 1, + "global_block_index": 0, + "module": "stages.0.1.gate", + "permutation_sha256": null, + "seed": 41041, + "stage": 1 + }, + { + "block": 2, + "global_block_index": 1, + "module": "stages.0.2.gate", + "permutation_sha256": null, + "seed": 51048, + "stage": 1 + }, + { + "block": 3, + "global_block_index": 2, + "module": "stages.0.3.gate", + "permutation_sha256": null, + "seed": 61055, + "stage": 1 + }, + { + "block": 1, + "global_block_index": 3, + "module": "stages.1.1.gate", + "permutation_sha256": null, + "seed": 71062, + "stage": 2 + }, + { + "block": 2, + "global_block_index": 4, + "module": "stages.1.2.gate", + "permutation_sha256": null, + "seed": 81069, + "stage": 2 + }, + { + "block": 3, + "global_block_index": 5, + "module": "stages.1.3.gate", + "permutation_sha256": null, + "seed": 91076, + "stage": 2 + }, + { + "block": 1, + "global_block_index": 6, + "module": "stages.2.1.gate", + "permutation_sha256": null, + "seed": 101083, + "stage": 3 + }, + { + "block": 2, + "global_block_index": 7, + "module": "stages.2.2.gate", + "permutation_sha256": null, + "seed": 111090, + "stage": 3 + }, + { + "block": 3, + "global_block_index": 8, + "module": "stages.2.3.gate", + "permutation_sha256": null, + "seed": 121097, + "stage": 3 + }, + { + "block": 4, + "global_block_index": 9, + "module": "stages.2.4.gate", + "permutation_sha256": null, + "seed": 131104, + "stage": 3 + }, + { + "block": 5, + "global_block_index": 10, + "module": "stages.2.5.gate", + "permutation_sha256": null, + "seed": 141111, + "stage": 3 + }, + { + "block": 6, + "global_block_index": 11, + "module": "stages.2.6.gate", + "permutation_sha256": null, + "seed": 151118, + "stage": 3 + }, + { + "block": 7, + "global_block_index": 12, + "module": "stages.2.7.gate", + "permutation_sha256": null, + "seed": 161125, + "stage": 3 + }, + { + "block": 8, + "global_block_index": 13, + "module": "stages.2.8.gate", + "permutation_sha256": null, + "seed": 171132, + "stage": 3 + }, + { + "block": 1, + "global_block_index": 14, + "module": "stages.3.1.gate", + "permutation_sha256": null, + "seed": 181139, + "stage": 4 + }, + { + "block": 2, + "global_block_index": 15, + "module": "stages.3.2.gate", + "permutation_sha256": null, + "seed": 191146, + "stage": 4 + }, + { + "block": 3, + "global_block_index": 16, + "module": "stages.3.3.gate", + "permutation_sha256": null, + "seed": 201153, + "stage": 4 + } + ], + "gate_intervention": "stop_gradient", + "permutation_manifest_sha256": null, + "run_dir": "/nfs/ywang29/GmNet/runs/e4_alignment/e4a_s3_stop_gradient_seed0", + "run_name": "e4a_s3_stop_gradient_seed0", + "top1": 76.774 + } + }, + "protocol_id": "imagenet-e4-mechanism-followup-single-seed-20260717", + "protocol_sha256": "2723bd29cd0205715f6d31888355ffe7ee312bee36c645bdb937d6e8c7146fb6", + "protocol_source": "/nfs/ywang29/GmNet/journal_exp/configs/e4_mechanism_followup_protocol.yaml", + "relationship_to_prior_work": "Post-hoc, single-seed exploratory mechanism follow-up registered after the E4 stop-gradient and channel-derangement results. These tasks are separate from the ImageNet-v2 Holm family and do not provide seed-level inference.", + "run_root": "/nfs/ywang29/GmNet/runs/e4_mechanism_followup", + "schema_version": 1, + "smoke_data": { + "batch_size": 2, + "class_to_idx_sha256": "dcc17de4122fd61855e35802303db455917d8b79eb17fe893924d9dc4a1ad9a1", + "eval_batch_size": 3, + "expected_classes": 5, + "expected_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "expected_train_samples": 20, + "expected_val_samples": 20, + "runtime_root": "/tmp/gmnet_data/imagenet-1k-batch2-smoke", + "source_root": "/tmp/gmnet_data/imagenet-1k-tiny", + "train_sample_index_sha256": "2d5a1cb5f64381dc11d9a42c3329f0061708b0c925bc477a4067856f20741182", + "train_sampled_content_sha256": "8667b66640afc0a986c60df5641771304b9dc968e154abfbc0ddbe12692bf140", + "val_sample_index_sha256": "a7d0f1d11af355d1cd623b8bab2eed818c0dfcc175478e427bfb40a3e6ddae83", + "val_sampled_content_sha256": "7ad2efef24d2beebdb28a3984c8f89b674a5b3c3d3625014b73d94e45a10a3eb" + }, + "smoke_evidence_path": "/nfs/ywang29/GmNet/depoly/e4_mechanism_followup_20260717/smoke_evidence.json", + "smoke_evidence_sha256": "2e04518469068593b3ed69e123ff8184ad3052b1311e7ef7d757a09abfb9239f", + "source_template": "/nfs/ywang29/LongLive/deploy/jul11_vgp/j11_vgp01_base.yaml", + "source_template_sha256": "1c84a6a1219bbd6a68c73aa673912d8154065f020083581089b5b615fd1459a9", + "summary": { + "approved_count": 3, + "seed_count": 1, + "task_count": 3 + }, + "tasks": [ + { + "approval_path": "/nfs/ywang29/GmNet/depoly/e4_mechanism_followup_20260717/approvals/e4f_s3_current_baseline_seed0.json", + "config_path": "configs/e4_mechanism_followup/imagenet_gmnet_s3_current_baseline.yaml", + "contrast": "current-code aligned ReLU6 self-gate versus the historical baseline", + "deploy_path": "/nfs/ywang29/GmNet/depoly/e4_mechanism_followup_20260717/e4f_s3_current_baseline_seed0.yaml", + "eta_class": ">12h", + "experiment": "E4F", + "gate": "relu6_self", + "gate_intervention": "baseline", + "gate_intervention_seed": 41041, + "job_name": "gmnet-e4f-s3-current-baseline-seed0", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/e4_mechanism_followup/e4f_s3_current_baseline_seed0", + "question": "Does the exact current code reproduce the accepted paper-recipe baseline?", + "role": "matched_current_code_control", + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4f_current_baseline.yaml", + "status": "ready_after_smoke", + "task_id": "e4f_s3_current_baseline_seed0" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/e4_mechanism_followup_20260717/approvals/e4f_s3_batch_derangement_seed0.json", + "config_path": "configs/e4_mechanism_followup/imagenet_gmnet_s3_batch_derangement.yaml", + "contrast": "local-batch sample-deranged gate input minus the current-code baseline", + "deploy_path": "/nfs/ywang29/GmNet/depoly/e4_mechanism_followup_20260717/e4f_s3_batch_derangement_seed0.yaml", + "eta_class": ">12h", + "experiment": "E4F", + "gate": "relu6_self", + "gate_intervention": "batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-e4f-s3-batch-derangement-seed0", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/e4_mechanism_followup/e4f_s3_batch_derangement_seed0", + "question": "Does the gate need to depend on the same sample whose feature branch it modulates?", + "role": "matched_sample_dependence_retraining", + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4f_batch_derangement.yaml", + "status": "ready_after_smoke", + "task_id": "e4f_s3_batch_derangement_seed0" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/e4_mechanism_followup_20260717/approvals/e4f_s3_stopgrad_channel_derangement_seed0.json", + "config_path": "configs/e4_mechanism_followup/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml", + "contrast": "combined stopped-gradient channel derangement minus the current-code baseline", + "deploy_path": "/nfs/ywang29/GmNet/depoly/e4_mechanism_followup_20260717/e4f_s3_stopgrad_channel_derangement_seed0.yaml", + "eta_class": ">12h", + "experiment": "E4F", + "gate": "relu6_self", + "gate_intervention": "stop_gradient_channel_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-e4f-s3-stopgrad-channel-derangement-seed0", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/e4_mechanism_followup/e4f_s3_stopgrad_channel_derangement_seed0", + "question": "Do the backward gate path and same-channel alignment interact beyond their individual effects?", + "role": "matched_forward_backward_interaction_retraining", + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4f_stopgrad_channel_derangement.yaml", + "status": "ready_after_smoke", + "task_id": "e4f_s3_stopgrad_channel_derangement_seed0" + } + ] +} diff --git a/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_batch_derangement_seed0.yaml b/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_batch_derangement_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7b55d63fc2b9d5ae05d4ea209bf43ab222dab995 --- /dev/null +++ b/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_batch_derangement_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by journal_exp/scripts/generate_e4_mechanism_followup_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/journal_exp && chmod +x ./scripts/*.sh && INSTALL_DEV=0 bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_batch_derangement_seed0 --require-approval && KEEP_ARCHIVE=0 bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_batch_derangement_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/journal_exp && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_batch_derangement_seed0 --require-approval && RUN_NAME=e4f_s3_batch_derangement_seed0 CONFIG_PATH=configs/e4_mechanism_followup/imagenet_gmnet_s3_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/e4_mechanism_followup/e4f_s3_batch_derangement_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 CODE_MANIFEST_PATH=configs/code_manifests/e4_mechanism_followup_20260717.json bash scripts/run_e4_mechanism_followup.sh + jobs: + - name: gmnet-e4f-s3-batch-derangement-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_current_baseline_seed0.yaml b/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_current_baseline_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d25556a14fff1b61fd3d4fd1487c2f526c3bc032 --- /dev/null +++ b/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_current_baseline_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by journal_exp/scripts/generate_e4_mechanism_followup_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/journal_exp && chmod +x ./scripts/*.sh && INSTALL_DEV=0 bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_current_baseline_seed0 --require-approval && KEEP_ARCHIVE=0 bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_current_baseline_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/journal_exp && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_current_baseline_seed0 --require-approval && RUN_NAME=e4f_s3_current_baseline_seed0 CONFIG_PATH=configs/e4_mechanism_followup/imagenet_gmnet_s3_current_baseline.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/e4_mechanism_followup/e4f_s3_current_baseline_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 CODE_MANIFEST_PATH=configs/code_manifests/e4_mechanism_followup_20260717.json bash scripts/run_e4_mechanism_followup.sh + jobs: + - name: gmnet-e4f-s3-current-baseline-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_stopgrad_channel_derangement_seed0.yaml b/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_stopgrad_channel_derangement_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6994919b52934e1366dd84660b19fd3f44f272b2 --- /dev/null +++ b/gmnet/deploy/e4_mechanism_followup_20260717/e4f_s3_stopgrad_channel_derangement_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by journal_exp/scripts/generate_e4_mechanism_followup_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/journal_exp && chmod +x ./scripts/*.sh && INSTALL_DEV=0 bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_stopgrad_channel_derangement_seed0 --require-approval && KEEP_ARCHIVE=0 bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_stopgrad_channel_derangement_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/journal_exp && /tmp/gmnet_venv/bin/python scripts/generate_e4_mechanism_followup_deploy.py --verify-task e4f_s3_stopgrad_channel_derangement_seed0 --require-approval && RUN_NAME=e4f_s3_stopgrad_channel_derangement_seed0 CONFIG_PATH=configs/e4_mechanism_followup/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/e4_mechanism_followup/e4f_s3_stopgrad_channel_derangement_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 CODE_MANIFEST_PATH=configs/code_manifests/e4_mechanism_followup_20260717.json bash scripts/run_e4_mechanism_followup.sh + jobs: + - name: gmnet-e4f-s3-stopgrad-channel-derangement-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/e4_mechanism_followup_20260717/smoke_evidence.json b/gmnet/deploy/e4_mechanism_followup_20260717/smoke_evidence.json new file mode 100644 index 0000000000000000000000000000000000000000..138a20315e09fc311b1d9dfafd359be3b77a111b --- /dev/null +++ b/gmnet/deploy/e4_mechanism_followup_20260717/smoke_evidence.json @@ -0,0 +1,1022 @@ +{ + "audited_at_utc": "2026-07-17T21:19:47.572339+00:00", + "batch_size": 2, + "code_manifest_path": "configs/code_manifests/e4_mechanism_followup_20260717.json", + "code_manifest_sha256": "e354339142ffc72e669234a9f297113a64e5294ce8ff37dd658e62f723f0b239", + "code_sha256": "f6bd434a2ac86c772f2e23683431f3bb7ccb06f539558682a3bea6464bacebf9", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "eval_batch_size": 3, + "protocol_id": "imagenet-e4-mechanism-followup-single-seed-20260717", + "schema_version": 1, + "shared_topology": { + "block_count": 16, + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "smoke_data": { + "batch_size": 2, + "class_to_idx_sha256": "dcc17de4122fd61855e35802303db455917d8b79eb17fe893924d9dc4a1ad9a1", + "eval_batch_size": 3, + "expected_classes": 5, + "expected_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "expected_train_samples": 20, + "expected_val_samples": 20, + "runtime_root": "/tmp/gmnet_data/imagenet-1k-batch2-smoke", + "source_root": "/tmp/gmnet_data/imagenet-1k-tiny", + "train_sample_index_sha256": "2d5a1cb5f64381dc11d9a42c3329f0061708b0c925bc477a4067856f20741182", + "train_sampled_content_sha256": "8667b66640afc0a986c60df5641771304b9dc968e154abfbc0ddbe12692bf140", + "val_sample_index_sha256": "a7d0f1d11af355d1cd623b8bab2eed818c0dfcc175478e427bfb40a3e6ddae83", + "val_sampled_content_sha256": "7ad2efef24d2beebdb28a3984c8f89b674a5b3c3d3625014b73d94e45a10a3eb" + }, + "smoke_root": "/tmp/gmnet_runs/e4_mechanism_followup_smoke", + "status": "passed", + "strict_resume": true, + "tasks": { + "e4f_s3_batch_derangement_seed0": { + "artifacts_sha256": { + "checkpoint_epoch0.pt": "2524591fd3e783ae9430d9871c00f769d2712223bc4a32a1fed9b26a1fd2e5a2", + "checkpoint_last.pt": "07176b0fb3a54834becaf7fb2c20d7a2a2dfdb494feeb5e1e8b929403db63d18", + "config_resolved.yaml": "b975a4b04c668a0ad8ef6418dee6923840ac4cb5f4488b63b606ed5780b698e1", + "config_source.yaml": "3fb58a5f69ff75047cf240f5b47019cfe341ddc53035cddc8f85319b995fbcee", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "e9963d27942ce9cf5f37bec5b936732f0a36db50df64e8ba37fcc0c80a45c891" + }, + "checkpoint_epoch0_sha256": "2524591fd3e783ae9430d9871c00f769d2712223bc4a32a1fed9b26a1fd2e5a2", + "checkpoint_last_sha256": "07176b0fb3a54834becaf7fb2c20d7a2a2dfdb494feeb5e1e8b929403db63d18", + "config_fingerprint": "b8c167e87c53bd30ea9a057a71d7fa49d9229bb1e838ea485d2c7e5be871c2a6", + "data_manifest": { + "class_to_idx_sha256": "dcc17de4122fd61855e35802303db455917d8b79eb17fe893924d9dc4a1ad9a1", + "dataset": "imagefolder", + "manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "num_classes": 5, + "sample_fingerprint_kind": "relative_path_and_target_plus_sampled_raw_file_bytes", + "sample_index_sha256": { + "train": "2d5a1cb5f64381dc11d9a42c3329f0061708b0c925bc477a4067856f20741182", + "val": "a7d0f1d11af355d1cd623b8bab2eed818c0dfcc175478e427bfb40a3e6ddae83" + }, + "sampled_content_policy": "first_sample_per_class_up_to_1000", + "sampled_content_samples": { + "train": 5, + "val": 5 + }, + "sampled_content_sha256": { + "train": "8667b66640afc0a986c60df5641771304b9dc968e154abfbc0ddbe12692bf140", + "val": "7ad2efef24d2beebdb28a3984c8f89b674a5b3c3d3625014b73d94e45a10a3eb" + }, + "samples": { + "train": 20, + "val": 20 + }, + "schema_version": 2, + "splits": { + "train": "train", + "val": "val" + } + }, + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "epoch0": { + "epoch": 0, + "global_step": 1, + "training_complete": false + }, + "final": { + "epoch": 1, + "global_step": 2, + "training_complete": true + }, + "gate_intervention": "batch_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "block_count": 16, + "block_seed_stride": 10007, + "blocks": [ + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 120, + "fixed_points": null, + "global_block_index": 0, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 41041, + "stage_block_index": 0, + "stage_index": 0, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 120, + "fixed_points": null, + "global_block_index": 1, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 51048, + "stage_block_index": 1, + "stage_index": 0, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 240, + "fixed_points": null, + "global_block_index": 2, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 61055, + "stage_block_index": 0, + "stage_index": 1, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 240, + "fixed_points": null, + "global_block_index": 3, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 71062, + "stage_block_index": 1, + "stage_index": 1, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 4, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 81069, + "stage_block_index": 0, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 5, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 91076, + "stage_block_index": 1, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 6, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 101083, + "stage_block_index": 2, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 7, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 111090, + "stage_block_index": 3, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 8, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 121097, + "stage_block_index": 4, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 9, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 131104, + "stage_block_index": 5, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 10, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 141111, + "stage_block_index": 6, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 11, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 151118, + "stage_block_index": 7, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 12, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 161125, + "stage_block_index": 8, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 13, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 171132, + "stage_block_index": 9, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 640, + "fixed_points": null, + "global_block_index": 14, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 181139, + "stage_block_index": 0, + "stage_index": 3, + "stops_gate_gradient": false + }, + { + "batch_derangement": true, + "batch_shift_rule": "1 + seed % (local_batch_size - 1)", + "channel_derangement": false, + "channels": 640, + "fixed_points": null, + "global_block_index": 15, + "is_bijection": null, + "mode": "batch_derangement", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 191146, + "stage_block_index": 1, + "stage_index": 3, + "stops_gate_gradient": false + } + ], + "channel_reference_matches": null, + "intervention_manifest_sha256": "403a6ca0fab7d32c729e0d05188ea41e8fe6ef46fd27adc1b12175605176de13", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "resume_verified": true, + "run_name": "e4f_s3_batch_derangement_seed0", + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4f_batch_derangement.yaml", + "smoke_run_dir": "/tmp/gmnet_runs/e4_mechanism_followup_smoke/batch_derangement", + "training_complete": true + }, + "e4f_s3_current_baseline_seed0": { + "artifacts_sha256": { + "checkpoint_epoch0.pt": "bb340c28acdb7ccb20218dccd126ce7da7506d97a7581bbcded862e13f130311", + "checkpoint_last.pt": "b13056369d77e1c72b84efa60c470c8bfd3985a16fd8527ea180b35e53fea338", + "config_resolved.yaml": "516473b97d5f448dc159a585e4324415af90339e8f2d3f3f27fb8e163b3683e0", + "config_source.yaml": "faebdc1c430d1316793ef5c94ff0f80bea582caf5c6306a5e95c1b58811fe65e", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "37930109d4ef8279bac216503fafa772213076c75430ca2dc1ad0d83d35c876b" + }, + "checkpoint_epoch0_sha256": "bb340c28acdb7ccb20218dccd126ce7da7506d97a7581bbcded862e13f130311", + "checkpoint_last_sha256": "b13056369d77e1c72b84efa60c470c8bfd3985a16fd8527ea180b35e53fea338", + "config_fingerprint": "a4fd9a5962dfa560bab01a02b9c2228662fbe3fd3453cb29f684f01a0fe580de", + "data_manifest": { + "class_to_idx_sha256": "dcc17de4122fd61855e35802303db455917d8b79eb17fe893924d9dc4a1ad9a1", + "dataset": "imagefolder", + "manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "num_classes": 5, + "sample_fingerprint_kind": "relative_path_and_target_plus_sampled_raw_file_bytes", + "sample_index_sha256": { + "train": "2d5a1cb5f64381dc11d9a42c3329f0061708b0c925bc477a4067856f20741182", + "val": "a7d0f1d11af355d1cd623b8bab2eed818c0dfcc175478e427bfb40a3e6ddae83" + }, + "sampled_content_policy": "first_sample_per_class_up_to_1000", + "sampled_content_samples": { + "train": 5, + "val": 5 + }, + "sampled_content_sha256": { + "train": "8667b66640afc0a986c60df5641771304b9dc968e154abfbc0ddbe12692bf140", + "val": "7ad2efef24d2beebdb28a3984c8f89b674a5b3c3d3625014b73d94e45a10a3eb" + }, + "samples": { + "train": 20, + "val": 20 + }, + "schema_version": 2, + "splits": { + "train": "train", + "val": "val" + } + }, + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "epoch0": { + "epoch": 0, + "global_step": 1, + "training_complete": false + }, + "final": { + "epoch": 1, + "global_step": 2, + "training_complete": true + }, + "gate_intervention": "baseline", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "block_count": 16, + "block_seed_stride": 10007, + "blocks": [ + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 120, + "fixed_points": null, + "global_block_index": 0, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 41041, + "stage_block_index": 0, + "stage_index": 0, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 120, + "fixed_points": null, + "global_block_index": 1, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 51048, + "stage_block_index": 1, + "stage_index": 0, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 240, + "fixed_points": null, + "global_block_index": 2, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 61055, + "stage_block_index": 0, + "stage_index": 1, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 240, + "fixed_points": null, + "global_block_index": 3, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 71062, + "stage_block_index": 1, + "stage_index": 1, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 4, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 81069, + "stage_block_index": 0, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 5, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 91076, + "stage_block_index": 1, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 6, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 101083, + "stage_block_index": 2, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 7, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 111090, + "stage_block_index": 3, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 8, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 121097, + "stage_block_index": 4, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 9, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 131104, + "stage_block_index": 5, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 10, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 141111, + "stage_block_index": 6, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 11, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 151118, + "stage_block_index": 7, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 12, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 161125, + "stage_block_index": 8, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 480, + "fixed_points": null, + "global_block_index": 13, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 171132, + "stage_block_index": 9, + "stage_index": 2, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 640, + "fixed_points": null, + "global_block_index": 14, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 181139, + "stage_block_index": 0, + "stage_index": 3, + "stops_gate_gradient": false + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": false, + "channels": 640, + "fixed_points": null, + "global_block_index": 15, + "is_bijection": null, + "mode": "baseline", + "permutation_hash_encoding": null, + "permutation_sha256": null, + "seed": 191146, + "stage_block_index": 1, + "stage_index": 3, + "stops_gate_gradient": false + } + ], + "channel_reference_matches": null, + "intervention_manifest_sha256": "8411ba16ca6d401cb647fe99f2982a42c6e49cb3d0c2da13a3c245f48159f45b", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "resume_verified": true, + "run_name": "e4f_s3_current_baseline_seed0", + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4f_current_baseline.yaml", + "smoke_run_dir": "/tmp/gmnet_runs/e4_mechanism_followup_smoke/current_baseline", + "training_complete": true + }, + "e4f_s3_stopgrad_channel_derangement_seed0": { + "artifacts_sha256": { + "checkpoint_epoch0.pt": "18b72160d82ec54aa04d0555e97e34818bdb80909b650a0804eaf49d14763c31", + "checkpoint_last.pt": "0e424ca2eaa0d4c669ee84316692dff3a98dcc640854f6a93d9b13f605d37d4b", + "config_resolved.yaml": "362ece8ba8164ee9d627f05bd9504803157f13e718b868e566d75f7718652580", + "config_source.yaml": "24869f8cf6a1745524c452f8ce206e0baaf842d37f4ca85f8d1e112f77dc2c88", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "266c18e3bee50cbbd798c0ecdd019d9cdf5f67a589fef4e3f7afbd94cc9b3333" + }, + "checkpoint_epoch0_sha256": "18b72160d82ec54aa04d0555e97e34818bdb80909b650a0804eaf49d14763c31", + "checkpoint_last_sha256": "0e424ca2eaa0d4c669ee84316692dff3a98dcc640854f6a93d9b13f605d37d4b", + "config_fingerprint": "6497ce02395cb03a849ee43ec4817c918963079514ac89714ac83f1a2d1606c5", + "data_manifest": { + "class_to_idx_sha256": "dcc17de4122fd61855e35802303db455917d8b79eb17fe893924d9dc4a1ad9a1", + "dataset": "imagefolder", + "manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "num_classes": 5, + "sample_fingerprint_kind": "relative_path_and_target_plus_sampled_raw_file_bytes", + "sample_index_sha256": { + "train": "2d5a1cb5f64381dc11d9a42c3329f0061708b0c925bc477a4067856f20741182", + "val": "a7d0f1d11af355d1cd623b8bab2eed818c0dfcc175478e427bfb40a3e6ddae83" + }, + "sampled_content_policy": "first_sample_per_class_up_to_1000", + "sampled_content_samples": { + "train": 5, + "val": 5 + }, + "sampled_content_sha256": { + "train": "8667b66640afc0a986c60df5641771304b9dc968e154abfbc0ddbe12692bf140", + "val": "7ad2efef24d2beebdb28a3984c8f89b674a5b3c3d3625014b73d94e45a10a3eb" + }, + "samples": { + "train": 20, + "val": 20 + }, + "schema_version": 2, + "splits": { + "train": "train", + "val": "val" + } + }, + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "epoch0": { + "epoch": 0, + "global_step": 1, + "training_complete": false + }, + "final": { + "epoch": 1, + "global_step": 2, + "training_complete": true + }, + "gate_intervention": "stop_gradient_channel_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "block_count": 16, + "block_seed_stride": 10007, + "blocks": [ + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 120, + "fixed_points": 0, + "global_block_index": 0, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "119f2202e3052dd65635c59c8693b9e10787820620c3df5d55a66ad36bda5aac", + "seed": 41041, + "stage_block_index": 0, + "stage_index": 0, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 120, + "fixed_points": 0, + "global_block_index": 1, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "65aa7c0d25e252cc1ae98236b1864dd7c39bd2243bb777e6bd03cf81b706d8c6", + "seed": 51048, + "stage_block_index": 1, + "stage_index": 0, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 240, + "fixed_points": 0, + "global_block_index": 2, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "d83766a3a126dd8d1e6d4ec11cea5f4bacea6049f15cd44a4167005d68e4f338", + "seed": 61055, + "stage_block_index": 0, + "stage_index": 1, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 240, + "fixed_points": 0, + "global_block_index": 3, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "b4065e708c8dbb0d1e29aefa0b238780c0fabb7de8f66315ac7207d2b9b7020b", + "seed": 71062, + "stage_block_index": 1, + "stage_index": 1, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 4, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "c1add1325f039397e1b126e0d807b2ab83ea91605cfeeec884f284a110203a24", + "seed": 81069, + "stage_block_index": 0, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 5, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "e549c10b225546dcd5c60c60dac154ca3d599a20ee6e6f3d76e617e6cc26de3c", + "seed": 91076, + "stage_block_index": 1, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 6, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "63c3dfebe9204eefc9d0adfd1e432270bfb0c6a30b8a230f623ef92e8b0013cb", + "seed": 101083, + "stage_block_index": 2, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 7, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "29bbd34cd1b7403e2f3bbaf03f1e73ceab88b6d672b88044d318fc844f07e039", + "seed": 111090, + "stage_block_index": 3, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 8, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "38d10e3ce9e2e97701db148154ef6904c63ca8572bc254e908e46bee15c3d1d5", + "seed": 121097, + "stage_block_index": 4, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 9, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "7c7dfdc76eea57e490e9f58097bd5a33c8dab1ed57e305c40800dce7b0c7a1fc", + "seed": 131104, + "stage_block_index": 5, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 10, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "fe99e4578cbcdf167c185d1e32f23efc5a4dcbe501e03198cde79fd8454da2d3", + "seed": 141111, + "stage_block_index": 6, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 11, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "6f4374ecd86e121c30725a201b0dee38b90e62b11872ad50d21b14e899ec68bc", + "seed": 151118, + "stage_block_index": 7, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 12, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "fdbecf663d6296b14dff04e75ebc0bfc8011569971b1c142ac18b372831c0256", + "seed": 161125, + "stage_block_index": 8, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 480, + "fixed_points": 0, + "global_block_index": 13, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "b7b74a17450be3d8046109291f41613ee0fa1486ef4949fc784ce75a756b074a", + "seed": 171132, + "stage_block_index": 9, + "stage_index": 2, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 640, + "fixed_points": 0, + "global_block_index": 14, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "ea96ebcfdfadb28872f3945d593813dda28b0b07554dc0496b9e2aa0429b374b", + "seed": 181139, + "stage_block_index": 0, + "stage_index": 3, + "stops_gate_gradient": true + }, + { + "batch_derangement": false, + "batch_shift_rule": null, + "channel_derangement": true, + "channels": 640, + "fixed_points": 0, + "global_block_index": 15, + "is_bijection": true, + "mode": "stop_gradient_channel_derangement", + "permutation_hash_encoding": "little_endian_int64_c_order", + "permutation_sha256": "a52b7dcc5f7f9f2309b5381a846e2205d79c70ff3052f8c4c49e44d3fa552fe7", + "seed": 191146, + "stage_block_index": 1, + "stage_index": 3, + "stops_gate_gradient": true + } + ], + "channel_reference_matches": true, + "intervention_manifest_sha256": "e015784a96cf58af97c679b844f420a3782b926a0eb45bbd7613ccd9906fdf6c", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "resume_verified": true, + "run_name": "e4f_s3_stopgrad_channel_derangement_seed0", + "smoke_config_path": "configs/smoke/imagenet5_gmnet_s1_e4f_stopgrad_channel_derangement.yaml", + "smoke_run_dir": "/tmp/gmnet_runs/e4_mechanism_followup_smoke/stopgrad_channel_derangement", + "training_complete": true + } + }, + "world_size": 8 +} diff --git a/gmnet/deploy/imagenet_v2/data_manifest_canonical.json b/gmnet/deploy/imagenet_v2/data_manifest_canonical.json new file mode 100644 index 0000000000000000000000000000000000000000..ad4994c5fa1d77aa5e36e5b97de0ee7ceb4da285 --- /dev/null +++ b/gmnet/deploy/imagenet_v2/data_manifest_canonical.json @@ -0,0 +1,29 @@ +{ + "class_to_idx_sha256": "2312848f9b87eb0d5afd5c3cd09fc3191dadfb5948dc7912639683c2bc5e5f1f", + "dataset": "imagenet", + "manifest_sha256": "bb70bc9f530db6bb24f70e648624b35281bfbc76a57775d589a2e0209dd98661", + "num_classes": 1000, + "sample_fingerprint_kind": "relative_path_and_target_plus_sampled_raw_file_bytes", + "sample_index_sha256": { + "train": "e74104e28ef79fff114e729e81d050a7b4f0c294c4d82345bad13c320d7255b2", + "val": "5ed16b5cd3ebd64e90cd7a8380b4e19d4c0d82eedcca3489dfa29313ce88d6f6" + }, + "sampled_content_policy": "first_sample_per_class_up_to_1000", + "sampled_content_samples": { + "train": 1000, + "val": 1000 + }, + "sampled_content_sha256": { + "train": "dea27b5dbcb5f110ed47c075d473ebd0f6aefc446b45ab1e62d8246f2a153798", + "val": "d80a57419bc9396df7c01e29a2b17698c02c3a9a68dc4006a1fe87ef129ed166" + }, + "samples": { + "train": 1281167, + "val": 50000 + }, + "schema_version": 2, + "splits": { + "train": "train", + "val": "val" + } +} diff --git a/gmnet/deploy/tpami_confirmatory_20260720/batch_manifest.json b/gmnet/deploy/tpami_confirmatory_20260720/batch_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..32c95732f651023735e3e458b973794c9ce4de68 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/batch_manifest.json @@ -0,0 +1,586 @@ +{ + "approval_state": "approved", + "claim_restrictions": [ + "Report every fixed-final result, including unfavorable outcomes.", + "Keep intervention seed 41041 fixed across training seeds and paired arms.", + "D and DD use deterministic local-rank cyclic donors, not global dataset pairing.", + "S minus DD is the clean forward sample-alignment contrast because both remove the gate-branch derivative.", + "D minus DD isolates the gate-gradient contribution under the same forward donor mismatch.", + "Three S3 seeds support paired training-seed inference only for the registered contrasts, not universal necessity.", + "S1 seed 0 is qualitative second-scale validation, not population-level scaling inference.", + "This batch does not add an adaptive clipping method or support a clean-accuracy clipping claim.", + "A detached-batch spectral audit is still required before claiming its total mixing is comparable to B or S." + ], + "code_manifest_path": "configs/code_manifests/tpami_confirmatory_20260720.json", + "code_manifest_sha256": "8b4b76e55d8ab69bf76dc61706d60d87e7bb0c8fe0427dec6bd1db773804de88", + "code_root": "/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code", + "code_sha256": "643343701e8715a13fc38e4385cb08b1ae1988647071300127176c24a2f47b37", + "data": { + "canonical_manifest_sha256": "bb70bc9f530db6bb24f70e648624b35281bfbc76a57775d589a2e0209dd98661", + "expected_archive_bytes": 161381969920, + "expected_train_samples": 1281167, + "expected_val_samples": 50000, + "runtime_root": "/tmp/gmnet_data/imagenet-1k", + "source_archive_uri": "s3://snap-research-cv-code/ywang29/datasets/imagenet-1k/imagenet-1k.tar", + "train_sample_index_sha256": "e74104e28ef79fff114e729e81d050a7b4f0c294c4d82345bad13c320d7255b2", + "train_sampled_content_sha256": "dea27b5dbcb5f110ed47c075d473ebd0f6aefc446b45ab1e62d8246f2a153798", + "val_sample_index_sha256": "5ed16b5cd3ebd64e90cd7a8380b4e19d4c0d82eedcca3489dfa29313ce88d6f6", + "val_sampled_content_sha256": "d80a57419bc9396df7c01e29a2b17698c02c3a9a68dc4006a1fe87ef129ed166" + }, + "frozen_prior_evidence": { + "s1_historical": { + "B_top1": 74.88, + "exclusion": "launch-time code manifest was not frozen", + "use": "sanity_reference_only" + }, + "s3_seed0": { + "B_top1": 78.798, + "C_top1": 77.794, + "D_top1": 54.362, + "SC_top1": 69.508, + "S_top1": 76.774, + "current_snapshot_arms": [ + "B", + "D", + "SC" + ], + "note": "S and C were launched from the earlier frozen snapshot; their model forward, input-gradient, parameter-gradient, and official replay equivalence to the current mechanism snapshot has been audited.", + "source_equivalent_arms": [ + "S", + "C" + ] + } + }, + "generated_by": "/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code/scripts/generate_tpami_confirmatory_deploy.py", + "policy": { + "approval_basis": "passed_8gpu_batch2_strict_resume_smoke", + "approval_required": true, + "block_seed_stride": 10007, + "checkpoint_policy": "fixed_last", + "epochs": 300, + "eta_class": "greater_than_12h", + "expected_new_task_count": 17, + "gpus_per_job": 8, + "intervention_seed": 41041, + "launchjob_submitted_by_generator": false, + "output_lock": "nonblocking_flock", + "post_eval": "strict_official", + "resume": "auto" + }, + "protocol_id": "imagenet-tpami-confirmatory-mechanism-20260720", + "protocol_sha256": "53d614fe9be4a976330f201e84240dd779af8a0ac97b86f584f0627d643879bb", + "protocol_source": "/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code/configs/tpami_confirmatory_protocol.yaml", + "queue_policy": { + "accelerated_queue": "diffusion-training-acceleration", + "accelerated_tasks": [ + "tpami_s3_dd_seed0", + "tpami_s3_b_seed1", + "tpami_s3_s_seed1", + "tpami_s3_c_seed1", + "tpami_s3_sc_seed1", + "tpami_s3_d_seed1", + "tpami_s3_dd_seed1" + ], + "expected_counts": { + "diffusion-training-acceleration": 7, + "mobile-video-backbone": 10 + }, + "template_default": "mobile-video-backbone" + }, + "registered_contrasts": { + "s1_sample_factorial": { + "arms": [ + "B", + "S", + "D", + "DD" + ], + "inference": "qualitative second-scale direction only", + "seeds": [ + 0 + ] + }, + "s3_channel_factorial": { + "aligned_gate_gradient": "B - S", + "arms": [ + "B", + "S", + "C", + "SC" + ], + "interaction": "(C - SC) - (B - S)", + "mismatched_gate_gradient": "C - SC", + "seeds": [ + 0, + 1, + 2 + ] + }, + "s3_sample_factorial": { + "aligned_gate_gradient": "B - S", + "arms": [ + "B", + "S", + "D", + "DD" + ], + "forward_alignment": "S - DD", + "interaction": "(D - DD) - (B - S)", + "mismatched_gate_gradient": "D - DD", + "seeds": [ + 0, + 1, + 2 + ] + } + }, + "relationship_to_prior_work": "Confirmatory extension of the completed seed-0 exploratory mechanism panel. The new runs test training-seed stability, identify forward sample alignment with a detached donor control, and check that sample-factor conclusions are qualitatively present at a smaller model scale.", + "run_root": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720", + "schema_version": 1, + "smoke_data": { + "batch_size": 2, + "class_to_idx_sha256": "dcc17de4122fd61855e35802303db455917d8b79eb17fe893924d9dc4a1ad9a1", + "eval_batch_size": 3, + "expected_classes": 5, + "expected_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "expected_train_samples": 20, + "expected_val_samples": 20, + "runtime_root": "/tmp/gmnet_data/imagenet-1k-batch2-smoke", + "source_root": "/tmp/gmnet_data/imagenet-1k-tiny", + "train_sample_index_sha256": "2d5a1cb5f64381dc11d9a42c3329f0061708b0c925bc477a4067856f20741182", + "train_sampled_content_sha256": "8667b66640afc0a986c60df5641771304b9dc968e154abfbc0ddbe12692bf140", + "val_sample_index_sha256": "a7d0f1d11af355d1cd623b8bab2eed818c0dfcc175478e427bfb40a3e6ddae83", + "val_sampled_content_sha256": "7ad2efef24d2beebdb28a3984c8f89b674a5b3c3d3625014b73d94e45a10a3eb" + }, + "smoke_evidence_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/smoke_evidence.json", + "smoke_evidence_sha256": "8c8b8ec6ffc4912f1c4b957de54f7c9c554534ee4ffc8afa596fe7afeb13c0c0", + "source_template": "/nfs/ywang29/LongLive/deploy/jul11_vgp/j11_vgp01_base.yaml", + "source_template_sha256": "1c84a6a1219bbd6a68c73aa673912d8154065f020083581089b5b615fd1459a9", + "status": "ready_not_submitted", + "summary": { + "approved_count": 17, + "by_model": { + "s1": 4, + "s3": 13 + }, + "by_phase": { + "phase_a_complete_seed0": 1, + "phase_b_training_seed_replication": 12, + "phase_c_second_scale": 4 + }, + "by_volcano_queue": { + "diffusion-training-acceleration": 7, + "mobile-video-backbone": 10 + }, + "seed_count": 3, + "task_count": 17 + }, + "tasks": [ + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_dd_seed0.json", + "arm": "DD", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_batch_derangement.yaml", + "depends_on": [], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_dd_seed0.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient_batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-dd-seed0", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_dd_seed0", + "phase": "phase_a_complete_seed0", + "question": "local-batch donor mismatch with its gate branch detached", + "seed": 0, + "slug": "dd", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_batch_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_dd_seed0", + "volcano_queue": "diffusion-training-acceleration" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_b_seed1.json", + "arm": "B", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_baseline.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_b_seed1.yaml", + "eta_class": ">12h", + "gate_intervention": "baseline", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-b-seed1", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_b_seed1", + "phase": "phase_b_training_seed_replication", + "question": "aligned exact-code control", + "seed": 1, + "slug": "b", + "smoke_config_path": "configs/smoke/imagenet5_tpami_baseline.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_b_seed1", + "volcano_queue": "diffusion-training-acceleration" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_s_seed1.json", + "arm": "S", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_stop_gradient.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_s_seed1.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-s-seed1", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_s_seed1", + "phase": "phase_b_training_seed_replication", + "question": "gate-gradient contribution under aligned forward values", + "seed": 1, + "slug": "s", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stop_gradient.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_s_seed1", + "volcano_queue": "diffusion-training-acceleration" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_c_seed1.json", + "arm": "C", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_channel_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_c_seed1.yaml", + "eta_class": ">12h", + "gate_intervention": "channel_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-c-seed1", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_c_seed1", + "phase": "phase_b_training_seed_replication", + "question": "adaptation to fixed channel mismatch", + "seed": 1, + "slug": "c", + "smoke_config_path": "configs/smoke/imagenet5_tpami_channel_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_c_seed1", + "volcano_queue": "diffusion-training-acceleration" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_sc_seed1.json", + "arm": "SC", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_sc_seed1.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient_channel_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-sc-seed1", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_sc_seed1", + "phase": "phase_b_training_seed_replication", + "question": "gate-gradient contribution under fixed channel mismatch", + "seed": 1, + "slug": "sc", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_channel_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_sc_seed1", + "volcano_queue": "diffusion-training-acceleration" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_d_seed1.json", + "arm": "D", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_batch_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_d_seed1.yaml", + "eta_class": ">12h", + "gate_intervention": "batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-d-seed1", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_d_seed1", + "phase": "phase_b_training_seed_replication", + "question": "local-batch donor mismatch with an active gate-gradient path", + "seed": 1, + "slug": "d", + "smoke_config_path": "configs/smoke/imagenet5_tpami_batch_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_d_seed1", + "volcano_queue": "diffusion-training-acceleration" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_dd_seed1.json", + "arm": "DD", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_batch_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_dd_seed1.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient_batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-dd-seed1", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_dd_seed1", + "phase": "phase_b_training_seed_replication", + "question": "local-batch donor mismatch with its gate branch detached", + "seed": 1, + "slug": "dd", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_batch_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_dd_seed1", + "volcano_queue": "diffusion-training-acceleration" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_b_seed2.json", + "arm": "B", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_baseline.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_b_seed2.yaml", + "eta_class": ">12h", + "gate_intervention": "baseline", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-b-seed2", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_b_seed2", + "phase": "phase_b_training_seed_replication", + "question": "aligned exact-code control", + "seed": 2, + "slug": "b", + "smoke_config_path": "configs/smoke/imagenet5_tpami_baseline.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_b_seed2", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_s_seed2.json", + "arm": "S", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_stop_gradient.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_s_seed2.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-s-seed2", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_s_seed2", + "phase": "phase_b_training_seed_replication", + "question": "gate-gradient contribution under aligned forward values", + "seed": 2, + "slug": "s", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stop_gradient.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_s_seed2", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_c_seed2.json", + "arm": "C", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_channel_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_c_seed2.yaml", + "eta_class": ">12h", + "gate_intervention": "channel_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-c-seed2", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_c_seed2", + "phase": "phase_b_training_seed_replication", + "question": "adaptation to fixed channel mismatch", + "seed": 2, + "slug": "c", + "smoke_config_path": "configs/smoke/imagenet5_tpami_channel_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_c_seed2", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_sc_seed2.json", + "arm": "SC", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_sc_seed2.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient_channel_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-sc-seed2", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_sc_seed2", + "phase": "phase_b_training_seed_replication", + "question": "gate-gradient contribution under fixed channel mismatch", + "seed": 2, + "slug": "sc", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_channel_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_sc_seed2", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_d_seed2.json", + "arm": "D", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_batch_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_d_seed2.yaml", + "eta_class": ">12h", + "gate_intervention": "batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-d-seed2", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_d_seed2", + "phase": "phase_b_training_seed_replication", + "question": "local-batch donor mismatch with an active gate-gradient path", + "seed": 2, + "slug": "d", + "smoke_config_path": "configs/smoke/imagenet5_tpami_batch_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_d_seed2", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s3_dd_seed2.json", + "arm": "DD", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_batch_derangement.yaml", + "depends_on": [ + "phase_a_complete_seed0_technical_validation" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s3_dd_seed2.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient_batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s3-dd-seed2", + "model": "s3", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_dd_seed2", + "phase": "phase_b_training_seed_replication", + "question": "local-batch donor mismatch with its gate branch detached", + "seed": 2, + "slug": "dd", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_batch_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s3_dd_seed2", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s1_b_seed0.json", + "arm": "B", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s1_baseline.yaml", + "depends_on": [ + "phase_b_registered_contrasts_complete" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s1_b_seed0.yaml", + "eta_class": ">12h", + "gate_intervention": "baseline", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s1-b-seed0", + "model": "s1", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_b_seed0", + "phase": "phase_c_second_scale", + "question": "aligned exact-code control", + "seed": 0, + "slug": "b", + "smoke_config_path": "configs/smoke/imagenet5_tpami_baseline.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s1_b_seed0", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s1_s_seed0.json", + "arm": "S", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s1_stop_gradient.yaml", + "depends_on": [ + "phase_b_registered_contrasts_complete" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s1_s_seed0.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s1-s-seed0", + "model": "s1", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_s_seed0", + "phase": "phase_c_second_scale", + "question": "gate-gradient contribution under aligned forward values", + "seed": 0, + "slug": "s", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stop_gradient.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s1_s_seed0", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s1_d_seed0.json", + "arm": "D", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s1_batch_derangement.yaml", + "depends_on": [ + "phase_b_registered_contrasts_complete" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s1_d_seed0.yaml", + "eta_class": ">12h", + "gate_intervention": "batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s1-d-seed0", + "model": "s1", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_d_seed0", + "phase": "phase_c_second_scale", + "question": "local-batch donor mismatch with an active gate-gradient path", + "seed": 0, + "slug": "d", + "smoke_config_path": "configs/smoke/imagenet5_tpami_batch_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s1_d_seed0", + "volcano_queue": "mobile-video-backbone" + }, + { + "approval_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/approvals/tpami_s1_dd_seed0.json", + "arm": "DD", + "config_path": "configs/tpami_confirmatory/imagenet_gmnet_s1_stopgrad_batch_derangement.yaml", + "depends_on": [ + "phase_b_registered_contrasts_complete" + ], + "deploy_path": "/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720/tpami_s1_dd_seed0.yaml", + "eta_class": ">12h", + "gate_intervention": "stop_gradient_batch_derangement", + "gate_intervention_seed": 41041, + "job_name": "gmnet-tpami-s1-dd-seed0", + "model": "s1", + "output_dir": "/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_dd_seed0", + "phase": "phase_c_second_scale", + "question": "local-batch donor mismatch with its gate branch detached", + "seed": 0, + "slug": "dd", + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_batch_derangement.yaml", + "status": "approved", + "submission_allowed": true, + "task_id": "tpami_s1_dd_seed0", + "volcano_queue": "mobile-video-backbone" + } + ] +} diff --git a/gmnet/deploy/tpami_confirmatory_20260720/smoke_evidence.json b/gmnet/deploy/tpami_confirmatory_20260720/smoke_evidence.json new file mode 100644 index 0000000000000000000000000000000000000000..493271285c6133985b2d2ea0a161ee7d7315bf6e --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/smoke_evidence.json @@ -0,0 +1,473 @@ +{ + "audited_at_utc": "2026-07-20T07:15:11.160386+00:00", + "batch_size": 2, + "code_manifest_path": "configs/code_manifests/tpami_confirmatory_20260720.json", + "code_manifest_sha256": "8b4b76e55d8ab69bf76dc61706d60d87e7bb0c8fe0427dec6bd1db773804de88", + "code_sha256": "643343701e8715a13fc38e4385cb08b1ae1988647071300127176c24a2f47b37", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "eval_batch_size": 3, + "interventions": { + "baseline": { + "arm": "B", + "arm_evidence_sha256": "bb436e20f29419c3bb30c47e27852a7b93a9a3198c528a79b57d9e8eafecb400", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "b8780db0108691244630ed3d0d7f92b72cdb6e89281eca7a374f073324d7bf5e", + "checkpoint_last.pt": "74ae4841827b61a942cdcd280cdd4f61b0e20702e851e3efffa131577d4d4e3a", + "config_resolved.yaml": "8b53487a5eab9a5e8a08b0b474293fea636ab293581f6c66bb37cace49971110", + "config_source.yaml": "cdfec73e75e25c18ec753fcc49094c124305e6717db3fae06bd596102c3a9cac", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "b4c0191e9faefeb8fb8fe8191e2df014b7eb4418696cf9274c56ce066e424527" + }, + "checkpoint_epoch0_sha256": "b8780db0108691244630ed3d0d7f92b72cdb6e89281eca7a374f073324d7bf5e", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "74ae4841827b61a942cdcd280cdd4f61b0e20702e851e3efffa131577d4d4e3a", + "config_fingerprint": "6342e09727201c66a14236a04e6b7f4d892066a6a5d671adeb51917642146621", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "baseline", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "8411ba16ca6d401cb647fe99f2982a42c6e49cb3d0c2da13a3c245f48159f45b", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_b_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_baseline.yaml", + "smoke_config_sha256": "cdfec73e75e25c18ec753fcc49094c124305e6717db3fae06bd596102c3a9cac", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/b", + "training_complete": true, + "world_size": 8 + }, + "batch_derangement": { + "arm": "D", + "arm_evidence_sha256": "103aaae7a2d10ff0e41e50a8a1bd3ade733f68c5639e6c739131f72c72c78f2a", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "998d0e1a875140d64eff92b1abd53aea2def2f838d8218e612eca81026ff6546", + "checkpoint_last.pt": "53fbd60db0eedb52b9df79fe70f40b8df34ce185a682447247ebfc8bc11073a8", + "config_resolved.yaml": "f23afca414de83195e0891f4fe173cb4ab311553cefdf47acfa2023fc52e56a1", + "config_source.yaml": "996a41b4db4ce3522ee530b272922f3137f9ad016f6fbc43a575bf7a94a3b429", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "0ef06fd237d26aae42d103c73ec4c603f8564e2009300d052f74534911eeb0f6" + }, + "checkpoint_epoch0_sha256": "998d0e1a875140d64eff92b1abd53aea2def2f838d8218e612eca81026ff6546", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "53fbd60db0eedb52b9df79fe70f40b8df34ce185a682447247ebfc8bc11073a8", + "config_fingerprint": "511728f78c5311cf3ef69800ca0f358d14b39311766f22c91bea5fb3c9998dfe", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "batch_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": "fd93f80baae6865825bbe424f573633bd6f0370dfa4838f3903185e8c298af7a", + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "403a6ca0fab7d32c729e0d05188ea41e8fe6ef46fd27adc1b12175605176de13", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_d_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_batch_derangement.yaml", + "smoke_config_sha256": "996a41b4db4ce3522ee530b272922f3137f9ad016f6fbc43a575bf7a94a3b429", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/d", + "training_complete": true, + "world_size": 8 + }, + "channel_derangement": { + "arm": "C", + "arm_evidence_sha256": "3544d61e1d06624f823c527c077a08914347ca5685d459179ae296a14c1f0297", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "2abfccced736e2c6c4c086822f9861ea49096a92cdd9fbee6368a12a98eea546", + "checkpoint_last.pt": "908ca3955c365cbbb675ac6d279033c97c7b67378994aff065b4b00bf2d0cd25", + "config_resolved.yaml": "2ea4fc0b19d06f73960500a984f597440c3dd311b4e5a65588026a7934b64c75", + "config_source.yaml": "b9105f3003f3b88a044996fe1e7ddc2d7447f8ca32a244a64cf7e98bec25dbb9", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "cad412da365912e028594a5fa695b63a4c85b1d6648f81b691a0aa6d04e55412" + }, + "checkpoint_epoch0_sha256": "2abfccced736e2c6c4c086822f9861ea49096a92cdd9fbee6368a12a98eea546", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "908ca3955c365cbbb675ac6d279033c97c7b67378994aff065b4b00bf2d0cd25", + "config_fingerprint": "ae1329eaa2ab1bc3898ff35492801b1e7669467df8cfe8047ab66785d8e3bd7f", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "channel_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [ + "119f2202e3052dd65635c59c8693b9e10787820620c3df5d55a66ad36bda5aac", + "65aa7c0d25e252cc1ae98236b1864dd7c39bd2243bb777e6bd03cf81b706d8c6", + "d83766a3a126dd8d1e6d4ec11cea5f4bacea6049f15cd44a4167005d68e4f338", + "b4065e708c8dbb0d1e29aefa0b238780c0fabb7de8f66315ac7207d2b9b7020b", + "c1add1325f039397e1b126e0d807b2ab83ea91605cfeeec884f284a110203a24", + "e549c10b225546dcd5c60c60dac154ca3d599a20ee6e6f3d76e617e6cc26de3c", + "63c3dfebe9204eefc9d0adfd1e432270bfb0c6a30b8a230f623ef92e8b0013cb", + "29bbd34cd1b7403e2f3bbaf03f1e73ceab88b6d672b88044d318fc844f07e039", + "38d10e3ce9e2e97701db148154ef6904c63ca8572bc254e908e46bee15c3d1d5", + "7c7dfdc76eea57e490e9f58097bd5a33c8dab1ed57e305c40800dce7b0c7a1fc", + "fe99e4578cbcdf167c185d1e32f23efc5a4dcbe501e03198cde79fd8454da2d3", + "6f4374ecd86e121c30725a201b0dee38b90e62b11872ad50d21b14e899ec68bc", + "fdbecf663d6296b14dff04e75ebc0bfc8011569971b1c142ac18b372831c0256", + "b7b74a17450be3d8046109291f41613ee0fa1486ef4949fc784ce75a756b074a", + "ea96ebcfdfadb28872f3945d593813dda28b0b07554dc0496b9e2aa0429b374b", + "a52b7dcc5f7f9f2309b5381a846e2205d79c70ff3052f8c4c49e44d3fa552fe7" + ], + "intervention_manifest_sha256": "e9e8e6b942fcef7f8968065db8e90f8b3b5ec4818505927160dd093fc8a82865", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_c_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_channel_derangement.yaml", + "smoke_config_sha256": "b9105f3003f3b88a044996fe1e7ddc2d7447f8ca32a244a64cf7e98bec25dbb9", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/c", + "training_complete": true, + "world_size": 8 + }, + "stop_gradient": { + "arm": "S", + "arm_evidence_sha256": "b579efaf6c26019bed3fd1089bbf3a5a4f8af85628aa119d5bb50b5d52631ed8", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "35d255bc1f35fc8fc41b0cedeaaae1904a5fdaca090ce713603c9b5685cfc0fc", + "checkpoint_last.pt": "1e41cc559d29b8e0a66f52e6970a260bbc058d115501db29959d70899a4d506e", + "config_resolved.yaml": "634ba357bebbe58bb568f413a1d19ca36eed79c6bec691fa8e41db3da0c639f0", + "config_source.yaml": "d2ca4bc4b72a9793d9162096bda9508b57cd7ae8d643b3548428b613ffeb90a4", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "f8b215491a1153c40cbbc4cf2a37a2f27a367d78946e8ca7f3c539a6bbf0eca5" + }, + "checkpoint_epoch0_sha256": "35d255bc1f35fc8fc41b0cedeaaae1904a5fdaca090ce713603c9b5685cfc0fc", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "1e41cc559d29b8e0a66f52e6970a260bbc058d115501db29959d70899a4d506e", + "config_fingerprint": "62f92477f3df0ed599d459f255d78ec0cecb1830fdc291360ea633a62a612611", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "stop_gradient", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "8808435f5f482f014a2862eda3e89dbf39bd66223611dd441fd9d6cd56752bf2", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_s_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_stop_gradient.yaml", + "smoke_config_sha256": "d2ca4bc4b72a9793d9162096bda9508b57cd7ae8d643b3548428b613ffeb90a4", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/s", + "training_complete": true, + "world_size": 8 + }, + "stop_gradient_batch_derangement": { + "arm": "DD", + "arm_evidence_sha256": "d4a07fae3c5cf338d3171c46307b71706cca5e2d78c3c872c9b70e0f7bb5d038", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "15ea9f03f573c9d76906b21d6a3172fd8a7d7c8d53e4ad89895029777bc6b5fc", + "checkpoint_last.pt": "5b59f663b57b4e42270edfa3bdb068f45d8f0f3e99ca2d373594eeeb6db28a79", + "config_resolved.yaml": "66532b0999d5ec4c0df8cd334aceb0055572dcd3d86bed9a45c79d0839cc4b6f", + "config_source.yaml": "12d61e4727f2f6b9584aa16174936e292ab52d0abf4c24c9a9ba37329a1d9dcc", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "6f2fc950977793ec75d927eabed69808ed2c125204104d3e364533cd24c64f5d" + }, + "checkpoint_epoch0_sha256": "15ea9f03f573c9d76906b21d6a3172fd8a7d7c8d53e4ad89895029777bc6b5fc", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "5b59f663b57b4e42270edfa3bdb068f45d8f0f3e99ca2d373594eeeb6db28a79", + "config_fingerprint": "5ece1ee5b5ca696cf05ddd8325d29b7b0a9a9e02a88943d6731d75a2e10a66ba", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "stop_gradient_batch_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": "fd93f80baae6865825bbe424f573633bd6f0370dfa4838f3903185e8c298af7a", + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "3f0d64fcc59c43642917a3e6638da6cdf16c5d5ec75ed345f543d0b5e44302b0", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_dd_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_batch_derangement.yaml", + "smoke_config_sha256": "12d61e4727f2f6b9584aa16174936e292ab52d0abf4c24c9a9ba37329a1d9dcc", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/dd", + "training_complete": true, + "world_size": 8 + }, + "stop_gradient_channel_derangement": { + "arm": "SC", + "arm_evidence_sha256": "d9043028892fb2259d75993f3dcfec1db73933a76f1a6eab126527b19d067ae8", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "52c2c772d58476ed871d04e28816e64eaac2f163d527d9e286585f31cf803812", + "checkpoint_last.pt": "f30a69eb478909711ae0d5df64f194840d8191467a3ccc9cd7b052fb652c7eb7", + "config_resolved.yaml": "c22d88af9bb54245d399be758b4f68383e8001bf1836548ca57d5b17eb98b4fb", + "config_source.yaml": "2facbd63cd3e31ef6d9f75a59ff26a61b3b260292d8d000a1e0abd6279357e0b", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "bf4d1a32a9f19b5a58777b54076fc14bce62107305e56d1b3d2879b0dc26de08" + }, + "checkpoint_epoch0_sha256": "52c2c772d58476ed871d04e28816e64eaac2f163d527d9e286585f31cf803812", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "f30a69eb478909711ae0d5df64f194840d8191467a3ccc9cd7b052fb652c7eb7", + "config_fingerprint": "a24f2524f7dc0418a16284a9a6097c8eb6a9a83712bde2800ff6a657d77582e2", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "stop_gradient_channel_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [ + "119f2202e3052dd65635c59c8693b9e10787820620c3df5d55a66ad36bda5aac", + "65aa7c0d25e252cc1ae98236b1864dd7c39bd2243bb777e6bd03cf81b706d8c6", + "d83766a3a126dd8d1e6d4ec11cea5f4bacea6049f15cd44a4167005d68e4f338", + "b4065e708c8dbb0d1e29aefa0b238780c0fabb7de8f66315ac7207d2b9b7020b", + "c1add1325f039397e1b126e0d807b2ab83ea91605cfeeec884f284a110203a24", + "e549c10b225546dcd5c60c60dac154ca3d599a20ee6e6f3d76e617e6cc26de3c", + "63c3dfebe9204eefc9d0adfd1e432270bfb0c6a30b8a230f623ef92e8b0013cb", + "29bbd34cd1b7403e2f3bbaf03f1e73ceab88b6d672b88044d318fc844f07e039", + "38d10e3ce9e2e97701db148154ef6904c63ca8572bc254e908e46bee15c3d1d5", + "7c7dfdc76eea57e490e9f58097bd5a33c8dab1ed57e305c40800dce7b0c7a1fc", + "fe99e4578cbcdf167c185d1e32f23efc5a4dcbe501e03198cde79fd8454da2d3", + "6f4374ecd86e121c30725a201b0dee38b90e62b11872ad50d21b14e899ec68bc", + "fdbecf663d6296b14dff04e75ebc0bfc8011569971b1c142ac18b372831c0256", + "b7b74a17450be3d8046109291f41613ee0fa1486ef4949fc784ce75a756b074a", + "ea96ebcfdfadb28872f3945d593813dda28b0b07554dc0496b9e2aa0429b374b", + "a52b7dcc5f7f9f2309b5381a846e2205d79c70ff3052f8c4c49e44d3fa552fe7" + ], + "intervention_manifest_sha256": "e015784a96cf58af97c679b844f420a3782b926a0eb45bbd7613ccd9906fdf6c", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_sc_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_channel_derangement.yaml", + "smoke_config_sha256": "2facbd63cd3e31ef6d9f75a59ff26a61b3b260292d8d000a1e0abd6279357e0b", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/sc", + "training_complete": true, + "world_size": 8 + } + }, + "paired_intervention_metadata": { + "batch_mapping_manifest_sha256": "fd93f80baae6865825bbe424f573633bd6f0370dfa4838f3903185e8c298af7a", + "batch_pair_matches": true, + "channel_pair_matches": true, + "channel_permutation_manifest_sha256": "d8207914c88871a146575d37b9de076d8c76b40cfe3b6d819a32aec7ab0db9a7" + }, + "protocol_id": "imagenet-tpami-confirmatory-mechanism-20260720", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "schema_version": 1, + "seed": 0, + "shared_topology": { + "block_count": 16, + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "smoke_root": "/tmp/gmnet_runs/tpami_confirmatory_smoke", + "status": "passed", + "strict_resume": true, + "world_size": 8 +} diff --git a/gmnet/deploy/tpami_confirmatory_20260720/smoke_evidence.pre_queue_override.json b/gmnet/deploy/tpami_confirmatory_20260720/smoke_evidence.pre_queue_override.json new file mode 100644 index 0000000000000000000000000000000000000000..2d80ab76e1416ca2d5fd0cd782e1a6de26552756 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/smoke_evidence.pre_queue_override.json @@ -0,0 +1,473 @@ +{ + "audited_at_utc": "2026-07-20T07:01:45.532010+00:00", + "batch_size": 2, + "code_manifest_path": "configs/code_manifests/tpami_confirmatory_20260720.json", + "code_manifest_sha256": "3d06b25ee988af739bce1d10d9c17fc2566049b39cb67009f4a1a7a57b59e105", + "code_sha256": "e4ea0e86a1b7aad15698db5abff41c7da6ecf66bd68c6230f209b44cc8e30f8c", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "eval_batch_size": 3, + "interventions": { + "baseline": { + "arm": "B", + "arm_evidence_sha256": "356a958c906dc0167fbd4cdeb1a45699a9c0003a9f00be185b2dd572b81e4d3a", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "787bede8f659750c4a2cf54db9985ff274f0a34b8084e144e83704db84e68bc2", + "checkpoint_last.pt": "a3981b54db1b3a09fb76c3a61297d7c51796c418de6b79efcace9e57a4f50045", + "config_resolved.yaml": "8139799a5a0f5986d1483bc9875ef1ad45bff624e3513b476c20cb04a2b2aba2", + "config_source.yaml": "cdfec73e75e25c18ec753fcc49094c124305e6717db3fae06bd596102c3a9cac", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "8c5afa26532e663e6d444eda749a99ad80ade52554adf6188fece617606f81b2" + }, + "checkpoint_epoch0_sha256": "787bede8f659750c4a2cf54db9985ff274f0a34b8084e144e83704db84e68bc2", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "a3981b54db1b3a09fb76c3a61297d7c51796c418de6b79efcace9e57a4f50045", + "config_fingerprint": "cd2b944c39ff030cecf5dc036f369f1f41701032a3ae4230773c06bf1498893d", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "baseline", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "8411ba16ca6d401cb647fe99f2982a42c6e49cb3d0c2da13a3c245f48159f45b", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_b_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_baseline.yaml", + "smoke_config_sha256": "cdfec73e75e25c18ec753fcc49094c124305e6717db3fae06bd596102c3a9cac", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/b", + "training_complete": true, + "world_size": 8 + }, + "batch_derangement": { + "arm": "D", + "arm_evidence_sha256": "3c4f7a1b3878eac1f73496d6d7d66b477b2f1470e310bf4e1394df20a6ee49b1", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "dadd8da2b0c00fed460b2469c29b2448d08e4539d95707d227cedc9149f47a83", + "checkpoint_last.pt": "c20db9cf5d7728d2f38f9819fb071862a8186c560057b8326e65c68fb0683a74", + "config_resolved.yaml": "8ff033ccc0fbe14f1d4ddf12d29efa04c903a4dfbdd9e1215e72923b54dc394f", + "config_source.yaml": "996a41b4db4ce3522ee530b272922f3137f9ad016f6fbc43a575bf7a94a3b429", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "990b01dc6b50723da883f6510544f23a2c79c5b2f7168296676662859fd172e6" + }, + "checkpoint_epoch0_sha256": "dadd8da2b0c00fed460b2469c29b2448d08e4539d95707d227cedc9149f47a83", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "c20db9cf5d7728d2f38f9819fb071862a8186c560057b8326e65c68fb0683a74", + "config_fingerprint": "1e3fc5596385effd4c59e3751674684a70abb0218ce319c8de97b92f7dd589b9", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "batch_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": "fd93f80baae6865825bbe424f573633bd6f0370dfa4838f3903185e8c298af7a", + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "403a6ca0fab7d32c729e0d05188ea41e8fe6ef46fd27adc1b12175605176de13", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_d_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_batch_derangement.yaml", + "smoke_config_sha256": "996a41b4db4ce3522ee530b272922f3137f9ad016f6fbc43a575bf7a94a3b429", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/d", + "training_complete": true, + "world_size": 8 + }, + "channel_derangement": { + "arm": "C", + "arm_evidence_sha256": "28656217f03419a85f5af328d46168808dcfff92ba3a69f10c291a6d4ef0b4d9", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "ca7f65fa22350cec40af77cf6d84323ee263d84d574d01beb0afaceca9690204", + "checkpoint_last.pt": "6db1df056c81df85b8f3f9055d770ff8e5359425525f1266272ad8031a3ee587", + "config_resolved.yaml": "b00fd04f1074065a099f0dedeef4b46ac596e34614ad7e4fe18db32f01f279c3", + "config_source.yaml": "b9105f3003f3b88a044996fe1e7ddc2d7447f8ca32a244a64cf7e98bec25dbb9", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "94fd78c5dfaefaa33595dc17c2e883b62f442d1e6693c94052b9ca095c103374" + }, + "checkpoint_epoch0_sha256": "ca7f65fa22350cec40af77cf6d84323ee263d84d574d01beb0afaceca9690204", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "6db1df056c81df85b8f3f9055d770ff8e5359425525f1266272ad8031a3ee587", + "config_fingerprint": "daf487d312b5ab7c2c9d16ddf4341deebb6f92bae88404faeb51502714495473", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "channel_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [ + "119f2202e3052dd65635c59c8693b9e10787820620c3df5d55a66ad36bda5aac", + "65aa7c0d25e252cc1ae98236b1864dd7c39bd2243bb777e6bd03cf81b706d8c6", + "d83766a3a126dd8d1e6d4ec11cea5f4bacea6049f15cd44a4167005d68e4f338", + "b4065e708c8dbb0d1e29aefa0b238780c0fabb7de8f66315ac7207d2b9b7020b", + "c1add1325f039397e1b126e0d807b2ab83ea91605cfeeec884f284a110203a24", + "e549c10b225546dcd5c60c60dac154ca3d599a20ee6e6f3d76e617e6cc26de3c", + "63c3dfebe9204eefc9d0adfd1e432270bfb0c6a30b8a230f623ef92e8b0013cb", + "29bbd34cd1b7403e2f3bbaf03f1e73ceab88b6d672b88044d318fc844f07e039", + "38d10e3ce9e2e97701db148154ef6904c63ca8572bc254e908e46bee15c3d1d5", + "7c7dfdc76eea57e490e9f58097bd5a33c8dab1ed57e305c40800dce7b0c7a1fc", + "fe99e4578cbcdf167c185d1e32f23efc5a4dcbe501e03198cde79fd8454da2d3", + "6f4374ecd86e121c30725a201b0dee38b90e62b11872ad50d21b14e899ec68bc", + "fdbecf663d6296b14dff04e75ebc0bfc8011569971b1c142ac18b372831c0256", + "b7b74a17450be3d8046109291f41613ee0fa1486ef4949fc784ce75a756b074a", + "ea96ebcfdfadb28872f3945d593813dda28b0b07554dc0496b9e2aa0429b374b", + "a52b7dcc5f7f9f2309b5381a846e2205d79c70ff3052f8c4c49e44d3fa552fe7" + ], + "intervention_manifest_sha256": "e9e8e6b942fcef7f8968065db8e90f8b3b5ec4818505927160dd093fc8a82865", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_c_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_channel_derangement.yaml", + "smoke_config_sha256": "b9105f3003f3b88a044996fe1e7ddc2d7447f8ca32a244a64cf7e98bec25dbb9", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/c", + "training_complete": true, + "world_size": 8 + }, + "stop_gradient": { + "arm": "S", + "arm_evidence_sha256": "93877d8d0f3125c1e75f505c5775cbbda9ec6640a1580ba3d9ac7443d2509d0b", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "9999a1620bede522fe89343c472e8f86e5ec726fa69a39054d36ec8f75692250", + "checkpoint_last.pt": "5840136d85bc11f11f44362dfdcb076dc71a4565028874c3288730ee0644af61", + "config_resolved.yaml": "9e20ccc82661562658a50ab76cce139deb554feeb59378b0611b80b0f59083ae", + "config_source.yaml": "d2ca4bc4b72a9793d9162096bda9508b57cd7ae8d643b3548428b613ffeb90a4", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "d0ec3f52b1696d3efb998aeff61806b2907f7d95964aa9c12e426ab8d717bac6" + }, + "checkpoint_epoch0_sha256": "9999a1620bede522fe89343c472e8f86e5ec726fa69a39054d36ec8f75692250", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "5840136d85bc11f11f44362dfdcb076dc71a4565028874c3288730ee0644af61", + "config_fingerprint": "3301fd061363536e1e4f67fcef90ce91c072f5ecdcc98a1011e2a5c937bcce2c", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "stop_gradient", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "8808435f5f482f014a2862eda3e89dbf39bd66223611dd441fd9d6cd56752bf2", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_s_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_stop_gradient.yaml", + "smoke_config_sha256": "d2ca4bc4b72a9793d9162096bda9508b57cd7ae8d643b3548428b613ffeb90a4", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/s", + "training_complete": true, + "world_size": 8 + }, + "stop_gradient_batch_derangement": { + "arm": "DD", + "arm_evidence_sha256": "d549fa96c2f73f329292da9687eb4ff85236c90e44df8d2d2ec4266b8077ac25", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "5578076fba1157a8deac905cd3587bb73b23be04ca2b1be0d7e1210abaf6228d", + "checkpoint_last.pt": "d5a3bf46483e706b0e381128af44e3915aa675319a16d0e20d65ff29d4fe490a", + "config_resolved.yaml": "a65808ba948f045b6ba947bd39826904e8c120aad7d6b26dd6eebb146b767666", + "config_source.yaml": "12d61e4727f2f6b9584aa16174936e292ab52d0abf4c24c9a9ba37329a1d9dcc", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "8fa5a67f657934a032ca2bd10184674eec566ee0fdfbaca8d5e0dff93730d27a" + }, + "checkpoint_epoch0_sha256": "5578076fba1157a8deac905cd3587bb73b23be04ca2b1be0d7e1210abaf6228d", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "d5a3bf46483e706b0e381128af44e3915aa675319a16d0e20d65ff29d4fe490a", + "config_fingerprint": "4f62065f33ac099c3d8289862aa8ba98b793abc19cbf28ed20998746020e1fe3", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "stop_gradient_batch_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": "fd93f80baae6865825bbe424f573633bd6f0370dfa4838f3903185e8c298af7a", + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [], + "intervention_manifest_sha256": "3f0d64fcc59c43642917a3e6638da6cdf16c5d5ec75ed345f543d0b5e44302b0", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_dd_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_batch_derangement.yaml", + "smoke_config_sha256": "12d61e4727f2f6b9584aa16174936e292ab52d0abf4c24c9a9ba37329a1d9dcc", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/dd", + "training_complete": true, + "world_size": 8 + }, + "stop_gradient_channel_derangement": { + "arm": "SC", + "arm_evidence_sha256": "663f7c8605257291df666402a5f4c3cc2338cd955a838cb0f4290c2f83e5f377", + "artifacts_sha256": { + "checkpoint_epoch0.pt": "4720f5298fcebbcfe30e5eadd7d547bdebcee671a000433ac56e74c6ce1362a3", + "checkpoint_last.pt": "f1d745622349b4baddff73c28f1ce8138820bccbf49c6cfd17f63284a01b4fc3", + "config_resolved.yaml": "752242e99ec978af3c79a5c70aae567c1ae0f1258ed2e31f434ec5fe50919234", + "config_source.yaml": "2facbd63cd3e31ef6d9f75a59ff26a61b3b260292d8d000a1e0abd6279357e0b", + "data_manifest.json": "e5235fbb723a9fa9103b07482ff5ecb5227d3177d8abdf97975397ff48438e45", + "metrics.jsonl": "54ebe3a79c0ef0f024dcb4150b4ef4f7263abe3b7d4e7b70e245f5be420cb2f1" + }, + "checkpoint_epoch0_sha256": "4720f5298fcebbcfe30e5eadd7d547bdebcee671a000433ac56e74c6ce1362a3", + "checkpoint_hash_changed": true, + "checkpoint_last_sha256": "f1d745622349b4baddff73c28f1ce8138820bccbf49c6cfd17f63284a01b4fc3", + "config_fingerprint": "4051269b9c4d3efd71dffb916ed0d0def12e2f6e1d2bce05ad458f78d1bd31c5", + "data_manifest_sha256": "103c257d284318cbdb55c002a8b423dd581a42152cdc6e3bd94c2dc6cfa203fa", + "gate_intervention": "stop_gradient_channel_derangement", + "gate_intervention_seed": 41041, + "metric_record_count": 4, + "model_identity": { + "batch_mapping_manifest_sha256": null, + "block_count": 16, + "block_seed_stride": 10007, + "channel_permutation_hashes": [ + "119f2202e3052dd65635c59c8693b9e10787820620c3df5d55a66ad36bda5aac", + "65aa7c0d25e252cc1ae98236b1864dd7c39bd2243bb777e6bd03cf81b706d8c6", + "d83766a3a126dd8d1e6d4ec11cea5f4bacea6049f15cd44a4167005d68e4f338", + "b4065e708c8dbb0d1e29aefa0b238780c0fabb7de8f66315ac7207d2b9b7020b", + "c1add1325f039397e1b126e0d807b2ab83ea91605cfeeec884f284a110203a24", + "e549c10b225546dcd5c60c60dac154ca3d599a20ee6e6f3d76e617e6cc26de3c", + "63c3dfebe9204eefc9d0adfd1e432270bfb0c6a30b8a230f623ef92e8b0013cb", + "29bbd34cd1b7403e2f3bbaf03f1e73ceab88b6d672b88044d318fc844f07e039", + "38d10e3ce9e2e97701db148154ef6904c63ca8572bc254e908e46bee15c3d1d5", + "7c7dfdc76eea57e490e9f58097bd5a33c8dab1ed57e305c40800dce7b0c7a1fc", + "fe99e4578cbcdf167c185d1e32f23efc5a4dcbe501e03198cde79fd8454da2d3", + "6f4374ecd86e121c30725a201b0dee38b90e62b11872ad50d21b14e899ec68bc", + "fdbecf663d6296b14dff04e75ebc0bfc8011569971b1c142ac18b372831c0256", + "b7b74a17450be3d8046109291f41613ee0fa1486ef4949fc784ce75a756b074a", + "ea96ebcfdfadb28872f3945d593813dda28b0b07554dc0496b9e2aa0429b374b", + "a52b7dcc5f7f9f2309b5381a846e2205d79c70ff3052f8c4c49e44d3fa552fe7" + ], + "intervention_manifest_sha256": "e015784a96cf58af97c679b844f420a3782b926a0eb45bbd7613ccd9906fdf6c", + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "model_state_changed": true, + "resume_verified": true, + "run_name": "tpami_smoke_sc_seed0", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "seed": 0, + "smoke_config_path": "configs/smoke/imagenet5_tpami_stopgrad_channel_derangement.yaml", + "smoke_config_sha256": "2facbd63cd3e31ef6d9f75a59ff26a61b3b260292d8d000a1e0abd6279357e0b", + "smoke_run_dir": "/tmp/gmnet_runs/tpami_confirmatory_smoke/sc", + "training_complete": true, + "world_size": 8 + } + }, + "paired_intervention_metadata": { + "batch_mapping_manifest_sha256": "fd93f80baae6865825bbe424f573633bd6f0370dfa4838f3903185e8c298af7a", + "batch_pair_matches": true, + "channel_pair_matches": true, + "channel_permutation_manifest_sha256": "d8207914c88871a146575d37b9de076d8c76b40cfe3b6d819a32aec7ab0db9a7" + }, + "protocol_id": "imagenet-tpami-confirmatory-mechanism-20260720", + "runtime": { + "allow_runtime_drift": true, + "cuda": "13.0", + "cuda_available": true, + "gpu_count": 8, + "gpu_names": [ + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB", + "NVIDIA A100-SXM4-80GB" + ], + "python": "3.12.10", + "python_major_minor": "3.12", + "reference": { + "cuda": "13.0", + "python_major_minor": "3.12", + "torch": "2.9.0+cu130" + }, + "reference_match": false, + "torch": "2.10.0+cu130" + }, + "schema_version": 1, + "seed": 0, + "shared_topology": { + "block_count": 16, + "model_state_schema_sha256": "856f1e7085c1cbbdaa1b12aea5c9ad50c02aec65b6cc419b24c2e440221bde0c", + "parameter_count": 3342205, + "state_tensor_count": 346 + }, + "smoke_root": "/tmp/gmnet_runs/tpami_confirmatory_smoke", + "status": "passed", + "strict_resume": true, + "world_size": 8 +} diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_b_seed0.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_b_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..df11f038abf3881674c07e8052cb436b3012ce69 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_b_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_b_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_b_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_b_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_b_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_baseline.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_b_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-b-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_d_seed0.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_d_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4a35cd487a915cf2cee7bb0bb9e8aa74f45a31ed --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_d_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_d_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_d_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_d_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_d_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_d_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-d-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_dd_seed0.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_dd_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0cb32b2e9d1dccb328218153010a21e0b7f81699 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_dd_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_dd_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_dd_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_dd_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_dd_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_stopgrad_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_dd_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-dd-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_s_seed0.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_s_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..23e8d3e1fbfdb23206121d0751d7494abaff7bef --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s1_s_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_s_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_s_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_s_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_s_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_stop_gradient.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_s_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-s-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_b_seed1.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_b_seed1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8fc314b290fcf33d5a70686945bc67d43378f155 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_b_seed1.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_b_seed1 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_b_seed1 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_b_seed1 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_b_seed1 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_baseline.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_b_seed1 SEED=1 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-b-seed1 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_b_seed2.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_b_seed2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..93b3eefefae48455e6e2531df1cb9c0405c3ea24 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_b_seed2.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_b_seed2 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_b_seed2 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_b_seed2 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_b_seed2 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_baseline.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_b_seed2 SEED=2 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-b-seed2 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_c_seed1.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_c_seed1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ed6ad81ffde701d219ea48debf16962b75c2027a --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_c_seed1.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_c_seed1 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_c_seed1 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_c_seed1 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_c_seed1 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_channel_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_c_seed1 SEED=1 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-c-seed1 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_c_seed2.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_c_seed2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1b4bd8157d252b4303546976f378ff33e37069a0 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_c_seed2.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_c_seed2 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_c_seed2 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_c_seed2 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_c_seed2 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_channel_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_c_seed2 SEED=2 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-c-seed2 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_d_seed1.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_d_seed1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2e08380636028e01d395ea690486c6f67122664d --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_d_seed1.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_d_seed1 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_d_seed1 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_d_seed1 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_d_seed1 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_d_seed1 SEED=1 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-d-seed1 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_d_seed2.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_d_seed2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c1b1f4af9da699b4e21560a62aad51845251029f --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_d_seed2.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_d_seed2 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_d_seed2 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_d_seed2 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_d_seed2 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_d_seed2 SEED=2 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-d-seed2 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed0.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..269cf48299e73051f1f3e86dbb4c6774a1f8372a --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_dd_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_dd_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-dd-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed1.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f288de4e45d1ff335faf557f394bb4e067d00fdb --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed1.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed1 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed1 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed1 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_dd_seed1 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_dd_seed1 SEED=1 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-dd-seed1 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed2.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..881fa0348fe5b5b330177142942259d38edc5bb5 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_dd_seed2.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed2 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed2 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed2 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_dd_seed2 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_dd_seed2 SEED=2 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-dd-seed2 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_s_seed1.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_s_seed1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..da158dfec228bde78bef98e1276db5c0868d9afc --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_s_seed1.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_s_seed1 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_s_seed1 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_s_seed1 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_s_seed1 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stop_gradient.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_s_seed1 SEED=1 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-s-seed1 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_s_seed2.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_s_seed2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8c47a4df2bfcc12e35b529068bf5d7e2a965880c --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_s_seed2.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_s_seed2 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_s_seed2 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_s_seed2 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_s_seed2 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stop_gradient.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_s_seed2 SEED=2 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-s-seed2 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_sc_seed1.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_sc_seed1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..40c81b0959a7937771d2ae1bfd7abb037bdf1522 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_sc_seed1.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_sc_seed1 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_sc_seed1 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_sc_seed1 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_sc_seed1 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_sc_seed1 SEED=1 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-sc-seed1 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_sc_seed2.yaml b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_sc_seed2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0b25aab1d3d18e8b403ba8493d5fbf42e39dd411 --- /dev/null +++ b/gmnet/deploy/tpami_confirmatory_20260720/tpami_s3_sc_seed2.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_sc_seed2 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_sc_seed2 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_sc_seed2 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_sc_seed2 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_channel_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_sc_seed2 SEED=2 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-sc-seed2 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_seed0_20260720/README.md b/gmnet/deploy/tpami_seed0_20260720/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b74bb66ff9327736722b1f8d6a82da7e5e924053 --- /dev/null +++ b/gmnet/deploy/tpami_seed0_20260720/README.md @@ -0,0 +1,28 @@ +# TPAMI Seed-0 Launch View + +This directory is the current five-job launch scope. It contains no multi-seed +YAMLs and no job has been submitted. + +## S3 + +`tpami_s3_dd_seed0.yaml` is the only new S3 seed-0 training job. Existing +B/S/C/SC/D seed-0 fixed-final results are reused; rerunning them would add cost +without filling a missing contrast. + +## S1 + +The four S1 jobs B/S/D/DD form the complete sample-alignment 2x2 control: + +- S minus DD isolates forward same-sample alignment with both gate branches + detached. +- B minus S measures aligned gate-gradient contribution. +- D minus DD measures gate-gradient contribution under donor mismatch. + +## Queue Assignment + +- S3 DD uses `diffusion-training-acceleration`. +- The four S1 jobs use `mobile-video-backbone`. + +The canonical generated batch, approvals, smoke evidence, and deferred +multi-seed YAMLs remain at +`/nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720`. diff --git a/gmnet/deploy/tpami_seed0_20260720/seed0_manifest.yaml b/gmnet/deploy/tpami_seed0_20260720/seed0_manifest.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b5ec4ef9840564ea1f743337458014a8400e3660 --- /dev/null +++ b/gmnet/deploy/tpami_seed0_20260720/seed0_manifest.yaml @@ -0,0 +1,55 @@ +schema_version: 1 +status: ready_not_submitted +selection: s1_s3_seed0_only +created_at_utc: "2026-07-20T07:16:00Z" +source_batch: /nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720 +code_root: /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code +code_sha256: 643343701e8715a13fc38e4385cb08b1ae1988647071300127176c24a2f47b37 +data_root: /tmp/gmnet_data/imagenet-1k +data_source: s3://snap-research-cv-code/ywang29/datasets/imagenet-1k/imagenet-1k.tar +task_count: 5 +multi_seed_in_current_scope: false +launchjob_submitted: false +queue_counts: + diffusion-training-acceleration: 1 + mobile-video-backbone: 4 +tasks: + - task_id: tpami_s3_dd_seed0 + model: s3 + arm: DD + seed: 0 + volcano_queue: diffusion-training-acceleration + yaml: tpami_s3_dd_seed0.yaml + - task_id: tpami_s1_b_seed0 + model: s1 + arm: B + seed: 0 + volcano_queue: mobile-video-backbone + yaml: tpami_s1_b_seed0.yaml + - task_id: tpami_s1_s_seed0 + model: s1 + arm: S + seed: 0 + volcano_queue: mobile-video-backbone + yaml: tpami_s1_s_seed0.yaml + - task_id: tpami_s1_d_seed0 + model: s1 + arm: D + seed: 0 + volcano_queue: mobile-video-backbone + yaml: tpami_s1_d_seed0.yaml + - task_id: tpami_s1_dd_seed0 + model: s1 + arm: DD + seed: 0 + volcano_queue: mobile-video-backbone + yaml: tpami_s1_dd_seed0.yaml +reused_completed_s3_seed0: + arms: [B, S, C, SC, D] + reason: >- + Existing fixed-final seed-0 artifacts passed official validation; only DD + is missing from the S3 seed-0 sample-factor panel. +deferred: + task_count: 12 + scope: s3_seeds_1_and_2 + location: /nfs/ywang29/GmNet/depoly/tpami_confirmatory_20260720 diff --git a/gmnet/deploy/tpami_seed0_20260720/tpami_s1_b_seed0.yaml b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_b_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..df11f038abf3881674c07e8052cb436b3012ce69 --- /dev/null +++ b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_b_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_b_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_b_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_b_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_b_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_baseline.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_b_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-b-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_seed0_20260720/tpami_s1_d_seed0.yaml b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_d_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4a35cd487a915cf2cee7bb0bb9e8aa74f45a31ed --- /dev/null +++ b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_d_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_d_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_d_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_d_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_d_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_d_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-d-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_seed0_20260720/tpami_s1_dd_seed0.yaml b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_dd_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0cb32b2e9d1dccb328218153010a21e0b7f81699 --- /dev/null +++ b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_dd_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_dd_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_dd_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_dd_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_dd_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_stopgrad_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_dd_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-dd-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_seed0_20260720/tpami_s1_s_seed0.yaml b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_s_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..23e8d3e1fbfdb23206121d0751d7494abaff7bef --- /dev/null +++ b/gmnet/deploy/tpami_seed0_20260720/tpami_s1_s_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: mobile-video-backbone +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_s_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_s_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s1_s_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s1_s_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s1_stop_gradient.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s1_s_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s1-s-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2 diff --git a/gmnet/deploy/tpami_seed0_20260720/tpami_s3_dd_seed0.yaml b/gmnet/deploy/tpami_seed0_20260720/tpami_s3_dd_seed0.yaml new file mode 100644 index 0000000000000000000000000000000000000000..269cf48299e73051f1f3e86dbb4c6774a1f8372a --- /dev/null +++ b/gmnet/deploy/tpami_seed0_20260720/tpami_s3_dd_seed0.yaml @@ -0,0 +1,45 @@ +# Generated by scripts/generate_tpami_confirmatory_deploy.py; do not edit. +gpu_type: nvidia-tesla-a100 +gpu_num: '8' +gpu_memory: '80' +cpu_num: '88' +memory: '880.0' +efa: false +priority: gpu-high +pytorchjob: + replicas: 1 +custom_node_labels: + snap.com/zone: us-west-2c + snap.com/ami_type: al2023 +volcano_queue: diffusion-training-acceleration +script: + pre_run_event: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && chmod +x ./scripts/*.sh && INSTALL_DEV=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/setup_env.sh && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed0 --require-approval && KEEP_ARCHIVE=0 VENV_DIR=/tmp/gmnet_venv bash ./scripts/stage_imagenet.sh full && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed0 --require-approval + command: cd /nfs/ywang29/GmNet/tpami_confirmatory_20260720/code && /tmp/gmnet_venv/bin/python scripts/generate_tpami_confirmatory_deploy.py --verify-task tpami_s3_dd_seed0 --require-approval && REPO_DIR=/nfs/ywang29/GmNet/tpami_confirmatory_20260720/code RUN_NAME=tpami_s3_dd_seed0 CONFIG_PATH=configs/tpami_confirmatory/imagenet_gmnet_s3_stopgrad_batch_derangement.yaml DATA_ROOT=/tmp/gmnet_data/imagenet-1k OUTPUT_DIR=/nfs/ywang29/GmNet/runs/tpami_confirmatory_20260720/tpami_s3_dd_seed0 SEED=0 NPROC_PER_NODE=8 RESUME=auto POST_EVAL=1 VENV_DIR=/tmp/gmnet_venv CODE_MANIFEST_PATH=configs/code_manifests/tpami_confirmatory_20260720.json bash scripts/run_tpami_confirmatory.sh + jobs: + - name: gmnet-tpami-s3-dd-seed0 +project_name: mobile_video +project_support_alias: ywang29 +team: creative_vision +cost_team: generative_ai +cost_feature: generative_ai_development +cost_sub_feature: video_generation +docker_image: 763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:2.9.0-gpu-py312-cu130-ubuntu22.04-ec2 +mount: +- type: s3 + name: snap-research-cv-code + mount_path: /s3-code +- type: fsx + name: fs-0aec9ce19ecc66a45 + mount_path: /nfs +- type: fsx + name: fs-0a730854e147a7bc2 + mount_path: /nfs-generative-one-shot +- type: fsx + name: fs-0edcd5941d62ce319 + mount_path: /snaphub +- type: s3 + name: snap-genvid + mount_path: /snap-genvid +- type: s3 + name: snap-genvid-us-east-2 + mount_path: /snap-genvid-us-east-2