Upload scripts/verify_stage4_checkpoint.py with huggingface_hub
Browse files
scripts/verify_stage4_checkpoint.py
CHANGED
|
@@ -48,6 +48,8 @@ def main():
|
|
| 48 |
parser.add_argument("--implementation-fp", required=True)
|
| 49 |
parser.add_argument("--tokens-per-step", type=int, default=16384)
|
| 50 |
parser.add_argument("--target", type=int, default=50_000_000_000)
|
|
|
|
|
|
|
| 51 |
parser.add_argument("--out", type=Path)
|
| 52 |
args = parser.parse_args()
|
| 53 |
|
|
@@ -96,8 +98,10 @@ def main():
|
|
| 96 |
check("token_count_arithmetic", token_count == manifest["step"] * args.tokens_per_step,
|
| 97 |
{"token_count": token_count, "step": manifest["step"], "per_step": args.tokens_per_step})
|
| 98 |
cursor = payload.get("data_cursor") or {}
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
| 101 |
|
| 102 |
identity = payload.get("identity") or {}
|
| 103 |
check("implementation_fingerprint", identity.get("implementation_fingerprint") == args.implementation_fp)
|
|
|
|
| 48 |
parser.add_argument("--implementation-fp", required=True)
|
| 49 |
parser.add_argument("--tokens-per-step", type=int, default=16384)
|
| 50 |
parser.add_argument("--target", type=int, default=50_000_000_000)
|
| 51 |
+
parser.add_argument("--dataset-tokens", type=int, default=997_885_340,
|
| 52 |
+
help="total tokens in the training dataset (for epoch wrap check)")
|
| 53 |
parser.add_argument("--out", type=Path)
|
| 54 |
args = parser.parse_args()
|
| 55 |
|
|
|
|
| 98 |
check("token_count_arithmetic", token_count == manifest["step"] * args.tokens_per_step,
|
| 99 |
{"token_count": token_count, "step": manifest["step"], "per_step": args.tokens_per_step})
|
| 100 |
cursor = payload.get("data_cursor") or {}
|
| 101 |
+
expected_epoch = token_count // args.dataset_tokens if type(token_count) is int else 0
|
| 102 |
+
expected_offset = token_count % args.dataset_tokens if type(token_count) is int else 0
|
| 103 |
+
check("data_cursor_offset", cursor.get("offset_tokens") == expected_offset, cursor)
|
| 104 |
+
check("data_cursor_epoch", cursor.get("epoch") == expected_epoch, cursor)
|
| 105 |
|
| 106 |
identity = payload.get("identity") or {}
|
| 107 |
check("implementation_fingerprint", identity.get("implementation_fingerprint") == args.implementation_fp)
|