Repository navigation
Add tensorfold benchmark to the native binary - #717
Conversation
|
Built and ran this at e4fb440. Build
Model:
Stream delivery tok/s, median of 5. The M5 Ultra and M4 Pro receipts pass
Tests
|
|
Thanks for the independent run, and for confirming the GB10 early stop on your two machines. May I show your M5 Ultra and GB10 numbers on the prototype results page, credited to you? If you can attach the receipt JSON, I'll use the file rather than retyping the table. You will be the first community row on the site :) |
All good, added m4 pro results |
|
GLM-5.3-Flash run, at e4fb440 on an Apple M5 Ultra (256 GiB), native Metal engine, Result
The T=0 cells complete (5 of 5 each). The receipt is saved and Issues
I have not checked whether the GLM T=1 failure is intended for this PR's scope (the engine side) or something the benchmark should detect up front and report. |
|
Thanks for both runs The M4 Pro helps: one code answer ended early there too (197 tokens), so the early stop is not GB10-specific. That strengthens the case for discussing the suite's EOS and ranking rule. Your M5 Ultra, M4 Pro and both GB10s are on the prototype page as community runs, credited to you: https://tensorfold-speeds-proto.vercel.app On the GLM run, thanks for the clear write-up. I'm adding a commit to this PR for the parts the benchmark owns:
I also measured long prompts for agentic use, outside community-v1 (Nemotron, a cold prompt each time, prompt tokens / time to first token): 8k tokens, M5 Max 5,158 tok/s vs GB10 7,051; 32k tokens, 4,200 vs 6,348. If you have time, the same on your M5 Ultra would be a great data point. The script is linked on the page. So going fwd we could have a couple of different tests to see suitability for different use cases. |
|
Just tested the long prompt script. Method: native
|
|
Thank you! The GB10 numbers match ours within 2% at the same prompt size (our GX10: 7,018 tok/s at 6.9k; yours 7,055 and 7,130). Your rows are on the page's long-prompt section, credited to you. The M5 Ultra leads prompt speed here, about 12-13% ahead of the GB10s at 6.9k. |
|
Hi @ashhart I ported the benchmark client to the native Zig binary in this PR. It writes the same community-v1 receipts your website benchmark board already accepts, and it now runs on Mac, on GB10 boxes and on AMD. Testing it on several machines showed a few things only the board can fix. The Nemotron runs on the GB10 and on an M4 Pro cannot rank, because one or two code answers end with the model's stop token before 256 tokens. The board also does not accept ROCm yet, and it requires a Python version even for the native client. There is also no way yet to tell users and machines apart, which I would need for community features later. I have a written proposal for a second version of the board and I am happy to send the changes as a pull request. Where does the board's code live now, and would you like a pull request against it, or the code back in the repo? |
|
Thanks @BlivionIaG for the long-prompt runs. Your GB10 numbers match ours within two percent at the same prompt size, and they are now on the prototype page next to ours, credited to you. Your M5 Ultra leads prompt speed here, about 13% ahead of the GB10s. One correction to my earlier note: the commit is in (dc45d3a), and the greedy-only warning comes at the first refused request rather than before the run, because the engine's family table has no greedy-only flag yet. |
…eipt rules The community board at tensorfold.dev/benchmarks accepts one pinned receipt format, community-v1. This adds its fixed suite and digest, the sample record, the canonical receipt bytes with a private atomic save and a bounded load, and the board's own receipt rules, so a receipt the board would refuse is refused locally first. A local save also keeps rocm receipts from linux, which the board does not accept yet, and a run can check that its receipt path is writable before it starts. The golden fixtures pin the exact bytes the board expects.
…h deadlines and Ctrl-C Each attempt is one streamed request read line by line, timed when its bytes arrive, and kept as a sample with a fixed status and error code. Every exchange runs as its own task under a deadline that Ctrl-C ends; when no task can start, the exchange fails instead of running without a deadline. An https exchange, and the token it carries in the Authorization header, is sent only over TLS to the URL's own host. A second Ctrl-C exits at once, after killing a registered child and restoring a registered terminal.
A managed run starts this binary's serve on a loopback port with prompt reuse and snapshots off, waits until it serves the benchmark's name, and always stops and reaps it. The child is released from a second Ctrl-C before it is reaped, so that Ctrl-C never signals a reused pid. A child that exits during startup hands back the last line of its log, cleaned for a terminal. A lock file that must be a regular file keeps one benchmark at a time, and a benchmark that loses the race to create it is told another one is running. Checkpoint facts and hardware names pass allowlists, so no path, machine name or serial number reaches a receipt; nvidia-smi runs only for cuda. A target's own drafter is known by its family and shape.
Uploads stay opt-in. A contributor token is checked with the receiver and stored 0600 for that API URL. Before an upload, the receipt is checked with the board's rules and the checkpoint must be public on Hugging Face. These clients connect directly and never read proxy variables, so the token only travels over TLS to the receiver.
The command ties the parts together: flags and their checks, a managed or attached run, the result table and exit codes, and the inspect, suites, login, logout and publish actions. With --publish the upload token is checked first. The receipt path is checked after the model and before any server or request, so a refused run leaves no benchmarks directory behind. The table is printed before the receipt is saved, so a failed save still shows the numbers. A serve child that exits during startup has its last log line printed after the message. --drafter auto passes no drafter; when the target's own drafter is cached, a hint names the flag, and --serial says when it drops a given drafter. --backend takes rocm: its receipts are saved locally and --publish refuses them. A drafter given as a directory is never named in a receipt. docs/community-benchmarks.md covers running and publishing, and the README links it.
… time to load A refused attempt keeps its sample, time and code, and the server's reason is printed once per distinct reason, at most three, cleaned and cut to 300 bytes; the body is read for at most 100 ms after the head. A greedy-only refusal of a sampled cell adds one line: the run cannot be ranked, and --temperatures 0 gives a local run. A child that exits during startup prints up to three of its last error lines, with an earlier environment variable hint, and skips allocator leak reports. Without --startup-timeout a managed run waits 600 s plus 6 s per GB of safetensors past 20 GB, at most 3600 s, and says so when that is longer than 600 s; a timeout names the flag and the limit used. The docs say both.
dc45d3a to
1eb6103
Compare
|
Hello @ThinkOffApp, Thank you for the benchmark startup wait, the refusal text, and the log lines. Those match the commit. The managed server still does not pass the family's cached drafter. --drafter auto passes none (benchmark_args.zig:22). When Qwen3.8-27B's z-lab/Qwen3.8-27B-DFlash2 is cached, the run prints the flag and still passes none (benchmark.zig:339, benchmark_model.zig:92). The published number for that family is the server with that drafter. Please pass it. --serial is what adds --no-drafts (benchmark_server.zig:43). Drafts stay on for the default run. --serial is the switch for a serial measurement, and the default bench should keep drafts. Those two are the whole list, and we are happy to make them ourselves when we land this, with your commits kept as they are. If you would rather push them, that works too. The long lines we will wrap either way. Thank you for this, and for everything you bring to the bench. |
…ts stay on unless --serial With the default --drafter auto, a managed run passes the target family's own drafter (z-lab/Qwen3.8-27B-DFlash2 for Qwen3.8-27B) to its serve child when the cache lookup serve uses for --drafter finds it, and the receipt names it as drafter_repo_id. The run prints the drafter it passes; when that drafter is not cached, it prints that it passes none and the cache lookup's reason. Nothing is downloaded. --drafter none passes none. Only --serial adds --no-drafts, and then no drafter is passed, so the default run keeps drafts on. The tests cover auto with and without the drafter in a temporary cache, none, a named drafter and --serial, and the serve flags for each pair of serial and drafter. The --drafter help and the docs say the same.
|
Thank you @ashhart ! Both are in one new commit, dc996ff. With --drafter auto the run now passes the family's cached drafter (z-lab/Qwen3.8-27B-DFlash2 for the 27B) and names it in the output and the receipt; when it is not cached, the run says so and goes on without one. The default run keeps drafts on and only --serial adds --no-drafts, now pinned by tests. The branch still merges cleanly with main at 1.0.11. |
…717) onto the candidate # Conflicts: # CHANGELOG.md # zig/src/native/metal.zig
…717) CHANGELOG in landing order; the other files both sides changed merged clean (LFM2's open branch sits after the --vision refusal, so an LFM2 checkpoint served with --vision is refused by name).
|
Thank you, @ThinkOffApp, for a benchmark in the installed binary with a readable receipt preview and explicit upload consent. Your seven commits ship in TensorFold 1.0.12 under your name: The macOS and Linux host checks pass. On an M3 Ultra with outbound network blocked but loopback, managed runs on LFM2.5-24B-A2B and on Qwen3.8-27B with its cached DFlash2 drafter each completed 20 of 20 samples, and the board's own rules accept and rank both receipts. Serial and external-server runs stayed unranked, as they should. Our own CUDA served run is still open; your GX10 receipts cover it. The board-schema questions in this thread (optional Python metadata, native and ROCm backend labels, early-stop ranking) stay open, and this release keeps the community-v1 rules. Posted by Ash's AI Assistant Synthena |
|
@ashhart Small correction to my note above: only the M5 Max has run so far, not the GX10. Result there, TensorFold 1.0.12 managed run with Nemotron 3.5 Lightning 4-bit on a MacBook Pro M5 Max (128 GB): chat at temperature 0, 225 to 243 tok/s over two runs, and code 325 to 347 tok/s. First text in 0.05 s. Both receipts pass Also, the board's install link points at codex/community-benchmark-cli, which no longer exists. It should point at the v1.0.12 release. |
…date The contributor's seven commits landed above; two met newer lines in the server's main.zig and root.zig and keep both sides. This keeps the PR's head in the history with no change to the tree.
…ld benchmark (ashhart#717) onto the candidate # Conflicts: # CHANGELOG.md # zig/src/native/metal.zig
…ld benchmark (ashhart#717) CHANGELOG in landing order; the other files both sides changed merged clean (LFM2's open branch sits after the --vision refusal, so an LFM2 checkpoint served with --vision is refused by name).
What this changes
This adds
tensorfold benchmarktotensorfold-native. It runs the community-v1 suite and saves a receipt. It can also publish that receipt to https://tensorfold.dev/benchmarks.The board serves the protocol.js and app.js from #96 byte for byte (checked again on 14 Oct), and it showed no approved runs that day. #96 was closed, and the native binary cannot write a community-v1 receipt today. This PR ports the #96 client to Zig. The receipt bytes are the same and the Worker is unchanged.
There are six commits: the receipt rules, streaming, the serve child, upload, the command itself, and clearer start-up and server errors. They are rebased on 1.0.10. The rebase changed no benchmark file. Each commit builds and passes the server tests on its own. Together they keep the whole client reviewable in one PR.
Also made proto of the site to handle this in tensorfold.dev style at https://tensorfold-speeds-proto.vercel.app
(not part of this PR but can be implemented to Vercel easily)
How it works
tensorfold benchmark MODELstarts its ownserveon a free port. It runs the code and chat workloads at temperature 1 and 0, with one warm-up and five repeats each. Then it writes the receipt.--server URLmeasures a server that is already running.benchmark inspect FILEchecks a receipt against the board's rules.benchmark loginstores a contributor token.benchmark publish FILEuploads a receipt.mlxandcudatoday.Docs:
docs/community-benchmarks.md, linked from the README.How to test
The model must be pulled first. On an M5 Max a default run takes about 30 seconds, and on a GX10 about 47 seconds. On Linux with CUDA, build with
zig build native -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=121(GB10) or your card's-Dsm.Receipt
Environment:
zig build native -Dcpu=apple_m1. The native Metal engine ran, recorded as backendmlx. No Python, MLX library or PyTorch was involved.-Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=121 -Dversion=1.0.10.TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bitat revision d9d758fb, run offline with an empty HOME.Exactness: this PR changes no engine code.
token_shaon 20 of 20 samples.token_shaas the old base on 20 of 20 samples, today and against the 11 Oct runs.Decode speed: no engine change in this PR. One default run per machine:
Model TensorFold/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-MLX-4bit (d9d758fb). Machine: MacBook Pro, Apple M5 Max, 128 GiB, macOS 27.0.1. TensorFold 1.0.10 with this branch. Exit 0 in 30.6 s, 20 of 20 samples ok.
Same model. Machine: ASUS Ascent GX10, NVIDIA GB10, native CUDA engine. TensorFold 1.0.10 with this branch. Exit 0 in 46.7 s, 20 of 20 samples ok.
On both machines these are client-side stream delivery rates, not an engine token clock. The server's own decode rate agrees within 0.1 % on every cell median.
1.0.10 against the old base. Three default runs of each build, alternating, on 14 Oct. On the Mac each run started after 4 minutes idle. The table gives the lowest and highest of the three cell medians. The last column is the old base on 11 and 12 Oct, four runs.
Same model. Machine: MacBook Pro, Apple M5 Max, 128 GiB, macOS 27.0.1.
Same model. Machine: ASUS Ascent GX10, NVIDIA GB10. The 12 Oct column is two GX10 units, two runs each.
What changed with 1.0.10, on the same day and machine: on the GX10, chat at T=1 is 5 % faster, and the T=0 cells are within 1 %. On the Mac, code at T=1 is 3 % faster and chat at T=1 is 4 % slower. The Mac's T=0 cells are within 1 %. The old base also measured lower on 14 Oct than on 11 and 12 Oct: 4 to 5 % on three Mac cells (chat at T=1 was the same), and 7 % on the three complete GX10 cells. So that gap goes with the day and the machine's background load, not with 1.0.10; these controls do not isolate its cause. On the Mac, other apps used two to three CPU cores during every run on 14 Oct.
AMD, an earlier run from 12 Oct, before the rebase. It was not repeated: the AMD machine was offline on 14 Oct. Main has no native HIP serve yet, so this run used attached mode (
--server ... --backend rocm) against the HIP serve from HIP: native Zig engine for Qwen3.5 MLX affine on RDNA2 / RDNA3 #490's branch. ModelTensorFold/Qwen3.8-27B-MLX-4bit(dense, no drafter). Machine: AMD Ryzen AI Max+ 395 with Radeon 8060S (gfx1151), Ubuntu x86_64. The client was built at an earlier commit of this branch with ROCm support, with a four-line host-only build change that is not part of this PR. Exit 0 in 491 s, 20 of 20 samples ok.The receipt is saved locally with backend
rocm, andbenchmark inspectexits 0. The board's validator refuses it (backendrocm), as expected.Prompt speed: no engine change, not measured.
Tests run, with pass and skip counts:
zig build test-server-cpu: 299 of 299 at the head (1.0.10: 193). Each commit alone, with a fresh cache: 211, 238, 262, 270, 293 and 299.zig build native -Dcpu=apple_m1builds on every commit.benchmark --helpworks from the fifth commit on.zig build test -Dcpu=apple_m1, fresh cache: 2165 of 2173 passed, 8 skipped (1.0.10: 1953 of 1961, the same 8 skipped). On both, one step fails: the 1.0.10 testa split checkpoint keeps later tensors in the file, packs the rest, and stages the same byteslogs an expected error throughstd.log.err, and the test runner fails any test that logs an error. It fails the same way on 1.0.10 without this PR.zig build test835 of 840 passed, 5 skipped, 46 of 46 steps (1.0.10: 729 of 734), and the server tests 299 of 299 (1.0.10: 193).zig fmt --check build.zig zig: clean on every commit.python3 tools/zig/lean_check.py: 527 problems on 1.0.10 and on every commit, the same lines.run_suiteand this command ran against the same loopback stream fake in 53 scenarios. They gave the same status, error code, counts, server telemetry and token hashes, with timings present in the same places. Request bodies were byte for byte the same. The receipt bytes equal Add benchmark CLI and moderated community uploads #96'sreceipt.canonicalplus a newline.Not run:
Differences from #96
python_versionas "none" because no Python runs. Attached runs record "unknown" as Add benchmark CLI and moderated community uploads #96 did.mlxon macOS because the board accepts no other name there. The engine is TensorFold's own Zig engine on Metal, not Apple's MLX library. Its flag for that backend is also--backend mlx.--drafter autopasses the family's drafter when it is cached and names it in the receipt; when it is not cached, the run says so and goes on without one. A drafter given as a local folder is not named in the receipt.--downloadis refused. Runtensorfold pullfirst.--outputpath, a missing token with--publish, and--publishwith ROCm are refused before the run.-hprints a compact list, and two refusal messages come from main's hub code. Exit codes are the same.Questions for Ash
python_versionas a string. Native runs have no Python and write "none". Could v2 make the field optional?mlxon macOS andcudaon Linux. Is that right, or should v2 add a value?rocmon Linux? ROCm runs work and stay local until then.ignore_eos, or rank answers that end on their own? I have a written v2 proposal with schema details and can open it as an issue.Ideas for v2
Results page
I built a prototype results page that shows these receipts: https://tensorfold-speeds-proto.vercel.app in a similar style as the tensorfold.dev site. It is not part of this PR, and the board at tensorfold.dev stays the real one. I am happy to integrate a results page with your board and run it, have a lot of Vercel experience.
Checklist
--serialonly uses serve's existing--no-drafts."draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. Not applicable: no engine change, and these were not re-run.