Repository navigation
Conversation
… masked by the grammar
42cafee to
2621d12
Compare
|
Thanks @Mirrdhyn. Masking each draw, rather than gating requests, is the right shape: drafts that break the grammar are rejected by the masked target draw, so constrained replies equal We've rerun it on our GB10 with Flash Next MLX 4-bit and MTP drafts, Posted by Ash's AI Assistant Synthena |
…dits The 1.1.2 section had no entries for the contributed pull requests carried into this release, so neither their changes nor their authors reached the release notes. Add an entry for each, written from its commits: Flash Next's CUDA prompt tiles and structured output (#1046, #1062), --thinking-reserve, the long-loop guard and the --vision template diagnostic (#1064, #1075, #1076), GLM's Metal eh_proj tile and CUDA waiting ranks (#1066, #1053), M1's simdgroup cap (#1055), Nemotron's CUDA image and shared-window fixes (#1057, #1058), Qwen's live-row expert routing (#1047), the shared CUDA operators and contract fixture (#1056, #1068, #1070, #1071, #1073), the ROCm receipt, drafter and draft-count work (#1043, #1044, #1045), the ModelOpt recipe numbers (#1042), the Windows host build (#1034) and the session store's allocation-free rollback (#637). Thank #643's and #1060's reporters as the other entries thank theirs.
|
Flash Next CUDA structured output and required tool calls are included in 1.1.2 (https://github.com/ashhart/TensorFold/releases/tag/v1.1.2), with your original authorship retained. The grammar masks the first draw and each draw in a verification window. Closing this as carried, and thank you. It landed as 8afbd14. - Synthema, Ash's AI Assistant. |
What this changes
Flash Next on the native CUDA engine refused
response_format, theguided_*fields andtool_choice: "required"or a named function with HTTP 400 (backend 'cuda' cannot enforce tool_choice "required" or a named function: it has no token grammar support), because its lane backend had nofirst_maskedhook. This adds the hook and masks every draw the backend makes on the host: the first token, each verify window's rows (draws) and the shared one-row rounds (tokenAt). A disallowed token's score becomes bf16 -inf, then the existing keyed draw runs unchanged; with no grammar the code path is the one before. Follows #564 and #596.1 commit, 5 files, +56/-11:
zig/src/families/flashnext/cuda_lanes.zig,cuda_mtp.zig,cuda_mtp_ops.zig,cuda_mtp_check.zig(the newdrawsargument) and one line indocs/api.md.Receipt
Environment: TensorFold main
d1018b31+ this commit (first measured ond46d17a7; after the rebase the six constrained cases and the unconstrained--alone --serialchecks were run again, same results); NVIDIA DGX Spark, GB10 sm_121, driver 595.84, nvcc 13.2.86; checkpoint Flash Next MLX 4-bit with MTP (qwen4_exp), drafts on;libtfgrammarbuilt withzig build grammar -Dxgrammar=from xgrammar v0.2.8.Before (main):
tool_choice: "required"and ajson_schemaresponse_formatboth return HTTP 400.After,
--parallel 4, six constrained cases (tool_choice: "required"with two tools, a named function, ajson_schemawith string and integer fields; each at T=0 and at T=1 with a seed), each sent alone, with"draft": false, and as four concurrent copies:finish_reason: "tool_calls"with offered tools and parseable arguments; the named one only; the schema's fields and types);"draft": falsereply;Unconstrained output unchanged:
bench_concurrent.py --alone --serial, T=0 levels 1/4 and T=1 levels 1/2: 0 unequal, 0 failed, and the sametoken_sha256per prompt as 1.1.0's receipt (code and chat, T=0 and T=1).Decode speed (
bench_openai.py, 256 tokens, 3 reps, T=0,--parallel 2 --context 131072, chunk 16384), tok/s:Prompt speed: n/a, the change only touches token draws after the prompt.
Tests run:
zig fmt --check,zig build native,test,test-cuda-hostpass (152 of 152 and 80 of 80 build steps, 0 failed); lean check 444 problems, main's count. New testcuda_mtp.zig"a masked row draws only allowed tokens, greedy the best of them": with the mask made a no-op it fails (expected 64, found 4).Not run, and why:
--tp(cuda_lanes_load.zig), and the CUDA build does not serve--tp(native/cuda.zig:31lists--mtp-draftsand--mtp-confidence), soservecannot start that path; GLM and Nemotron take theirs fromTF_GLM_RANK/TF_NEMOTRON_RANK. Rank 0 draws every token there, so these masks would apply as they are; is Flash Next at TP=2 on CUDA meant to be reachable fromserve?Checklist
"draft": false, a resumed prompt equals a fresh one (not exercised with a grammar), and concurrent equals solo.