Skip to content

Commit 0031bcc

Browse files
committed
tooling(probe): add --grad-checkpoint flag (default off) to real-step mem probe
1 parent 3057f77 commit 0031bcc

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

scripts/probe_real_step_mem_20260601.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ def main() -> None:
5252
ap.add_argument("--seq", type=int, default=4096)
5353
ap.add_argument("--vocab", type=int, default=65_536)
5454
ap.add_argument("--optimizer", action="store_true", help="also run AdamW update")
55+
ap.add_argument(
56+
"--grad-checkpoint",
57+
dest="grad_checkpoint",
58+
action="store_true",
59+
default=False,
60+
help="enable per-layer mx.checkpoint (default: off)",
61+
)
5562
args = ap.parse_args()
5663

5764
try:
@@ -63,7 +70,7 @@ def main() -> None:
6370
have_torch = False
6471

6572
t0 = time.time()
66-
model = local_gb10_quarter(dtype=mx.bfloat16, grad_checkpoint=True)
73+
model = local_gb10_quarter(dtype=mx.bfloat16, grad_checkpoint=args.grad_checkpoint)
6774
mx.eval(model.parameters())
6875
mx.synchronize()
6976
build_s = time.time() - t0
@@ -112,6 +119,7 @@ def loss_fn(m, b):
112119
"mamba3_bwd_seq_chunk": os.environ.get("CPPMEGA_MAMBA3_BWD_SEQ_CHUNK") or None,
113120
"batch": args.batch,
114121
"seq": args.seq,
122+
"grad_checkpoint": bool(args.grad_checkpoint),
115123
"optimizer": bool(args.optimizer),
116124
"build_s": round(build_s, 2),
117125
"run_s": round(run_s, 2),

0 commit comments

Comments
 (0)