merge VRAM eviction + split args
Browse files- scripts/smoke_l4.py +22 -3
scripts/smoke_l4.py
CHANGED
|
@@ -485,7 +485,14 @@ def run_circuitkit(
|
|
| 485 |
# ---------------------------------------------------------------------------
|
| 486 |
|
| 487 |
|
| 488 |
-
def run_aligntune(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 489 |
timer.check("aligntune", need=420)
|
| 490 |
t0 = time.time()
|
| 491 |
train_path = workdir / "aligntune_train.jsonl"
|
|
@@ -540,7 +547,7 @@ print("ALIGNTUNE_RESULT " + json.dumps(result, default=str)[:3000])
|
|
| 540 |
cmd = [
|
| 541 |
align_python,
|
| 542 |
str(smoke_script),
|
| 543 |
-
str(workdir / "rmu_ckpt"),
|
| 544 |
str(train_path),
|
| 545 |
str(out_dir),
|
| 546 |
]
|
|
@@ -581,6 +588,11 @@ def main(argv: list[str] | None = None) -> int:
|
|
| 581 |
parser.add_argument("--circuitkit-examples", type=int, default=4)
|
| 582 |
parser.add_argument("--circuitkit-ig-steps", type=int, default=2)
|
| 583 |
parser.add_argument("--circuitkit-scope", default="both", choices=["heads", "mlp", "both"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 584 |
args = parser.parse_args(argv)
|
| 585 |
|
| 586 |
workdir = Path("/tmp/zw_smoke")
|
|
@@ -633,7 +645,14 @@ def main(argv: list[str] | None = None) -> int:
|
|
| 633 |
|
| 634 |
try:
|
| 635 |
if "aligntune" not in args.skip:
|
| 636 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 637 |
except Exception as exc: # noqa: BLE001
|
| 638 |
summary["errors"].append({"phase": "aligntune", "error": f"{type(exc).__name__}: {exc}", "traceback": traceback.format_exc()[-3000:]})
|
| 639 |
print(f"[aligntune] ERROR: {exc}", file=sys.stderr, flush=True)
|
|
|
|
| 485 |
# ---------------------------------------------------------------------------
|
| 486 |
|
| 487 |
|
| 488 |
+
def run_aligntune(
|
| 489 |
+
workdir: Path,
|
| 490 |
+
bench_repo: str,
|
| 491 |
+
telemetry: Telemetry,
|
| 492 |
+
timer: Timer,
|
| 493 |
+
max_seconds: int,
|
| 494 |
+
model_override: str | None = None,
|
| 495 |
+
) -> dict:
|
| 496 |
timer.check("aligntune", need=420)
|
| 497 |
t0 = time.time()
|
| 498 |
train_path = workdir / "aligntune_train.jsonl"
|
|
|
|
| 547 |
cmd = [
|
| 548 |
align_python,
|
| 549 |
str(smoke_script),
|
| 550 |
+
model_override or str(workdir / "rmu_ckpt"),
|
| 551 |
str(train_path),
|
| 552 |
str(out_dir),
|
| 553 |
]
|
|
|
|
| 588 |
parser.add_argument("--circuitkit-examples", type=int, default=4)
|
| 589 |
parser.add_argument("--circuitkit-ig-steps", type=int, default=2)
|
| 590 |
parser.add_argument("--circuitkit-scope", default="both", choices=["heads", "mlp", "both"])
|
| 591 |
+
parser.add_argument(
|
| 592 |
+
"--aligntune-model",
|
| 593 |
+
default="rmu",
|
| 594 |
+
help="'rmu' (checkpoint from the RMU phase), 'base' (fresh model), or an explicit path",
|
| 595 |
+
)
|
| 596 |
args = parser.parse_args(argv)
|
| 597 |
|
| 598 |
workdir = Path("/tmp/zw_smoke")
|
|
|
|
| 645 |
|
| 646 |
try:
|
| 647 |
if "aligntune" not in args.skip:
|
| 648 |
+
align_model = args.aligntune_model
|
| 649 |
+
if align_model == "base":
|
| 650 |
+
align_model = args.model
|
| 651 |
+
elif align_model == "rmu":
|
| 652 |
+
align_model = None
|
| 653 |
+
summary["phases"]["aligntune"] = run_aligntune(
|
| 654 |
+
workdir, args.bench_repo, telemetry, timer, args.max_seconds, model_override=align_model
|
| 655 |
+
)
|
| 656 |
except Exception as exc: # noqa: BLE001
|
| 657 |
summary["errors"].append({"phase": "aligntune", "error": f"{type(exc).__name__}: {exc}", "traceback": traceback.format_exc()[-3000:]})
|
| 658 |
print(f"[aligntune] ERROR: {exc}", file=sys.stderr, flush=True)
|