File size: 1,859 Bytes
12eb3a5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #!/usr/bin/env python3
"""Upload the project code, docs and measurement results to the HF repo."""
from __future__ import annotations
import argparse
import os
import sys
from pathlib import Path
from huggingface_hub import HfApi
# this script lives in bench/, the repo root is its parent
REPO = Path(__file__).resolve().parent.parent
MSG = """EPM: expert paging CPU inference for MiniCPM-V-4.7-35B-A3B Q4_K_M
Port the 8 GiB expert pager to openbmb/MiniCPM-V-4.7-35B-A3B-Q4_K_M.gguf
(19.71 GiB, qwen35moe, 40 layers, 256 experts, top-8).
Measured under an 8 GiB / no-swap ceiling enforced by tools/strict8g.py:
5.83 tok/s median (N=9), peak anon RSS 7799 MiB, VmSwap 0, 9/9 strict_ok.
Unmodified llama.cpp cannot load the model at that ceiling.
Correctness: 3-layer verification passes; 5 runs x 48 tokens x 248144 vocab
logits bit-identical.
Port-specific changes: GGUF BOOL-array header fix, calibrated SDQ_RESERVE_MB,
two expert size classes, hybrid SSM/attention thread behaviour.
"""
def main() -> int:
ap = argparse.ArgumentParser()
ap.add_argument("--repo", default=os.environ.get("EPM_HF_REPO", "HelloSun/minicpm47woek"))
ap.add_argument("--folder", default=str(REPO))
ap.add_argument("--message", default=MSG)
ap.add_argument("--dry-run", action="store_true")
a = ap.parse_args()
api = HfApi()
print("whoami:", api.whoami()["name"])
if a.dry_run:
print("dry run, not uploading")
return 0
api.upload_folder(
folder_path=a.folder,
repo_id=a.repo,
repo_type="model",
ignore_patterns=[".git/*", "__pycache__/*", "*.pyc", "*.so",
"bench/results/.*", "*.gguf", "*.bin"],
commit_message=a.message,
)
print(f"uploaded -> https://huggingface.co/{a.repo}")
return 0
if __name__ == "__main__":
sys.exit(main()) |