Repository navigation
GLM-5.3-Flash: use the 0.08 depth rate on one Mac - #1131
Closed
harrisonfriia wants to merge 1 commit into
Closed
harrisonfriia wants to merge 1 commit into
harrisonfriia wants to merge 1 commit into
Conversation
Two Macs move the depth rule's acceptance estimates at 0.08. One Mac left the rate at 0, so it took the core's 0.15. At 0.15 a short run of missed drafts puts a stream's estimate under the line where plain rounds win. The stream goes plain and its probes back off to one draft in 128 rounds, so a reply can stay plain after its drafts would land again. At 0.08 a stream takes about twice the misses in a row to go plain. The constant moves from timing.zig to backend.zig, beside the one-Mac costs. Replies do not change: every depth gives depth 0's tokens.
harrisonfriia
force-pushed
the
perf/glm-depth-rate-one-mac
branch
from
October 23, 2026 23:17
a4ad73e to
79a6ea0
Compare
Owner
|
Thanks @harrisonfriia. The 0.08 depth rate on one Mac is on - Synthema, Ash's AI Assistant. |
Owner
|
This shipped in TensorFold 1.1.4: https://github.com/ashhart/TensorFold/releases/tag/v1.1.4 Thank you @harrisonfriia for the contribution. - Synthema, Ash's AI Assistant. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
One Mac moves GLM-5.3-Flash's depth rule estimates at 0.08, the rate two Macs already use. Before this change, one Mac left the rate at 0 and took the core's 0.15.
At 0.15, a short run of missed drafts puts a stream's acceptance estimate under the line where plain rounds win. The stream goes plain, and its probes back off to one draft in 128 rounds, so a reply can stay plain after its drafts would land again. At 0.08, a stream takes about twice the misses in a row to go plain. The constant moves from
timing.zigtobackend.zig, beside the one-Mac costs.This is the served lanes' depth rule, separate from #1114's standalone controller. The speed receipts are single-stream, on main before #1059's shared-round fix.
Rebase validation
Rebased onto
c0b0afceat79a6ea09; the patch is unchanged. Static integration review found no blocker. On macOS with Zig 0.17.0:All 76 build steps and 140 tests passed. Formatting and diff checks passed; lean reports zero new findings (438 on both branches). Model measurements were not repeated; the receipt retains its original source commits.
ATC coverage is incomplete (
pullFilesLimit). The reported overlap with #911 already conflicts against the base, with the same conflict-file set.Receipt
Environment: TensorFold
d1018b31(main) anda4ad73e1(this PR), each built withzig build native -Dcpu=apple_m1(Zig 0.17.0, Xcode 27.1). Mac Studio, M3 Ultra with the 80-core GPU, 256 GB, macOS 27.0.1. Checkpoints:TensorFold/GLM-5.3-Flash-MLX-oQ4-MTPat98725463andddalcu/GLM-5.3-Flash-MLX-Serve-iQ-MLX-5.1bpwat2b1c4539. Served with--context 262144 --max-tokens 32768 --parallel 3 --thinking --reasoning-effort high --thinking-budget 15360 --temperature 1 --top-p 0.95 --prompt-cache-gib 24andGLM_LOAD_LIMIT_GB=220.Exactness:
tools/bench_concurrent.py --levels 3 --alone --serial(256 tokens, 3 reps, temperatures 1 and 0) on both checkpoints, main and this PR: 36 of 36 alone runs equal their concurrent replies, and 8 of 8 serial checks equal"draft": false. Everybench_openai.pyreply in the following tables, seeded at both temperatures, has the sameoutput_sha256on main and this PR. Resumed prompts: a greedy two-turn chat over TensorFold'sREADME.md, 64-token replies with thinking off, sent as turn 1, turn 2, turn 2. With--prompt-cache-gib 24, both turn 2 requests (10,056 prompt tokens) resumed at 10,021 cached tokens from turn 1's state and gave the sametoken_sha256as fresh runs with--prompt-cache-gib 0on main, on both checkpoints.Decode speed before and after, from
tools/bench_openai.py, tok/s, the median of 3 replies, two runs each. Long replies,--tokens 2048 --reps 3, on oQ4-MTP, in the order main, this PR, this PR, main:The chat replies at temperature 1 are the same tokens in all four runs. Each reply's tok/s:
512-token replies,
--tokens 512 --reps 3, each build twice on each checkpoint, main first, then in reverse order:oQ4-MTP
iQ-MLX-5.1bpw
On iQ at temperature 0 this PR is 1.2 to 1.4% slower, within the 1.4 to 1.5% between main's own two runs.
Prompt speed: n/a. The depth rule runs only in decode. The median cold
ttft_sfromtools/bench_cache.py --require-cold --repeats 1 --streams 1on a 16,384-token prompt: oQ4-MTP 32.30 and 32.25 s on main, 32.31 and 32.26 s with this PR; iQ-MLX-5.1bpw 70.65 and 70.64 s on main, 70.64 and 70.62 s with this PR.Tests run:
zig build test test-golden -Dcpu=apple_m1with an empty cache: 4,927 of 4,948 passed, 0 failed, 21 skipped, including the JPEG and WebP pixel cases, whose libraries are not installed here.python3 tools/zig/lean_check.py: 444 problems, the same as main.Not run: CUDA, because the change is in the Metal backend only. Metal on M1, M2, M4 and M5, because I have no access to those chips. Two Macs, because I have one; a pair's rank 0 already used 0.08. The kernel contract, because no kernel changes.
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.SUMMARYline is in the receipt. No kernel changes.zig/src/core/lanes/config.zigalready tests a family rate of 0.08.