Repository navigation
feat(server): serve flags a backend opts into: tensor parallelism, MTP, kept entries, policy - #624
Conversation
…P, kept entries, policy
A native module may list `serves`: the flags past the common ones it takes. The binary's root re-exports the
list and cli.zig reads it there, so the server library and its tests stay engine-less. Listed flags parse,
are checked, appear in `capabilities --json` and reach the engine through `api.Open`:
- --tp {1,2,4,8}, --rank (below --tp), --master, --master-port: a rank above 0 serves no HTTP and runs
rank 0's steps through the backend's `follow`;
- --mtp-drafts (0 to 64) and --mtp-confidence (0 to 1);
- --checkpoint-slots (kept prompt entries, from 0);
- --policy key=value, repeatable, joined by commas; `Info.policy` is shown by /health.
--backend also takes rocm when the backend lists `--backend=rocm`. Metal, CUDA and the engine-less build list
nothing: their parse, their refusals and `capabilities --json` are byte-identical to before. The Args-to-Open
mapping moves from engines.zig to cli.zig, where its test runs.
|
Thank you, @BlivionIaG. This is merged into main (38de96b) on top of #623, your commit as it was, and it ships in 1.0.6. Since the Args-to- One note for when a backend first lists |
… and model checks The HIP branch's engine (ashhart#490) on ashhart#463's runtime and the kernel launches of ashhart#617 and ashhart#621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (ashhart#625), chunked prompts (ashhart#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (ashhart#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
… and model checks The HIP branch's engine (#490) on #463's runtime and the kernel launches of #617 and #621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (#625), chunked prompts (#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
… and model checks The HIP branch's engine (#490) on #463's runtime and the kernel launches of #617 and #621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (#625), chunked prompts (#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
… and model checks The HIP branch's engine (ashhart#490) on ashhart#463's runtime and the kernel launches of ashhart#617 and ashhart#621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (ashhart#625), chunked prompts (ashhart#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (ashhart#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
… and model checks The HIP branch's engine (ashhart#490) on ashhart#463's runtime and the kernel launches of ashhart#617 and ashhart#621: the lane rounds with MTP drafts, the paged attention cache and the radix prompt cache (ashhart#625), chunked prompts (ashhart#623), CUDA-graph rounds, the memory plan, and tensor parallelism over RCCL (comm/: the library, the rank link, the group). The native server takes it with `zig build native-hip -Dhip-arch=...` and the serve flags it lists (ashhart#624); `tf-qwen35-test` runs the model checks on a GPU. `zig build test` compiles both against stub kernels. The engine reads the policy (`--policy`, TF_POLICY) once and hands the kernels `Launcher.Choices`; a GPU other than the one the kernels were built for is refused with both names. round_shape.zig stays in the family: its only reader is the plan.
What this changes
The server CLI slice tracked in #491: the serve flags the HIP engine will read. They are off in every build that has today: a backend opts in by listing them, and none does yet. The Qwen3.5 HIP engine will be the first.
serves, the flags beyond the common ones that it takes.main.zigre-exports the list, andcli.zigreads it from@import("root"), so the server library and its tests stay engine-less. A listed flag parses, is checked, appears incapabilities --json, and reaches the engine throughapi.Open:--tp {1,2,4,8},--rank(below--tp),--master,--master-port. A rank above 0 serves no HTTP; it runs rank 0's steps through the backend'sfollow(a build withoutfollowrefuses it).--mtp-drafts(0 to 64),--mtp-confidence(0 to 1).--checkpoint-slots: kept prompt entries, from 0.--policy key=value: repeatable, joined by commas.Info.policyis shown by/health.--backendtakesrocmwhen the backend lists--backend=rocm.Openmapping moves fromengines.zigtocli.zig, where its test runs (engines.zigis in no test root).Receipt
mainat bec00ae, head 8392fc3. Zig 0.17.0, on macOS (Apple silicon) and Linux 7.1.7.tensorfold-native capabilities --jsonis byte-identical tomain's.serve m --tp 2gives the same refusal, word for word.servesentry is present, and refused otherwise. Every value bound is checked.requestmaps every new flag, and its defaults equalapi.Open's.--tpserved unconditionally fails the first (expected false, found true);--checkpoint-slotsnot mapped fails the second (expected 3, found null).serveslists the flags, refuses--rank 2with--tp 2and--policy matrix, and sends--rank 1tofollow("this build has no tensor-parallel ranks").zig build test test-golden -Dcpu=apple_m1: 141/141 steps; golden 309/319 equal, 0 unexpected.zig build test: 37/37 steps, 373/373 tests.zig fmt --checkis clean on the changed files. On the whole tree it reportstokenizer.zig,native/cuda.zigandtests/moe_bench.zig, the same asmain.lean_check.py: 542 problems, the same asmain.zig/tests/server/build.shfails onmaintoo: it doesn't passcheckpoint_cli.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No engine path touched.)