From b1f68b4bebfe5817bfbc5077fd666020517e656e Mon Sep 17 00:00:00 2001 From: Saatvik Viniak Date: Fri, 4 Dec 2026 01:18:16 -0600 Subject: [PATCH] make_profile: --n-layer for the 40 x 256 q4_lite profile --- docs/QWEN4_35B.md | 3 +-- terminal/tools/make_profile.py | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/QWEN4_35B.md b/docs/QWEN4_35B.md index 368008fd7e..3c67d01983 100644 --- a/docs/QWEN4_35B.md +++ b/docs/QWEN4_35B.md @@ -56,8 +56,7 @@ original shard 2 and is read with `--ple-gguf`. dense list as well, and every tensor it holds twice is refused as a duplicate. `--ple-gguf` is **shard 2** (the file that holds `per_layer_token_embd.weight`), not shard 1. -The expert profile is a uniform 40 x 256 ranking (the pack's table; `tools/make_profile.py --no-base --n-expert -256` with 40 layers). +The expert profile is a uniform 40 x 256 ranking (the pack's table; `tools/make_profile.py --no-base --n-layer 40 --n-expert 256`). ## 4. Measured diff --git a/terminal/tools/make_profile.py b/terminal/tools/make_profile.py index ba041879df..37a106e066 100644 --- a/terminal/tools/make_profile.py +++ b/terminal/tools/make_profile.py @@ -107,7 +107,12 @@ def main(): "base that already ranks every pair, where --base alone cannot change the order") ap.add_argument("--out", default=str(ROOT / "data" / "expert-profile.bin")) ap.add_argument("--n-expert", type=int, default=N_EXPERT, help="experts per layer (default 512)") + ap.add_argument("--n-layer", type=int, default=N_LAYER, help="routing layers (default 48; q4_lite is 40)") a = ap.parse_args() + global N_LAYER + if a.n_layer <= 0: + ap.error("--n-layer must be positive") + N_LAYER = a.n_layer ne = a.n_expert freq = defaultdict(int)