Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/README.md +5 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/no_mask.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_10.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_15.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_20.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_30.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_40.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_50.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_no_mask.json +24 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_10.json +26 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_15.json +26 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_20.json +26 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_30.json +26 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_40.json +26 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_50.json +26 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/build_ntrex.log +6 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_no_mask.log +2 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_10.log +2 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_15.log +2 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_20.log +2 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_30.log +2 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_40.log +2 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_50.log +2 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/hf_download_issue42.log +4 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/issue43_progress.log +23 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/nohup.log +23 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/package_issue43_hf_upload.log +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/select_percentile_masks.log +6 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/summarize_issue43.log +5 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_no_mask.log +17 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_10.log +17 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_15.log +17 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_20.log +17 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_30.log +17 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_40.log +17 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_50.log +17 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/manifests/SHA256SUMS +156 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/manifests/manifest.json +7 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/restored/issue42/circuit-shotting/artifacts/percentile_proxy/issue42_percentile_proxy_20260518T110628Z/damage/percentile_results.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/actdelta_mlp_common.py +252 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/build_ntrex_en2pt_jsonl.py +35 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/evaluate_mlp_nuke_translation.py +212 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/issue43_xcomet_destructive_mlp_runner.sh +326 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/package_issue43_hf_upload.sh +87 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/score_xcomet_sharded.py +194 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/select_percentile_mlp_mix.py +104 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/summarize_issue43_xcomet_destructive_mlp.py +169 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/xcomet_service.py +560 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/cumulative_percentile_mixes.jsonl +0 -0
- circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_1.full.npz +3 -0
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Issue 43 XCOMET Destructive MLP 95% Gate Artifacts
|
| 2 |
+
|
| 3 |
+
This package contains restored issue #42 percentile damage inputs, cumulative MLP masks, NTREX generation dumps, XCOMET scores, summaries, and logs for the destructive <=5% recovery gate.
|
| 4 |
+
|
| 5 |
+
Upstream HY-MT and XCOMET model weights are not included.
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/no_mask.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_10.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_15.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_20.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_30.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_40.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_50.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_no_mask.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "tencent/HY-MT1.5-1.8B",
|
| 3 |
+
"n_layers": 32,
|
| 4 |
+
"hidden_size": 2048,
|
| 5 |
+
"d_ffn": 6144,
|
| 6 |
+
"row_slice": {
|
| 7 |
+
"start_idx": 0,
|
| 8 |
+
"end_idx": 1012
|
| 9 |
+
},
|
| 10 |
+
"n_rows": 1012,
|
| 11 |
+
"results": {
|
| 12 |
+
"no_mask": {
|
| 13 |
+
"scores": {
|
| 14 |
+
"chrFpp": 54.224041106849185,
|
| 15 |
+
"chrF": 56.928538294695194,
|
| 16 |
+
"BLEU": 25.785229280531734,
|
| 17 |
+
"n": 1012
|
| 18 |
+
},
|
| 19 |
+
"elapsed_s": 120.06071972846985,
|
| 20 |
+
"dump_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/no_mask.jsonl",
|
| 21 |
+
"channels": 0
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_10.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "tencent/HY-MT1.5-1.8B",
|
| 3 |
+
"n_layers": 32,
|
| 4 |
+
"hidden_size": 2048,
|
| 5 |
+
"d_ffn": 6144,
|
| 6 |
+
"row_slice": {
|
| 7 |
+
"start_idx": 0,
|
| 8 |
+
"end_idx": 1012
|
| 9 |
+
},
|
| 10 |
+
"n_rows": 1012,
|
| 11 |
+
"results": {
|
| 12 |
+
"percentile_top_10": {
|
| 13 |
+
"scores": {
|
| 14 |
+
"chrFpp": 2.023711437925785,
|
| 15 |
+
"chrF": 2.6477265882046366,
|
| 16 |
+
"BLEU": 0.002859284356231794,
|
| 17 |
+
"n": 1012
|
| 18 |
+
},
|
| 19 |
+
"elapsed_s": 488.18473625183105,
|
| 20 |
+
"dump_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_10.jsonl",
|
| 21 |
+
"channels": 19660,
|
| 22 |
+
"mask_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/selection/percentile/masks/percentile_top_10.full.npz",
|
| 23 |
+
"intervention": "nuke-zero"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_15.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "tencent/HY-MT1.5-1.8B",
|
| 3 |
+
"n_layers": 32,
|
| 4 |
+
"hidden_size": 2048,
|
| 5 |
+
"d_ffn": 6144,
|
| 6 |
+
"row_slice": {
|
| 7 |
+
"start_idx": 0,
|
| 8 |
+
"end_idx": 1012
|
| 9 |
+
},
|
| 10 |
+
"n_rows": 1012,
|
| 11 |
+
"results": {
|
| 12 |
+
"percentile_top_15": {
|
| 13 |
+
"scores": {
|
| 14 |
+
"chrFpp": 1.0764037131822992,
|
| 15 |
+
"chrF": 1.4352049509097324,
|
| 16 |
+
"BLEU": 0.0009640701642685707,
|
| 17 |
+
"n": 1012
|
| 18 |
+
},
|
| 19 |
+
"elapsed_s": 474.4585359096527,
|
| 20 |
+
"dump_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_15.jsonl",
|
| 21 |
+
"channels": 29491,
|
| 22 |
+
"mask_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/selection/percentile/masks/percentile_top_15.full.npz",
|
| 23 |
+
"intervention": "nuke-zero"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_20.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "tencent/HY-MT1.5-1.8B",
|
| 3 |
+
"n_layers": 32,
|
| 4 |
+
"hidden_size": 2048,
|
| 5 |
+
"d_ffn": 6144,
|
| 6 |
+
"row_slice": {
|
| 7 |
+
"start_idx": 0,
|
| 8 |
+
"end_idx": 1012
|
| 9 |
+
},
|
| 10 |
+
"n_rows": 1012,
|
| 11 |
+
"results": {
|
| 12 |
+
"percentile_top_20": {
|
| 13 |
+
"scores": {
|
| 14 |
+
"chrFpp": 2.4641771477317875,
|
| 15 |
+
"chrF": 2.6459489632437827,
|
| 16 |
+
"BLEU": 0.007639825625700025,
|
| 17 |
+
"n": 1012
|
| 18 |
+
},
|
| 19 |
+
"elapsed_s": 505.30048990249634,
|
| 20 |
+
"dump_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_20.jsonl",
|
| 21 |
+
"channels": 39321,
|
| 22 |
+
"mask_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/selection/percentile/masks/percentile_top_20.full.npz",
|
| 23 |
+
"intervention": "nuke-zero"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_30.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "tencent/HY-MT1.5-1.8B",
|
| 3 |
+
"n_layers": 32,
|
| 4 |
+
"hidden_size": 2048,
|
| 5 |
+
"d_ffn": 6144,
|
| 6 |
+
"row_slice": {
|
| 7 |
+
"start_idx": 0,
|
| 8 |
+
"end_idx": 1012
|
| 9 |
+
},
|
| 10 |
+
"n_rows": 1012,
|
| 11 |
+
"results": {
|
| 12 |
+
"percentile_top_30": {
|
| 13 |
+
"scores": {
|
| 14 |
+
"chrFpp": 3.1316565972832366,
|
| 15 |
+
"chrF": 4.172057644643041,
|
| 16 |
+
"BLEU": 0.0008254288439485306,
|
| 17 |
+
"n": 1012
|
| 18 |
+
},
|
| 19 |
+
"elapsed_s": 497.1354627609253,
|
| 20 |
+
"dump_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_30.jsonl",
|
| 21 |
+
"channels": 58982,
|
| 22 |
+
"mask_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/selection/percentile/masks/percentile_top_30.full.npz",
|
| 23 |
+
"intervention": "nuke-zero"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_40.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "tencent/HY-MT1.5-1.8B",
|
| 3 |
+
"n_layers": 32,
|
| 4 |
+
"hidden_size": 2048,
|
| 5 |
+
"d_ffn": 6144,
|
| 6 |
+
"row_slice": {
|
| 7 |
+
"start_idx": 0,
|
| 8 |
+
"end_idx": 1012
|
| 9 |
+
},
|
| 10 |
+
"n_rows": 1012,
|
| 11 |
+
"results": {
|
| 12 |
+
"percentile_top_40": {
|
| 13 |
+
"scores": {
|
| 14 |
+
"chrFpp": 2.0259324848441826,
|
| 15 |
+
"chrF": 2.701243313125577,
|
| 16 |
+
"BLEU": 0.000277549379833518,
|
| 17 |
+
"n": 1012
|
| 18 |
+
},
|
| 19 |
+
"elapsed_s": 493.63351464271545,
|
| 20 |
+
"dump_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_40.jsonl",
|
| 21 |
+
"channels": 78643,
|
| 22 |
+
"mask_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/selection/percentile/masks/percentile_top_40.full.npz",
|
| 23 |
+
"intervention": "nuke-zero"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_50.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "tencent/HY-MT1.5-1.8B",
|
| 3 |
+
"n_layers": 32,
|
| 4 |
+
"hidden_size": 2048,
|
| 5 |
+
"d_ffn": 6144,
|
| 6 |
+
"row_slice": {
|
| 7 |
+
"start_idx": 0,
|
| 8 |
+
"end_idx": 1012
|
| 9 |
+
},
|
| 10 |
+
"n_rows": 1012,
|
| 11 |
+
"results": {
|
| 12 |
+
"percentile_top_50": {
|
| 13 |
+
"scores": {
|
| 14 |
+
"chrFpp": 0.3801321408444973,
|
| 15 |
+
"chrF": 0.490406237031587,
|
| 16 |
+
"BLEU": 0.0033661885320217834,
|
| 17 |
+
"n": 1012
|
| 18 |
+
},
|
| 19 |
+
"elapsed_s": 513.6594152450562,
|
| 20 |
+
"dump_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_50.jsonl",
|
| 21 |
+
"channels": 98304,
|
| 22 |
+
"mask_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/selection/percentile/masks/percentile_top_50.full.npz",
|
| 23 |
+
"intervention": "nuke-zero"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/build_ntrex.log
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
NTREX-128 columns sample: ['sna_Latn', 'est_Latn', 'glg_Latn', 'bem_Latn', 'nob_Latn', 'zul_Latn', 'hye_Armn', 'nep_Deva'] ...
|
| 3 |
+
NTREX-128 size: 1997 rows
|
| 4 |
+
src column: eng_Latn
|
| 5 |
+
tgt column: por_Latn
|
| 6 |
+
wrote 1012 pairs -> /root/runs/ntrex_eval/ntrex_en2pt.jsonl
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_no_mask.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
|
| 2 |
+
{"name": "no_mask", "scores": {"chrFpp": 54.224041106849185, "chrF": 56.928538294695194, "BLEU": 25.785229280531734, "n": 1012}}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_10.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
|
| 2 |
+
{"name": "percentile_top_10", "channels": 19660, "scores": {"chrFpp": 2.023711437925785, "chrF": 2.6477265882046366, "BLEU": 0.002859284356231794, "n": 1012}}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_15.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
|
| 2 |
+
{"name": "percentile_top_15", "channels": 29491, "scores": {"chrFpp": 1.0764037131822992, "chrF": 1.4352049509097324, "BLEU": 0.0009640701642685707, "n": 1012}}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_20.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
|
| 2 |
+
{"name": "percentile_top_20", "channels": 39321, "scores": {"chrFpp": 2.4641771477317875, "chrF": 2.6459489632437827, "BLEU": 0.007639825625700025, "n": 1012}}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_30.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
|
| 2 |
+
{"name": "percentile_top_30", "channels": 58982, "scores": {"chrFpp": 3.1316565972832366, "chrF": 4.172057644643041, "BLEU": 0.0008254288439485306, "n": 1012}}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_40.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
|
| 2 |
+
{"name": "percentile_top_40", "channels": 78643, "scores": {"chrFpp": 2.0259324848441826, "chrF": 2.701243313125577, "BLEU": 0.000277549379833518, "n": 1012}}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_50.log
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The following generation flags are not valid and may be ignored: ['temperature', 'top_p', 'top_k']. Set `TRANSFORMERS_VERBOSITY=info` for more details.
|
| 2 |
+
{"name": "percentile_top_50", "channels": 98304, "scores": {"chrFpp": 0.3801321408444973, "chrF": 0.490406237031587, "BLEU": 0.0033661885320217834, "n": 1012}}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/hf_download_issue42.log
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Download complete. Moving file to /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/restored/issue42/circuit-shotting/artifacts/percentile_proxy/issue42_percentile_proxy_20260518T110628Z/damage/percentile_results.jsonl
|
| 3 |
+
|
| 4 |
+
/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/restored/issue42
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/issue43_progress.log
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[2026-05-18T11:47:45+00:00] issue43 start XCOMET destructive MLP gate gpus=0 1 2 3 top_ns=10,15,20,30,40,50 target=0.05
|
| 2 |
+
[2026-05-18T11:47:45+00:00] build NTREX EN->PT held-out jsonl
|
| 3 |
+
[2026-05-18T11:47:49+00:00] restore issue42 percentile damage results from HF
|
| 4 |
+
[2026-05-18T11:47:50+00:00] build cumulative percentile masks through top 50
|
| 5 |
+
[2026-05-18T11:48:03+00:00] generate NTREX hypotheses for no-mask and candidate nukes over 4 GPUs
|
| 6 |
+
[2026-05-18T12:05:23+00:00] start 4 XCOMET services sequentially
|
| 7 |
+
[2026-05-18T12:05:23+00:00] start XCOMET service idx=0 gpu=0 port=10001
|
| 8 |
+
[2026-05-18T12:08:10+00:00] XCOMET service idx=0 healthy on port=10001
|
| 9 |
+
[2026-05-18T12:08:10+00:00] start XCOMET service idx=1 gpu=1 port=10002
|
| 10 |
+
[2026-05-18T12:11:12+00:00] XCOMET service idx=1 healthy on port=10002
|
| 11 |
+
[2026-05-18T12:11:12+00:00] start XCOMET service idx=2 gpu=2 port=10003
|
| 12 |
+
[2026-05-18T12:14:14+00:00] XCOMET service idx=2 healthy on port=10003
|
| 13 |
+
[2026-05-18T12:14:14+00:00] start XCOMET service idx=3 gpu=3 port=10004
|
| 14 |
+
[2026-05-18T12:17:16+00:00] XCOMET service idx=3 healthy on port=10004
|
| 15 |
+
[2026-05-18T12:17:16+00:00] XCOMET score no_mask
|
| 16 |
+
[2026-05-18T12:38:49+00:00] XCOMET score percentile_top_10
|
| 17 |
+
[2026-05-18T13:01:32+00:00] XCOMET score percentile_top_15
|
| 18 |
+
[2026-05-18T13:23:15+00:00] XCOMET score percentile_top_20
|
| 19 |
+
[2026-05-18T13:47:42+00:00] XCOMET score percentile_top_30
|
| 20 |
+
[2026-05-18T14:10:27+00:00] XCOMET score percentile_top_40
|
| 21 |
+
[2026-05-18T14:33:38+00:00] XCOMET score percentile_top_50
|
| 22 |
+
[2026-05-18T14:56:43+00:00] target recovery 0.05 not reached by scored candidates
|
| 23 |
+
[2026-05-18T14:56:43+00:00] package and upload issue43 artifacts
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/nohup.log
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[2026-05-18T11:47:45+00:00] issue43 start XCOMET destructive MLP gate gpus=0 1 2 3 top_ns=10,15,20,30,40,50 target=0.05
|
| 2 |
+
[2026-05-18T11:47:45+00:00] build NTREX EN->PT held-out jsonl
|
| 3 |
+
[2026-05-18T11:47:49+00:00] restore issue42 percentile damage results from HF
|
| 4 |
+
[2026-05-18T11:47:50+00:00] build cumulative percentile masks through top 50
|
| 5 |
+
[2026-05-18T11:48:03+00:00] generate NTREX hypotheses for no-mask and candidate nukes over 4 GPUs
|
| 6 |
+
[2026-05-18T12:05:23+00:00] start 4 XCOMET services sequentially
|
| 7 |
+
[2026-05-18T12:05:23+00:00] start XCOMET service idx=0 gpu=0 port=10001
|
| 8 |
+
[2026-05-18T12:08:10+00:00] XCOMET service idx=0 healthy on port=10001
|
| 9 |
+
[2026-05-18T12:08:10+00:00] start XCOMET service idx=1 gpu=1 port=10002
|
| 10 |
+
[2026-05-18T12:11:12+00:00] XCOMET service idx=1 healthy on port=10002
|
| 11 |
+
[2026-05-18T12:11:12+00:00] start XCOMET service idx=2 gpu=2 port=10003
|
| 12 |
+
[2026-05-18T12:14:14+00:00] XCOMET service idx=2 healthy on port=10003
|
| 13 |
+
[2026-05-18T12:14:14+00:00] start XCOMET service idx=3 gpu=3 port=10004
|
| 14 |
+
[2026-05-18T12:17:16+00:00] XCOMET service idx=3 healthy on port=10004
|
| 15 |
+
[2026-05-18T12:17:16+00:00] XCOMET score no_mask
|
| 16 |
+
[2026-05-18T12:38:49+00:00] XCOMET score percentile_top_10
|
| 17 |
+
[2026-05-18T13:01:32+00:00] XCOMET score percentile_top_15
|
| 18 |
+
[2026-05-18T13:23:15+00:00] XCOMET score percentile_top_20
|
| 19 |
+
[2026-05-18T13:47:42+00:00] XCOMET score percentile_top_30
|
| 20 |
+
[2026-05-18T14:10:27+00:00] XCOMET score percentile_top_40
|
| 21 |
+
[2026-05-18T14:33:38+00:00] XCOMET score percentile_top_50
|
| 22 |
+
[2026-05-18T14:56:43+00:00] target recovery 0.05 not reached by scored candidates
|
| 23 |
+
[2026-05-18T14:56:43+00:00] package and upload issue43 artifacts
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/package_issue43_hf_upload.log
ADDED
|
File without changes
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/select_percentile_masks.log
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"top_n": 50,
|
| 3 |
+
"final_mix": "percentile_top_50",
|
| 4 |
+
"channels": 98304,
|
| 5 |
+
"out_dir": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/selection/percentile"
|
| 6 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/summarize_issue43.log
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/summaries/issue43_summary.json",
|
| 3 |
+
"out_md": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/summaries/issue43_summary.md",
|
| 4 |
+
"gate_passed": false
|
| 5 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_no_mask.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/xcomet/no_mask.json",
|
| 3 |
+
"summary": {
|
| 4 |
+
"source_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/no_mask.jsonl",
|
| 5 |
+
"comet_model": "Unbabel/XCOMET-XXL",
|
| 6 |
+
"checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt",
|
| 7 |
+
"n": 1012,
|
| 8 |
+
"threshold": 0.99,
|
| 9 |
+
"system_score": 0.9281014436671856,
|
| 10 |
+
"passed": 382,
|
| 11 |
+
"elapsed_seconds": 1293.3849756717682,
|
| 12 |
+
"batch_size": 1,
|
| 13 |
+
"chunk_size": 8,
|
| 14 |
+
"shard_count": 4,
|
| 15 |
+
"throughput_seg_per_s": 0.7824429835580732
|
| 16 |
+
}
|
| 17 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_10.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/xcomet/percentile_top_10.json",
|
| 3 |
+
"summary": {
|
| 4 |
+
"source_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_10.jsonl",
|
| 5 |
+
"comet_model": "Unbabel/XCOMET-XXL",
|
| 6 |
+
"checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt",
|
| 7 |
+
"n": 1012,
|
| 8 |
+
"threshold": 0.99,
|
| 9 |
+
"system_score": 0.18256553325603309,
|
| 10 |
+
"passed": 0,
|
| 11 |
+
"elapsed_seconds": 1362.0329356193542,
|
| 12 |
+
"batch_size": 1,
|
| 13 |
+
"chunk_size": 8,
|
| 14 |
+
"shard_count": 4,
|
| 15 |
+
"throughput_seg_per_s": 0.7430069951280501
|
| 16 |
+
}
|
| 17 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_15.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/xcomet/percentile_top_15.json",
|
| 3 |
+
"summary": {
|
| 4 |
+
"source_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_15.jsonl",
|
| 5 |
+
"comet_model": "Unbabel/XCOMET-XXL",
|
| 6 |
+
"checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt",
|
| 7 |
+
"n": 1012,
|
| 8 |
+
"threshold": 0.99,
|
| 9 |
+
"system_score": 0.2529226868034234,
|
| 10 |
+
"passed": 0,
|
| 11 |
+
"elapsed_seconds": 1303.2930221557617,
|
| 12 |
+
"batch_size": 1,
|
| 13 |
+
"chunk_size": 8,
|
| 14 |
+
"shard_count": 4,
|
| 15 |
+
"throughput_seg_per_s": 0.7764946038115651
|
| 16 |
+
}
|
| 17 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_20.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/xcomet/percentile_top_20.json",
|
| 3 |
+
"summary": {
|
| 4 |
+
"source_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_20.jsonl",
|
| 5 |
+
"comet_model": "Unbabel/XCOMET-XXL",
|
| 6 |
+
"checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt",
|
| 7 |
+
"n": 1012,
|
| 8 |
+
"threshold": 0.99,
|
| 9 |
+
"system_score": 0.19338692443559438,
|
| 10 |
+
"passed": 0,
|
| 11 |
+
"elapsed_seconds": 1466.9191575050354,
|
| 12 |
+
"batch_size": 1,
|
| 13 |
+
"chunk_size": 8,
|
| 14 |
+
"shard_count": 4,
|
| 15 |
+
"throughput_seg_per_s": 0.6898812343103803
|
| 16 |
+
}
|
| 17 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_30.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/xcomet/percentile_top_30.json",
|
| 3 |
+
"summary": {
|
| 4 |
+
"source_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_30.jsonl",
|
| 5 |
+
"comet_model": "Unbabel/XCOMET-XXL",
|
| 6 |
+
"checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt",
|
| 7 |
+
"n": 1012,
|
| 8 |
+
"threshold": 0.99,
|
| 9 |
+
"system_score": 0.189112861187974,
|
| 10 |
+
"passed": 0,
|
| 11 |
+
"elapsed_seconds": 1364.2606618404388,
|
| 12 |
+
"batch_size": 1,
|
| 13 |
+
"chunk_size": 8,
|
| 14 |
+
"shard_count": 4,
|
| 15 |
+
"throughput_seg_per_s": 0.7417937256583261
|
| 16 |
+
}
|
| 17 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_40.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/xcomet/percentile_top_40.json",
|
| 3 |
+
"summary": {
|
| 4 |
+
"source_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_40.jsonl",
|
| 5 |
+
"comet_model": "Unbabel/XCOMET-XXL",
|
| 6 |
+
"checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt",
|
| 7 |
+
"n": 1012,
|
| 8 |
+
"threshold": 0.99,
|
| 9 |
+
"system_score": 0.2072743144836056,
|
| 10 |
+
"passed": 0,
|
| 11 |
+
"elapsed_seconds": 1390.8875968456268,
|
| 12 |
+
"batch_size": 1,
|
| 13 |
+
"chunk_size": 8,
|
| 14 |
+
"shard_count": 4,
|
| 15 |
+
"throughput_seg_per_s": 0.7275929423971723
|
| 16 |
+
}
|
| 17 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_50.log
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"out_json": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/xcomet/percentile_top_50.json",
|
| 3 |
+
"summary": {
|
| 4 |
+
"source_path": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f/dumps/ntrex/percentile_top_50.jsonl",
|
| 5 |
+
"comet_model": "Unbabel/XCOMET-XXL",
|
| 6 |
+
"checkpoint_path": "/root/.cache/huggingface/hub/models--Unbabel--XCOMET-XXL/snapshots/873bac1b1c461e410c4a6e379f6790d3d1c7c214/checkpoints/model.ckpt",
|
| 7 |
+
"n": 1012,
|
| 8 |
+
"threshold": 0.99,
|
| 9 |
+
"system_score": 0.2053742483847226,
|
| 10 |
+
"passed": 0,
|
| 11 |
+
"elapsed_seconds": 1385.4018139839172,
|
| 12 |
+
"batch_size": 1,
|
| 13 |
+
"chunk_size": 8,
|
| 14 |
+
"shard_count": 4,
|
| 15 |
+
"throughput_seg_per_s": 0.7304739957505484
|
| 16 |
+
}
|
| 17 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/manifests/SHA256SUMS
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
bf03e35db27513749409d858e713f1ef51f923abd5920fef087de4536e5f57c6 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/no_mask.jsonl
|
| 2 |
+
e4c27fbac5f60ba9e154ffe927ae03f20791e217b1d9738b9b51ae683f794e55 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_10.jsonl
|
| 3 |
+
2cdd46c4c57cc0817af81c94358e36e8bb4f43579322949623d2501382030404 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_15.jsonl
|
| 4 |
+
63a31568ca89897cb7bd484e72f17bedd8e16d85f097d916dce274debfb7c5fe /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_20.jsonl
|
| 5 |
+
1648e848ccd27150747ebdc76881a86e4f8c70b2da8fc1d7d5becf0484a3128f /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_30.jsonl
|
| 6 |
+
9eb493e8c1861a698fa21ad5d0f6f7db068a4f02eee469f0c981b79793c69194 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_40.jsonl
|
| 7 |
+
cd0f0e295c2b2b70ba3b54bbaf711308db319c2cfa3f4e0633f7f102b7f2f0e9 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/dumps/ntrex/percentile_top_50.jsonl
|
| 8 |
+
1b4ef683f1089e4cd0ba8b8df4c7ca11390987a3e3135d55c3bdaeee255aa4b5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_no_mask.json
|
| 9 |
+
9580eabfc9f46a63a964ef4dbeff8d676fa8db814a267824624a1a33e0be5f8b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_10.json
|
| 10 |
+
81cc9cef22f4011d085a9d83b4389f70a807aec1451e79d15058a03f47567793 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_15.json
|
| 11 |
+
15f3f451d6e3a3280b9d9f6480b0abb4b361975b831673f446cdaa8b4fbad7de /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_20.json
|
| 12 |
+
e48acda7dc495a470be129f90276d0a4e698595ac10fd067669d172d15989f43 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_30.json
|
| 13 |
+
4d337a64bf32dc7ed47cdfe5664cef78232826070b9a0c9a797c9cd1a423ae5e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_40.json
|
| 14 |
+
f32eb6ec2a007a41ef9fef6f069619cb3f047513a3998ecc7993bb6ea7ef625d /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/eval/ntrex_percentile_top_50.json
|
| 15 |
+
4bff1faaab87a6eabbed6d7b30a15c8f46ae29ecce69bedcc314a0a828721eb3 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/build_ntrex.log
|
| 16 |
+
ed7583ebf37db02c54690bdbbaac912bf63900d3a2e676aeae768b6935756c08 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_no_mask.log
|
| 17 |
+
fb2d734883aa003e4a686dbc7c0c097d0373625086bc6af1b68ce0ab33591862 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_10.log
|
| 18 |
+
5b174d3f0cbe9051c4341bb49d8038c2babb9bdd476a48e8cff636cec567a31b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_15.log
|
| 19 |
+
dc78cdf39f737c15726508816c42fd3af86d446dd9ec67527fefe9390ecaa531 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_20.log
|
| 20 |
+
aca0653b344477538a90d1ba3329687ddd51bf84764b470bcc50f074d67571c4 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_30.log
|
| 21 |
+
dfb0c2fd6f665cd30bc83928dc0c625a9fe2ed1a18dfc8e7ceb21b4e397421a6 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_40.log
|
| 22 |
+
19e3e62ec4849398c938268f4d1f3b4ff1d5727313543efa47fd6595c3f96906 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/eval_ntrex_percentile_top_50.log
|
| 23 |
+
9a7e3fc70dfaae02d4d218f3c4f8ca860678b21bfd873d17b04b90706ae8d05d /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/hf_download_issue42.log
|
| 24 |
+
a92e11642586654d7c009f34a234934dd5bd01ac6180e86fbb815aa95ef88b64 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/issue43_progress.log
|
| 25 |
+
a92e11642586654d7c009f34a234934dd5bd01ac6180e86fbb815aa95ef88b64 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/nohup.log
|
| 26 |
+
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/package_issue43_hf_upload.log
|
| 27 |
+
a2027fa025a2c5ee5429755301fbc875fc3074eeefbd6c381933b8ed5dc49ffc /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/select_percentile_masks.log
|
| 28 |
+
8a96844569862f0c722918e6f66cec9678f590da04fbd4e6766296292425cc0b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/summarize_issue43.log
|
| 29 |
+
4b13ddc672704c8fe4ccfcf227f95760a63c0117739b6d52644bda36e5981f2e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_no_mask.log
|
| 30 |
+
486ba93c6f6e8ec6add921d78b00d918696ca23c085dee3e0380829f978a2d1d /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_10.log
|
| 31 |
+
8c55645dad49e6ab461140c118aa859d0ef22a020cc1ea2c5882f221a51f145c /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_15.log
|
| 32 |
+
0d9f3fbc70fbf1e5d52e620d3f4b39075d735af48b87c269bbe28259a245f4e0 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_20.log
|
| 33 |
+
983b18afd417007558f42fb0a1b6abb3f671dfc1a1d3e92035abeb68b19b7b86 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_30.log
|
| 34 |
+
f664d90365b11c852e6a34f5c4a69eea55012da7454f4c3fd662f0b7cb6a5022 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_40.log
|
| 35 |
+
3fbf697c27209bda0bb1f1b2fe60b10121726609488408f6ce151e7235f34630 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/logs/xcomet_percentile_top_50.log
|
| 36 |
+
d6823fa3e74320bbae7433645b11ab1109489d73c6eafb08272d3af866bd4a4e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/manifests/SHA256SUMS
|
| 37 |
+
684888c0ebb17f374298b65ee2807526c066094c701bcc7ebbe1c1095f494fc1 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/restored/issue42/.cache/huggingface/.gitignore
|
| 38 |
+
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/restored/issue42/.cache/huggingface/download/circuit-shotting/artifacts/percentile_proxy/issue42_percentile_proxy_20260518T110628Z/damage/percentile_results.jsonl.lock
|
| 39 |
+
60b1fae66f3219f1b916b490fce08f36d74209ae7a19a445d37bb4bc52c43355 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/restored/issue42/.cache/huggingface/download/circuit-shotting/artifacts/percentile_proxy/issue42_percentile_proxy_20260518T110628Z/damage/percentile_results.jsonl.metadata
|
| 40 |
+
dd945e5ed7f681cb522fb979401367a407a65b76560d8bc10375d974958f5b0c /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/restored/issue42/circuit-shotting/artifacts/percentile_proxy/issue42_percentile_proxy_20260518T110628Z/damage/percentile_results.jsonl
|
| 41 |
+
66cf52044faf04ad1afa04e99e7249cae65b760d2f5ccddd7efd4057f328b3fc /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/actdelta_mlp_common.py
|
| 42 |
+
a197f22e29b086f8e637982d26b762fd9e5dce2fb5b70bf8b68e3b08d4988d0d /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/build_ntrex_en2pt_jsonl.py
|
| 43 |
+
6986306655c0c67c27934f87dd8cb4147756d45f1c93168cbfccad5c812f4ac2 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/evaluate_mlp_nuke_translation.py
|
| 44 |
+
bf2c867b371954b03a0c559aae99aec9184f4d91fab28380314186e97ceb0877 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/issue43_xcomet_destructive_mlp_runner.sh
|
| 45 |
+
00fd9564ec740ea851cfce4b1fe747b65ff8c496b6882c8a7fe9aa4c0c991b87 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/package_issue43_hf_upload.sh
|
| 46 |
+
31a662571b9792487ba674810c6e545193b61214bc1951a65a2a5edd07def55b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/score_xcomet_sharded.py
|
| 47 |
+
1f4862a56ec1ccdf4cc8fc47d2c84aeae4baa90645ac0d6e22d28547b67f60bc /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/select_percentile_mlp_mix.py
|
| 48 |
+
65a0b0fc8ce3fcd78752e78497d28653bffd0b7f50f51177ecc364282c12380b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/summarize_issue43_xcomet_destructive_mlp.py
|
| 49 |
+
59e5b31759fdc1b19c9f39edf8ed72f8c1a61b17930d8b7418892cc519481bc5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/xcomet_service.py
|
| 50 |
+
4f22910781440a38985ff19ce889e1757b11d9e8a62f4a114a2a4b8b8cb8589e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/cumulative_percentile_mixes.jsonl
|
| 51 |
+
5c8d140828eefea1d2dd4565eb0a64a78b7c33381b1cdb37d83c6a00e17f723b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_1.full.npz
|
| 52 |
+
17f7a4853934f8dd8639d4deda4fa5124976a7cf52f7863762e27bbb9cbef577 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_10.full.npz
|
| 53 |
+
d1faadfbb41b9770b56b674a0ceb1d6645fc75769053412c385835189ba007c8 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_11.full.npz
|
| 54 |
+
f230209755b1201e62b116647467324e47d2f826793277f236fe14f9e7ba8da6 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_12.full.npz
|
| 55 |
+
ab90f8e7b2a292f5fad5faa1585c79cd3064ec70cac815cfb095060d87475560 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_13.full.npz
|
| 56 |
+
0024c3f3b86c937dec7fba9b4fb5caab382a035af41523de77699dcfc284bbc7 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_14.full.npz
|
| 57 |
+
81d2fc2324e67f86e6d23a913de7c159dbe7b588e77460f0fa45df9e52564645 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_15.full.npz
|
| 58 |
+
3ebcb44ab4282429b283f9bfb15a2a21ca9f2e595fde05968e6ad223e995b802 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_16.full.npz
|
| 59 |
+
17c43e70cc13ff5e8534210ebf19a7bc1d878fa05b310dac2a966992e94e65d9 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_17.full.npz
|
| 60 |
+
627f7ec469c3c825725d9a31e4b6078601e25bcba1ca5a4d1111359fa88dd3b5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_18.full.npz
|
| 61 |
+
677336ea8ba1a06b3f6a3c47bec76caa36647963b31b761c2b4c8fe6ce171fc8 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_19.full.npz
|
| 62 |
+
b6b1652ddd55f816922d4dc6cec11ea2320aeb96acc63e8788307ac311783149 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_2.full.npz
|
| 63 |
+
a82f3092f3039a04e117072bd32595d27ae7e24a6fc3c183d6b5caf9aa5080a1 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_20.full.npz
|
| 64 |
+
74719057a36ed06a293f9f9efdfaed45d85aa6a3aa9954843b14d8d486a53ef6 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_21.full.npz
|
| 65 |
+
7438d493c049547171c635bb0edd9535358231e11fadf55c76eac13776775718 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_22.full.npz
|
| 66 |
+
675209220e2b35338fa3ac5a49f5cde1bbeceea08ab06db8d25036b6ed71b1f7 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_23.full.npz
|
| 67 |
+
1f126f38f1b9e8c3b38df1a91edec94d21d42e3c51e24e8d4364f39e3127cffa /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_24.full.npz
|
| 68 |
+
4434c72fe48518425d81be74b7c9f1f6f7916b80af85c0c0eb72178712e3224c /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_25.full.npz
|
| 69 |
+
ea5640917e9c5a92a3bd3c45aa25e067a180fc4705054de549fffe2009aa4a18 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_26.full.npz
|
| 70 |
+
b7056c26479fba2d5158d2c5d432f5a2f8c62b94bb2b21244ced4fdbe4ae32af /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_27.full.npz
|
| 71 |
+
a2f329416585f756d6ac71e28a594f559110108ab9054403a2552e1baf910541 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_28.full.npz
|
| 72 |
+
2aadcb6995549350ba5a230b6fdb3d7ff5f10f81b36603668b83a75f53b29a38 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_29.full.npz
|
| 73 |
+
de5cb7822203180456edf209db34b7109028056c207d24877d17a87bbdd308a7 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_3.full.npz
|
| 74 |
+
354c52928f404b2de9bb804c6487a2f05904492323e950e84d6d0dbaa47f3f00 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_30.full.npz
|
| 75 |
+
e9b46fd6a1324036a6a015bab112dbc484378a8f1345dc444f75e79c50da6954 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_31.full.npz
|
| 76 |
+
ec7bb63f8c500d3fac7ae8c8a002aa039f6c7a16f25ef18f806844e96d81dbf8 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_32.full.npz
|
| 77 |
+
cebe62766804d5ae0effd998c592492d90e0ab890e05fe9772804d8176f31f76 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_33.full.npz
|
| 78 |
+
481852b4577cf5f5e5364fb8137c7caa6081ccf3d8bdd28d3d628e5e8444f5a3 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_34.full.npz
|
| 79 |
+
59d410cb15bd754af8e4723f183de6077def99beb59e24070051aca0619f3b05 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_35.full.npz
|
| 80 |
+
c5fd2dbceeac7bec00a7143f8ce94ef35ace529240129b89f5595230edcd3521 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_36.full.npz
|
| 81 |
+
d5bb34560b3a388e05d398dbeed580148641156ba0212e1870c65cfbce8c02cf /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_37.full.npz
|
| 82 |
+
057f70177328bfdad742d42f39dbf434707f8eae9052ff76f912a9c0fe14a285 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_38.full.npz
|
| 83 |
+
b3849bd3077f8233c89caa7100bbdb4adf132f1d6a3732c5845bf5bd628c4a4f /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_39.full.npz
|
| 84 |
+
a7f79c8a23373952cd3935d884cce05df8129617814fd5f9326b07e9084d51a0 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_4.full.npz
|
| 85 |
+
167e27856a5c8c9f815da2dabbac641377283dee7be53a520d69fcf9e01c698e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_40.full.npz
|
| 86 |
+
20571cdfb7f44a0dadfeb549722b0a8bed5f6f243199b2b38a68c0d63cb349db /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_41.full.npz
|
| 87 |
+
4476b82ae250966876383ef21fa881508d55473f91905e4d56840aab17b2e5cb /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_42.full.npz
|
| 88 |
+
2451ad932683d8df2b26555432b66210ba6ebbbf3c427e74222844e2ae3f0110 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_43.full.npz
|
| 89 |
+
0457b7531724466793b42f9404563102b4c3a5ae8e4de43d46d15bec690e2f0d /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_44.full.npz
|
| 90 |
+
fb6cdd69de1bab002ec84844ba7d5eab25c9376bdb48fbcba3608f3b06e716a0 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_45.full.npz
|
| 91 |
+
e65373edb08ccffcf22f22b97c8f08e20d6cb26935b1af13d9e72ced14e4406b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_46.full.npz
|
| 92 |
+
95b7874a2d5a03e2699057ccecdbb6488ed12826a7ef80014daf7fdb77ef0eb8 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_47.full.npz
|
| 93 |
+
91779723996b2950ac9155050bc5fd095731014a0b144a42560eff57b8137075 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_48.full.npz
|
| 94 |
+
d80ea0110b439434a459f45bcbb0c8e58b6a935b352e7921f7506c00b7287c2a /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_49.full.npz
|
| 95 |
+
91db480bef3c2d90e6a328388e8ff7a3eea37d1daa20dede217e8f17cedba684 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_5.full.npz
|
| 96 |
+
4ba7c4273f45d2aff93fea932498705c1c35562fe3d6b10683afc497f4b4f9fc /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_50.full.npz
|
| 97 |
+
976c5b4e4ef988ecb5deeb5dd8757dd55ac3c4a73cd3c99ffac69d028b0a5344 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_6.full.npz
|
| 98 |
+
a8db5459270a6e49d25bc3851b66eadac6a14b2f14bf88f72fa98f00fa97fa0a /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_7.full.npz
|
| 99 |
+
3fdf1d3adce3b0c10b0a336ed92d1fb46a5aa886810966d1ee439a388ef27107 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_8.full.npz
|
| 100 |
+
bbbfe35c68966ab423fc5e02bcf50ba7e05c373ffb11c2a9a40e726150e2508c /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_9.full.npz
|
| 101 |
+
c23669745250b3d2e42175ca87fe488a0e02e0b62df7b4cf9c8e59f077699d4e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/ranked_percentiles.jsonl
|
| 102 |
+
32fce4ab5b52ffcf073a03751aae372139ffee8f7ab90cf3d2193251351a60b4 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/selection_summary.json
|
| 103 |
+
29520c3c91d5b84b3a09a427143946fa44dea0cdf353f0cb13b7646b45ea8fb5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/scored_candidate_names.txt
|
| 104 |
+
8dcdeb8cb722edac2fefa43d630b8cda8d3cdc7753bcd364b9d1d783e5d37470 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_0/health.json
|
| 105 |
+
67a7cad6dce93e577f4b52ebba936cc02c8bfda892e3f34126a042b6d0baade5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_0/service.log
|
| 106 |
+
1273f6bfd4aeed397577e989d0bfd6648554361ae737dfd07dfe69e20d65f694 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_1/health.json
|
| 107 |
+
91a2577d397aca4b7043aeb8f5a5b3ceba483bcbedebd652189ffa96798fba64 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_1/service.log
|
| 108 |
+
af08ac8453219c2b017faf7e1acf67366f3a01e07fac341a65041d1c11536537 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_2/health.json
|
| 109 |
+
267a155c763505d50cb0e6c799acc282ad30292d5e5309fd78c6253adcb0aea5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_2/service.log
|
| 110 |
+
9865ee9d76bd567aec86d9ce3a760b83f83811a0503137da3a4c0c38ca667e68 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_3/health.json
|
| 111 |
+
c64f00da643fbbf2742cee2c11a6b6774a95817157df8d75c58c486c133967f9 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/services/xcomet_3/service.log
|
| 112 |
+
9dd8f6e8ce2e726be8c81f945a941dee17fb57a1ccd1de31386ede9436cd1bb0 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/spec/issue43_xcomet_destructive_mlp_95.json
|
| 113 |
+
cdf6da89b51de1b46ea8dcbddb8d94fef1dee2cbd0191617492253db202bcc22 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/summaries/issue43_summary.json
|
| 114 |
+
53704cb9dd95b4cfadc0e774a186cd2d9601e762920c36825c3ef6eb54cd79fe /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/summaries/issue43_summary.md
|
| 115 |
+
72b66ea94a79b14a84b6bcb07496a5e283a591ae3826bea3b1b8e4e80b2b2370 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/no_mask.json
|
| 116 |
+
a89fffa1159a8a15c69f59cb471558b979fc67fd24c4941b7734e83ce8184808 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/no_mask.scored_pool.jsonl
|
| 117 |
+
8fbbb547210aa768978ceef5465cb83cd121d73431eb0ac3687e8ec434b49a8e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_10.json
|
| 118 |
+
821689c3afd4fe7c3a5e3580f4e902603537fac00157d97c26ea9f04cb4c11f1 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_10.scored_pool.jsonl
|
| 119 |
+
2f574b71134ad16eaf7e223f17c9e53d76cb387f702c794a93daf9a12331158e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_15.json
|
| 120 |
+
19d6092bf78e3fe52a063d64865a15a573f2df0f3937c440d93ce136604f2687 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_15.scored_pool.jsonl
|
| 121 |
+
8d8c8f9143aac3026718887a2da067981fa1778fe125aadd89aacd079d4bac69 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_20.json
|
| 122 |
+
2dee4ea2c88cdf70a0e9c9b6d598d68b80bbf07a15a023e72cdef9a8f892ea8c /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_20.scored_pool.jsonl
|
| 123 |
+
6cfe391ef3df9c430f225f34f1e7439e4abe9a1b98848291e7568851e4ab735b /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_30.json
|
| 124 |
+
701c412978268ee2b0b04da294eb56b58b1123d11d62165b7e07ff1c255493e9 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_30.scored_pool.jsonl
|
| 125 |
+
098320152d96efb8285905dd3ab2e12365d3ef425a82de3f1ea0c37283915328 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_40.json
|
| 126 |
+
5d3d801ac701eeff3acc2b842e47b157de5a6d2915a6e45a68ffffc00e7a3651 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_40.scored_pool.jsonl
|
| 127 |
+
0474fb737a5376ff4c3160f0e5109397fd73c5c1e4d344584d5b0358e5314816 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_50.json
|
| 128 |
+
c4b7ccea505da4fb4f2ad72ae29950f6a8d6095b63db77226f3969ed6ea9b159 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet/percentile_top_50.scored_pool.jsonl
|
| 129 |
+
d030b00f9b46fe19739abc996bf23b2b45dd9cbb5c7d51a33d1049ece3ab2839 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/no_mask/shard_000.jsonl
|
| 130 |
+
32b1e0ab478400d1bb2c559b408fb5aa7c597a55a8be5cc970b132b9d27251d2 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/no_mask/shard_001.jsonl
|
| 131 |
+
4702c0ce4c54d104a525e5e1d3d6bb76c30227316daee9ea21fcb774d15cfb7f /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/no_mask/shard_002.jsonl
|
| 132 |
+
e2b0b47f5bf3dd02168e37fbc7333b31c209b07d3b2e386e7e9d001c6274fa0a /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/no_mask/shard_003.jsonl
|
| 133 |
+
fb88d62a3179000b60ea39929c1130a93c7264b707f0b64acf872bf432a95382 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_10/shard_000.jsonl
|
| 134 |
+
83007298cc8773c5d780d557365ed6638ca033b98f2c0aec4e70c4e99ee16567 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_10/shard_001.jsonl
|
| 135 |
+
5db8be6ab00eb9a0a388493bdc03fd720236b0682eabcafafe944c51cc26bd8e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_10/shard_002.jsonl
|
| 136 |
+
b9a07b6c03d282caf1d6b6e09a544341369b58c65006801530134d66e89fc894 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_10/shard_003.jsonl
|
| 137 |
+
5efa75f7f99adf5ac8853256a0ebb21ec2ffd3ce440ba7fb560086613a8967f7 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_15/shard_000.jsonl
|
| 138 |
+
42ada2b08fa04f4e4e2a9510529fb12953aec4fee1166d4352581e5374fc03d7 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_15/shard_001.jsonl
|
| 139 |
+
3dd4e44508b879ff543aff3538119534a2e99854200869da8e26f5ebd19cc5e4 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_15/shard_002.jsonl
|
| 140 |
+
a62dfd04a459a9461477ee69ef0208140ee6f2549e217822d382df8d92855e1f /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_15/shard_003.jsonl
|
| 141 |
+
3a940d7d4580900319b224f2c958a9ec1dfc3b7ece98a893ee24e15fbdcca3a5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_20/shard_000.jsonl
|
| 142 |
+
3768f1ecf04f6b7a61bb42cd38c4b7292c4118cdffe71a72be2298c5f4d5e5ce /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_20/shard_001.jsonl
|
| 143 |
+
7915f91d85f2c0fb5da84e1b896e07bcca38e9c507a3ec29ed7bf047c5a880b5 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_20/shard_002.jsonl
|
| 144 |
+
c68b062b29275272dc1a008406943e9ff45b18db62feb84e8a7558d9457e74b6 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_20/shard_003.jsonl
|
| 145 |
+
e28ca48003ea9be16fafe40dfa826da2bf84907d001dc5d876d96d3682c7b7d0 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_30/shard_000.jsonl
|
| 146 |
+
e040bdb8c1d0ecbe1d0fbd14bb960f6cfb61ad8ce298092972e23749681bbde6 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_30/shard_001.jsonl
|
| 147 |
+
7b8f6de5990de040c5de5fec3cab323e8107d8a2899f353dd726b8a160a32b6a /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_30/shard_002.jsonl
|
| 148 |
+
22cd35c1179e20b2f2267fc81142fd6bd54db978280ed370a0d000f891ac9a7c /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_30/shard_003.jsonl
|
| 149 |
+
26a6990df9efad918f6e9a82cc82ec581c6f468d20527ed9604c1264ac9ebd67 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_40/shard_000.jsonl
|
| 150 |
+
3669717be70bbc2cd0b724292e1e4c08e997839fd600627b4084d569333d9f4e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_40/shard_001.jsonl
|
| 151 |
+
be25af1409f2e28ba98a4749b0685393bca8bd941d4b8803d8d0e62aa2ac23f9 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_40/shard_002.jsonl
|
| 152 |
+
a5e57a349474cf83ef15263d7de772d72b861374ed509cbb0093d649556e22a2 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_40/shard_003.jsonl
|
| 153 |
+
69067d66f32aebda09bf894d76018b930b3173e85a78e11584ac4f25add9f5f3 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_50/shard_000.jsonl
|
| 154 |
+
755ebbfc08943794a73dd87d2918e534d4048b78c451a1e10a3bff9a518b4dc2 /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_50/shard_001.jsonl
|
| 155 |
+
1b5b15f3b407d90a6eeeff44cc2fea085aeb94e380d3505e54dfc2d95e23d5dd /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_50/shard_002.jsonl
|
| 156 |
+
7df04fa406a768952c782ad4cdf85f3d50fdb4cd91877963f1fa3f23291d383e /root/runs/issue43_xcomet_destructive_mlp_95_038f04f/package/issue43_xcomet_destructive_mlp_95_20260518T145643Z/xcomet_shards/percentile_top_50/shard_003.jsonl
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/manifests/manifest.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"upload_prefix": "issue43_xcomet_destructive_mlp_95_20260518T145643Z",
|
| 3 |
+
"run_root": "/root/runs/issue43_xcomet_destructive_mlp_95_038f04f",
|
| 4 |
+
"file_count": 156,
|
| 5 |
+
"bytes": 39404709,
|
| 6 |
+
"weights_policy": "Includes experiment masks, generated hypotheses, XCOMET summaries/scored rows, scripts, specs, and logs. Excludes upstream HY-MT/XCOMET weights, HF caches, API keys, and service tokens."
|
| 7 |
+
}
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/restored/issue42/circuit-shotting/artifacts/percentile_proxy/issue42_percentile_proxy_20260518T110628Z/damage/percentile_results.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/actdelta_mlp_common.py
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Shared helpers for ActDeltaLoRA MLP MVC experiments."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import json
|
| 7 |
+
from dataclasses import dataclass
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
from typing import Any, Iterable
|
| 10 |
+
|
| 11 |
+
import numpy as np
|
| 12 |
+
import torch
|
| 13 |
+
import torch.nn.functional as F
|
| 14 |
+
|
| 15 |
+
from translation_io import DEFAULT_PROMPT_STYLE, Pair, load_flores_devtest_any
|
| 16 |
+
from translation_region_student import (
|
| 17 |
+
collate_translation,
|
| 18 |
+
decoder_root,
|
| 19 |
+
encode_supervised_row,
|
| 20 |
+
load_mask_npz,
|
| 21 |
+
save_mask_npz,
|
| 22 |
+
text_config,
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@dataclass(frozen=True)
|
| 27 |
+
class Candidate:
|
| 28 |
+
name: str
|
| 29 |
+
ranges: tuple[tuple[int, int], ...]
|
| 30 |
+
meta: dict[str, Any]
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def dtype_from_name(name: str) -> torch.dtype:
|
| 34 |
+
return {
|
| 35 |
+
"float32": torch.float32,
|
| 36 |
+
"float16": torch.float16,
|
| 37 |
+
"bfloat16": torch.bfloat16,
|
| 38 |
+
}[name]
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def mlp_total(n_layers: int, d_ffn: int) -> int:
|
| 42 |
+
return int(n_layers) * int(d_ffn)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def flat_to_layer_channel(flat_idx: int, d_ffn: int) -> tuple[int, int]:
|
| 46 |
+
return int(flat_idx) // int(d_ffn), int(flat_idx) % int(d_ffn)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def sector_ranges(total: int, sectors: int) -> list[tuple[int, int]]:
|
| 50 |
+
return [
|
| 51 |
+
(int(total * i // sectors), int(total * (i + 1) // sectors))
|
| 52 |
+
for i in range(sectors)
|
| 53 |
+
]
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def split_range(start: int, end: int, parts: int) -> list[tuple[int, int]]:
|
| 57 |
+
size = end - start
|
| 58 |
+
return [
|
| 59 |
+
(start + int(size * i // parts), start + int(size * (i + 1) // parts))
|
| 60 |
+
for i in range(parts)
|
| 61 |
+
]
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
def normalize_ranges(ranges: Iterable[tuple[int, int]]) -> tuple[tuple[int, int], ...]:
|
| 65 |
+
out = []
|
| 66 |
+
for start, end in ranges:
|
| 67 |
+
start = int(start)
|
| 68 |
+
end = int(end)
|
| 69 |
+
if end > start:
|
| 70 |
+
out.append((start, end))
|
| 71 |
+
return tuple(out)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
def mask_from_ranges(ranges: Iterable[tuple[int, int]], n_layers: int,
|
| 75 |
+
d_ffn: int) -> dict[int, torch.Tensor]:
|
| 76 |
+
mask = {layer: torch.zeros(d_ffn, dtype=torch.bool) for layer in range(n_layers)}
|
| 77 |
+
total = mlp_total(n_layers, d_ffn)
|
| 78 |
+
for raw_start, raw_end in ranges:
|
| 79 |
+
start = max(0, int(raw_start))
|
| 80 |
+
end = min(total, int(raw_end))
|
| 81 |
+
for flat in range(start, end):
|
| 82 |
+
layer, channel = flat_to_layer_channel(flat, d_ffn)
|
| 83 |
+
mask[layer][channel] = True
|
| 84 |
+
return mask
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def count_mask(mask: dict[int, torch.Tensor]) -> int:
|
| 88 |
+
return int(sum(int(v.sum().item()) for v in mask.values()))
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def mask_to_ranges(mask: dict[int, torch.Tensor], d_ffn: int) -> list[tuple[int, int]]:
|
| 92 |
+
flats: list[int] = []
|
| 93 |
+
for layer, values in sorted(mask.items()):
|
| 94 |
+
idx = torch.nonzero(values.cpu(), as_tuple=False).flatten().tolist()
|
| 95 |
+
flats.extend([int(layer) * d_ffn + int(i) for i in idx])
|
| 96 |
+
if not flats:
|
| 97 |
+
return []
|
| 98 |
+
flats.sort()
|
| 99 |
+
ranges: list[tuple[int, int]] = []
|
| 100 |
+
start = prev = flats[0]
|
| 101 |
+
for flat in flats[1:]:
|
| 102 |
+
if flat == prev + 1:
|
| 103 |
+
prev = flat
|
| 104 |
+
continue
|
| 105 |
+
ranges.append((start, prev + 1))
|
| 106 |
+
start = prev = flat
|
| 107 |
+
ranges.append((start, prev + 1))
|
| 108 |
+
return ranges
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def load_candidate_jsonl(path: str | Path) -> list[dict[str, Any]]:
|
| 112 |
+
rows: list[dict[str, Any]] = []
|
| 113 |
+
with Path(path).open() as f:
|
| 114 |
+
for line in f:
|
| 115 |
+
if line.strip():
|
| 116 |
+
rows.append(json.loads(line))
|
| 117 |
+
return rows
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def write_jsonl(path: str | Path, rows: Iterable[dict[str, Any]]) -> None:
|
| 121 |
+
out = Path(path)
|
| 122 |
+
out.parent.mkdir(parents=True, exist_ok=True)
|
| 123 |
+
with out.open("w") as f:
|
| 124 |
+
for row in rows:
|
| 125 |
+
f.write(json.dumps(row, ensure_ascii=False) + "\n")
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
def load_pairs(path: str | None, *, src_lang: str = "eng_Latn",
|
| 129 |
+
tgt_lang: str = "por_Latn", max_rows: int | None = None) -> list[Pair]:
|
| 130 |
+
if path is None:
|
| 131 |
+
return load_flores_devtest_any(
|
| 132 |
+
src_lang=src_lang,
|
| 133 |
+
tgt_lang=tgt_lang,
|
| 134 |
+
max_examples=max_rows,
|
| 135 |
+
)
|
| 136 |
+
rows: list[Pair] = []
|
| 137 |
+
with Path(path).open() as f:
|
| 138 |
+
for line in f:
|
| 139 |
+
if not line.strip():
|
| 140 |
+
continue
|
| 141 |
+
raw = json.loads(line)
|
| 142 |
+
src = (raw.get("en") or raw.get("src") or "").strip()
|
| 143 |
+
tgt = (raw.get("model_hyp") or raw.get("pt") or raw.get("tgt") or "").strip()
|
| 144 |
+
if src and tgt:
|
| 145 |
+
rows.append(Pair(src=src, tgt=tgt))
|
| 146 |
+
if max_rows is not None and len(rows) >= max_rows:
|
| 147 |
+
break
|
| 148 |
+
return rows
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
def build_supervised_examples(pairs: list[Pair], tokenizer, *, target_language: str,
|
| 152 |
+
prompt_style: str = DEFAULT_PROMPT_STYLE,
|
| 153 |
+
max_seq_length: int = 1024) -> list[dict[str, Any]]:
|
| 154 |
+
examples: list[dict[str, Any]] = []
|
| 155 |
+
for pair in pairs:
|
| 156 |
+
row = {"en": pair.src, "target": pair.tgt, "raw": {"en": pair.src, "pt": pair.tgt}}
|
| 157 |
+
enc = encode_supervised_row(
|
| 158 |
+
row,
|
| 159 |
+
tokenizer,
|
| 160 |
+
target_language=target_language,
|
| 161 |
+
prompt_style=prompt_style,
|
| 162 |
+
max_seq_length=max_seq_length,
|
| 163 |
+
kl_on="answer",
|
| 164 |
+
)
|
| 165 |
+
if enc is not None:
|
| 166 |
+
examples.append(enc)
|
| 167 |
+
return examples
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
def iter_batches(examples: list[dict[str, Any]], *, batch_size: int, pad_id: int):
|
| 171 |
+
for start in range(0, len(examples), batch_size):
|
| 172 |
+
yield collate_translation(examples[start:start + batch_size], pad_id)
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
def move_batch(batch: dict[str, Any], device: str) -> dict[str, Any]:
|
| 176 |
+
return {k: v.to(device) if torch.is_tensor(v) else v for k, v in batch.items()}
|
| 177 |
+
|
| 178 |
+
|
| 179 |
+
def tokenwise_kl(teacher_logits: torch.Tensor, student_logits: torch.Tensor,
|
| 180 |
+
logit_mask: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
|
| 181 |
+
mask = logit_mask[:, :-1]
|
| 182 |
+
t_logits = teacher_logits[:, :-1, :]
|
| 183 |
+
s_logits = student_logits[:, :-1, :]
|
| 184 |
+
log_t = F.log_softmax(t_logits, dim=-1)
|
| 185 |
+
prob_t = log_t.exp()
|
| 186 |
+
log_s = F.log_softmax(s_logits, dim=-1)
|
| 187 |
+
kl = (prob_t * (log_t - log_s)).sum(dim=-1)
|
| 188 |
+
return kl, mask
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
def sentence_kl_values(teacher_logits: torch.Tensor, student_logits: torch.Tensor,
|
| 192 |
+
logit_mask: torch.Tensor) -> list[float]:
|
| 193 |
+
kl, mask = tokenwise_kl(teacher_logits, student_logits, logit_mask)
|
| 194 |
+
values: list[float] = []
|
| 195 |
+
for row_idx in range(kl.shape[0]):
|
| 196 |
+
row_mask = mask[row_idx]
|
| 197 |
+
if bool(row_mask.any().item()):
|
| 198 |
+
values.append(float(kl[row_idx][row_mask].mean().detach().cpu().item()))
|
| 199 |
+
else:
|
| 200 |
+
values.append(0.0)
|
| 201 |
+
return values
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
def install_mlp_nuke_hooks(model, nuke_mask: dict[int, torch.Tensor],
|
| 205 |
+
*, device: str, dtype: torch.dtype) -> list[Any]:
|
| 206 |
+
hooks: list[Any] = []
|
| 207 |
+
root = decoder_root(model)
|
| 208 |
+
for layer_idx, layer in enumerate(root.layers):
|
| 209 |
+
selected = nuke_mask[layer_idx].to(device)
|
| 210 |
+
if not bool(selected.any().item()):
|
| 211 |
+
continue
|
| 212 |
+
keep = (~selected).to(dtype=dtype).view(1, 1, -1)
|
| 213 |
+
|
| 214 |
+
def make_hook(keep: torch.Tensor):
|
| 215 |
+
def hook_fn(module, hook_args):
|
| 216 |
+
act = hook_args[0]
|
| 217 |
+
return (act * keep,) + hook_args[1:]
|
| 218 |
+
return hook_fn
|
| 219 |
+
|
| 220 |
+
hooks.append(layer.mlp.down_proj.register_forward_pre_hook(make_hook(keep)))
|
| 221 |
+
return hooks
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
def install_mlp_keep_only_hooks(model, keep_mask: dict[int, torch.Tensor],
|
| 225 |
+
*, device: str, dtype: torch.dtype) -> list[Any]:
|
| 226 |
+
"""Keep selected MLP down-proj input channels and zero every other MLP channel."""
|
| 227 |
+
hooks: list[Any] = []
|
| 228 |
+
root = decoder_root(model)
|
| 229 |
+
for layer_idx, layer in enumerate(root.layers):
|
| 230 |
+
keep = keep_mask[layer_idx].to(device=device, dtype=dtype).view(1, 1, -1)
|
| 231 |
+
|
| 232 |
+
def make_hook(keep: torch.Tensor):
|
| 233 |
+
def hook_fn(module, hook_args):
|
| 234 |
+
act = hook_args[0]
|
| 235 |
+
return (act * keep,) + hook_args[1:]
|
| 236 |
+
return hook_fn
|
| 237 |
+
|
| 238 |
+
hooks.append(layer.mlp.down_proj.register_forward_pre_hook(make_hook(keep)))
|
| 239 |
+
return hooks
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
def save_mask_for_candidate(out_dir: Path, candidate: Candidate, n_layers: int,
|
| 243 |
+
d_ffn: int) -> str:
|
| 244 |
+
mask = mask_from_ranges(candidate.ranges, n_layers, d_ffn)
|
| 245 |
+
path = out_dir / f"{candidate.name}.full.npz"
|
| 246 |
+
save_mask_npz(path, mask)
|
| 247 |
+
return str(path)
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
def model_mlp_shape(model) -> tuple[int, int, int]:
|
| 251 |
+
cfg = text_config(model)
|
| 252 |
+
return int(cfg.num_hidden_layers), int(cfg.hidden_size), int(cfg.intermediate_size)
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/build_ntrex_en2pt_jsonl.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Dump NTREX-128 en->pt to a jsonl for our gen+score pipeline.
|
| 2 |
+
Truncates to 1012 rows to match the FLORES devtest size for apples-to-apples."""
|
| 3 |
+
import json, sys
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from datasets import load_dataset
|
| 6 |
+
|
| 7 |
+
ds = load_dataset("mteb/NTREX", split="test")
|
| 8 |
+
print(f"NTREX-128 columns sample: {list(ds.column_names)[:8]} ...")
|
| 9 |
+
print(f"NTREX-128 size: {len(ds)} rows")
|
| 10 |
+
|
| 11 |
+
# Find en + pt column names
|
| 12 |
+
src_col = next((c for c in ds.column_names if c == "eng" or c == "eng_Latn" or c == "en"), None)
|
| 13 |
+
tgt_col = next((c for c in ds.column_names if c == "por" or c == "por_Latn" or c == "pt" or c == "por-BR" or c == "por_BR" or c == "por-PT"), None)
|
| 14 |
+
print(f" src column: {src_col}")
|
| 15 |
+
print(f" tgt column: {tgt_col}")
|
| 16 |
+
|
| 17 |
+
assert src_col and tgt_col, f"Could not auto-detect en/pt columns. Available: {ds.column_names}"
|
| 18 |
+
|
| 19 |
+
pairs = []
|
| 20 |
+
for row in ds:
|
| 21 |
+
s, t = row.get(src_col), row.get(tgt_col)
|
| 22 |
+
if not s or not t:
|
| 23 |
+
continue
|
| 24 |
+
pairs.append((s.strip(), t.strip()))
|
| 25 |
+
if len(pairs) >= 1012:
|
| 26 |
+
break
|
| 27 |
+
|
| 28 |
+
out = Path("/root/runs/ntrex_eval/ntrex_en2pt.jsonl")
|
| 29 |
+
out.parent.mkdir(parents=True, exist_ok=True)
|
| 30 |
+
with open(out, "w") as f:
|
| 31 |
+
for i, (en, pt) in enumerate(pairs):
|
| 32 |
+
f.write(json.dumps({"id": i, "en": en, "pt": pt,
|
| 33 |
+
"category": "ntrex_test", "tag": "heldout"},
|
| 34 |
+
ensure_ascii=False) + "\n")
|
| 35 |
+
print(f"wrote {len(pairs)} pairs -> {out}")
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/evaluate_mlp_nuke_translation.py
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Evaluate HY-MT EN->PT generation with selected MLP channels zero-nuked."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
import json
|
| 8 |
+
import time
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
import sacrebleu
|
| 12 |
+
import torch
|
| 13 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 14 |
+
|
| 15 |
+
from actdelta_mlp_common import (
|
| 16 |
+
count_mask,
|
| 17 |
+
dtype_from_name,
|
| 18 |
+
install_mlp_keep_only_hooks,
|
| 19 |
+
install_mlp_nuke_hooks,
|
| 20 |
+
load_pairs,
|
| 21 |
+
model_mlp_shape,
|
| 22 |
+
)
|
| 23 |
+
from translation_io import DEFAULT_PROMPT_STYLE, generate_translations
|
| 24 |
+
from translation_region_student import load_mask_npz
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
def parse_args() -> argparse.Namespace:
|
| 28 |
+
p = argparse.ArgumentParser(description=__doc__)
|
| 29 |
+
p.add_argument("--model", default="tencent/HY-MT1.5-1.8B")
|
| 30 |
+
p.add_argument("--mask", action="append", default=[], metavar="NAME:PATH")
|
| 31 |
+
p.add_argument("--out-json", required=True)
|
| 32 |
+
p.add_argument("--dump-dir", required=True)
|
| 33 |
+
p.add_argument("--input-jsonl", default=None)
|
| 34 |
+
p.add_argument("--max-rows", type=int, default=None)
|
| 35 |
+
p.add_argument("--start-idx", type=int, default=0)
|
| 36 |
+
p.add_argument("--end-idx", type=int, default=None)
|
| 37 |
+
p.add_argument("--batch-size", type=int, default=32)
|
| 38 |
+
p.add_argument("--max-new-tokens", type=int, default=384)
|
| 39 |
+
p.add_argument("--target-language", default="Portuguese")
|
| 40 |
+
p.add_argument("--prompt-style", default=DEFAULT_PROMPT_STYLE)
|
| 41 |
+
p.add_argument("--src-lang", default="eng_Latn")
|
| 42 |
+
p.add_argument("--tgt-lang", default="por_Latn")
|
| 43 |
+
p.add_argument("--device", default="cuda")
|
| 44 |
+
p.add_argument("--dtype", default="bfloat16", choices=["float32", "float16", "bfloat16"])
|
| 45 |
+
p.add_argument("--include-no-mask", action="store_true")
|
| 46 |
+
p.add_argument("--intervention", default="nuke-zero", choices=["nuke-zero", "keep-only"],
|
| 47 |
+
help="nuke-zero zeros selected channels; keep-only zeros every non-selected MLP channel.")
|
| 48 |
+
p.add_argument("--category", default="actdelta_eval")
|
| 49 |
+
p.add_argument("--tag", default="heldout")
|
| 50 |
+
return p.parse_args()
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def parse_mask_specs(values: list[str]) -> list[tuple[str, Path]]:
|
| 54 |
+
out = []
|
| 55 |
+
for value in values:
|
| 56 |
+
if ":" not in value:
|
| 57 |
+
raise ValueError(f"--mask must be NAME:PATH, got {value!r}")
|
| 58 |
+
name, path = value.split(":", 1)
|
| 59 |
+
out.append((name, Path(path)))
|
| 60 |
+
return out
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def dump_hyps(path: Path, pairs, hyps: list[str], *, mask_name: str, extra: dict) -> None:
|
| 64 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 65 |
+
with path.open("w") as f:
|
| 66 |
+
for idx, (pair, hyp) in enumerate(zip(pairs, hyps)):
|
| 67 |
+
f.write(json.dumps({
|
| 68 |
+
"id": idx,
|
| 69 |
+
"en": pair.src,
|
| 70 |
+
"pt": pair.tgt,
|
| 71 |
+
"model_hyp": hyp,
|
| 72 |
+
"category": extra.get("category", "actdelta_eval"),
|
| 73 |
+
"tag": extra.get("tag", "heldout"),
|
| 74 |
+
"mask_name": mask_name,
|
| 75 |
+
**{k: v for k, v in extra.items() if k not in {"category", "tag"}},
|
| 76 |
+
}, ensure_ascii=False) + "\n")
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def score(hyps: list[str], refs: list[str]) -> dict:
|
| 80 |
+
return {
|
| 81 |
+
"chrFpp": float(sacrebleu.corpus_chrf(hyps, [refs], word_order=2).score),
|
| 82 |
+
"chrF": float(sacrebleu.corpus_chrf(hyps, [refs], word_order=0).score),
|
| 83 |
+
"BLEU": float(sacrebleu.corpus_bleu(hyps, [refs]).score),
|
| 84 |
+
"n": len(hyps),
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
def main() -> None:
|
| 89 |
+
args = parse_args()
|
| 90 |
+
dtype = dtype_from_name(args.dtype)
|
| 91 |
+
out_path = Path(args.out_json)
|
| 92 |
+
dump_dir = Path(args.dump_dir)
|
| 93 |
+
out_path.parent.mkdir(parents=True, exist_ok=True)
|
| 94 |
+
dump_dir.mkdir(parents=True, exist_ok=True)
|
| 95 |
+
|
| 96 |
+
tokenizer = AutoTokenizer.from_pretrained(args.model)
|
| 97 |
+
if tokenizer.pad_token_id is None:
|
| 98 |
+
tokenizer.pad_token = tokenizer.eos_token
|
| 99 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 100 |
+
args.model,
|
| 101 |
+
dtype=dtype,
|
| 102 |
+
attn_implementation="eager",
|
| 103 |
+
).to(args.device).eval()
|
| 104 |
+
model.config.use_cache = True
|
| 105 |
+
for param in model.parameters():
|
| 106 |
+
param.requires_grad_(False)
|
| 107 |
+
|
| 108 |
+
n_layers, hidden_size, d_ffn = model_mlp_shape(model)
|
| 109 |
+
all_pairs = load_pairs(
|
| 110 |
+
args.input_jsonl,
|
| 111 |
+
src_lang=args.src_lang,
|
| 112 |
+
tgt_lang=args.tgt_lang,
|
| 113 |
+
max_rows=None,
|
| 114 |
+
)
|
| 115 |
+
end_idx = args.end_idx if args.end_idx is not None else len(all_pairs)
|
| 116 |
+
pairs = all_pairs[args.start_idx:end_idx]
|
| 117 |
+
if args.max_rows is not None:
|
| 118 |
+
pairs = pairs[:args.max_rows]
|
| 119 |
+
sources = [pair.src for pair in pairs]
|
| 120 |
+
refs = [pair.tgt for pair in pairs]
|
| 121 |
+
|
| 122 |
+
results = {}
|
| 123 |
+
if args.include_no_mask:
|
| 124 |
+
t0 = time.time()
|
| 125 |
+
hyps = generate_translations(
|
| 126 |
+
model,
|
| 127 |
+
tokenizer,
|
| 128 |
+
sources,
|
| 129 |
+
target_language=args.target_language,
|
| 130 |
+
prompt_style=args.prompt_style,
|
| 131 |
+
batch_size=args.batch_size,
|
| 132 |
+
max_new_tokens=args.max_new_tokens,
|
| 133 |
+
do_sample=False,
|
| 134 |
+
device=args.device,
|
| 135 |
+
)
|
| 136 |
+
scores = score(hyps, refs)
|
| 137 |
+
dump_path = dump_dir / "no_mask.jsonl"
|
| 138 |
+
dump_hyps(dump_path, pairs, hyps, mask_name="no_mask",
|
| 139 |
+
extra={"category": args.category, "tag": args.tag, "method": "no_mask"})
|
| 140 |
+
results["no_mask"] = {
|
| 141 |
+
"scores": scores,
|
| 142 |
+
"elapsed_s": time.time() - t0,
|
| 143 |
+
"dump_path": str(dump_path),
|
| 144 |
+
"channels": 0,
|
| 145 |
+
}
|
| 146 |
+
print(json.dumps({"name": "no_mask", "scores": scores}), flush=True)
|
| 147 |
+
|
| 148 |
+
for name, mask_path in parse_mask_specs(args.mask):
|
| 149 |
+
mask = load_mask_npz(mask_path, n_layers, d_ffn)
|
| 150 |
+
channels = count_mask(mask)
|
| 151 |
+
t0 = time.time()
|
| 152 |
+
if args.intervention == "nuke-zero":
|
| 153 |
+
hooks = install_mlp_nuke_hooks(model, mask, device=args.device, dtype=dtype)
|
| 154 |
+
method = "mlp_nuke_zero"
|
| 155 |
+
else:
|
| 156 |
+
hooks = install_mlp_keep_only_hooks(model, mask, device=args.device, dtype=dtype)
|
| 157 |
+
method = "mlp_keep_only_zero"
|
| 158 |
+
try:
|
| 159 |
+
hyps = generate_translations(
|
| 160 |
+
model,
|
| 161 |
+
tokenizer,
|
| 162 |
+
sources,
|
| 163 |
+
target_language=args.target_language,
|
| 164 |
+
prompt_style=args.prompt_style,
|
| 165 |
+
batch_size=args.batch_size,
|
| 166 |
+
max_new_tokens=args.max_new_tokens,
|
| 167 |
+
do_sample=False,
|
| 168 |
+
device=args.device,
|
| 169 |
+
)
|
| 170 |
+
finally:
|
| 171 |
+
for hook in hooks:
|
| 172 |
+
hook.remove()
|
| 173 |
+
scores = score(hyps, refs)
|
| 174 |
+
dump_path = dump_dir / f"{name}.jsonl"
|
| 175 |
+
dump_hyps(
|
| 176 |
+
dump_path,
|
| 177 |
+
pairs,
|
| 178 |
+
hyps,
|
| 179 |
+
mask_name=name,
|
| 180 |
+
extra={
|
| 181 |
+
"category": args.category,
|
| 182 |
+
"tag": args.tag,
|
| 183 |
+
"method": method,
|
| 184 |
+
"intervention": args.intervention,
|
| 185 |
+
"channels": channels,
|
| 186 |
+
"mask_path": str(mask_path),
|
| 187 |
+
},
|
| 188 |
+
)
|
| 189 |
+
results[name] = {
|
| 190 |
+
"scores": scores,
|
| 191 |
+
"elapsed_s": time.time() - t0,
|
| 192 |
+
"dump_path": str(dump_path),
|
| 193 |
+
"channels": channels,
|
| 194 |
+
"mask_path": str(mask_path),
|
| 195 |
+
"intervention": args.intervention,
|
| 196 |
+
}
|
| 197 |
+
print(json.dumps({"name": name, "channels": channels, "scores": scores}), flush=True)
|
| 198 |
+
|
| 199 |
+
payload = {
|
| 200 |
+
"model": args.model,
|
| 201 |
+
"n_layers": n_layers,
|
| 202 |
+
"hidden_size": hidden_size,
|
| 203 |
+
"d_ffn": d_ffn,
|
| 204 |
+
"row_slice": {"start_idx": args.start_idx, "end_idx": end_idx},
|
| 205 |
+
"n_rows": len(pairs),
|
| 206 |
+
"results": results,
|
| 207 |
+
}
|
| 208 |
+
out_path.write_text(json.dumps(payload, indent=2, ensure_ascii=False) + "\n")
|
| 209 |
+
|
| 210 |
+
|
| 211 |
+
if __name__ == "__main__":
|
| 212 |
+
main()
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/issue43_xcomet_destructive_mlp_runner.sh
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Issue #43: XCOMET-confirm destructive MLP mining to <=5% recovery.
|
| 3 |
+
set -euo pipefail
|
| 4 |
+
|
| 5 |
+
export TOKENIZERS_PARALLELISM="${TOKENIZERS_PARALLELISM:-false}"
|
| 6 |
+
export TORCH_ALLOW_TF32_CUBLAS_OVERRIDE="${TORCH_ALLOW_TF32_CUBLAS_OVERRIDE:-1}"
|
| 7 |
+
|
| 8 |
+
REPO_DIR="${REPO_DIR:-/root/work/circuit-shotting}"
|
| 9 |
+
cd "$REPO_DIR"
|
| 10 |
+
|
| 11 |
+
MODEL="${MODEL:-tencent/HY-MT1.5-1.8B}"
|
| 12 |
+
RUN_ROOT="${RUN_ROOT:-/root/runs/issue43_xcomet_destructive_mlp_95}"
|
| 13 |
+
NTREX_JSONL="${NTREX_JSONL:-/root/runs/ntrex_eval/ntrex_en2pt.jsonl}"
|
| 14 |
+
ISSUE42_HF_REPO="${ISSUE42_HF_REPO:-TokenBender/circuit-discovery}"
|
| 15 |
+
ISSUE42_RESULTS_PATH="${ISSUE42_RESULTS_PATH:-circuit-shotting/artifacts/percentile_proxy/issue42_percentile_proxy_20260518T110628Z/damage/percentile_results.jsonl}"
|
| 16 |
+
TOP_NS="${TOP_NS:-10,15,20,30,40,50}"
|
| 17 |
+
TARGET_RECOVERY="${TARGET_RECOVERY:-0.05}"
|
| 18 |
+
GPU_LIST="${GPU_LIST:-}"
|
| 19 |
+
EVAL_MAX_ROWS="${EVAL_MAX_ROWS:-}"
|
| 20 |
+
BATCH_SIZE_GEN="${BATCH_SIZE_GEN:-32}"
|
| 21 |
+
MAX_NEW_TOKENS="${MAX_NEW_TOKENS:-384}"
|
| 22 |
+
XCOMET_SERVICE_BASE_PORT="${XCOMET_SERVICE_BASE_PORT:-10001}"
|
| 23 |
+
XCOMET_MODEL="${XCOMET_MODEL:-Unbabel/XCOMET-XXL}"
|
| 24 |
+
XCOMET_BATCH_SIZE="${XCOMET_BATCH_SIZE:-4}"
|
| 25 |
+
XCOMET_CHUNK_SIZE="${XCOMET_CHUNK_SIZE:-16}"
|
| 26 |
+
XCOMET_SERVICE_LOAD_TIMEOUT_S="${XCOMET_SERVICE_LOAD_TIMEOUT_S:-1800}"
|
| 27 |
+
UPLOAD_AFTER="${UPLOAD_AFTER:-0}"
|
| 28 |
+
|
| 29 |
+
mkdir -p "$RUN_ROOT"/{logs,restored,selection,eval,dumps/ntrex,xcomet,xcomet_shards,services,summaries,package}
|
| 30 |
+
|
| 31 |
+
mark() {
|
| 32 |
+
echo "[$(date -Iseconds)] $*" | tee -a "$RUN_ROOT/logs/issue43_progress.log"
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
run_python() {
|
| 36 |
+
python3 "$@"
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
detect_gpus() {
|
| 40 |
+
if [[ -n "$GPU_LIST" ]]; then
|
| 41 |
+
echo "$GPU_LIST" | tr ',' ' '
|
| 42 |
+
return
|
| 43 |
+
fi
|
| 44 |
+
nvidia-smi --query-gpu=index --format=csv,noheader | tr '\n' ' '
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
read -r -a GPU_ARRAY <<<"$(detect_gpus)"
|
| 48 |
+
GPU_COUNT="${#GPU_ARRAY[@]}"
|
| 49 |
+
if ((GPU_COUNT < 1)); then
|
| 50 |
+
echo "no GPUs found" >&2
|
| 51 |
+
exit 2
|
| 52 |
+
fi
|
| 53 |
+
|
| 54 |
+
wait_pids() {
|
| 55 |
+
local failed=0
|
| 56 |
+
for pid in "$@"; do
|
| 57 |
+
if ! wait "$pid"; then
|
| 58 |
+
failed=1
|
| 59 |
+
fi
|
| 60 |
+
done
|
| 61 |
+
return "$failed"
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
max_top_n() {
|
| 65 |
+
python3 - "$TOP_NS" <<'PY'
|
| 66 |
+
import sys
|
| 67 |
+
vals = [int(x) for x in sys.argv[1].replace(",", " ").split() if x.strip()]
|
| 68 |
+
print(max(vals))
|
| 69 |
+
PY
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
candidate_names() {
|
| 73 |
+
python3 - "$TOP_NS" <<'PY'
|
| 74 |
+
import sys
|
| 75 |
+
vals = [int(x) for x in sys.argv[1].replace(",", " ").split() if x.strip()]
|
| 76 |
+
for value in vals:
|
| 77 |
+
print(f"percentile_top_{value}")
|
| 78 |
+
PY
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
build_ntrex() {
|
| 82 |
+
if [[ -f "$NTREX_JSONL" ]]; then
|
| 83 |
+
return 0
|
| 84 |
+
fi
|
| 85 |
+
mark "build NTREX EN->PT held-out jsonl"
|
| 86 |
+
run_python build_ntrex_en2pt_jsonl.py > "$RUN_ROOT/logs/build_ntrex.log" 2>&1
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
restore_and_select_masks() {
|
| 90 |
+
local restored="$RUN_ROOT/restored/issue42/$ISSUE42_RESULTS_PATH"
|
| 91 |
+
if [[ ! -s "$restored" ]]; then
|
| 92 |
+
mark "restore issue42 percentile damage results from HF"
|
| 93 |
+
hf download "$ISSUE42_HF_REPO" \
|
| 94 |
+
--repo-type dataset \
|
| 95 |
+
--include "$ISSUE42_RESULTS_PATH" \
|
| 96 |
+
--local-dir "$RUN_ROOT/restored/issue42" \
|
| 97 |
+
> "$RUN_ROOT/logs/hf_download_issue42.log" 2>&1
|
| 98 |
+
fi
|
| 99 |
+
if [[ ! -s "$RUN_ROOT/selection/percentile/selection_summary.json" ]]; then
|
| 100 |
+
mark "build cumulative percentile masks through top $(max_top_n)"
|
| 101 |
+
run_python select_percentile_mlp_mix.py \
|
| 102 |
+
--chunk-results "$restored" \
|
| 103 |
+
--out-dir "$RUN_ROOT/selection/percentile" \
|
| 104 |
+
--top-n "$(max_top_n)" \
|
| 105 |
+
> "$RUN_ROOT/logs/select_percentile_masks.log" 2>&1
|
| 106 |
+
fi
|
| 107 |
+
candidate_names > "$RUN_ROOT/selection/scored_candidate_names.txt"
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
run_generation_job() {
|
| 111 |
+
local gpu="$1"
|
| 112 |
+
local name="$2"
|
| 113 |
+
local mask_path="${3:-}"
|
| 114 |
+
local out="$RUN_ROOT/eval/ntrex_${name}.json"
|
| 115 |
+
if [[ -s "$out" && -s "$RUN_ROOT/dumps/ntrex/${name}.jsonl" ]]; then
|
| 116 |
+
return 0
|
| 117 |
+
fi
|
| 118 |
+
if [[ "$name" == "no_mask" ]]; then
|
| 119 |
+
CUDA_VISIBLE_DEVICES="$gpu" run_python evaluate_mlp_nuke_translation.py \
|
| 120 |
+
--model "$MODEL" \
|
| 121 |
+
--input-jsonl "$NTREX_JSONL" \
|
| 122 |
+
--out-json "$out" \
|
| 123 |
+
--dump-dir "$RUN_ROOT/dumps/ntrex" \
|
| 124 |
+
${EVAL_MAX_ROWS:+--max-rows "$EVAL_MAX_ROWS"} \
|
| 125 |
+
--batch-size "$BATCH_SIZE_GEN" \
|
| 126 |
+
--max-new-tokens "$MAX_NEW_TOKENS" \
|
| 127 |
+
--include-no-mask \
|
| 128 |
+
--category "ntrex_test" \
|
| 129 |
+
--tag "heldout" \
|
| 130 |
+
> "$RUN_ROOT/logs/eval_ntrex_${name}.log" 2>&1
|
| 131 |
+
else
|
| 132 |
+
CUDA_VISIBLE_DEVICES="$gpu" run_python evaluate_mlp_nuke_translation.py \
|
| 133 |
+
--model "$MODEL" \
|
| 134 |
+
--input-jsonl "$NTREX_JSONL" \
|
| 135 |
+
--out-json "$out" \
|
| 136 |
+
--dump-dir "$RUN_ROOT/dumps/ntrex" \
|
| 137 |
+
--mask "${name}:${mask_path}" \
|
| 138 |
+
${EVAL_MAX_ROWS:+--max-rows "$EVAL_MAX_ROWS"} \
|
| 139 |
+
--batch-size "$BATCH_SIZE_GEN" \
|
| 140 |
+
--max-new-tokens "$MAX_NEW_TOKENS" \
|
| 141 |
+
--category "ntrex_test" \
|
| 142 |
+
--tag "heldout" \
|
| 143 |
+
> "$RUN_ROOT/logs/eval_ntrex_${name}.log" 2>&1
|
| 144 |
+
fi
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
generate_candidates() {
|
| 148 |
+
mark "generate NTREX hypotheses for no-mask and candidate nukes over $GPU_COUNT GPUs"
|
| 149 |
+
local pids=()
|
| 150 |
+
local idx=0
|
| 151 |
+
local gpu
|
| 152 |
+
gpu="${GPU_ARRAY[$((idx % GPU_COUNT))]}"
|
| 153 |
+
run_generation_job "$gpu" "no_mask" &
|
| 154 |
+
pids+=("$!")
|
| 155 |
+
idx=$((idx + 1))
|
| 156 |
+
while read -r name; do
|
| 157 |
+
[[ -n "$name" ]] || continue
|
| 158 |
+
gpu="${GPU_ARRAY[$((idx % GPU_COUNT))]}"
|
| 159 |
+
run_generation_job "$gpu" "$name" "$RUN_ROOT/selection/percentile/masks/${name}.full.npz" &
|
| 160 |
+
pids+=("$!")
|
| 161 |
+
idx=$((idx + 1))
|
| 162 |
+
if ((${#pids[@]} >= GPU_COUNT)); then
|
| 163 |
+
wait_pids "${pids[@]}"
|
| 164 |
+
pids=()
|
| 165 |
+
fi
|
| 166 |
+
done < <(candidate_names)
|
| 167 |
+
if ((${#pids[@]})); then
|
| 168 |
+
wait_pids "${pids[@]}"
|
| 169 |
+
fi
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
start_xcomet_service() {
|
| 173 |
+
local service_idx="$1"
|
| 174 |
+
local gpu="$2"
|
| 175 |
+
local port="$3"
|
| 176 |
+
local service_root="$RUN_ROOT/services/xcomet_${service_idx}"
|
| 177 |
+
mkdir -p "$service_root"
|
| 178 |
+
if [[ ! -s "$service_root/service.token" ]]; then
|
| 179 |
+
run_python - "$service_root/service.token" <<'PY'
|
| 180 |
+
import secrets, sys
|
| 181 |
+
from pathlib import Path
|
| 182 |
+
p = Path(sys.argv[1])
|
| 183 |
+
p.write_text(secrets.token_urlsafe(32))
|
| 184 |
+
p.chmod(0o600)
|
| 185 |
+
PY
|
| 186 |
+
fi
|
| 187 |
+
if [[ -s "$service_root/service.pid" ]] && kill -0 "$(cat "$service_root/service.pid")" 2>/dev/null; then
|
| 188 |
+
return 0
|
| 189 |
+
fi
|
| 190 |
+
mark "start XCOMET service idx=$service_idx gpu=$gpu port=$port"
|
| 191 |
+
CUDA_VISIBLE_DEVICES="$gpu" XCOMET_SERVICE_TOKEN="$(cat "$service_root/service.token")" \
|
| 192 |
+
nohup python3 xcomet_service.py \
|
| 193 |
+
--host 0.0.0.0 --port "$port" \
|
| 194 |
+
--comet-model "$XCOMET_MODEL" \
|
| 195 |
+
--run-root "$service_root" \
|
| 196 |
+
--default-batch-size "$XCOMET_BATCH_SIZE" \
|
| 197 |
+
--default-chunk-size "$XCOMET_CHUNK_SIZE" \
|
| 198 |
+
--max-worker-batch-size "$XCOMET_BATCH_SIZE" \
|
| 199 |
+
--max-batch-rows "$XCOMET_CHUNK_SIZE" \
|
| 200 |
+
--max-batch-wait-ms 100 \
|
| 201 |
+
--max-queue-rows 4096 \
|
| 202 |
+
--queue-timeout-s 7200 \
|
| 203 |
+
--float32-matmul-precision high \
|
| 204 |
+
--load-on-start \
|
| 205 |
+
> "$service_root/service.log" 2>&1 &
|
| 206 |
+
echo "$!" > "$service_root/service.pid"
|
| 207 |
+
}
|
| 208 |
+
|
| 209 |
+
wait_xcomet_service() {
|
| 210 |
+
local service_idx="$1"
|
| 211 |
+
local port="$2"
|
| 212 |
+
local service_root="$RUN_ROOT/services/xcomet_${service_idx}"
|
| 213 |
+
local start_ts now elapsed
|
| 214 |
+
start_ts="$(date +%s)"
|
| 215 |
+
while true; do
|
| 216 |
+
if [[ -s "$service_root/service.pid" ]] && ! kill -0 "$(cat "$service_root/service.pid")" 2>/dev/null; then
|
| 217 |
+
tail -n 200 "$service_root/service.log" >&2 || true
|
| 218 |
+
return 1
|
| 219 |
+
fi
|
| 220 |
+
if curl -fsS -H "Authorization: Bearer $(cat "$service_root/service.token")" \
|
| 221 |
+
"http://127.0.0.1:${port}/health" > "$service_root/health.json" 2>/dev/null; then
|
| 222 |
+
if grep -q '"model_loaded": true' "$service_root/health.json"; then
|
| 223 |
+
mark "XCOMET service idx=$service_idx healthy on port=$port"
|
| 224 |
+
return 0
|
| 225 |
+
fi
|
| 226 |
+
fi
|
| 227 |
+
now="$(date +%s)"
|
| 228 |
+
elapsed=$((now - start_ts))
|
| 229 |
+
if ((elapsed > XCOMET_SERVICE_LOAD_TIMEOUT_S)); then
|
| 230 |
+
tail -n 200 "$service_root/service.log" >&2 || true
|
| 231 |
+
return 1
|
| 232 |
+
fi
|
| 233 |
+
sleep 15
|
| 234 |
+
done
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
start_xcomet_services() {
|
| 238 |
+
mark "start $GPU_COUNT XCOMET services sequentially"
|
| 239 |
+
for ((j=0; j<GPU_COUNT; j++)); do
|
| 240 |
+
start_xcomet_service "$j" "${GPU_ARRAY[$j]}" "$((XCOMET_SERVICE_BASE_PORT + j))"
|
| 241 |
+
wait_xcomet_service "$j" "$((XCOMET_SERVICE_BASE_PORT + j))"
|
| 242 |
+
done
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
score_xcomet_name() {
|
| 246 |
+
local name="$1"
|
| 247 |
+
local hyps="$RUN_ROOT/dumps/ntrex/${name}.jsonl"
|
| 248 |
+
local out="$RUN_ROOT/xcomet/${name}.json"
|
| 249 |
+
if [[ -s "$out" ]]; then
|
| 250 |
+
return 0
|
| 251 |
+
fi
|
| 252 |
+
local service_args=()
|
| 253 |
+
for ((j=0; j<GPU_COUNT; j++)); do
|
| 254 |
+
service_args+=(--service "$j,http://127.0.0.1:$((XCOMET_SERVICE_BASE_PORT + j)),$RUN_ROOT/services/xcomet_${j}/service.token")
|
| 255 |
+
done
|
| 256 |
+
mark "XCOMET score $name"
|
| 257 |
+
run_python score_xcomet_sharded.py \
|
| 258 |
+
--hyps-jsonl "$hyps" \
|
| 259 |
+
--out-json "$out" \
|
| 260 |
+
--out-jsonl "$RUN_ROOT/xcomet/${name}.scored_pool.jsonl" \
|
| 261 |
+
--shard-dir "$RUN_ROOT/xcomet_shards/$name" \
|
| 262 |
+
--request-id "issue43_${name}" \
|
| 263 |
+
--system-name "issue43_${name}" \
|
| 264 |
+
--batch-size "$XCOMET_BATCH_SIZE" \
|
| 265 |
+
--chunk-size "$XCOMET_CHUNK_SIZE" \
|
| 266 |
+
--timeout-s 7200 \
|
| 267 |
+
"${service_args[@]}" \
|
| 268 |
+
> "$RUN_ROOT/logs/xcomet_${name}.log" 2>&1
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
summarize() {
|
| 272 |
+
run_python summarize_issue43_xcomet_destructive_mlp.py \
|
| 273 |
+
--run-root "$RUN_ROOT" \
|
| 274 |
+
--target-recovery "$TARGET_RECOVERY" \
|
| 275 |
+
--out-json "$RUN_ROOT/summaries/issue43_summary.json" \
|
| 276 |
+
--out-md "$RUN_ROOT/summaries/issue43_summary.md" \
|
| 277 |
+
> "$RUN_ROOT/logs/summarize_issue43.log" 2>&1
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
gate_passed() {
|
| 281 |
+
python3 - "$RUN_ROOT/summaries/issue43_summary.json" <<'PY'
|
| 282 |
+
import json, sys
|
| 283 |
+
payload = json.load(open(sys.argv[1]))
|
| 284 |
+
raise SystemExit(0 if payload.get("gate_passed") else 1)
|
| 285 |
+
PY
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
score_until_gate() {
|
| 289 |
+
start_xcomet_services
|
| 290 |
+
score_xcomet_name "no_mask"
|
| 291 |
+
summarize
|
| 292 |
+
while read -r name; do
|
| 293 |
+
[[ -n "$name" ]] || continue
|
| 294 |
+
score_xcomet_name "$name"
|
| 295 |
+
summarize
|
| 296 |
+
if gate_passed; then
|
| 297 |
+
mark "target reached by $name; stop further XCOMET scoring"
|
| 298 |
+
return 0
|
| 299 |
+
fi
|
| 300 |
+
done < <(candidate_names)
|
| 301 |
+
mark "target recovery $TARGET_RECOVERY not reached by scored candidates"
|
| 302 |
+
return 3
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
package_upload() {
|
| 306 |
+
if [[ "$UPLOAD_AFTER" == "1" || "$UPLOAD_AFTER" == "true" ]]; then
|
| 307 |
+
mark "package and upload issue43 artifacts"
|
| 308 |
+
RUN_ROOT="$RUN_ROOT" REPO_DIR="$REPO_DIR" bash scripts/package_issue43_hf_upload.sh \
|
| 309 |
+
> "$RUN_ROOT/logs/package_issue43_hf_upload.log" 2>&1
|
| 310 |
+
fi
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
mark "issue43 start XCOMET destructive MLP gate gpus=${GPU_ARRAY[*]} top_ns=$TOP_NS target=$TARGET_RECOVERY"
|
| 314 |
+
build_ntrex
|
| 315 |
+
restore_and_select_masks
|
| 316 |
+
generate_candidates
|
| 317 |
+
set +e
|
| 318 |
+
score_until_gate
|
| 319 |
+
status="$?"
|
| 320 |
+
set -e
|
| 321 |
+
summarize
|
| 322 |
+
package_upload
|
| 323 |
+
if [[ "$status" != "0" ]]; then
|
| 324 |
+
exit "$status"
|
| 325 |
+
fi
|
| 326 |
+
mark "issue43 done"
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/package_issue43_hf_upload.sh
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
# Package and upload issue #43 XCOMET destructive MLP artifacts.
|
| 3 |
+
set -euo pipefail
|
| 4 |
+
|
| 5 |
+
RUN_ROOT="${RUN_ROOT:-/root/runs/issue43_xcomet_destructive_mlp_95}"
|
| 6 |
+
REPO_DIR="${REPO_DIR:-/root/work/circuit-shotting}"
|
| 7 |
+
STAMP="$(date -u +%Y%m%dT%H%M%SZ)"
|
| 8 |
+
UPLOAD_PREFIX="${UPLOAD_PREFIX:-issue43_xcomet_destructive_mlp_95_$STAMP}"
|
| 9 |
+
SYNTH_HF_REPO="${SYNTH_HF_REPO:-TokenBender/synth-data-en-pt-circuit}"
|
| 10 |
+
CIRCUIT_HF_REPO="${CIRCUIT_HF_REPO:-TokenBender/circuit-discovery}"
|
| 11 |
+
UPLOAD_DIR="$RUN_ROOT/package/$UPLOAD_PREFIX"
|
| 12 |
+
|
| 13 |
+
rm -rf "$UPLOAD_DIR"
|
| 14 |
+
mkdir -p "$UPLOAD_DIR"/{spec,scripts,restored,selection,eval,dumps,xcomet,xcomet_shards,summaries,logs,services,manifests}
|
| 15 |
+
|
| 16 |
+
copy_if_present() {
|
| 17 |
+
local src="$1"
|
| 18 |
+
local dst="$2"
|
| 19 |
+
if [[ -e "$src" ]]; then
|
| 20 |
+
mkdir -p "$(dirname "$dst")"
|
| 21 |
+
cp -a "$src" "$dst"
|
| 22 |
+
fi
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
copy_if_present "$REPO_DIR/configs/issue43_xcomet_destructive_mlp_95.json" "$UPLOAD_DIR/spec/issue43_xcomet_destructive_mlp_95.json"
|
| 26 |
+
|
| 27 |
+
for path in \
|
| 28 |
+
actdelta_mlp_common.py \
|
| 29 |
+
build_ntrex_en2pt_jsonl.py \
|
| 30 |
+
evaluate_mlp_nuke_translation.py \
|
| 31 |
+
issue43_xcomet_destructive_mlp_runner.sh \
|
| 32 |
+
score_xcomet_sharded.py \
|
| 33 |
+
select_percentile_mlp_mix.py \
|
| 34 |
+
summarize_issue43_xcomet_destructive_mlp.py \
|
| 35 |
+
xcomet_service.py \
|
| 36 |
+
scripts/package_issue43_hf_upload.sh; do
|
| 37 |
+
copy_if_present "$REPO_DIR/$path" "$UPLOAD_DIR/scripts/$(basename "$path")"
|
| 38 |
+
done
|
| 39 |
+
|
| 40 |
+
cp -a "$RUN_ROOT/restored"/* "$UPLOAD_DIR/restored/" 2>/dev/null || true
|
| 41 |
+
cp -a "$RUN_ROOT/selection"/* "$UPLOAD_DIR/selection/" 2>/dev/null || true
|
| 42 |
+
cp -a "$RUN_ROOT/eval"/* "$UPLOAD_DIR/eval/" 2>/dev/null || true
|
| 43 |
+
cp -a "$RUN_ROOT/xcomet"/* "$UPLOAD_DIR/xcomet/" 2>/dev/null || true
|
| 44 |
+
cp -a "$RUN_ROOT/xcomet_shards"/* "$UPLOAD_DIR/xcomet_shards/" 2>/dev/null || true
|
| 45 |
+
cp -a "$RUN_ROOT/summaries"/* "$UPLOAD_DIR/summaries/" 2>/dev/null || true
|
| 46 |
+
cp -a "$RUN_ROOT/logs"/* "$UPLOAD_DIR/logs/" 2>/dev/null || true
|
| 47 |
+
|
| 48 |
+
find "$RUN_ROOT/dumps" -maxdepth 3 -type f -name '*.jsonl' -print0 2>/dev/null \
|
| 49 |
+
| while IFS= read -r -d '' file; do
|
| 50 |
+
rel="${file#$RUN_ROOT/dumps/}"
|
| 51 |
+
copy_if_present "$file" "$UPLOAD_DIR/dumps/$rel"
|
| 52 |
+
done
|
| 53 |
+
|
| 54 |
+
find "$RUN_ROOT/services" -maxdepth 2 -type f \( -name 'service.log' -o -name 'health.json' \) -print0 2>/dev/null \
|
| 55 |
+
| while IFS= read -r -d '' file; do
|
| 56 |
+
rel="${file#$RUN_ROOT/services/}"
|
| 57 |
+
copy_if_present "$file" "$UPLOAD_DIR/services/$rel"
|
| 58 |
+
done
|
| 59 |
+
|
| 60 |
+
find "$UPLOAD_DIR" -type f -print0 | sort -z | xargs -0 sha256sum > "$UPLOAD_DIR/manifests/SHA256SUMS"
|
| 61 |
+
python3 - "$UPLOAD_DIR" "$RUN_ROOT" "$UPLOAD_PREFIX" <<'PY'
|
| 62 |
+
import json, sys
|
| 63 |
+
from pathlib import Path
|
| 64 |
+
upload = Path(sys.argv[1])
|
| 65 |
+
run_root = Path(sys.argv[2])
|
| 66 |
+
prefix = sys.argv[3]
|
| 67 |
+
files = [p for p in upload.rglob("*") if p.is_file()]
|
| 68 |
+
manifest = {
|
| 69 |
+
"upload_prefix": prefix,
|
| 70 |
+
"run_root": str(run_root),
|
| 71 |
+
"file_count": len(files),
|
| 72 |
+
"bytes": sum(p.stat().st_size for p in files),
|
| 73 |
+
"weights_policy": "Includes experiment masks, generated hypotheses, XCOMET summaries/scored rows, scripts, specs, and logs. Excludes upstream HY-MT/XCOMET weights, HF caches, API keys, and service tokens.",
|
| 74 |
+
}
|
| 75 |
+
(upload / "manifests" / "manifest.json").write_text(json.dumps(manifest, indent=2) + "\n")
|
| 76 |
+
(upload / "README.md").write_text(
|
| 77 |
+
"# Issue 43 XCOMET Destructive MLP 95% Gate Artifacts\n\n"
|
| 78 |
+
"This package contains restored issue #42 percentile damage inputs, cumulative MLP masks, "
|
| 79 |
+
"NTREX generation dumps, XCOMET scores, summaries, and logs for the destructive <=5% recovery gate.\n\n"
|
| 80 |
+
"Upstream HY-MT and XCOMET model weights are not included.\n"
|
| 81 |
+
)
|
| 82 |
+
PY
|
| 83 |
+
|
| 84 |
+
hf upload "$SYNTH_HF_REPO" "$UPLOAD_DIR" "$UPLOAD_PREFIX" --repo-type dataset
|
| 85 |
+
hf upload "$CIRCUIT_HF_REPO" "$UPLOAD_DIR" "circuit-shotting/artifacts/xcomet_destructive_mlp_95/$UPLOAD_PREFIX" --repo-type dataset
|
| 86 |
+
|
| 87 |
+
echo "$UPLOAD_PREFIX"
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/score_xcomet_sharded.py
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Score one hypothesis file by sharding it across all XCOMET services."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
from concurrent.futures import ThreadPoolExecutor, as_completed
|
| 8 |
+
import json
|
| 9 |
+
import statistics
|
| 10 |
+
import time
|
| 11 |
+
import urllib.error
|
| 12 |
+
import urllib.request
|
| 13 |
+
from pathlib import Path
|
| 14 |
+
from typing import Any
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def parse_args() -> argparse.Namespace:
|
| 18 |
+
p = argparse.ArgumentParser(description=__doc__)
|
| 19 |
+
p.add_argument("--hyps-jsonl", required=True)
|
| 20 |
+
p.add_argument("--out-json", required=True)
|
| 21 |
+
p.add_argument("--out-jsonl", required=True)
|
| 22 |
+
p.add_argument("--shard-dir", required=True)
|
| 23 |
+
p.add_argument("--service", action="append", required=True,
|
| 24 |
+
help="Service spec idx,base_url,token_file. Repeat once per GPU.")
|
| 25 |
+
p.add_argument("--request-id", default=None)
|
| 26 |
+
p.add_argument("--system-name", default=None)
|
| 27 |
+
p.add_argument("--batch-size", type=int, default=1)
|
| 28 |
+
p.add_argument("--chunk-size", type=int, default=16)
|
| 29 |
+
p.add_argument("--timeout-s", type=float, default=7200)
|
| 30 |
+
p.add_argument("--threshold", type=float, default=0.99)
|
| 31 |
+
return p.parse_args()
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def load_jsonl(path: Path) -> list[dict[str, Any]]:
|
| 35 |
+
rows = []
|
| 36 |
+
with path.open() as f:
|
| 37 |
+
for idx, line in enumerate(f):
|
| 38 |
+
if not line.strip():
|
| 39 |
+
continue
|
| 40 |
+
row = json.loads(line)
|
| 41 |
+
row.setdefault("id", idx)
|
| 42 |
+
rows.append(row)
|
| 43 |
+
return rows
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
def write_jsonl(path: Path, rows: list[dict[str, Any]]) -> None:
|
| 47 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 48 |
+
with path.open("w") as f:
|
| 49 |
+
for row in rows:
|
| 50 |
+
f.write(json.dumps(row, ensure_ascii=False) + "\n")
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def parse_service(spec: str) -> dict[str, Any]:
|
| 54 |
+
parts = spec.split(",", 2)
|
| 55 |
+
if len(parts) != 3:
|
| 56 |
+
raise ValueError(f"bad --service {spec!r}; expected idx,base_url,token_file")
|
| 57 |
+
idx, base_url, token_file = parts
|
| 58 |
+
return {
|
| 59 |
+
"idx": int(idx),
|
| 60 |
+
"base_url": base_url.rstrip("/"),
|
| 61 |
+
"token_file": token_file,
|
| 62 |
+
"token": Path(token_file).read_text().strip(),
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def request_json(method: str, url: str, token: str, payload: dict[str, Any] | None,
|
| 67 |
+
timeout: float) -> dict[str, Any]:
|
| 68 |
+
body = None if payload is None else json.dumps(payload).encode("utf-8")
|
| 69 |
+
req = urllib.request.Request(url, data=body, method=method)
|
| 70 |
+
req.add_header("Authorization", f"Bearer {token}")
|
| 71 |
+
if body is not None:
|
| 72 |
+
req.add_header("Content-Type", "application/json")
|
| 73 |
+
try:
|
| 74 |
+
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
| 75 |
+
return json.loads(resp.read())
|
| 76 |
+
except urllib.error.HTTPError as exc:
|
| 77 |
+
text = exc.read().decode("utf-8", errors="replace")
|
| 78 |
+
raise RuntimeError(f"{url} failed {exc.code}: {text}") from exc
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def score_shard(service: dict[str, Any], shard_path: Path, *, request_id: str,
|
| 82 |
+
system_name: str, batch_size: int, chunk_size: int,
|
| 83 |
+
timeout_s: float) -> dict[str, Any]:
|
| 84 |
+
base = service["base_url"]
|
| 85 |
+
token = service["token"]
|
| 86 |
+
health = request_json("GET", f"{base}/health", token, None, timeout=30)
|
| 87 |
+
payload = {
|
| 88 |
+
"hyps_jsonl": str(shard_path),
|
| 89 |
+
"request_id": request_id,
|
| 90 |
+
"system_name": system_name,
|
| 91 |
+
"batch_size": batch_size,
|
| 92 |
+
"chunk_size": chunk_size,
|
| 93 |
+
"timeout_s": timeout_s,
|
| 94 |
+
"return_rows": False,
|
| 95 |
+
}
|
| 96 |
+
result = request_json("POST", f"{base}/score-dataset", token, payload, timeout=timeout_s + 60)
|
| 97 |
+
return {
|
| 98 |
+
"service": {
|
| 99 |
+
"idx": service["idx"],
|
| 100 |
+
"base_url": base,
|
| 101 |
+
"health": {
|
| 102 |
+
"model_loaded": health.get("model_loaded"),
|
| 103 |
+
"comet_model": health.get("comet_model"),
|
| 104 |
+
"cuda": health.get("cuda"),
|
| 105 |
+
},
|
| 106 |
+
},
|
| 107 |
+
"shard_path": str(shard_path),
|
| 108 |
+
**result,
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
def main() -> None:
|
| 113 |
+
args = parse_args()
|
| 114 |
+
services = [parse_service(spec) for spec in args.service]
|
| 115 |
+
if not services:
|
| 116 |
+
raise ValueError("at least one --service is required")
|
| 117 |
+
rows = load_jsonl(Path(args.hyps_jsonl))
|
| 118 |
+
if not rows:
|
| 119 |
+
raise ValueError(f"no rows in {args.hyps_jsonl}")
|
| 120 |
+
|
| 121 |
+
shard_dir = Path(args.shard_dir)
|
| 122 |
+
shard_dir.mkdir(parents=True, exist_ok=True)
|
| 123 |
+
request_root = args.request_id or Path(args.hyps_jsonl).stem
|
| 124 |
+
system_name = args.system_name or Path(args.hyps_jsonl).stem
|
| 125 |
+
|
| 126 |
+
shard_paths: list[Path] = []
|
| 127 |
+
for shard_idx, service in enumerate(services):
|
| 128 |
+
shard_rows = rows[shard_idx::len(services)]
|
| 129 |
+
shard_path = shard_dir / f"shard_{shard_idx:03d}.jsonl"
|
| 130 |
+
write_jsonl(shard_path, shard_rows)
|
| 131 |
+
shard_paths.append(shard_path)
|
| 132 |
+
|
| 133 |
+
t0 = time.time()
|
| 134 |
+
shard_results: list[dict[str, Any]] = []
|
| 135 |
+
with ThreadPoolExecutor(max_workers=len(services)) as executor:
|
| 136 |
+
futures = []
|
| 137 |
+
for shard_idx, (service, shard_path) in enumerate(zip(services, shard_paths)):
|
| 138 |
+
futures.append(executor.submit(
|
| 139 |
+
score_shard,
|
| 140 |
+
service,
|
| 141 |
+
shard_path,
|
| 142 |
+
request_id=f"{request_root}_shard{shard_idx:03d}",
|
| 143 |
+
system_name=f"{system_name}_shard{shard_idx:03d}",
|
| 144 |
+
batch_size=args.batch_size,
|
| 145 |
+
chunk_size=args.chunk_size,
|
| 146 |
+
timeout_s=args.timeout_s,
|
| 147 |
+
))
|
| 148 |
+
for future in as_completed(futures):
|
| 149 |
+
shard_results.append(future.result())
|
| 150 |
+
|
| 151 |
+
scored_rows: list[dict[str, Any]] = []
|
| 152 |
+
for result in shard_results:
|
| 153 |
+
out_jsonl = result.get("outputs", {}).get("out_jsonl")
|
| 154 |
+
if not out_jsonl:
|
| 155 |
+
raise ValueError(f"shard result missing outputs.out_jsonl: {result}")
|
| 156 |
+
for row in load_jsonl(Path(out_jsonl)):
|
| 157 |
+
row["system"] = system_name
|
| 158 |
+
scored_rows.append(row)
|
| 159 |
+
scored_rows.sort(key=lambda row: int(row.get("row_id", row.get("id", 0))))
|
| 160 |
+
|
| 161 |
+
scores = [float(row["score"]) for row in scored_rows]
|
| 162 |
+
out_jsonl = Path(args.out_jsonl)
|
| 163 |
+
write_jsonl(out_jsonl, scored_rows)
|
| 164 |
+
summary = {
|
| 165 |
+
"source_path": args.hyps_jsonl,
|
| 166 |
+
"comet_model": shard_results[0].get("summary", {}).get("comet_model"),
|
| 167 |
+
"checkpoint_path": shard_results[0].get("summary", {}).get("checkpoint_path"),
|
| 168 |
+
"n": len(scored_rows),
|
| 169 |
+
"threshold": args.threshold,
|
| 170 |
+
"system_score": statistics.fmean(scores),
|
| 171 |
+
"passed": sum(1 for score in scores if score >= args.threshold),
|
| 172 |
+
"elapsed_seconds": time.time() - t0,
|
| 173 |
+
"batch_size": args.batch_size,
|
| 174 |
+
"chunk_size": args.chunk_size,
|
| 175 |
+
"shard_count": len(services),
|
| 176 |
+
"throughput_seg_per_s": len(scored_rows) / max(time.time() - t0, 1e-9),
|
| 177 |
+
}
|
| 178 |
+
payload = {
|
| 179 |
+
"health": [result["service"] for result in sorted(shard_results, key=lambda row: row["service"]["idx"])],
|
| 180 |
+
"summary": summary,
|
| 181 |
+
"outputs": {
|
| 182 |
+
"out_jsonl": str(out_jsonl),
|
| 183 |
+
"shard_dir": str(shard_dir),
|
| 184 |
+
},
|
| 185 |
+
"shards": sorted(shard_results, key=lambda row: row["service"]["idx"]),
|
| 186 |
+
}
|
| 187 |
+
out_json = Path(args.out_json)
|
| 188 |
+
out_json.parent.mkdir(parents=True, exist_ok=True)
|
| 189 |
+
out_json.write_text(json.dumps(payload, indent=2, ensure_ascii=False) + "\n")
|
| 190 |
+
print(json.dumps({"out_json": str(out_json), "summary": summary}, indent=2), flush=True)
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
if __name__ == "__main__":
|
| 194 |
+
main()
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/select_percentile_mlp_mix.py
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Select destructive 1%ile MLP chunks and emit cumulative union masks."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
import json
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
|
| 10 |
+
from actdelta_mlp_common import (
|
| 11 |
+
Candidate,
|
| 12 |
+
count_mask,
|
| 13 |
+
load_candidate_jsonl,
|
| 14 |
+
mask_from_ranges,
|
| 15 |
+
mlp_total,
|
| 16 |
+
normalize_ranges,
|
| 17 |
+
save_mask_npz,
|
| 18 |
+
write_jsonl,
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def parse_args() -> argparse.Namespace:
|
| 23 |
+
p = argparse.ArgumentParser(description=__doc__)
|
| 24 |
+
p.add_argument("--chunk-results", required=True)
|
| 25 |
+
p.add_argument("--out-dir", required=True)
|
| 26 |
+
p.add_argument("--n-layers", type=int, default=32)
|
| 27 |
+
p.add_argument("--d-ffn", type=int, default=6144)
|
| 28 |
+
p.add_argument("--top-n", type=int, default=20)
|
| 29 |
+
return p.parse_args()
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def main() -> None:
|
| 33 |
+
args = parse_args()
|
| 34 |
+
out_dir = Path(args.out_dir)
|
| 35 |
+
mask_dir = out_dir / "masks"
|
| 36 |
+
out_dir.mkdir(parents=True, exist_ok=True)
|
| 37 |
+
mask_dir.mkdir(parents=True, exist_ok=True)
|
| 38 |
+
|
| 39 |
+
rows = load_candidate_jsonl(args.chunk_results)
|
| 40 |
+
ranked = sorted(rows, key=lambda row: float(row["score"]), reverse=True)
|
| 41 |
+
write_jsonl(out_dir / "ranked_percentiles.jsonl", ranked)
|
| 42 |
+
|
| 43 |
+
cumulative_rows = []
|
| 44 |
+
for top_n in range(1, min(args.top_n, len(ranked)) + 1):
|
| 45 |
+
selected = ranked[:top_n]
|
| 46 |
+
ranges = []
|
| 47 |
+
for row in selected:
|
| 48 |
+
ranges.extend((int(start), int(end)) for start, end in row["ranges"])
|
| 49 |
+
ranges = normalize_ranges(ranges)
|
| 50 |
+
name = f"percentile_top_{top_n}"
|
| 51 |
+
candidate = Candidate(
|
| 52 |
+
name=name,
|
| 53 |
+
ranges=ranges,
|
| 54 |
+
meta={"top_n": top_n, "chunk_names": [row["name"] for row in selected]},
|
| 55 |
+
)
|
| 56 |
+
mask = mask_from_ranges(candidate.ranges, args.n_layers, args.d_ffn)
|
| 57 |
+
mask_path = mask_dir / f"{name}.full.npz"
|
| 58 |
+
save_mask_npz(mask_path, mask)
|
| 59 |
+
cumulative_rows.append({
|
| 60 |
+
"name": name,
|
| 61 |
+
"top_n": top_n,
|
| 62 |
+
"ranges": [list(r) for r in candidate.ranges],
|
| 63 |
+
"channels": count_mask(mask),
|
| 64 |
+
"channel_fraction": count_mask(mask) / max(mlp_total(args.n_layers, args.d_ffn), 1),
|
| 65 |
+
"chunk_names": candidate.meta["chunk_names"],
|
| 66 |
+
"mask_path": str(mask_path),
|
| 67 |
+
"selected_chunks": [
|
| 68 |
+
{
|
| 69 |
+
"rank": idx + 1,
|
| 70 |
+
"name": row["name"],
|
| 71 |
+
"score": row["score"],
|
| 72 |
+
"mean_sentence_kl": row["mean_sentence_kl"],
|
| 73 |
+
"tail90_sentence_kl": row["tail90_sentence_kl"],
|
| 74 |
+
"channels": row["channels"],
|
| 75 |
+
"ranges": row["ranges"],
|
| 76 |
+
}
|
| 77 |
+
for idx, row in enumerate(selected)
|
| 78 |
+
],
|
| 79 |
+
})
|
| 80 |
+
write_jsonl(out_dir / "cumulative_percentile_mixes.jsonl", cumulative_rows)
|
| 81 |
+
final = cumulative_rows[-1] if cumulative_rows else None
|
| 82 |
+
|
| 83 |
+
summary = {
|
| 84 |
+
"n_layers": args.n_layers,
|
| 85 |
+
"d_ffn": args.d_ffn,
|
| 86 |
+
"mlp_total": mlp_total(args.n_layers, args.d_ffn),
|
| 87 |
+
"top_n": args.top_n,
|
| 88 |
+
"ranked_percentiles_jsonl": str(out_dir / "ranked_percentiles.jsonl"),
|
| 89 |
+
"cumulative_percentile_mixes_jsonl": str(out_dir / "cumulative_percentile_mixes.jsonl"),
|
| 90 |
+
"final_mix": final,
|
| 91 |
+
}
|
| 92 |
+
(out_dir / "selection_summary.json").write_text(
|
| 93 |
+
json.dumps(summary, indent=2, ensure_ascii=False) + "\n"
|
| 94 |
+
)
|
| 95 |
+
print(json.dumps({
|
| 96 |
+
"top_n": args.top_n,
|
| 97 |
+
"final_mix": None if final is None else final["name"],
|
| 98 |
+
"channels": None if final is None else final["channels"],
|
| 99 |
+
"out_dir": str(out_dir),
|
| 100 |
+
}, indent=2), flush=True)
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
if __name__ == "__main__":
|
| 104 |
+
main()
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/summarize_issue43_xcomet_destructive_mlp.py
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Summarize issue #43 XCOMET destructive MLP gate results."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
import json
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
from typing import Any
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
PRIOR_ANCHOR = {
|
| 13 |
+
"name": "issue39_final_mix_top_3",
|
| 14 |
+
"channels": 5898,
|
| 15 |
+
"channel_fraction": 5898 / 196608,
|
| 16 |
+
"xcomet": 0.14186869932268653,
|
| 17 |
+
"recovery": 0.15275785974445857,
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def parse_args() -> argparse.Namespace:
|
| 22 |
+
p = argparse.ArgumentParser(description=__doc__)
|
| 23 |
+
p.add_argument("--run-root", required=True)
|
| 24 |
+
p.add_argument("--target-recovery", type=float, default=0.05)
|
| 25 |
+
p.add_argument("--out-json", required=True)
|
| 26 |
+
p.add_argument("--out-md", required=True)
|
| 27 |
+
return p.parse_args()
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def maybe_json(path: Path) -> Any | None:
|
| 31 |
+
if not path.exists():
|
| 32 |
+
return None
|
| 33 |
+
with path.open() as f:
|
| 34 |
+
return json.load(f)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def xcomet_score(path: Path) -> float | None:
|
| 38 |
+
payload = maybe_json(path)
|
| 39 |
+
if not payload:
|
| 40 |
+
return None
|
| 41 |
+
return payload.get("summary", {}).get("system_score")
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def load_selection_rows(path: Path) -> list[dict[str, Any]]:
|
| 45 |
+
rows: list[dict[str, Any]] = []
|
| 46 |
+
if not path.exists():
|
| 47 |
+
return rows
|
| 48 |
+
with path.open() as f:
|
| 49 |
+
for line in f:
|
| 50 |
+
if line.strip():
|
| 51 |
+
rows.append(json.loads(line))
|
| 52 |
+
return rows
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
def eval_row(root: Path, name: str) -> dict[str, Any]:
|
| 56 |
+
payload = maybe_json(root / "eval" / f"ntrex_{name}.json") or {}
|
| 57 |
+
result = (payload.get("results") or {}).get(name) or {}
|
| 58 |
+
return {
|
| 59 |
+
"name": name,
|
| 60 |
+
"channels": result.get("channels"),
|
| 61 |
+
"channel_fraction": None if result.get("channels") is None else result.get("channels") / 196608,
|
| 62 |
+
"chrFpp": (result.get("scores") or {}).get("chrFpp"),
|
| 63 |
+
"BLEU": (result.get("scores") or {}).get("BLEU"),
|
| 64 |
+
"dump_path": result.get("dump_path"),
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def main() -> None:
|
| 69 |
+
args = parse_args()
|
| 70 |
+
root = Path(args.run_root)
|
| 71 |
+
out_json = Path(args.out_json)
|
| 72 |
+
out_md = Path(args.out_md)
|
| 73 |
+
out_json.parent.mkdir(parents=True, exist_ok=True)
|
| 74 |
+
out_md.parent.mkdir(parents=True, exist_ok=True)
|
| 75 |
+
|
| 76 |
+
selection_rows = load_selection_rows(root / "selection" / "percentile" / "cumulative_percentile_mixes.jsonl")
|
| 77 |
+
names_path = root / "selection" / "scored_candidate_names.txt"
|
| 78 |
+
if names_path.exists():
|
| 79 |
+
candidate_names = [line.strip() for line in names_path.read_text().splitlines() if line.strip()]
|
| 80 |
+
else:
|
| 81 |
+
candidate_names = [row["name"] for row in selection_rows]
|
| 82 |
+
candidate_meta = {row["name"]: row for row in selection_rows}
|
| 83 |
+
|
| 84 |
+
no_mask_eval = maybe_json(root / "eval" / "ntrex_no_mask.json") or {}
|
| 85 |
+
no_mask_result = (no_mask_eval.get("results") or {}).get("no_mask") or {}
|
| 86 |
+
baseline_xcomet = xcomet_score(root / "xcomet" / "no_mask.json")
|
| 87 |
+
|
| 88 |
+
rows: list[dict[str, Any]] = []
|
| 89 |
+
for name in candidate_names:
|
| 90 |
+
row = eval_row(root, name)
|
| 91 |
+
meta = candidate_meta.get(name) or {}
|
| 92 |
+
row["top_n"] = meta.get("top_n")
|
| 93 |
+
row["chunk_names"] = meta.get("chunk_names")
|
| 94 |
+
row["xcomet"] = xcomet_score(root / "xcomet" / f"{name}.json")
|
| 95 |
+
if baseline_xcomet and row["xcomet"] is not None:
|
| 96 |
+
row["recovery"] = row["xcomet"] / baseline_xcomet
|
| 97 |
+
row["destruction"] = 1.0 - row["recovery"]
|
| 98 |
+
row["passes_target"] = row["recovery"] <= args.target_recovery
|
| 99 |
+
else:
|
| 100 |
+
row["recovery"] = None
|
| 101 |
+
row["destruction"] = None
|
| 102 |
+
row["passes_target"] = False
|
| 103 |
+
rows.append(row)
|
| 104 |
+
|
| 105 |
+
scored_rows = [row for row in rows if row["xcomet"] is not None]
|
| 106 |
+
passing = [row for row in scored_rows if row["passes_target"]]
|
| 107 |
+
passing.sort(key=lambda row: (row.get("channels") or 10**18, row.get("top_n") or 10**18))
|
| 108 |
+
best = passing[0] if passing else None
|
| 109 |
+
|
| 110 |
+
payload = {
|
| 111 |
+
"run_root": str(root),
|
| 112 |
+
"target_recovery": args.target_recovery,
|
| 113 |
+
"no_mask": {
|
| 114 |
+
"xcomet": baseline_xcomet,
|
| 115 |
+
"chrFpp": (no_mask_result.get("scores") or {}).get("chrFpp"),
|
| 116 |
+
"BLEU": (no_mask_result.get("scores") or {}).get("BLEU"),
|
| 117 |
+
"dump_path": no_mask_result.get("dump_path"),
|
| 118 |
+
},
|
| 119 |
+
"prior_anchor": PRIOR_ANCHOR,
|
| 120 |
+
"candidates": rows,
|
| 121 |
+
"best_passing": best,
|
| 122 |
+
"gate_passed": best is not None,
|
| 123 |
+
}
|
| 124 |
+
out_json.write_text(json.dumps(payload, indent=2, ensure_ascii=False) + "\n")
|
| 125 |
+
|
| 126 |
+
lines = [
|
| 127 |
+
"# Issue 43 XCOMET Destructive MLP 95% Gate",
|
| 128 |
+
"",
|
| 129 |
+
f"- Target recovery: `{args.target_recovery}`",
|
| 130 |
+
f"- No-mask XCOMET: `{baseline_xcomet}`",
|
| 131 |
+
f"- Gate passed: `{best is not None}`",
|
| 132 |
+
]
|
| 133 |
+
if best:
|
| 134 |
+
lines.extend([
|
| 135 |
+
f"- Smallest passing candidate: `{best['name']}`",
|
| 136 |
+
f"- Passing channels: `{best.get('channels')}`",
|
| 137 |
+
f"- Passing recovery: `{best.get('recovery')}`",
|
| 138 |
+
f"- Passing destruction: `{best.get('destruction')}`",
|
| 139 |
+
])
|
| 140 |
+
lines.extend([
|
| 141 |
+
"",
|
| 142 |
+
"## Prior Anchor",
|
| 143 |
+
"",
|
| 144 |
+
"| anchor | channels | XCOMET | recovery | destruction |",
|
| 145 |
+
"|---|---:|---:|---:|---:|",
|
| 146 |
+
(
|
| 147 |
+
f"| `{PRIOR_ANCHOR['name']}` | `{PRIOR_ANCHOR['channels']}` | "
|
| 148 |
+
f"`{PRIOR_ANCHOR['xcomet']}` | `{PRIOR_ANCHOR['recovery']}` | "
|
| 149 |
+
f"`{1.0 - PRIOR_ANCHOR['recovery']}` |"
|
| 150 |
+
),
|
| 151 |
+
"",
|
| 152 |
+
"## XCOMET Candidates",
|
| 153 |
+
"",
|
| 154 |
+
"| candidate | top_n | channels | chrF++ | BLEU | XCOMET | recovery | destruction | pass |",
|
| 155 |
+
"|---|---:|---:|---:|---:|---:|---:|---:|---|",
|
| 156 |
+
])
|
| 157 |
+
for row in rows:
|
| 158 |
+
lines.append(
|
| 159 |
+
f"| `{row['name']}` | `{row.get('top_n')}` | `{row.get('channels')}` | "
|
| 160 |
+
f"`{row.get('chrFpp')}` | `{row.get('BLEU')}` | `{row.get('xcomet')}` | "
|
| 161 |
+
f"`{row.get('recovery')}` | `{row.get('destruction')}` | "
|
| 162 |
+
f"`{row.get('passes_target')}` |"
|
| 163 |
+
)
|
| 164 |
+
out_md.write_text("\n".join(lines) + "\n")
|
| 165 |
+
print(json.dumps({"out_json": str(out_json), "out_md": str(out_md), "gate_passed": best is not None}, indent=2), flush=True)
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
if __name__ == "__main__":
|
| 169 |
+
main()
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/scripts/xcomet_service.py
ADDED
|
@@ -0,0 +1,560 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Long-running HTTP service for XCOMET/COMET scoring and dataset export."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import argparse
|
| 7 |
+
from dataclasses import dataclass
|
| 8 |
+
import json
|
| 9 |
+
import os
|
| 10 |
+
import queue
|
| 11 |
+
import statistics
|
| 12 |
+
import threading
|
| 13 |
+
import time
|
| 14 |
+
import uuid
|
| 15 |
+
from http import HTTPStatus
|
| 16 |
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
| 17 |
+
from pathlib import Path
|
| 18 |
+
from types import SimpleNamespace
|
| 19 |
+
from typing import Any
|
| 20 |
+
|
| 21 |
+
import torch
|
| 22 |
+
|
| 23 |
+
from build_xcomet_ft_dataset import (
|
| 24 |
+
build_preferences,
|
| 25 |
+
build_repairs,
|
| 26 |
+
build_sft,
|
| 27 |
+
load_jsonl,
|
| 28 |
+
normalize_pool,
|
| 29 |
+
score_distribution,
|
| 30 |
+
write_jsonl,
|
| 31 |
+
)
|
| 32 |
+
from score_xcomet_pool import prediction_extras, resolve_checkpoint
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def parse_args() -> argparse.Namespace:
|
| 36 |
+
p = argparse.ArgumentParser(description=__doc__)
|
| 37 |
+
p.add_argument("--host", default="0.0.0.0")
|
| 38 |
+
p.add_argument("--port", type=int, default=20000)
|
| 39 |
+
p.add_argument("--comet-model", default=os.environ.get("COMET_MODEL", "Unbabel/XCOMET-XXL"))
|
| 40 |
+
p.add_argument("--checkpoint-path", default=os.environ.get("XCOMET_CKPT_PATH"))
|
| 41 |
+
p.add_argument("--run-root", default=os.environ.get("RUN_ROOT", "/root/runs/xcomet_service"))
|
| 42 |
+
p.add_argument("--default-batch-size", type=int, default=int(os.environ.get("XCOMET_BATCH", "4")))
|
| 43 |
+
p.add_argument("--default-chunk-size", type=int, default=int(os.environ.get("XCOMET_CHUNK", "32")))
|
| 44 |
+
p.add_argument("--max-worker-batch-size", type=int, default=int(os.environ.get("XCOMET_MAX_WORKER_BATCH", os.environ.get("XCOMET_BATCH", "4"))))
|
| 45 |
+
p.add_argument("--max-batch-rows", type=int, default=int(os.environ.get("XCOMET_MAX_BATCH_ROWS", os.environ.get("XCOMET_CHUNK", "32"))))
|
| 46 |
+
p.add_argument("--max-batch-wait-ms", type=int, default=int(os.environ.get("XCOMET_MAX_BATCH_WAIT_MS", "100")))
|
| 47 |
+
p.add_argument("--max-queue-rows", type=int, default=int(os.environ.get("XCOMET_MAX_QUEUE_ROWS", "4096")))
|
| 48 |
+
p.add_argument("--queue-timeout-s", type=float, default=float(os.environ.get("XCOMET_QUEUE_TIMEOUT_S", "1800")))
|
| 49 |
+
p.add_argument("--float32-matmul-precision", choices=["highest", "high", "medium"], default=os.environ.get("XCOMET_FLOAT32_MATMUL_PRECISION", "high"))
|
| 50 |
+
p.add_argument("--threshold", type=float, default=float(os.environ.get("XCOMET_THRESHOLD", "0.99")))
|
| 51 |
+
p.add_argument("--auth-token", default=os.environ.get("XCOMET_SERVICE_TOKEN"))
|
| 52 |
+
p.add_argument("--load-on-start", action="store_true")
|
| 53 |
+
return p.parse_args()
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
@dataclass(frozen=True)
|
| 57 |
+
class ScoreResult:
|
| 58 |
+
score: float
|
| 59 |
+
extra: dict[str, Any]
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
@dataclass(frozen=True)
|
| 63 |
+
class ScoreUnit:
|
| 64 |
+
job: "ScoreJob"
|
| 65 |
+
index: int
|
| 66 |
+
data: dict[str, Any]
|
| 67 |
+
batch_size: int
|
| 68 |
+
enqueued_at: float
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
class ScoreJob:
|
| 72 |
+
def __init__(self, size: int):
|
| 73 |
+
self.results: list[ScoreResult | None] = [None] * size
|
| 74 |
+
self.remaining = size
|
| 75 |
+
self.error: BaseException | None = None
|
| 76 |
+
self.event = threading.Event()
|
| 77 |
+
self.lock = threading.Lock()
|
| 78 |
+
|
| 79 |
+
def record(self, index: int, result: ScoreResult) -> None:
|
| 80 |
+
with self.lock:
|
| 81 |
+
if self.error is not None:
|
| 82 |
+
return
|
| 83 |
+
self.results[index] = result
|
| 84 |
+
self.remaining -= 1
|
| 85 |
+
if self.remaining == 0:
|
| 86 |
+
self.event.set()
|
| 87 |
+
|
| 88 |
+
def fail(self, exc: BaseException) -> None:
|
| 89 |
+
with self.lock:
|
| 90 |
+
if self.error is None:
|
| 91 |
+
self.error = exc
|
| 92 |
+
self.event.set()
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
class ScoringBatcher:
|
| 96 |
+
"""Single GPU worker with dynamic row batching across HTTP callers."""
|
| 97 |
+
|
| 98 |
+
def __init__(self, state: "ServiceState"):
|
| 99 |
+
self.state = state
|
| 100 |
+
self.work: queue.Queue[ScoreUnit] = queue.Queue(maxsize=state.args.max_queue_rows)
|
| 101 |
+
self.max_rows = max(1, state.args.max_batch_rows)
|
| 102 |
+
self.max_worker_batch_size = max(1, state.args.max_worker_batch_size)
|
| 103 |
+
self.max_wait_seconds = max(0.0, state.args.max_batch_wait_ms / 1000.0)
|
| 104 |
+
self.stats_lock = threading.Lock()
|
| 105 |
+
self.active_batch_rows = 0
|
| 106 |
+
self.completed_batches = 0
|
| 107 |
+
self.completed_rows = 0
|
| 108 |
+
self.failed_batches = 0
|
| 109 |
+
self.last_batch_rows = 0
|
| 110 |
+
self.last_batch_seconds: float | None = None
|
| 111 |
+
self.last_batch_started_at: float | None = None
|
| 112 |
+
self.last_error: str | None = None
|
| 113 |
+
self.worker = threading.Thread(target=self._worker_loop, name="xcomet-gpu-worker", daemon=True)
|
| 114 |
+
self.worker.start()
|
| 115 |
+
|
| 116 |
+
def status(self) -> dict[str, Any]:
|
| 117 |
+
with self.stats_lock:
|
| 118 |
+
return {
|
| 119 |
+
"pending_rows": self.work.qsize(),
|
| 120 |
+
"active_batch_rows": self.active_batch_rows,
|
| 121 |
+
"completed_batches": self.completed_batches,
|
| 122 |
+
"completed_rows": self.completed_rows,
|
| 123 |
+
"failed_batches": self.failed_batches,
|
| 124 |
+
"last_batch_rows": self.last_batch_rows,
|
| 125 |
+
"last_batch_seconds": self.last_batch_seconds,
|
| 126 |
+
"last_batch_started_at": self.last_batch_started_at,
|
| 127 |
+
"last_error": self.last_error,
|
| 128 |
+
"max_batch_rows": self.max_rows,
|
| 129 |
+
"max_worker_batch_size": self.max_worker_batch_size,
|
| 130 |
+
"max_batch_wait_ms": int(self.max_wait_seconds * 1000),
|
| 131 |
+
"max_queue_rows": self.work.maxsize,
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
def score(self, data: list[dict[str, Any]], batch_size: int, timeout_s: float | None) -> list[ScoreResult]:
|
| 135 |
+
job = ScoreJob(len(data))
|
| 136 |
+
deadline = None if timeout_s is None else time.time() + timeout_s
|
| 137 |
+
for index, item in enumerate(data):
|
| 138 |
+
remaining = None if deadline is None else max(0.0, deadline - time.time())
|
| 139 |
+
try:
|
| 140 |
+
self.work.put(
|
| 141 |
+
ScoreUnit(job=job, index=index, data=item, batch_size=batch_size, enqueued_at=time.time()),
|
| 142 |
+
timeout=remaining,
|
| 143 |
+
)
|
| 144 |
+
except queue.Full as exc:
|
| 145 |
+
job.fail(TimeoutError("timed out while queueing rows for scoring"))
|
| 146 |
+
raise TimeoutError("timed out while queueing rows for scoring") from exc
|
| 147 |
+
|
| 148 |
+
wait_timeout = None if deadline is None else max(0.0, deadline - time.time())
|
| 149 |
+
if not job.event.wait(wait_timeout):
|
| 150 |
+
job.fail(TimeoutError("timed out while waiting for scoring"))
|
| 151 |
+
raise TimeoutError("timed out while waiting for scoring")
|
| 152 |
+
if job.error is not None:
|
| 153 |
+
raise job.error
|
| 154 |
+
results = [result for result in job.results if result is not None]
|
| 155 |
+
if len(results) != len(data):
|
| 156 |
+
raise RuntimeError("scoring worker returned an incomplete result set")
|
| 157 |
+
return results
|
| 158 |
+
|
| 159 |
+
def _worker_loop(self) -> None:
|
| 160 |
+
while True:
|
| 161 |
+
first = self.work.get()
|
| 162 |
+
units = [first]
|
| 163 |
+
deadline = time.time() + self.max_wait_seconds
|
| 164 |
+
while len(units) < self.max_rows:
|
| 165 |
+
timeout = max(0.0, deadline - time.time())
|
| 166 |
+
if timeout == 0.0:
|
| 167 |
+
break
|
| 168 |
+
try:
|
| 169 |
+
units.append(self.work.get(timeout=timeout))
|
| 170 |
+
except queue.Empty:
|
| 171 |
+
break
|
| 172 |
+
self._predict_units(units)
|
| 173 |
+
for _ in units:
|
| 174 |
+
self.work.task_done()
|
| 175 |
+
|
| 176 |
+
def _predict_units(self, units: list[ScoreUnit]) -> None:
|
| 177 |
+
started = time.time()
|
| 178 |
+
with self.stats_lock:
|
| 179 |
+
self.active_batch_rows = len(units)
|
| 180 |
+
self.last_batch_started_at = started
|
| 181 |
+
try:
|
| 182 |
+
self.state.load_model()
|
| 183 |
+
batch_size = min(max(unit.batch_size for unit in units), self.max_worker_batch_size)
|
| 184 |
+
preds = self.state.model.predict(
|
| 185 |
+
[unit.data for unit in units],
|
| 186 |
+
batch_size=batch_size,
|
| 187 |
+
gpus=1,
|
| 188 |
+
progress_bar=False,
|
| 189 |
+
)
|
| 190 |
+
scores = [float(s) for s in preds["scores"]]
|
| 191 |
+
extras = prediction_extras(preds, 0, len(units))
|
| 192 |
+
for unit, score, extra in zip(units, scores, extras, strict=True):
|
| 193 |
+
unit.job.record(unit.index, ScoreResult(score=score, extra=extra or {}))
|
| 194 |
+
elapsed = time.time() - started
|
| 195 |
+
with self.stats_lock:
|
| 196 |
+
self.completed_batches += 1
|
| 197 |
+
self.completed_rows += len(units)
|
| 198 |
+
self.last_batch_rows = len(units)
|
| 199 |
+
self.last_batch_seconds = elapsed
|
| 200 |
+
self.last_error = None
|
| 201 |
+
except Exception as exc: # noqa: BLE001 - return scoring failures to callers
|
| 202 |
+
with self.stats_lock:
|
| 203 |
+
self.failed_batches += 1
|
| 204 |
+
self.last_error = f"{type(exc).__name__}: {exc}"
|
| 205 |
+
for unit in units:
|
| 206 |
+
unit.job.fail(exc)
|
| 207 |
+
finally:
|
| 208 |
+
with self.stats_lock:
|
| 209 |
+
self.active_batch_rows = 0
|
| 210 |
+
if torch.cuda.is_available():
|
| 211 |
+
torch.cuda.empty_cache()
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
class ServiceState:
|
| 215 |
+
def __init__(self, args: argparse.Namespace):
|
| 216 |
+
self.args = args
|
| 217 |
+
self.run_root = Path(args.run_root)
|
| 218 |
+
self.run_root.mkdir(parents=True, exist_ok=True)
|
| 219 |
+
self.model = None
|
| 220 |
+
self.checkpoint_path: str | None = None
|
| 221 |
+
self.loaded_at: float | None = None
|
| 222 |
+
self.load_error: str | None = None
|
| 223 |
+
self.load_lock = threading.Lock()
|
| 224 |
+
self.scoring_batcher = ScoringBatcher(self)
|
| 225 |
+
|
| 226 |
+
def load_model(self) -> dict[str, Any]:
|
| 227 |
+
with self.load_lock:
|
| 228 |
+
if self.model is not None:
|
| 229 |
+
return self.status()
|
| 230 |
+
try:
|
| 231 |
+
from comet import load_from_checkpoint
|
| 232 |
+
|
| 233 |
+
ckpt = resolve_checkpoint(self.args.comet_model, self.args.checkpoint_path)
|
| 234 |
+
model = load_from_checkpoint(ckpt)
|
| 235 |
+
self.model = model
|
| 236 |
+
self.checkpoint_path = ckpt
|
| 237 |
+
self.loaded_at = time.time()
|
| 238 |
+
self.load_error = None
|
| 239 |
+
except Exception as exc: # noqa: BLE001 - report service-load failures
|
| 240 |
+
self.load_error = f"{type(exc).__name__}: {exc}"
|
| 241 |
+
raise
|
| 242 |
+
return self.status()
|
| 243 |
+
|
| 244 |
+
def status(self) -> dict[str, Any]:
|
| 245 |
+
cuda = {
|
| 246 |
+
"available": torch.cuda.is_available(),
|
| 247 |
+
"device_count": torch.cuda.device_count(),
|
| 248 |
+
}
|
| 249 |
+
if torch.cuda.is_available():
|
| 250 |
+
cuda["device_name"] = torch.cuda.get_device_name(0)
|
| 251 |
+
cuda["memory_allocated"] = torch.cuda.memory_allocated(0)
|
| 252 |
+
cuda["memory_reserved"] = torch.cuda.memory_reserved(0)
|
| 253 |
+
return {
|
| 254 |
+
"ok": self.load_error is None,
|
| 255 |
+
"model_loaded": self.model is not None,
|
| 256 |
+
"comet_model": self.args.comet_model,
|
| 257 |
+
"checkpoint_path": self.checkpoint_path,
|
| 258 |
+
"loaded_at": self.loaded_at,
|
| 259 |
+
"run_root": str(self.run_root),
|
| 260 |
+
"float32_matmul_precision": self.args.float32_matmul_precision,
|
| 261 |
+
"cuda": cuda,
|
| 262 |
+
"load_error": self.load_error,
|
| 263 |
+
"queue": self.scoring_batcher.status(),
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def rows_from_request(payload: dict[str, Any]) -> tuple[list[dict[str, Any]], str]:
|
| 268 |
+
max_rows = payload.get("max_rows")
|
| 269 |
+
if payload.get("rows") is not None:
|
| 270 |
+
rows = list(payload["rows"])
|
| 271 |
+
if max_rows is not None:
|
| 272 |
+
rows = rows[: int(max_rows)]
|
| 273 |
+
return rows, payload.get("source_path", "request_rows")
|
| 274 |
+
if payload.get("hyps_jsonl"):
|
| 275 |
+
path = Path(payload["hyps_jsonl"])
|
| 276 |
+
rows = load_jsonl(path)
|
| 277 |
+
if max_rows is not None:
|
| 278 |
+
rows = rows[: int(max_rows)]
|
| 279 |
+
return rows, str(path)
|
| 280 |
+
raise ValueError("request needs either rows or hyps_jsonl")
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
def score_payload(state: ServiceState, payload: dict[str, Any]) -> tuple[list[dict[str, Any]], dict[str, Any]]:
|
| 284 |
+
state.load_model()
|
| 285 |
+
rows, source_path = rows_from_request(payload)
|
| 286 |
+
|
| 287 |
+
src_field = payload.get("src_field", "en")
|
| 288 |
+
ref_field = payload.get("ref_field", "pt")
|
| 289 |
+
hyp_field = payload.get("hyp_field", "model_hyp")
|
| 290 |
+
id_field = payload.get("id_field", "id")
|
| 291 |
+
batch_size = int(payload.get("batch_size", state.args.default_batch_size))
|
| 292 |
+
chunk_size = int(payload.get("chunk_size", state.args.default_chunk_size))
|
| 293 |
+
timeout_s = float(payload.get("timeout_s", state.args.queue_timeout_s))
|
| 294 |
+
threshold = float(payload.get("threshold", state.args.threshold))
|
| 295 |
+
system_name = payload.get("system_name") or Path(source_path).stem
|
| 296 |
+
|
| 297 |
+
data = []
|
| 298 |
+
valid_rows = []
|
| 299 |
+
for row in rows:
|
| 300 |
+
src = row.get(src_field)
|
| 301 |
+
hyp = row.get(hyp_field)
|
| 302 |
+
ref = row.get(ref_field)
|
| 303 |
+
if src is None or hyp is None:
|
| 304 |
+
continue
|
| 305 |
+
item = {"src": src, "mt": hyp}
|
| 306 |
+
if ref is not None:
|
| 307 |
+
item["ref"] = ref
|
| 308 |
+
data.append(item)
|
| 309 |
+
valid_rows.append(row)
|
| 310 |
+
if not data:
|
| 311 |
+
raise ValueError("no scoreable rows found")
|
| 312 |
+
|
| 313 |
+
t0 = time.time()
|
| 314 |
+
scored_rows: list[dict[str, Any]] = []
|
| 315 |
+
seg_scores: list[float] = []
|
| 316 |
+
results = state.scoring_batcher.score(data, batch_size=batch_size, timeout_s=timeout_s)
|
| 317 |
+
for i, result in enumerate(results):
|
| 318 |
+
src_row = valid_rows[i]
|
| 319 |
+
scored = {
|
| 320 |
+
"row_id": src_row.get(id_field, i),
|
| 321 |
+
"source_path": source_path,
|
| 322 |
+
"system": system_name,
|
| 323 |
+
"metric": state.args.comet_model,
|
| 324 |
+
"score": result.score,
|
| 325 |
+
"src": src_row[src_field],
|
| 326 |
+
"ref": src_row.get(ref_field),
|
| 327 |
+
"mt": src_row[hyp_field],
|
| 328 |
+
"category": src_row.get("category"),
|
| 329 |
+
"tag": src_row.get("tag"),
|
| 330 |
+
"metadata": {
|
| 331 |
+
k: v for k, v in src_row.items()
|
| 332 |
+
if k not in {src_field, ref_field, hyp_field}
|
| 333 |
+
},
|
| 334 |
+
}
|
| 335 |
+
if result.extra:
|
| 336 |
+
scored["metric_metadata"] = result.extra
|
| 337 |
+
scored_rows.append(scored)
|
| 338 |
+
seg_scores.append(result.score)
|
| 339 |
+
|
| 340 |
+
summary = {
|
| 341 |
+
"source_path": source_path,
|
| 342 |
+
"comet_model": state.args.comet_model,
|
| 343 |
+
"checkpoint_path": state.checkpoint_path,
|
| 344 |
+
"n": len(scored_rows),
|
| 345 |
+
"threshold": threshold,
|
| 346 |
+
"system_score": statistics.fmean(seg_scores),
|
| 347 |
+
"passed": sum(1 for s in seg_scores if s >= threshold),
|
| 348 |
+
"elapsed_seconds": time.time() - t0,
|
| 349 |
+
"batch_size": batch_size,
|
| 350 |
+
"chunk_size": chunk_size,
|
| 351 |
+
"max_worker_batch_size": state.scoring_batcher.max_worker_batch_size,
|
| 352 |
+
"max_batch_rows": state.scoring_batcher.max_rows,
|
| 353 |
+
"max_batch_wait_ms": int(state.scoring_batcher.max_wait_seconds * 1000),
|
| 354 |
+
"throughput_seg_per_s": len(scored_rows) / max(time.time() - t0, 1e-9),
|
| 355 |
+
}
|
| 356 |
+
return scored_rows, summary
|
| 357 |
+
|
| 358 |
+
|
| 359 |
+
def write_score_outputs(payload: dict[str, Any], rows: list[dict[str, Any]], summary: dict[str, Any]) -> dict[str, Any]:
|
| 360 |
+
out: dict[str, Any] = {}
|
| 361 |
+
out_jsonl = payload.get("out_jsonl")
|
| 362 |
+
if out_jsonl:
|
| 363 |
+
path = Path(out_jsonl)
|
| 364 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 365 |
+
write_jsonl(path, rows)
|
| 366 |
+
out["out_jsonl"] = str(path)
|
| 367 |
+
|
| 368 |
+
summary_json = payload.get("summary_json")
|
| 369 |
+
if summary_json:
|
| 370 |
+
path = Path(summary_json)
|
| 371 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 372 |
+
with path.open("w") as f:
|
| 373 |
+
json.dump(summary, f, indent=2, ensure_ascii=False)
|
| 374 |
+
out["summary_json"] = str(path)
|
| 375 |
+
return out
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
def build_dataset_payload(payload: dict[str, Any]) -> dict[str, Any]:
|
| 379 |
+
if payload.get("scored_rows") is not None:
|
| 380 |
+
scored_rows = normalize_pool(list(payload["scored_rows"]))
|
| 381 |
+
source = payload.get("source", "request_scored_rows")
|
| 382 |
+
elif payload.get("scored_jsonl"):
|
| 383 |
+
source_path = Path(payload["scored_jsonl"])
|
| 384 |
+
scored_rows = normalize_pool(load_jsonl(source_path))
|
| 385 |
+
source = str(source_path)
|
| 386 |
+
else:
|
| 387 |
+
raise ValueError("request needs either scored_rows or scored_jsonl")
|
| 388 |
+
if not scored_rows:
|
| 389 |
+
raise ValueError("no valid scored rows")
|
| 390 |
+
|
| 391 |
+
out_dir = Path(payload["out_dir"])
|
| 392 |
+
out_dir.mkdir(parents=True, exist_ok=True)
|
| 393 |
+
args = SimpleNamespace(
|
| 394 |
+
target_language=payload.get("target_language", "Portuguese"),
|
| 395 |
+
sft_min_score=float(payload.get("sft_min_score", 0.85)),
|
| 396 |
+
preference_min_gap=float(payload.get("preference_min_gap", 0.05)),
|
| 397 |
+
repair_max_score=float(payload.get("repair_max_score", 0.80)),
|
| 398 |
+
max_pairs_per_source=int(payload.get("max_pairs_per_source", 3)),
|
| 399 |
+
)
|
| 400 |
+
|
| 401 |
+
rows_by_source: dict[str, list[dict[str, Any]]] = {}
|
| 402 |
+
for row in scored_rows:
|
| 403 |
+
rows_by_source.setdefault(row["src"], []).append(row)
|
| 404 |
+
|
| 405 |
+
sft_rows, sft_rejects = build_sft(rows_by_source, args)
|
| 406 |
+
pref_rows, pref_rejects = build_preferences(rows_by_source, args)
|
| 407 |
+
repair_rows, repair_rejects = build_repairs(scored_rows, args)
|
| 408 |
+
|
| 409 |
+
write_jsonl(out_dir / "scored_pool.jsonl", scored_rows)
|
| 410 |
+
write_jsonl(out_dir / "sft.jsonl", sft_rows)
|
| 411 |
+
write_jsonl(out_dir / "preferences.jsonl", pref_rows)
|
| 412 |
+
write_jsonl(out_dir / "repair_triples.jsonl", repair_rows)
|
| 413 |
+
|
| 414 |
+
from collections import Counter
|
| 415 |
+
|
| 416 |
+
manifest = {
|
| 417 |
+
"source": source,
|
| 418 |
+
"target_language": args.target_language,
|
| 419 |
+
"thresholds": {
|
| 420 |
+
"sft_min_score": args.sft_min_score,
|
| 421 |
+
"preference_min_gap": args.preference_min_gap,
|
| 422 |
+
"repair_max_score": args.repair_max_score,
|
| 423 |
+
"max_pairs_per_source": args.max_pairs_per_source,
|
| 424 |
+
},
|
| 425 |
+
"counts": {
|
| 426 |
+
"scored_pool": len(scored_rows),
|
| 427 |
+
"unique_sources": len(rows_by_source),
|
| 428 |
+
"sft": len(sft_rows),
|
| 429 |
+
"preferences": len(pref_rows),
|
| 430 |
+
"repair_triples": len(repair_rows),
|
| 431 |
+
},
|
| 432 |
+
"splits": dict(Counter(row["split"] for row in scored_rows)),
|
| 433 |
+
"systems": dict(Counter(row.get("system", "?") for row in scored_rows)),
|
| 434 |
+
"categories": dict(Counter(row.get("category", "?") for row in scored_rows)),
|
| 435 |
+
"score_distribution": score_distribution(scored_rows),
|
| 436 |
+
"rejections": {
|
| 437 |
+
"sft": dict(sft_rejects),
|
| 438 |
+
"preferences": dict(pref_rejects),
|
| 439 |
+
"repair_triples": dict(repair_rejects),
|
| 440 |
+
},
|
| 441 |
+
"artifacts": {
|
| 442 |
+
"scored_pool": str(out_dir / "scored_pool.jsonl"),
|
| 443 |
+
"sft": str(out_dir / "sft.jsonl"),
|
| 444 |
+
"preferences": str(out_dir / "preferences.jsonl"),
|
| 445 |
+
"repair_triples": str(out_dir / "repair_triples.jsonl"),
|
| 446 |
+
},
|
| 447 |
+
}
|
| 448 |
+
with (out_dir / "curriculum_manifest.json").open("w") as f:
|
| 449 |
+
json.dump(manifest, f, indent=2, ensure_ascii=False)
|
| 450 |
+
return manifest
|
| 451 |
+
|
| 452 |
+
|
| 453 |
+
def make_handler(state: ServiceState):
|
| 454 |
+
class Handler(BaseHTTPRequestHandler):
|
| 455 |
+
server_version = "XCOMETService/0.1"
|
| 456 |
+
|
| 457 |
+
def log_message(self, fmt: str, *args: Any) -> None:
|
| 458 |
+
print(f"[{self.log_date_time_string()}] {self.address_string()} {fmt % args}", flush=True)
|
| 459 |
+
|
| 460 |
+
def authenticated(self) -> bool:
|
| 461 |
+
token = state.args.auth_token
|
| 462 |
+
if not token:
|
| 463 |
+
return True
|
| 464 |
+
auth = self.headers.get("Authorization", "")
|
| 465 |
+
header_token = self.headers.get("X-XCOMET-Token")
|
| 466 |
+
return auth == f"Bearer {token}" or header_token == token
|
| 467 |
+
|
| 468 |
+
def read_json(self) -> dict[str, Any]:
|
| 469 |
+
n = int(self.headers.get("Content-Length", "0"))
|
| 470 |
+
if n <= 0:
|
| 471 |
+
return {}
|
| 472 |
+
return json.loads(self.rfile.read(n))
|
| 473 |
+
|
| 474 |
+
def send_json(self, status: HTTPStatus, payload: dict[str, Any]) -> None:
|
| 475 |
+
body = json.dumps(payload, ensure_ascii=False).encode("utf-8")
|
| 476 |
+
self.send_response(status)
|
| 477 |
+
self.send_header("Content-Type", "application/json; charset=utf-8")
|
| 478 |
+
self.send_header("Content-Length", str(len(body)))
|
| 479 |
+
self.end_headers()
|
| 480 |
+
self.wfile.write(body)
|
| 481 |
+
|
| 482 |
+
def do_GET(self) -> None:
|
| 483 |
+
if self.path in {"/", "/health"}:
|
| 484 |
+
self.send_json(HTTPStatus.OK, state.status() | {
|
| 485 |
+
"endpoints": ["/health", "/load", "/score", "/dataset", "/score-dataset"],
|
| 486 |
+
})
|
| 487 |
+
return
|
| 488 |
+
self.send_json(HTTPStatus.NOT_FOUND, {"error": "not found"})
|
| 489 |
+
|
| 490 |
+
def do_POST(self) -> None:
|
| 491 |
+
if not self.authenticated():
|
| 492 |
+
self.send_json(HTTPStatus.UNAUTHORIZED, {"error": "unauthorized"})
|
| 493 |
+
return
|
| 494 |
+
try:
|
| 495 |
+
payload = self.read_json()
|
| 496 |
+
if self.path == "/load":
|
| 497 |
+
self.send_json(HTTPStatus.OK, state.load_model())
|
| 498 |
+
return
|
| 499 |
+
if self.path == "/score":
|
| 500 |
+
rows, summary = score_payload(state, payload)
|
| 501 |
+
outputs = write_score_outputs(payload, rows, summary)
|
| 502 |
+
response = {"summary": summary, "outputs": outputs}
|
| 503 |
+
if payload.get("return_rows", True):
|
| 504 |
+
response["rows"] = rows
|
| 505 |
+
self.send_json(HTTPStatus.OK, response)
|
| 506 |
+
return
|
| 507 |
+
if self.path == "/dataset":
|
| 508 |
+
self.send_json(HTTPStatus.OK, {"manifest": build_dataset_payload(payload)})
|
| 509 |
+
return
|
| 510 |
+
if self.path == "/score-dataset":
|
| 511 |
+
request_id = payload.get("request_id") or uuid.uuid4().hex[:12]
|
| 512 |
+
root = state.run_root / request_id
|
| 513 |
+
payload.setdefault("out_jsonl", str(root / "scored_pool.jsonl"))
|
| 514 |
+
payload.setdefault("summary_json", str(root / "scored_pool.summary.json"))
|
| 515 |
+
payload.setdefault("out_dir", str(root / "dataset"))
|
| 516 |
+
rows, summary = score_payload(state, payload)
|
| 517 |
+
outputs = write_score_outputs(payload, rows, summary)
|
| 518 |
+
manifest = build_dataset_payload({
|
| 519 |
+
**payload,
|
| 520 |
+
"scored_rows": rows,
|
| 521 |
+
"source": outputs.get("out_jsonl", "inline_scored_rows"),
|
| 522 |
+
})
|
| 523 |
+
self.send_json(HTTPStatus.OK, {
|
| 524 |
+
"summary": summary,
|
| 525 |
+
"outputs": outputs,
|
| 526 |
+
"manifest": manifest,
|
| 527 |
+
})
|
| 528 |
+
return
|
| 529 |
+
self.send_json(HTTPStatus.NOT_FOUND, {"error": "not found"})
|
| 530 |
+
except Exception as exc: # noqa: BLE001 - return JSON errors to callers
|
| 531 |
+
self.send_json(HTTPStatus.INTERNAL_SERVER_ERROR, {
|
| 532 |
+
"error": type(exc).__name__,
|
| 533 |
+
"message": str(exc),
|
| 534 |
+
})
|
| 535 |
+
|
| 536 |
+
return Handler
|
| 537 |
+
|
| 538 |
+
|
| 539 |
+
def main() -> None:
|
| 540 |
+
args = parse_args()
|
| 541 |
+
if torch.cuda.is_available():
|
| 542 |
+
torch.set_float32_matmul_precision(args.float32_matmul_precision)
|
| 543 |
+
state = ServiceState(args)
|
| 544 |
+
if args.load_on_start:
|
| 545 |
+
state.load_model()
|
| 546 |
+
server = ThreadingHTTPServer((args.host, args.port), make_handler(state))
|
| 547 |
+
print(json.dumps({
|
| 548 |
+
"event": "xcomet_service_start",
|
| 549 |
+
"host": args.host,
|
| 550 |
+
"port": args.port,
|
| 551 |
+
"comet_model": args.comet_model,
|
| 552 |
+
"run_root": args.run_root,
|
| 553 |
+
"auth_enabled": bool(args.auth_token),
|
| 554 |
+
"load_on_start": args.load_on_start,
|
| 555 |
+
}), flush=True)
|
| 556 |
+
server.serve_forever()
|
| 557 |
+
|
| 558 |
+
|
| 559 |
+
if __name__ == "__main__":
|
| 560 |
+
main()
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/cumulative_percentile_mixes.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
circuit-shotting/artifacts/xcomet_destructive_mlp_95/issue43_xcomet_destructive_mlp_95_20260518T145643Z/selection/percentile/masks/percentile_top_1.full.npz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c8d140828eefea1d2dd4565eb0a64a78b7c33381b1cdb37d83c6a00e17f723b
|
| 3 |
+
size 7205
|