Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@

Each release's page on GitHub has its notes and measurements. See [the 1.0.0 release notes](RELEASE-NOTES-1.0.0.md) for the native binary's supported models and migration details.

## Unreleased

- HIP on gfx1151: a plain prompt of 1 or 2 rows takes the 2-row K-parallel tile, with byte-identical output (#3273). Thanks to @AbrahamCete.

- GLM-5.3-Flash on CUDA with `TF_KV_SHARE` and no `--prompt-cache-gib`: the kept states' slots, `TF_KV_SHARE` at most, now come where an asked cache goes, before the windows past the engine's own, so a room that holds one more whole window no longer keeps fewer states; Jammed XSFP4 at TP=3 on three GB10s keeps all 32 at `TF_KV_SHARE=32` instead of 8, with the same tokens (#3125). Thanks to @Bizuayeu.
- Metal: Baidu's Unlimited-OCR-2 is served natively from its BF16 release on M5-class Macs: page images through `serve --vision`, the family's chat template built in, its SAM and CLIP image encoders and decoder under the kernel contract; on five reference pages every departure from the release's own reply is a one-step tie (#2074). Thanks to @BobClawblaw.
- Unlimited-OCR-2 on native Metal (M5 GPUs): Baidu's BF16 release as published serves page images through
`tensorfold-native serve --vision`; one stream, greedy, up to 131,072 tokens. On the recipe's single pages its text
is identical to the release's own `infer` in torch bf16, or departs from it only where two candidate tokens lie
within one bf16 step of each other, the same two torch's float32 run weighs. The five-page document is served the
same way; its departures are listed in the recipe beside float32's (#2074). Thanks to @BobClawblaw.
## 1.2.9

- Flash Next on CUDA: a lone stream draws on its own path again; the batched draws #2927 added now run only when two or more streams share a step, so one sampled stream no longer pays the group's whole-buffer download each step. Tokens are unchanged (#3391, after #2927).

- Tests: the sessions writes test on real files does the same coverage with 40 requests at half the token sizes, so it no longer times out on busy CI runners (#3347).

- Tests: two CI flakes fixed: the security check accepts the server closing an over-cap request first, and check-release-paths waits for its install before running (#3349).
Expand All @@ -30,6 +43,13 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel

- Server: an Ollama-compatible API serves `/api/chat`, `/api/generate`, `/api/embed`, `/api/tags`, `/api/show`, `/api/ps` and `/api/version` through the same chat, completions and embeddings paths as the OpenAI routes, with NDJSON streaming and named refusals for unsupported options (#3342, fixes #3117).
- Server: each `/v1/models` entry now ends with `input_types`, the content parts the model takes: `["text"]`, plus `"image"` with `--vision`, plus `"video"` when the checkpoint reads video and the server loads `libtfvideo`. A `video_url` part sent to a model without video now gets HTTP 400 (`invalid_request_error`) instead of a 500, decided by the same startup check, so the listing and the refusal agree; a server whose model reads video loads `libtfvideo` at startup and says once in its log when it is missing. The other keys are unchanged (#3019, fixes #3004). Thanks to @WebReflection for the design.
- Unlimited-OCR-2 on native Metal (M5 GPUs): Baidu's BF16 release as published serves page images through
`tensorfold-native serve --vision`; one stream, greedy, up to 131,072 tokens. On the recipe's single pages its text
is identical to the release's own `infer` in torch bf16, or departs from it only where two candidate tokens lie
within one bf16 step of each other, the same two torch's float32 run weighs. The five-page document is served the
same way; its departures are listed in the recipe beside float32's (#2074). Thanks to @BobClawblaw.
- GLM-5.3-Flash on CUDA with `TF_KV_SHARE` and no `--prompt-cache-gib`: the kept states' slots, `TF_KV_SHARE` at most, now come where an asked cache goes, before the windows past the engine's own, so a room that holds one more whole window no longer keeps fewer states; Jammed XSFP4 at TP=3 on three GB10s keeps all 32 at `TF_KV_SHARE=32` instead of 8, with the same tokens (#3125). Thanks to @Bizuayeu.


- Server: with thinking off, the reasoning effort a request names reaches the chat template (GLM's head follows it), and the reply reports it; a server's own `--reasoning-effort` no longer changes a thinking-off prompt (#3017, fixes #1911). Thanks to @ss-cong for the report.

Expand Down
26 changes: 26 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,3 +511,29 @@ The fixtures in `zig/src/server/fixtures/thinking/` are unmodified release files
`70ae7fac63274ff2eac54152031433374cb80f2f` (an MLX conversion of
[Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B), whose template it carries), under the Apache License 2.0.
See [`LICENSES/Apache-2.0.txt`](LICENSES/Apache-2.0.txt).

## Unlimited-OCR-2

The `unlimited-ocr` family (`zig/src/families/uocr/` and its kernels) follows these parts of the Python code that ships
with [baidu/Unlimited-OCR-2](https://huggingface.co/baidu/Unlimited-OCR-2) at revision
`0480966938291445591f69f08a13b041c073a96a`, the release's own files:

- `modeling_unlimitedocr.py`: the page guard (`_uocr_page_count_guard`), gundam's tiles (`dynamic_preprocess`,
`find_closest_aspect_ratio`), the views' token layout and the prompt (`_uocr_build_inputs`, `infer`), which
`generate.zig`, `preprocess.zig`, `prompt.zig` and `chat_template.jinja` repeat;
- `deepencoder.py`, its CLIP section only (`CLIPVisionEmbeddings`, `NoTPTransformer`, `VitModel`, `quick_gelu`,
`get_abs_pos`; the release's own code, citing no library there): the class row, the position table resized to a
tile, the pre-norm, `quick_gelu`'s 1.702 and the layer order, which `vision.zig`'s CLIP steps repeat;
- `dash_attention.py` and `modeling_deepseekv2.py`: the DASH router (block keys, page-aware candidates, top 16,
entmax-1.5).

The release ships no LICENSE file; its model card states `license: mit`, and these notices carry that licence's text
("MIT License text" above). The SAM encoder, the decoder's attention, its page2d rotary and its MoE gate follow none of
the release's code: they are written from the papers and from the release's modules measured through their inputs and
outputs. `resize.zig` follows no code either: it is the antialiased bicubic the release asks of torch
(`F.interpolate(mode="bicubic", antialias=True, align_corners=False)`, Keys' cubic with a = -0.5, taps spread by the
scale and normalised) for the position tables, written to that operator's definition, with its fp32 rounding order fixed
by measuring torch's output on the release's tables bit for bit.

TensorFold ships none of these files and no Unlimited-OCR-2 weights; `tools/zig/uocr_reference.py` runs the release's
own code as the reference.
8 changes: 5 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,11 @@ one from 0.5 GiB up.

With pages, the plan takes the engine's own window first, then each other stream's fixed part, then the prompt cache:
a named `--prompt-cache-gib` comes before every window but the engine's own, and an unnamed one after the whole
windows the budget holds, half of what they leave but at least 16 GiB and at most all of it (#2987 shows what that
does to `TF_KV_SHARE`'s states). The cache then holds the kept states (on GLM with `TF_KV_SHARE`, a slot a state, the
rest of it made pages), and the rest of the budget becomes pages, up to the streams' windows plus the cache's pages.
windows the budget holds, half of what they leave but at least 16 GiB and at most all of it. On GLM with
`TF_KV_SHARE` named and the cache unnamed, the kept states' slots, `TF_KV_SHARE` at most, come where a named cache
goes, and the rest of the cache after the windows. The cache then holds the kept states (on GLM with `TF_KV_SHARE`,
a slot a state, the rest of it made pages), and the rest of the budget becomes pages, up to the streams' windows plus
the cache's pages.
The settings that decide each part:

| Setting | Kind | Scope | Unset | What it decides | Read in |
Expand Down
1 change: 1 addition & 0 deletions docs/recipes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ For agent-assisted contributions, read the [TensorFold contributor skill](SKILL.
| Nanbeige4.3-33B | [Native Metal, the bf16 and INT4 releases, the Llama family](nanbeige-4.3-33b-metal.md) |
| Underdog Woof | [Native CPU speech on a Mac, int8, non-commercial licence](woof.md) |
| Recursive Flint | [Native Metal, the publisher's affine 4-bit export, reasoning and tool calls](flint.md) |
| Unlimited-OCR-2 | [Native Metal, the bf16 release: page images to structured text, 131k context](unlimited-ocr-metal.md) |

[Persisted serving-state identities](persisted-serving-keys.md) lists the disk owners, their compatibility keys and stale-state host checks.

Expand Down
11 changes: 7 additions & 4 deletions docs/recipes/glm-5.3-flash-cuda.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ left after a 12.2 GiB reserve` and a 5.8 GiB prompt cache
prompt's rows as the pool's pages instead of copying them into the cache, and that log line names it.
- With KV pages (the default at two or more ranks), the pool sets the windows the room holds aside before the prompt
cache, which gets what they leave of its 16 GiB. `--prompt-cache-gib N` sets N GiB aside first, after the engine's
own window and a fixed part and page for each other stream, and the pool takes the rest.
own window and a fixed part and page for each other stream, and the pool takes the rest. `TF_KV_SHARE=n` sets its n
kept states' slots aside in the same place.
- `TF_GLM_PROMPT_TAIL=1` keeps a prompt that names no history, as a `/v1/completions` request's, at its last prompt
chunk start, as a chat keeps its history's, so the same prompt or a longer one resumes there. Those states share the
prompt cache's budget with chat states, least recently used out first, so long raw prompts between two chat turns can
Expand All @@ -78,9 +79,11 @@ left after a 12.2 GiB reserve` and a 5.8 GiB prompt cache
`TF_GLM_KV_HOST_GIB` sizes the host pages (one full window unasked); `TF_GLM_KV_HOST_SHARED=1` gives the ranks of
one host a single copy in `/dev/shm`. Checked on two RTX PRO 6000 Blackwell cards at TP=2.
- `TF_KV_SHARE=n` (with KV pages, 64 at most) keeps prompts' rows as the pool's pages, and the startup plan sets aside
a slot for each of the n kept states' other parts in the prompt cache, as many as the cache holds; the rest of the
cache goes to the pool's pages. `--prompt-cache-gib N` bounds them: the startup line names the slots, and when the
cache holds fewer than n, how many it holds and the `--prompt-cache-gib` that holds all n.
a slot for each of the n kept states' other parts first, where an asked cache goes, as many as fit there; the rest of
the prompt cache goes to the pool's pages after the windows. Where the room would hold one more whole window, the
slots come out of it, so the pool holds fewer pages than it would without them. A named `--prompt-cache-gib N`
bounds the slots too: the startup line names them, and when fewer than n fit, how many, and the
`--prompt-cache-gib` that holds all n where one does.
- `TF_GLM_CHUNK_SOLO=4096` on every rank (opt-in) lets a prompt pass take 4,096 rows while no other stream is decoding.
Unset or `2048`, every pass takes 2,048 rows and nothing extra is held. See [Prompt chunk size](#prompt-chunk-size).
- `TF_GLM_REQUEST_STARTS=1` on rank 0 (opt-in, off by default) cuts each prompt pass at the request's message starts
Expand Down
Loading