Repository navigation
glm metal: GLM_ROUND_PROF per-round host and GPU summary - #3894
Conversation
1c584f4 to
c6e7a05
Compare
|
Thank you @gilby. The strict opt-in, one-branch-off hooks and per-round summary look right, and the environment, full host and CI checks are green. Leaving the changelog line out of the branch is fine; we place it at landing. Nothing further is needed from you here.
|
|
I checked On the resulting trial tree, Zig 0.17.0 on an M5 Max passed 94/94 with Igor Lessio - AIFLOW LABS |
f4701d0 to
2c84357
Compare
|
The latest The current trial passed all 112 tests on M5 Max with Zig 0.17.0. That covers the round-profile option, clock-free disabled hooks, histogram buckets, the environment suite and the adjacent prompt-profile suite. zig build test-environment-host test-glm-prompt-profile-host \
-Dcpu=apple_m1 -Doptimize=ReleaseSafe -j2 --summary allFor the feature-specific tests I also registered a scratch target with the existing Metal engine test root filtered on Igor Lessio - AIFLOW LABS |
d9883f9 to
9731ace
Compare
GLM_ROUND_PROF=1 logs verify window GPU time, idle gap, ahead span, host phases, and partial accepts when streams end. Unset, blank, or 0 stays off; invalid values fail startup by name via environment.read. Refs ashhart#3152.
9731ace to
ba31eb0
Compare
|
Thank you @gilby. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
What this changes
GLM_ROUND_PROF=1has GLM-5.3-Flash's Metal verify server accumulate and log a per-round GPU timing, idle gap, ahead span, and host phase summary broken down by batch row tier, stream count, drafted vs plain round, and partial accepts when streams end; when unset, empty, whitespace-only, or0, round profiling stays off with unchanged behavior, and invalid values stop startup namingGLM_ROUND_PROF.GLM_POOL_TOKENSfollow in separate PRs).main(a1781885e921e9a772c641fef26010557e1349da), fast-forward mergedorigin/mainatf4701d07d30b31a3761c1c75b51bd7f89230c2cd(c6e7a05a4+f794af849+f4701d07ddroppingCHANGELOG.mddiff perCONTRIBUTING.mdso post-mergechangelog:commits do not conflict;#3152measurements taken on1c584f43aa4cd9e874aff6362ee1423200d46001with identical Zig/docs sources).git merge-tree --write-tree origin/main f4701d07d30b31a3761c1c75b51bd7f89230c2cdsucceeds cleanly (361a8e8520ba6adbfe7b95b2b59430bb636f192f).atc overlap --json: Run onf4701d07d30b31a3761c1c75b51bd7f89230c2cdagainstorigin/main;complete: false(myPullRequestsLimit,otherPullRequestsLimit,pullFilesUnavailable,timeLimit). Clean (0conflicts) on#1434,#1508,#1924; 1 stale overlap#1634(conflictFiles: 2); zero overlap with#3448; GitHubmergeable: MERGEABLE.Checks on this head
f4701d07d30b31a3761c1c75b51bd7f89230c2cd(measured on1c584f43aa4cd9e874aff6362ee1423200d46001, full host CI verified onf794af849; identical Zig/docs sources)python3 tools/zig/lean_check.py, on the base and on this head:221vs221,0 new(tools/zig/lean_new.pyclean againstorigin/maina1781885e9;tools/pr_check.py --base origin/main --pr 3894exits0with0 error(s), 1 warning(s): the expected advisoryCHANGELOG.mdUnreleased warning sinceCHANGELOG.mdis omitted to avoid merge conflicts).zig fmt --check build.zig zig: passed (0exit) onf4701d07d.git diff --check origin/main: passed (0exit) onf4701d07d.GLM_ROUND_PROFrule tozig/src/platform/environment.zig,zig build test-environment-hostfailed (24/26, 2 crashes on unregistered strict parser) andzig build testfailed (1165/1181, 3 crashes); after adding it:zig build test-environment-host --summary all: passed (3/3 steps succeeded; 26/26 tests passed) onf4701d07d.zig build test test-golden dev-tools --summary all -Dcpu=apple_m1: passed (1103/1103 steps succeeded; 1912/1958 tests passed, 46 skipped) onf794af849(identical Zig/docs sources).zig build native -Dcpu=apple_m1 -Dversion=1.0.0: passed (1c584f43a, identical Zig sources).f4701d07d(merge droppingCHANGELOG.md), 5/9 active checksCOMPLETED SUCCESS(Zig format/fmt,No GPU:benchmark-clients (windows-latest),pytest,release-paths (ubuntu-24.04),zig-macos-dev-tools), 4/9CANCELLEDasinfrastructurewhen the repo-wide queued PR Actions backlog was cleared (benchmark-clients (ubuntu-latest),zig,zig-b,zig-windows), andhost-nightly-linux/host-nightly-macosSKIPPED. Identical Zig/docs commitf794af849passed 9/9 active checksCOMPLETED SUCCESS(Zig format,No GPU).environment.zigrules; no GPU kernels changed).Receipt
TensorFold/GLM-5.3-Flash-MLX-4bit-MTP,--parallel 3 --context 1048576 --prompt-cache-gib 0, Nominal thermal (notifyutil -g com.apple.system.thermalpressurelevel==0) and idle background (mediaanalysisdCPU0.0) at start and end of every arm. Raw scrubbed artifacts + script: https://gist.github.com/20a8e462fd1ffff017e6be8dd8ff0b6etools/bench_concurrent.py --alone --serial --tokens 256 --reps 3 --temperatures 0,1.0 --levels 1,3), aggregate / per-stream tok/s (2-arm median per condition):code, T=0.0, L=1:main98.95vsunset99.00vsGLM_ROUND_PROF=198.95code, T=0.0, L=3:main170.85 / 58.0vsunset170.50 / 57.45vsGLM_ROUND_PROF=1170.75 / 57.9code, T=1.0, L=1:main111.00vsunset111.20vsGLM_ROUND_PROF=1110.75code, T=1.0, L=3:main114.85 / 46.15vsunset113.70 / 41.8vsGLM_ROUND_PROF=1113.45 / 46.55chat, T=0.0, L=1:main81.20vsunset81.15vsGLM_ROUND_PROF=181.75chat, T=0.0, L=3:main146.25 / 49.9vsunset146.25 / 49.85vsGLM_ROUND_PROF=1146.25 / 49.85chat, T=1.0, L=1:main73.65vsunset72.65vsGLM_ROUND_PROF=174.65chat, T=1.0, L=3:main104.80 / 41.45vsunset102.65 / 40.5vsGLM_ROUND_PROF=1105.20 / 40.4tools/bench_openai.py --tokens 256 --reps 3 --temperatures 0,1.0), median decode tok/s / TTFT s (2-arm per condition):fibonacci-raw, T=0.0:main98.95 / 98.91(0.08s) vsunset99.29 / 93.99(0.08s, one arm saw transient host jitter) vsGLM_ROUND_PROF=198.97 / 99.02(0.08s)fibonacci-raw, T=1.0:main97.80 / 97.90(0.08s) vsunset98.12 / 97.65(0.08s) vsGLM_ROUND_PROF=197.84 / 97.57(0.08s)gpu-chat-no-think, T=0.0:main81.91 / 80.74(0.12s) vsunset81.86 / 79.63(0.12s) vsGLM_ROUND_PROF=181.00 / 81.97(0.12s)gpu-chat-no-think, T=1.0:main77.04 / 77.75(0.12s) vsunset77.04 / 77.12(0.12s) vsGLM_ROUND_PROF=177.44 / 77.94(0.12s)GLM_ROUND_PROF=1arms loggedglm round prof:summary tables (789 windowsacross run);mainand unset arms logged none; invalid valuesGLM_ROUND_PROF=yesand2both stopped startup (exit 1) namingGLM_ROUND_PROF.tensorfold-native); no CUDA/HIP/Windows/app runtime reach.GLM_ROUND_PROF(registered inzig/src/platform/environment.zig, scope.metal, kind.bool). Unset, empty, or whitespace-only =0(off). Accepted values:0,1. Any other text stops startup namingGLM_ROUND_PROFand accepted forms (expected 0 or 1). No optimization-ledger profile row added (diagnostic toggle only, unchanged throughput).origin/maina1781885e921e9a772c641fef26010557e1349da(originally2a674b552498739e783a31c2573fc9ccf4d8cc0dv1.2.10), measured head1c584f43aa4cd9e874aff6362ee1423200d46001(current headf4701d07d30b31a3761c1c75b51bd7f89230c2cd,CHANGELOG.mdmerge/drop only); Zig0.17.0; Apple Metal toolchain32023.922 (metalfe-32023.922.4)(Metal 4); Apple M5 Ultra (80-core GPU, 512 GiB RAM), macOS27.2.1(26B131); checkpointTensorFold/GLM-5.3-Flash-MLX-4bit-MTP(rev d2b17f5253440224422b150705c1109a9a3a0368).zig/src/families/glm/{backend.zig,slots.zig,round_prof.zig}) andzig/src/platform/environment.zig. Ran on M5 Ultra (macOS27.2.1); M1–M4 hardware not run on-device (host unit tests built-Dcpu=apple_m1).tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: Across all 6 measured arms (arm1..arm6),unequal_alone = 0,unequal_serial = 0,failed = 0, andtoken_sha256_diffs_vs_main = 0(arm1_main_avs all measuredmain,unset, andGLM_ROUND_PROF=1cells).https://gist.github.com/20a8e462fd1ffff017e6be8dd8ff0b6e).tools/bench_openai.py: SeeMain against branchabove (98.95 / 98.91vs98.97 / 99.02tok/s greedy raw;81.91 / 80.74vs81.00 / 81.97tok/s greedy chat; no slowdown with profiling off or on).ttft_sfromtools/bench_cache.py --require-coldon a long prompt, or "n/a" with the reason when the change cannot reach prompt processing: n/a for prompt prefill kernels —GLM_ROUND_PROFonly observes verify-window host/GPU timestamps after prefill (first-request TTFT inbench_openai.pystays identical at0.08sraw /0.12schat across all arms).TensorFold/GLM-5.3-Flash-MLX-4bit-MTPcheckpoint, no new weights or drafter).Checklist
The title and description match the head commit, including the receipt and the stack.
New tests fail before the change, pass after it, and skip cleanly without their dependency.
Comments and docstrings are one line. No measurements or history in the source.
No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
Drafted output equals
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.No precision traded for speed. If the bits change, the description says which sums change and why.
Decode and prompt processing are no slower than main at one stream and the widest admitted; with
--drafter, no slower than without it, greedy and sampled