Repository navigation
TensorFold 1.3.4
1.3.4 makes tensorfold pull work through proxies: it honours the proxy environment on every hop of a redirect, bounds every connect and read, and resumes a stalled file from its partial bytes. It hardens tool-call parsing and grammar compiles, which now bound their work, and cluster launch, session restore, Hub pulls and Web pairing now fail closed on malformed input; the json_object grammar is fixed to work on large vocabularies under the new limits. On CUDA, GLM at TP=2 does less work per prompt by default, and with TF_GLM_PAIR_EXPERTS=1 its prompts are 15% faster at 2K on two GB10s, while the server takes n up to 16 and cache_salt and Ripple-65B-Preview runs on M5 Macs. This release is not slower than 1.3.3 anywhere: copy-only decode on AMD Strix Halo keeps 1.3.3's lone-stream copy pricing.
Speed
- Flash Next on Metal (M5): the 4-bit expert scale and bias index is now built on Macs with tensor units too. One-stream decode is 2-5% faster on an M5 Ultra, with the same tokens (#4547).
- Qwen3.8-27B on Intel GPUs (decode attention): decode attention merges its slices with 16 subgroups a head instead of one, adding them in the same order, so every output byte is unchanged (token hashes match main, drafted and plain, bf16 and int8 KV). On an Arc Pro B70, plain decode gains 1.8 to 2.0% at about 8,000 prompt tokens, 14.7 to 16.0% at about 30,000 and 39.8 to 42.2% at 121,022. Drafted decode is level. The kernel contract registers it as a bit-equal replacement with two planted controls (#3960, lands #2799).
- GLM on CUDA (TP=2 prompts): when a chunk crosses the dense limit, dense attention runs only on the rows sparse attention leaves untouched. Prefill also skips projections nothing reads (the MTP proposal and query-side work). Outputs are unchanged (#4499).
- GLM on CUDA (TP=2 paired experts): opt-in
TF_GLM_PAIR_EXPERTS=1runs one grouped routed-expert pass per prompt pair with 128-row items, so experts with many tokens read their weights once. Each rank passes its own FFN partial under the default split reduction, so tokens match the unpaired path. On two GB10s, prompts are 15% faster at 2K and about 5% faster at 8K and 32K. Off, nothing changes (#4493, #4619). - GLM on CUDA (TP=2 index split):
TF_GLM_INDEX_SPLIT=32768keeps indexer scores, pools and token rows local on each rank below that position, with no blocking all-gathers, and own partials are read in place. Outputs are unchanged, and the default stays 2048 (#4510). - GLM-5.3-Flash on CUDA (EXL3 experts):
TF_GLM_MOE_DIRECT=1(off by default) runs a decode window's EXL3 experts without their two row copies and the shared expert's slot write. It sums the slot rows bit-equal to the default path, so replies are unchanged (#3659, for #3570). - Flash Next on CUDA (fused split): opt-in
TF_FLASHNEXT_FUSED_SPLIT=1runs decode projections that split K over a cluster, at 2,048 output columns or more, on the fused form. It adds the K slices in the cluster's order, so the bits are unchanged. Unset, blank or0keeps the current kernels, and Metal and HIP refuse1at startup (#3475). - Flash Next on CUDA (n-gram gather):
TF_FLASHNEXT_GATHER_EARLY=1(default0) gathers a shared decode pass's n-gram rows for every lane in one pooled call instead of one call a stream, for passes of at most 64 lanes. Wider passes keep the per-stream call. Which rows are read and how a row is dequantized do not change, so replies are unchanged. The measured mean decode gain on one GB10 rises to +2.10% at eight streams (#4009). - Flash Next on CUDA (follow-up turns): after a chat reply, a quiet background pass keeps its state, so the next turn resumes past the reply instead of prefilling it. The pass runs on one rank and yields when a request arrives (#3219).
- HIP (DFlash2 holds): a DFlash2 hold runs only the rows its drafts need: a frame takes its deepest stream's drafts plus the pending row, within the block. A draft's marginal cost is measured at load to price holds (0.56 ms a draft on gfx1151 against the full block's 1.73 ms), so the depth rule prices shared rounds at what a hold costs. The 27B recipe's DFlash2 figures are refreshed on current main, and nothing changes without
--drafter(#3918, fixes #1563). - DeepSeek-V4.1 on Metal (cold prompts): cold prompts read the early Engram rows beside the first rows of a chunk, the Engram row cache keeps more records by default, and the keepalive probes residency while a request runs. Prompt bits stay equal to decode bits (#3459).
- DeepSeek-V4.1 on Metal (draft pricing):
TF_DSV41_CALIB=measure, off by default, times a draft cost table on the loaded model at start, reports it and prices the draft depth from it. Other values store or read a table. Tokens are unchanged, and unset or blank times nothing and keeps the built-in table (#2952, refs #2984). - Host draw: greedy and masked rows scan 64-logit blocks and skip blocks whose mask word allows nothing, on both the row draw and the bounded top-k path. A
test-host-draw-timingstep times a row outsidetestand CI (#2846).
New
- Ripple-65B-Preview on Metal: the native engine serves ricursiveAI's NVFP4 and bf16 releases as published, on M5 or later Macs, with bf16 caches. M1 to M4 are refused by name.
--contextdefaults to and stops at 262,144 tokens, and athinking_budgetis refused for this model. Every model's/v1/modelscapabilities gain areasoning_optionalfield, false for all but Ripple (#2231, fixes #2171). - Qwen3.8-27B on HIP (DFlash2):
servewith--drafterruns Qwen3.8-27B's DFlash2 drafter on the HIP engine through the lane core, where it was refused. The drafter's weights and per-stream contexts count in the memory plan (#3665, refs #1563). - Qwen3.8-27B on Metal (MTP on M1 to M4):
--mtp-drafts Nloads the checkpoint's MTP head frommtp-4bit.safetensorsand drafts chains of up to N tokens for every stream, alone or in shared rounds.--mtp-confidencestops a chain below its floor. Before, the Metal build refused both flags (#2464, refs #2368). - Qwen3.5 family on CUDA (MTP): dense MTP drafting is enabled for Qwen3.5-family targets with compatible checkpoint tensors (#3582).
- MiniMax-H3-Image on Metal (server):
tf-h3-image-serverloads the prompt encoder, transformer and decoder once and serves one text-to-image request per input line, keeping the weights resident between pictures (#3718). - Idol on Metal (DINOv3 encoder): Idol's DINOv3 ViT-H+/16 image encoder runs natively on M5 Metal, from one 1024 x 1024 image to the denoiser's feature1 in bf16, as idol-sdk's ImageEncoder makes it. It uses the ungated timm weights (DINOv3 License), which
tools/zig/idol_case.py dinoshows to be Meta's gated checkpoint byte for byte and feature for feature. On an M5 Ultra an encode takes 0.120 s against the SDK's 0.261 s on torch MPS, with a 2.28 GB peak footprint. On torch's own input, feature1 and each of the 32 blocks sit as close to a float32 ruler as torch's bf16 run, within the 2x gate.tf-idol-dinoruns those gates, and its eight kernels pass the kernel contract (#1775, after #1766, for #1757). - Qwen3-ASR on CUDA (tools):
tf-qwen3-asrruns a WAV clip through the 0.6B or 1.7B checkpoint: the audio tower, then greedy decode through the Qwen3 CUDA pass the embedding engine runs.tf-qwen3-asr-forcedteacher-forces a clip on a reference case, andtest-qwen3-asr-hostandtf-qwen3-asr-checkcover config admission, tensor names, log-mel rows and a float64 tower without a GPU. It is not served yet (#2239, refs #2105). - GLM-5.3 on CUDA (shapes): GLM-5.3-Flash's latent cache and indexer accept full GLM-5.3's shapes, slice (a) of #3063 (#3949).
- Runtime LoRA overlays (core): exact runtime LoRA overlays, with adapter config, target and identity checks. They are not yet wired to a flag (#4384).
Server and API
- Several choices (
n): chat and completions takenfrom 1 through 16. Each choice is its own engine request on the one prompt, with its ownindexandtensorfold.seed. Choice 0 keeps the request's seed, son: 1replies are unchanged, andusagecounts the prompt once. A request withnabove 1 takesnplaces under--max-inflightand--max-inflight-per-key, all or none, and gets 400 withlogprobsor a required tool call./v1/responsesand/v1/imprintstill refusenother than 1 (#3148, closes #3114). - Cache salts:
cache_salton chat, completions, Responses and Messages, andserve --cache-salt-per-key, keep kept prompt states apart by salt or API key. A request without a salt is keyed exactly as before, and no reply's tokens change. Salts preserve every bit of image words after the first key word, a high-bit first word is refused before it can alias text, and salted states stay in RAM only (#3222, fixes #3196). - Sampling penalties on Metal: Qwen3.8-Flash-Next and Qwen3.8-27B accept
presence_penaltyandfrequency_penalty, counting each reply row and its own draft path, so drafted replies match undrafted ones. At zero the default path is unchanged. With--instruct-sampling cardthey now also take the card'spresence_penaltyof 1.5, so sampled replies under that flag differ from 1.3.3 (#3145). - Speech formats:
/v1/audio/speechaddswav24,wav32fandflac, with an optionalsample_rateandchannels: 2. The defaultwavandpcmreplies stay byte-identical, andmp3,opusandaacare refused by name (#3138). - Hardening (parsers and grammars): tool-call parsing, streaming parsers and grammar compiles bound their work and validate arguments before emitting them (#4378).
Desktop and Web
- Hardening (sign-in and input): TensorFold Web addresses no longer sign in with
?token=; the browser gets a one-time sign-in code instead. Cluster launch, session restore, the app's shell policy, Hub pulls, Web pairing and media downloads fail closed on malformed input.tensorfold pullchecks each cached file's digest before reusing it and refuses Hub file lists over 16 MiB and aconfig.jsonover 1 MiB (#4381).
Platforms and settings
tensorfold pull(proxies and timeouts): pull honours the proxy environment on every hop of a redirect:https_proxy/HTTPS_PROXY,http_proxy/HTTP_PROXYandall_proxy/ALL_PROXY, lower case first, andNO_PROXYfor exact hosts, domain suffixes and ports. It tunnels https names through a realCONNECTto anhttp://proxy under std's HTTP and TLS. A socks or https:// proxy inHTTPS_PROXYorALL_PROXYis skipped with a warning, and pull connects directly, as 1.3.3 did. Every connect is bounded byTENSORFOLD_PULL_CONNECT_SECONDS(default 30) and every read byTENSORFOLD_PULL_STALL_SECONDS(default 60). A stalled file resumes from its.incompletebytes with a Range request up to three times, and a failure names the proxy's scheme, host and port, never its credentials (#4140, part of #3692).- CUDA on unified-memory Linux (GB10): the start-up budget counts the checkpoint's own cached pages as room, so a checkpoint that was just read is not refused for them, without dropping them from the page cache before the load (#4427, refs #3192, #1857).
- GLM on CUDA (dependent launches): programmatic dependent launches follow one policy. The compute capability is known before GLM's lane, KDA and matmul modules choose, so below 9.0 they stay off even when asked for.
TF_GLM_PDL=0now also makes the Q4 draft-head matmul a plain launch. The default on GB10 (on) is unchanged (#4321).
Docs
- Flash Next on HIP (receipts): the first gfx1201 receipt in the repository runs Flash Next oQ2-MTP at
--tp 2on two Radeon AI PRO R9700s, against #2401's 1.2.3 numbers on the same card class, anddocs/recipes/flash-next-hip.mdbecomes the home for Flash Next on HIP (#3608, refs #2401). The first world-4 Flash Next receipt on HIP runs oQ2-MTP at--tp 4on four Radeon AI PRO R9700s, with a same-binary world-2 control run that separates the world effect from engine changes (#4210, refs #2401).
Fixes
- Lanes (Qwen3.5/3.8 on HIP, copies only): #3728's lone-stream copy pricing applies only to a family that opts in and serves without a model drafter, so copies-only decode on AMD Strix Halo keeps 1.3.3's speed, while streams with a model drafter price their drafts as before. Tokens are unchanged.
- Structured output (
json_object):response_format: json_objectwithgrammar_budget: trueworks again on large vocabularies after the hardening in #4378. The server's fixedjson_objectrule gets budget limits sized to it, computed once per tokenizer, while every client-supplied grammar keeps the limits from #4378. A budget refusal now names what it hit: work, edges, bytes, timeout or busy slots (#4615, follows #4378). - Tool-call arguments (
NaNandInfinity): tool-call arguments whose text containsNaNorInfinity(Qwen XML, GLM, Gemma, MiniMax string values, LFM2 Python strings) parse again. Only values read as JSON refuse the non-finite literals. LFM2 tools with parameters named like schema keywords (pattern,format,not,if) are supported again (#4604, follows #4378). tensorfold pull(long pulls): pull no longer stops with "detecting network configuration failed" after 64 distinct resolved addresses on a long pull. A full address table replaces its oldest entry (#4621, follows #4140).- Metal (large checkpoint files): a checkpoint file span of 16 GiB or more loads. Each
preadasks for at most 1 GiB, since macOS refuses a count above INT_MAX (#4435, first fix in #4433). - GLM-5.3-Flash on Metal (long conversations on disk): every resident kept state is staged to disk while its borrowed rows can still be read, whatever
--spill-gibis set to. A long conversation's disk copy no longer stays at an older depth, and later turns resume from the newest state (#2755, refs #2669). - GLM on Metal (NaN and Inf): masked sparse attention, its padding entries and the DFlash2 head's q4 matmul give the float64 reference's NaN and Inf instead of dropping or inventing them. This clears nine known kernel-contract failures, and finite outputs are unchanged (#4396).
- Prompt cache (salt identity): reuse now requires the request's full cache-salt identity in the RAM prefix cache, family device snapshots and Qwen3.8-27B standing slots. Disk-restored state also checks the tokenizer and template files, and page ownership on HIP fault and adoption paths is singular and transactional (#4504). The fork rule picks its extra resume mark only from kept prompts with the request's
cache_salt, as every other lookup does, and unsalted requests are unchanged (#4601). - Qwen3.5 on CUDA (pass size): the start-up line and the prompt cache's recorded pass size say the rows the engine actually passes, 4096 by default and 8192 with
TF_QWEN35_CHUNK_SOLO=8192, instead of 8192 always. Nothing else reads the value, so tokens and behaviour are unchanged (#4600). - Tokenizer memo (aarch64 Linux): the tokenizer memo now has its own allocator, so requests that add memo segments no longer leave allocator buckets behind on aarch64 Linux (#4455).
- Torch
.pthcheckpoints: a tensor whose element count overflowsu64is refused as a bad archive instead of panicking or wrapping the count (#4322).
Tools and tests
- Kernel contract (GLM on Metal): the GLM Metal contract runs to the end on M1 to M4 Macs again, since its KDA and index texts carry the pre-M5 define the loader adds. Gate 5 resolves GLM's routed-expert row launches on every Mac instead of stopping with
UnknownLaunch(#4397). - GLM on CUDA (profiling): with
TF_GLM_PROF=1, the four profiling traces are created at startup before the server reports ready, so the first prompt no longer pays their setup. Profiling-off behaviour is unchanged (#4511). - Tests (lane core): a conformance suite pins fresh = resumed cache state, tree windows = plain decode, run-to-run reproducibility, stop reasons and malformed-parent refusal on the host, with a ledger of seven decode invariants in
docs/conformance-ledger.md(#4472). A reusable gate checks that a request's tokens, stop reason and RNG positions never depend on which other requests share its batch, when they arrive or when they leave, over cohorts of 2, 4 and 8, drafts on and off, greedy and keyed, and fresh and restored prefixes (#4491). A lane-host case checks that a third short request queued behind two long ones at two slots starts within two rounds of a slot freeing and then gets its fair share of rounds, with full outputs for every request (#4495). - Tests (
nchoices): requests withnfrom 2 to 16 give back every--max-inflightand per-key place on each way they can end (done, disconnect, a failing choice, 429, 400, cancel, shutdown), plus a seeded concurrent disconnect case (#4602). - Tests (timing): the lane host's lone-driver test no longer fails under CI load. Its fake driver now hands streams back with their cache settled, as the lane core requires, and its scheduling check no longer depends on timing (#4568). The lane host explore test's replay check no longer depends on thread timing: the test thread's idle send waits until no engine yield point is mid-decision, so a seed replays its schedule the same on a loaded runner (#4414). The idle-unload host tests wait on the ticker's event and the manager's condition instead of a 2-second real-clock bound (#4352), and three host tests (Qwen3.5 CUDA kept-state read-back, the grammar compile deadline, the chats resume store) wait on events instead of real-clock bounds (#4358), so a loaded CI host no longer fails them.
- Tests (host and build): a Drama 3 host test runs the codec's decode and encode schedules over a recording binding and pins their call lists, so a schedule change fails the test without a GPU. The lists are fixtures beside the test, and it runs in
test-drama-host(#2962). The Nemotron HIP page-fault suite compiles again, with its fixture building ids throughhip_serve.pages, and the Flash Next recipe says the scale index runs on every Mac since #4547 (#4605). The Flash Next environment table test counts theTF_FLASHNEXT_FUSED_SPLITswitch that #3475 added (37 settings), so main is green again (#4467). - CI: the root pytest job installs PyYAML, which the workflow-conditions test needs, so GitHub pytest runs collect again (#4469, #4454).
What changes by default
- Same tokens, bytes or outputs: Flash Next on M5 Macs builds the 4-bit expert scale and bias index, with the same tokens (#4547). Qwen3.8-27B decode attention on Intel GPUs merges with 16 subgroups a head, with every output byte unchanged (#3960). GLM at TP=2 on CUDA runs dense attention only on the rows sparse attention leaves untouched and skips prefill projections nothing reads, with outputs unchanged (#4499). DeepSeek-V4.1 on Metal reads early Engram rows beside a chunk's first rows and keeps more Engram records, with prompt bits equal to decode bits (#3459). Qwen3.5 on CUDA reports the rows it actually passes, with tokens and behaviour unchanged (#4600).
- GLM on Metal (NaN and Inf): masked sparse attention, its padding entries and the DFlash2 head's q4 matmul now give the float64 reference's NaN and Inf. Finite outputs are unchanged (#4396).
- Conversation state and draws: Flash Next on CUDA keeps a background pass's state after a chat reply, so the next turn resumes past the reply instead of prefilling it (#3219). GLM-5.3-Flash on Metal stages every resident kept state to disk whatever
--spill-gibis set to, so later turns resume from the newest state (#2755). Greedy and masked host draws skip 64-logit blocks whose mask word allows nothing (#2846). - Requests and parsing: tool-call parsing, streaming parsers and grammar compiles bound their work and validate arguments (#4378). The server's fixed
json_objectrule has budget limits sized to it, and a budget refusal names what it hit (#4615). Every model's/v1/modelscapabilities gain areasoning_optionalfield, false for all but Ripple (#2231). - Pull, sign-in and loading:
tensorfold pullhonours the proxy environment on every hop of a redirect, bounds connects at 30 seconds and reads at 60 seconds, and resumes a stalled file up to three times (#4140). A socks or https:// proxy inHTTPS_PROXYorALL_PROXYis skipped with a warning, and pull connects directly, as 1.3.3 did. Pull checks each cached file's digest before reusing it and refuses Hub file lists over 16 MiB and aconfig.jsonover 1 MiB, and TensorFold Web addresses sign in with a one-time code instead of?token=(#4381). On GB10, the start-up budget counts the checkpoint's own cached pages as room (#4427). These are about files, sign-in and start-up, not replies.
Thanks
@AbrahamCete, @AIFlowML, @BadAd84, @bikepresentball, @bjornmonnens, @BobClawblaw, @gilby, @jayleaton, @joshuaswarren, @jschmied, @markyu0401, @Mirrdhyn, @plotarmordev, @sethforprivacy, @tacosta, @timmyit, @ultradaoto.