Datasets:
Rebuild: eval-4b-rtn lane + damping ablation
Browse files- kit_manifest.json +5 -4
- lanes/eval-4b-rtn.json +41 -0
- scripts/build_kit.py +1 -0
- scripts/run_lane.py +16 -9
- tests/test_run_lane.py +13 -0
kit_manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"built_from_commit": "
|
| 3 |
"files": {
|
| 4 |
"scripts/rht_int4_convert.py": "c27bec9abcca8ab673f6b1e1a1252d5fb5562c1cdc57be4d7023ccc6844a79ce",
|
| 5 |
"scripts/rewrite_lalamo_hybrid_spec.py": "154564c88391f81b5c24f64125d99abc15d81bd082a8264e36d43a00d4c47a04",
|
|
@@ -11,7 +11,7 @@
|
|
| 11 |
"scripts/eval_quantized.py": "f5a1bcf8972e258f99b563934430779642473a54b5bfa4c31cfe2a28b0a424fb",
|
| 12 |
"scripts/qad_finetune.py": "26830bf55203a6a2e7fd79451c400949a1f6cdd1fc8d4011b62ff59d39c6e486",
|
| 13 |
"scripts/compute_bpc.py": "2b55fd1df406d54b40daeeca2ecaf2efb35981655f5bf5e0cc10c057ce796256",
|
| 14 |
-
"scripts/run_lane.py": "
|
| 15 |
"scripts/make_sweep_spec.py": "dc31ec026c89e7db316a185575a4423bca988c2ac6cf08ef6df8f955328cda69",
|
| 16 |
"scripts/combine_lane_manifests.py": "164ba691d60b3e2987b805426c606d135dcf3cf0c855b38cf7f5d6d57628a481",
|
| 17 |
"scripts/make_qad_dataset.py": "18e91221c5ac1b07362dd6978956168ed1148a3c6e8f73e0a2efc3f1f4047634",
|
|
@@ -26,7 +26,7 @@
|
|
| 26 |
"scripts/check_experiment.py": "a2e7e40909f68031dfccd7013ed055dfbc0ebb21f2a619622b71e6772c685ca5",
|
| 27 |
"scripts/tiny_sharding_probe.py": "29eb58f2689242b919616f6aab6ff753e0de031b16371137975b4d645e836fae",
|
| 28 |
"scripts/audit_public_corpus.py": "84f1ec805a74004e71f63a70a8ed19967cb3fad9966f254798e655ab95e53ab0",
|
| 29 |
-
"scripts/build_kit.py": "
|
| 30 |
"scripts/bootstrap_kaggle.py": "1633e3edbb80976c337444e3e4544e2b5210b2d8d1821e3a2717c1099c00843e",
|
| 31 |
"data/calibration_en_wikitext2_dedup.txt": "18a79f4f938cc25747a90a12b120c7131e7f4ac55b58dfc691795ea61d4b5e9a",
|
| 32 |
"data/calibration_ja_wikipedia_dedup.txt": "b45e3f3f00f2137be280a75c1fa9c9883a7e69d289257c4388fc701f33fee0d1",
|
|
@@ -40,12 +40,13 @@
|
|
| 40 |
"lanes/clean-suite-08b.json": "a1b74a5f2b7a36edc3fe060ec071df27bcbafe7975fd46ba3562b77458d94b99",
|
| 41 |
"lanes/balanced-h-08b.json": "21a16d50b0b5096843e0a8fb944a6fdbb7314f3c2c51618eb9651a7575192cb8",
|
| 42 |
"lanes/damping-ablation-08b.json": "bb0a635c8b3e2b80d701af45c3561bbc9570af01614a800ee3acef3dccd22c1a",
|
|
|
|
| 43 |
"lanes/robustness-08b-shard1of3.json": "11bd73ddfb110c60420546e1c6f47d777ce6d8c321cf31ce5003d15c96743b9b",
|
| 44 |
"lanes/robustness-08b-shard2of3.json": "3196a32cf56eb1e3792a4f15a29effa561ff0472d82282f5e98ad8e283249935",
|
| 45 |
"lanes/robustness-08b-shard3of3.json": "3f6928c34d3145d7d17eda991e6dede3695a0e9b723fbf4c068a6c07bc9cfd17",
|
| 46 |
"tests/test_experiment_guards.py": "d71ddf9586c1d7ece52e217288b9d4b09079be54d32ceaf391be113c1832b6ef",
|
| 47 |
"tests/test_compute_bpc.py": "bba5b6d0afc9b0699ebb6f7f0ed9fc5ebfcb98472867e9ccff4262fe9999949f",
|
| 48 |
-
"tests/test_run_lane.py": "
|
| 49 |
"tests/test_tiny_sharding.py": "eaed062b5547ed66923d567753494fe2c26d15c7df4a160601182aacdbf0ceb1",
|
| 50 |
"configs/qwen35-0.8b.json": "12640a7b738d8c8dbc046f59e9249b85d5d3775b8ee2afe9becaba285ae90764",
|
| 51 |
"configs/qwen35-4b.json": "8f32da42655963134c1f73f4fa825c8ae16b464254d4fd9ddccf6b2f8ecae833",
|
|
|
|
| 1 |
{
|
| 2 |
+
"built_from_commit": "942ce13951aad43c7af6a54b401ff11cc23a55ac",
|
| 3 |
"files": {
|
| 4 |
"scripts/rht_int4_convert.py": "c27bec9abcca8ab673f6b1e1a1252d5fb5562c1cdc57be4d7023ccc6844a79ce",
|
| 5 |
"scripts/rewrite_lalamo_hybrid_spec.py": "154564c88391f81b5c24f64125d99abc15d81bd082a8264e36d43a00d4c47a04",
|
|
|
|
| 11 |
"scripts/eval_quantized.py": "f5a1bcf8972e258f99b563934430779642473a54b5bfa4c31cfe2a28b0a424fb",
|
| 12 |
"scripts/qad_finetune.py": "26830bf55203a6a2e7fd79451c400949a1f6cdd1fc8d4011b62ff59d39c6e486",
|
| 13 |
"scripts/compute_bpc.py": "2b55fd1df406d54b40daeeca2ecaf2efb35981655f5bf5e0cc10c057ce796256",
|
| 14 |
+
"scripts/run_lane.py": "a913e2f17c8f0651f4d1bbe88131fee1ccef5ef0c53ab98193b8e28e5546dda6",
|
| 15 |
"scripts/make_sweep_spec.py": "dc31ec026c89e7db316a185575a4423bca988c2ac6cf08ef6df8f955328cda69",
|
| 16 |
"scripts/combine_lane_manifests.py": "164ba691d60b3e2987b805426c606d135dcf3cf0c855b38cf7f5d6d57628a481",
|
| 17 |
"scripts/make_qad_dataset.py": "18e91221c5ac1b07362dd6978956168ed1148a3c6e8f73e0a2efc3f1f4047634",
|
|
|
|
| 26 |
"scripts/check_experiment.py": "a2e7e40909f68031dfccd7013ed055dfbc0ebb21f2a619622b71e6772c685ca5",
|
| 27 |
"scripts/tiny_sharding_probe.py": "29eb58f2689242b919616f6aab6ff753e0de031b16371137975b4d645e836fae",
|
| 28 |
"scripts/audit_public_corpus.py": "84f1ec805a74004e71f63a70a8ed19967cb3fad9966f254798e655ab95e53ab0",
|
| 29 |
+
"scripts/build_kit.py": "40d45085740664af49203611f267df09cf3688343d7e7cd4c622f038b5466cce",
|
| 30 |
"scripts/bootstrap_kaggle.py": "1633e3edbb80976c337444e3e4544e2b5210b2d8d1821e3a2717c1099c00843e",
|
| 31 |
"data/calibration_en_wikitext2_dedup.txt": "18a79f4f938cc25747a90a12b120c7131e7f4ac55b58dfc691795ea61d4b5e9a",
|
| 32 |
"data/calibration_ja_wikipedia_dedup.txt": "b45e3f3f00f2137be280a75c1fa9c9883a7e69d289257c4388fc701f33fee0d1",
|
|
|
|
| 40 |
"lanes/clean-suite-08b.json": "a1b74a5f2b7a36edc3fe060ec071df27bcbafe7975fd46ba3562b77458d94b99",
|
| 41 |
"lanes/balanced-h-08b.json": "21a16d50b0b5096843e0a8fb944a6fdbb7314f3c2c51618eb9651a7575192cb8",
|
| 42 |
"lanes/damping-ablation-08b.json": "bb0a635c8b3e2b80d701af45c3561bbc9570af01614a800ee3acef3dccd22c1a",
|
| 43 |
+
"lanes/eval-4b-rtn.json": "0bb897c10ea2e53f52192cfe3bc0342737562fcc58a7ea208ed9566b0e03636b",
|
| 44 |
"lanes/robustness-08b-shard1of3.json": "11bd73ddfb110c60420546e1c6f47d777ce6d8c321cf31ce5003d15c96743b9b",
|
| 45 |
"lanes/robustness-08b-shard2of3.json": "3196a32cf56eb1e3792a4f15a29effa561ff0472d82282f5e98ad8e283249935",
|
| 46 |
"lanes/robustness-08b-shard3of3.json": "3f6928c34d3145d7d17eda991e6dede3695a0e9b723fbf4c068a6c07bc9cfd17",
|
| 47 |
"tests/test_experiment_guards.py": "d71ddf9586c1d7ece52e217288b9d4b09079be54d32ceaf391be113c1832b6ef",
|
| 48 |
"tests/test_compute_bpc.py": "bba5b6d0afc9b0699ebb6f7f0ed9fc5ebfcb98472867e9ccff4262fe9999949f",
|
| 49 |
+
"tests/test_run_lane.py": "e96aadfd63e539b8b50612b10ae59c339bec57011a6ff7b58fffdb3cef502741",
|
| 50 |
"tests/test_tiny_sharding.py": "eaed062b5547ed66923d567753494fe2c26d15c7df4a160601182aacdbf0ceb1",
|
| 51 |
"configs/qwen35-0.8b.json": "12640a7b738d8c8dbc046f59e9249b85d5d3775b8ee2afe9becaba285ae90764",
|
| 52 |
"configs/qwen35-4b.json": "8f32da42655963134c1f73f4fa825c8ae16b464254d4fd9ddccf6b2f8ecae833",
|
lanes/eval-4b-rtn.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"lane": "eval-4b-rtn",
|
| 3 |
+
"model": {
|
| 4 |
+
"hf_repo": "huihui-ai/Huihui-Qwen3.5-4B-Claude-4.6-Opus-abliterated",
|
| 5 |
+
"spec_name": "Qwen3.5-4B",
|
| 6 |
+
"bf16_dir": "bf16-4b-lalamo",
|
| 7 |
+
"bf16_source": "/kaggle/input/uzu-bf16-4b-lalamo",
|
| 8 |
+
"bf16_source_auto": true
|
| 9 |
+
},
|
| 10 |
+
"paths": {
|
| 11 |
+
"kit": "kit",
|
| 12 |
+
"work": "/kaggle/working",
|
| 13 |
+
"jax_platform": "gpu"
|
| 14 |
+
},
|
| 15 |
+
"eval": {
|
| 16 |
+
"max_sequences": 100,
|
| 17 |
+
"max_tokens": 128,
|
| 18 |
+
"min_tokens": 16,
|
| 19 |
+
"corpora": {
|
| 20 |
+
"en": "data/eval_en_wikitext2_dedup.txt",
|
| 21 |
+
"ja": "data/eval_ja_wikipedia_dedup.txt"
|
| 22 |
+
}
|
| 23 |
+
},
|
| 24 |
+
"condition_defaults": {
|
| 25 |
+
"samples": 32,
|
| 26 |
+
"max_tokens": 128,
|
| 27 |
+
"calib_dtype": "bfloat16"
|
| 28 |
+
},
|
| 29 |
+
"convert": {
|
| 30 |
+
"bits": 4,
|
| 31 |
+
"group_size": 32,
|
| 32 |
+
"block_size": 32,
|
| 33 |
+
"parallel": "replicated"
|
| 34 |
+
},
|
| 35 |
+
"conditions": [
|
| 36 |
+
{
|
| 37 |
+
"name": "rtn",
|
| 38 |
+
"rtn": true
|
| 39 |
+
}
|
| 40 |
+
]
|
| 41 |
+
}
|
scripts/build_kit.py
CHANGED
|
@@ -80,6 +80,7 @@ KIT_LANES = [
|
|
| 80 |
"clean-suite-08b.json",
|
| 81 |
"balanced-h-08b.json",
|
| 82 |
"damping-ablation-08b.json",
|
|
|
|
| 83 |
"robustness-08b-shard1of3.json",
|
| 84 |
"robustness-08b-shard2of3.json",
|
| 85 |
"robustness-08b-shard3of3.json",
|
|
|
|
| 80 |
"clean-suite-08b.json",
|
| 81 |
"balanced-h-08b.json",
|
| 82 |
"damping-ablation-08b.json",
|
| 83 |
+
"eval-4b-rtn.json",
|
| 84 |
"robustness-08b-shard1of3.json",
|
| 85 |
"robustness-08b-shard2of3.json",
|
| 86 |
"robustness-08b-shard3of3.json",
|
scripts/run_lane.py
CHANGED
|
@@ -318,19 +318,23 @@ class Runner:
|
|
| 318 |
if not self.dry_run:
|
| 319 |
out.mkdir(parents=True, exist_ok=True)
|
| 320 |
settings = self.condition_settings(condition)
|
| 321 |
-
|
| 322 |
-
|
|
|
|
|
|
|
| 323 |
|
| 324 |
existing = self.existing_result(name)
|
| 325 |
if existing is not None:
|
| 326 |
print(f"skip {name}: result.json already complete", flush=True)
|
| 327 |
return existing
|
| 328 |
|
| 329 |
-
skip_convert = bool(condition.get("skip_convert")) or (
|
| 330 |
settings.get("raw_output") and bool(self.spec.get("merge")) and not condition.get("force_convert")
|
| 331 |
-
)
|
| 332 |
calib_npz = out / "calibration.npz"
|
| 333 |
-
if
|
|
|
|
|
|
|
| 334 |
command = [
|
| 335 |
sys.executable,
|
| 336 |
str(self.scripts["calibrate"]),
|
|
@@ -395,11 +399,14 @@ class Runner:
|
|
| 395 |
str(bf16),
|
| 396 |
"--output-dir",
|
| 397 |
str(int4),
|
| 398 |
-
"--preconditioners",
|
| 399 |
-
str(calib_npz),
|
| 400 |
-
"--calibration-json",
|
| 401 |
-
str(out / "calibration.json"),
|
| 402 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 403 |
for key in ("bits", "group_size", "block_size", "parallel"):
|
| 404 |
if key in self.spec.get("convert", {}):
|
| 405 |
convert_command += [f"--{key.replace('_', '-')}", str(self.spec["convert"][key])]
|
|
|
|
| 318 |
if not self.dry_run:
|
| 319 |
out.mkdir(parents=True, exist_ok=True)
|
| 320 |
settings = self.condition_settings(condition)
|
| 321 |
+
is_rtn = bool(condition.get("rtn"))
|
| 322 |
+
corpus = self.resolve(condition.get("calibration_corpus")) if not is_rtn else None
|
| 323 |
+
if not is_rtn and corpus is None:
|
| 324 |
+
raise SystemExit(f"{name}: calibration_corpus is required unless rtn=true")
|
| 325 |
|
| 326 |
existing = self.existing_result(name)
|
| 327 |
if existing is not None:
|
| 328 |
print(f"skip {name}: result.json already complete", flush=True)
|
| 329 |
return existing
|
| 330 |
|
| 331 |
+
skip_convert = (not is_rtn) and (bool(condition.get("skip_convert")) or (
|
| 332 |
settings.get("raw_output") and bool(self.spec.get("merge")) and not condition.get("force_convert")
|
| 333 |
+
))
|
| 334 |
calib_npz = out / "calibration.npz"
|
| 335 |
+
if is_rtn:
|
| 336 |
+
print(f"{name}: RTN (no calibration)", flush=True)
|
| 337 |
+
elif not calib_npz.exists():
|
| 338 |
command = [
|
| 339 |
sys.executable,
|
| 340 |
str(self.scripts["calibrate"]),
|
|
|
|
| 399 |
str(bf16),
|
| 400 |
"--output-dir",
|
| 401 |
str(int4),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
]
|
| 403 |
+
if not is_rtn:
|
| 404 |
+
convert_command += [
|
| 405 |
+
"--preconditioners",
|
| 406 |
+
str(calib_npz),
|
| 407 |
+
"--calibration-json",
|
| 408 |
+
str(out / "calibration.json"),
|
| 409 |
+
]
|
| 410 |
for key in ("bits", "group_size", "block_size", "parallel"):
|
| 411 |
if key in self.spec.get("convert", {}):
|
| 412 |
convert_command += [f"--{key.replace('_', '-')}", str(self.spec["convert"][key])]
|
tests/test_run_lane.py
CHANGED
|
@@ -82,6 +82,19 @@ def test_calib_dtype_is_passed_to_calibration() -> None:
|
|
| 82 |
assert all("--damping 0.01" in line for line in calibration)
|
| 83 |
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
def test_missing_spec_fields_fail_loudly(tmp_path: Path) -> None:
|
| 86 |
spec = tmp_path / "bad.json"
|
| 87 |
spec.write_text(json.dumps({"lane": "bad", "paths": {"kit": "kit", "work": str(tmp_path)}}), encoding="utf-8")
|
|
|
|
| 82 |
assert all("--damping 0.01" in line for line in calibration)
|
| 83 |
|
| 84 |
|
| 85 |
+
def test_rtn_condition_skips_calibration_and_preconditioners() -> None:
|
| 86 |
+
result = run_lane(LANES / "eval-4b-rtn.json")
|
| 87 |
+
assert result.returncode == 0, result.stdout + result.stderr
|
| 88 |
+
commands = [line for line in result.stdout.splitlines() if line.startswith("$ ")]
|
| 89 |
+
assert not [line for line in commands if "yaqa_calibration.py" in line]
|
| 90 |
+
conversions = [
|
| 91 |
+
line for line in commands if "rht_int4_convert.py" in line and "--load-from" in line
|
| 92 |
+
]
|
| 93 |
+
assert len(conversions) == 1
|
| 94 |
+
assert "--preconditioners" not in conversions[0]
|
| 95 |
+
assert len([line for line in commands if "eval_quantized.py" in line]) == 2
|
| 96 |
+
|
| 97 |
+
|
| 98 |
def test_missing_spec_fields_fail_loudly(tmp_path: Path) -> None:
|
| 99 |
spec = tmp_path / "bad.json"
|
| 100 |
spec.write_text(json.dumps({"lane": "bad", "paths": {"kit": "kit", "work": str(tmp_path)}}), encoding="utf-8")
|